- type: entity
  id: BaseMeleeWeaponEnergy # more generic naming in case someone makes like, idk, an energy axe
  parent: BaseItem
  abstract: true
  components:
  - 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: ItemToggleHot
  - type: ItemToggleSize
    activatedSize: Huge
  - type: ItemTogglePointLight
    toggleableVisualsColorModulatesLights: true
  - 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: 15
        Structural: 20
  - type: MeleeWeapon
    wideAnimationRotation: -135
    attackRate: 1
    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: ToggleableVisuals # Add support for multiple layers
    spriteLayer: blade
    inhandVisuals:
      left:
      - state: inhand-left-blade
        shader: unshaded
      right:
      - state: inhand-right-blade
        shader: unshaded
  - type: Reflect
    # Starlight-start
    reflectProb: 0.25
    spread: 75
    enhancedReflection:
      TaserBolt: 0.80 # cheesy
      DisablerBolt: 0.50
      LaserBolt: 0.50
      BulletDisabler: 0.50
      BulletDisablerSmgSpread: 0.50
      BulletLaserSpread: 0.50
      DisablerBoltSmg: 0.50
      BulletLaserSpreadNarrow: 0.50
      BulletDisablerSmg: 0.45
      PelletClusterRubber: 0.50
      RedLaserBeam: 0.40
      IgnitionRedLaser: 0.40
      DestroyBeam: 0.40
      RadOrb: 0.40
      FreezeRay: 0.40
      # Starlight-end
  - type: IgnitionSource
    temperature: 700
  # 🌟Starlight-start🌟
  - type: SurgeryTool
    successRate: 0.6
    startSound:
      path: /Audio/_Starlight/Medical/Surgery/cautery1.ogg
    endSound:
      path: /Audio/_Starlight/Medical/Surgery/cautery2.ogg
  - type: Cautery
  - type: Scalpel
  # 🌟Starlight-end🌟

- type: entity
  name: energy sword
  parent: [BaseMeleeWeaponEnergy, BaseSyndicateContraband]
  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: StaticPrice
    price: 2500

- type: entity
  name: energy dagger
  parent: [BaseMeleeWeaponEnergy, BaseSyndicateContraband]
  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: 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
    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: 2.7
    color: white
    netsync: false

- type: entity
  name: pen
  parent: [BaseMeleeWeaponEnergy, SelectableLock]
  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: Contraband
      severity: Syndicate
  - 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: 2.7
    color: white
    netsync: false
  - type: MeleeWeapon
    wideAnimationRotation: 145
    attackRate: 1
    hidden: true
    damage:
      types:
        Blunt: 1
  - type: EmitSoundOnUse
    sound:
      path: /Audio/Items/pen_click.ogg
      params:
        volume: -4
        maxDistance: 2
  - type: UseDelay
    delay: 1.5
  - type: ItemToggleRequiresLock #  TODO: FIX THIS VERB IS COOKED
    lockedPopup: null
  - type: Tag
    tags:
    - Write

- type: entity
  parent: [BaseItem, BaseSyndicateContraband]
  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, BaseMajorContraband]
  id: EnergyCutlass
  description: An exotic energy weapon.
  components:
  - type: ItemToggleMeleeWeapon
    activatedDamage:
        types:
            Slash: 10
            Heat: 12
    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, BaseSyndicateContraband]
  id: EnergySwordDouble
  description: Syndicate Command Interns thought that having one blade on the energy sword was not enough. 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: 12
            Heat: 12
            Structural: 15
  - type: ItemToggleActiveSound
    activeSound:
      path: /Audio/Weapons/ebladehum.ogg
      params:
        volume: 3
  - type: ComponentToggler
    components:
    - type: Sharp
    - type: DisarmMalus
      malus: 0.7
  - type: Wieldable
    wieldSound: null # esword light sound instead
  - type: MeleeWeapon
    wideAnimationRotation: -135
    attackRate: 1.5
    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

# 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: 20
        Structural: 20
  - 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
  parent: EnergySword
  id: CyborgEnergySword
  suffix: For Borgs
  description: A very loud & dangerous sword with a beam made of pure, concentrated plasma. Specially designed for syndicate cyborgs.

- type: entity
  parent: EnergySwordDouble
  id: CyborgEnergySwordDouble # why is this invalid if ID is BorgEnergySwordDouble
  suffix: One-Handed, For Borgs
  description: Syndicate Command Interns thought that having one blade on the energy sword was not enough. Specially designed for syndicate 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

- type: entity
  parent: [ EnergyDaggerLoud, BaseXenoborgContraband ]
  id: EnergyDaggerLoudBlue
  suffix: blue
  components:
  - type: EnergySword
    colorOptions:
    - "#2288ff" # can only be blue
