- type: entity
  id: BaseMeleeWeaponEnergy # more generic naming in case someone makes like, idk, an energy axe
  parent: BaseItem
  abstract: true
  components:
  - type: WeaponCaseInsertable # Frontier
  - type: EnergySword
  - type: ItemToggle
    soundActivate:
      path: /Audio/Weapons/ebladeon.ogg
    soundDeactivate:
      path: /Audio/Weapons/ebladeoff.ogg
  - type: ItemToggleActiveSound
    activeSound:
      path: /Audio/Weapons/ebladehum.ogg
  - type: ComponentToggler
    components:
    - type: Sharp
    - type: DisarmMalus
      malus: 0.6
    - type: Execution
      doAfterDuration: 4.0
  - type: ItemToggleHot
  - type: ItemToggleSize
    activatedSize: Huge
  - type: ItemTogglePointLight
  - type: ItemToggleMeleeWeapon
    activatedSoundOnHit:
      path: /Audio/Weapons/eblade1.ogg
      params:
        variation: 0.250
    activatedSoundOnHitNoDamage:
      path: /Audio/Weapons/eblade1.ogg
      params:
        variation: 0.250
        volume: -10
    activatedSoundOnSwing:
      path: /Audio/Weapons/eblademiss.ogg
      params:
        variation: 0.125
    activatedDamage:
      types:
        Slash: 15
        Heat: 20
        Structural: 20
  - type: MeleeWeapon
    heavyStaminaCost: 2.5 # goob edit
    wideAnimationRotation: -135
    attackRate: 1.15
    damage:
      types:
        Blunt: 4.5
  - type: Item
    size: Small
  - type: UseDelay
    delay: 1.0
  - type: PointLight
    enabled: false
    radius: 2
    energy: 2
    color: white
    netsync: false
  - type: Appearance
  - type: ToggleableLightVisuals # Add support for multiple layers
    spriteLayer: blade
    inhandVisuals:
      left:
      - state: inhand-left-blade
        shader: unshaded
      right:
      - state: inhand-right-blade
        shader: unshaded
  - type: Reflect
  - type: IgnitionSource
    temperature: 700
  - type: Scalpel # Shitmed
    speed: 0.75
  - type: Cautery # Shitmed: you have to be very, very careful to cauterize with it
    speed: 0.2
  - type: SurgeryTool # Shitmed
    startSound:
      path: /Audio/Weapons/ebladehum.ogg
    endSound:
      path: /Audio/Weapons/eblade1.ogg
      params:
        variation: 0.250

- type: entity
  name: energy sword
  parent: BaseMeleeWeaponEnergy
  id: EnergySword
  description: A very loud & dangerous sword with a beam made of pure, concentrated plasma. Cuts through unarmored targets like butter.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/e_sword.rsi
    layers:
    - state: e_sword
    - state: e_sword_blade
      color: "#FFFFFF"
      visible: false
      shader: unshaded
      map: [ "blade" ]
  - type: Item
    sprite: Objects/Weapons/Melee/e_sword-inhands.rsi
  - type: PirateBountyItem # Mono
    id: TSFEnergyWeapon
  - type: Tag  # Mono
    tags:
    - EnergySword

- type: entity
  name: energy dagger
  parent: BaseMeleeWeaponEnergy
  id: EnergyDaggerLoud
  description: A not as loud and dangerous dagger with a beam made of pure, concentrated plasma. This one is completely undisguised.
  components:
  - type: ItemToggle
    soundActivate:
      path: /Audio/Weapons/ebladeon.ogg
      params:
        volume: -3
    soundDeactivate:
      path: /Audio/Weapons/ebladeoff.ogg
      params:
        volume: -3
  - type: ItemToggleMeleeWeapon
    activatedSoundOnSwing:
      path: /Audio/Weapons/eblademiss.ogg
      params:
        volume: -3
        variation: 0.250
    activatedDamage:
      types:
        Slash: 10
        Heat: 10
    deactivatedSecret: true
  - type: ItemToggleActiveSound
    activeSound:
      path: /Audio/Weapons/ebladehum.ogg
      params:
        volume: -3
  - type: ComponentToggler
    components:
    - type: Sharp
    - type: DisarmMalus
      malus: 0.4
    - type: Execution
      doAfterDuration: 4.0
  - type: Sprite
    sprite: Objects/Weapons/Melee/e_dagger_loud.rsi
    layers:
    - state: e_sword
    - state: e_sword_blade
      color: "#FFFFFF"
      visible: false
      shader: unshaded
      map: [ "blade" ]
  - type: MeleeWeapon
    heavyStaminaCost: 1 # goob edit
    wideAnimationRotation: 145
    attackRate: 1
    hidden: true
    damage:
      types:
        Blunt: 1
  - type: Item
    size: Tiny
    sprite: Objects/Weapons/Melee/e_dagger_loud.rsi
  - type: PointLight
    enabled: false
    radius: 1.5
    energy: 1.5
    color: white
    netsync: false


- type: entity
  name: pen
  parent: BaseMeleeWeaponEnergy
  id: EnergyDagger
  suffix: E-Dagger
  description: 'A dark ink pen.'
  components:
  - type: ItemToggle
    soundActivate:
      path: /Audio/Weapons/ebladeon.ogg
      params:
        volume: -6
    soundDeactivate:
      path: /Audio/Weapons/ebladeoff.ogg
      params:
        volume: -6
  - type: ItemToggleActiveSound
    activeSound:
      path: /Audio/Weapons/ebladehum.ogg
      params:
        volume: -6
  - type: ItemToggleMeleeWeapon
    activatedSoundOnSwing:
      path: /Audio/Weapons/eblademiss.ogg
      params:
        volume: -3
        variation: 0.250
    activatedDamage:
      types:
        Slash: 10
        Heat: 10
  - type: ComponentToggler
    components:
    - type: Sharp
    - type: DisarmMalus
      malus: 0.4
    - type: Execution
      doAfterDuration: 4.0
  - type: Sprite
    sprite: Objects/Weapons/Melee/e_dagger.rsi
    layers:
    - state: e_sword
    - state: e_sword_blade
      color: "#FFFFFF"
      visible: false
      shader: unshaded
      map: [ "blade" ]
  - type: Item
    size: Tiny
    sprite: Objects/Weapons/Melee/e_dagger.rsi
  - type: PointLight
    enabled: false
    radius: 1.5
    energy: 1.5
    color: white
    netsync: false
  - type: MeleeWeapon
    heavyStaminaCost: 1 # goob edit
    wideAnimationRotation: 145
    attackRate: 1
    hidden: true
    damage:
      types:
        Blunt: 1
  - type: Tag
    tags:
    - Write

- type: entity
  parent: BaseItem
  id: EnergyDaggerBox
  name: e-dagger box
  suffix: E-Dagger
  description: A small box containing an e-dagger. Packaging disintegrates when opened, leaving no evidence behind.
  components:
  - type: Item
    size: Tiny
  - type: Sprite
    sprite: Objects/Storage/penbox.rsi
    state: e_dagger
  - type: SpawnItemsOnUse
    items:
    - id: EnergyDagger
    sound:
      path: /Audio/Effects/unwrap.ogg

- type: entity
  name: energy cutlass
  parent: BaseMeleeWeaponEnergy
  id: EnergyCutlass
  description: An exotic energy weapon.
  components:
  - type: ItemToggleMeleeWeapon
    activatedDamage:
      types:
        Slash: 15
        Heat: 20
        Structural: 15
    deactivatedSecret: true
  - type: Sprite
    sprite: Objects/Weapons/Melee/e_cutlass.rsi
    layers:
    - state: e_cutlass
    - state: e_cutlass_blade
      color: "#e95151"
      visible: false
      shader: unshaded
      map: [ "blade" ]
  - type: Item
    sprite: Objects/Weapons/Melee/e_cutlass.rsi

- type: entity
  name: double-bladed energy sword
  parent: BaseMeleeWeaponEnergy
  id: EnergySwordDouble
  description: This energy sword has been modified to have blades on both ends, it's unwieldy and dangerous... This can be stored in pockets.
  components:
  - type: ItemToggle
    onUse: false # wielding events control it instead
    onActivate: false # prevents the weapon from being able to be turned on when it is on the ground
    soundActivate:
      path: /Audio/Weapons/ebladeon.ogg
      params:
        volume: 3
    soundDeactivate:
      path: /Audio/Weapons/ebladeoff.ogg
      params:
        volume: 3
  - type: ItemToggleMeleeWeapon
    activatedSoundOnSwing:
      path: /Audio/Weapons/eblademiss.ogg
      params:
        volume: 3
        variation: 0.250
    activatedDamage:
      types:
        Slash: 15 # Mono increased from 10 to 15 to be on-par with normal e-swords
        Heat: 20
        Structural: 75 # Mono increased from 25 to 75, keep in mind a breaching hammer does 300 a hit
  - type: ItemToggleActiveSound
    activeSound:
      path: /Audio/Weapons/ebladehum.ogg
      params:
        volume: 3
  - type: ComponentToggler
    components:
    - type: Sharp
    - type: DisarmMalus
      malus: 0.7
    - type: Execution
      doAfterDuration: 4.0
  - type: Wieldable
    wieldSound: null # esword light sound instead
  - type: MeleeWeapon
    heavyStaminaCost: 0 # goob edit
    wideAnimationRotation: -135
    attackRate: 1.3
    angle: 100
    damage:
      types:
        Blunt: 4.5
  - type: Sprite
    sprite: Objects/Weapons/Melee/e_sword_double.rsi
    layers:
    - state: e_sword_double
    - state: e_sword_double_blade
      color: "#FFFFFF"
      visible: false
      shader: unshaded
      map: [ "blade" ]
  - type: Item
    size: Small
    sprite: Objects/Weapons/Melee/e_sword_double-inhands.rsi
  - type: Reflect
    reflectProb: .75
    spread: 75
  - type: PirateBountyItem # Mono
    id: TSFEnergyWeapon

# Item will look weird in handslot. Will need to adjust handstorage visuals in a future PR
- type: entity
  parent: EnergySwordDouble
  id: HyperEutacticBlade
  name: hypereutactic-blade
  description: A supermassive weapon envisioned to cleave the very fabric of space and time itself in twain, the hypereutactic blade dynamically flash-forges a hypereutactic crystaline nanostructure capable of passing through most known forms of matter like a hot knife through butter.
  components:
  - type: MeleeWeapon
    wideAnimationRotation: 180
    attackRate: 0.8 #0.7 and below is too slow
    angle: 100
    range: 2.0
    damage:
      types:
        Blunt: 4.5
  - type: ItemToggleMeleeWeapon
    activatedSoundOnSwing:
      path: /Audio/Weapons/eblademiss.ogg
      params:
        volume: -3
        variation: 0.250
    activatedDamage:
      types:
        Slash: 20
        Heat: 25
        Structural: 25
  - type: MeleeRequiresWield
  - type: HeldSpeedModifier #slowdown is what balances this compared to a dsword
    walkModifier: 0.6
    sprintModifier: 0.6
  - type: UseDelay
    delay: 1.5
  - type: Sprite
    sprite: Objects/Weapons/Melee/hypereutactic_blade.rsi
    layers:
    - state: hypereutactic
    - state: hypereutactic_blade
      color: "#FFFFFF"
      visible: false
      shader: unshaded
      map: [ "blade" ]
    - state: hypereutactic_gem
      color: "#FFFFFF"
      visible: false
      shader: unshaded
      map: [ "gem" ]
  - type: Item
    size: Small
    sprite: Objects/Weapons/Melee/hypereutactic_blade_inhands.rsi
  - type: Reflect
    reflectProb: 1.0
    spread: 75

# Borgs
- type: entity
  suffix: One-Handed, For Borgs
  parent: EnergySwordDouble
  id: CyborgEnergySwordDouble # why is this invalid if ID is BorgEnergySwordDouble
  description: A double-bladed e-sword now stuck onto a cyborg, who and why would they do this? Specially designed for cyborgs.
  components: # could add energy-draining like the L6C
  - type: Wieldable
    freeHandsRequired: 0 # because borg has no off-hand to wield with.  Without this, it will be unable to activate the esword
