- type: entity
  name: stun baton
  parent: [BaseItem, BaseSecurityContraband]
  id: Stunbaton
  description: A stun baton for incapacitating people with. Actively harming with this is considered bad tone.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/stunbaton.rsi
    layers:
    - state: stunbaton_off
      map: [ "enum.ToggleableVisuals.Layer" ]
  - type: Stunbaton
    energyPerUse: 50
  - type: ItemToggle
    predictable: false
    soundActivate:
      collection: sparks
      params:
        variation: 0.250
    soundDeactivate:
      collection: sparks
      params:
        variation: 0.250
    soundFailToActivate:
      path: /Audio/Machines/button.ogg
      params:
        variation: 0.250
  - type: ItemTogglePrefix
    prefixOn: on
    prefixOff: off
  - type: ItemToggleMeleeWeapon
    activatedDamage:
      types:
        Blunt: 0
    deactivatedSoundOnHit: #starlight
      collection: GenericHit #starlight
  - type: MeleeWeapon
    wideAnimationRotation: -135
    damage:
      types:
        Blunt: 7
    bluntStaminaDamageFactor: 2.0
    angle: 60
    animation: WeaponArcThrust
    soundHit: #starlight
      collection: GenericHit #starlight
  - type: StaminaDamageOnHit
    damage: 35
    sound: /Audio/Weapons/egloves.ogg
  - type: StaminaDamageOnCollide
    damage: 35
    sound: /Audio/Weapons/egloves.ogg
  - type: LandAtCursor # it deals stamina damage when thrown
  - type: PredictedBattery
    maxCharge: 1000
    startingCharge: 1000
  - type: UseDelay
  - type: Item
    heldPrefix: off
    size: Normal
  - type: Clothing
    sprite: Objects/Weapons/Melee/stunbaton.rsi
    quickEquip: false
    slots:
    - Belt
  - type: DisarmMalus
    malus: 0.225
  - type: Appearance
  - type: GenericVisualizer
    visuals:
     enum.ToggleableVisuals.Enabled:
        enum.ToggleableVisuals.Layer:
          True: {state: stunbaton_on}
          False: {state: stunbaton_off}
  - type: StaticPrice
    price: 80
  - type: Riggable
  - type: SolutionContainerManager
    solutions:
      battery:
        maxVol: 5
  - type: InjectableSolution
    solution: battery
  - type: DrawableSolution
    solution: battery
  - type: Explosive
    explosionType: Default
    intensitySlope: 1.5
    maxIntensity: 200
  - type: PhysicalComposition
    materialComposition:
      Steel: 100
      Plastic: 100
  - type: GuideHelp
    guides:
    - Security
    - Antagonists

- type: entity
  name: truncheon
  parent: [BaseItem, BaseSecurityContraband]
  id: Truncheon
  description: A rigid, steel-studded baton, meant to harm.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Melee/truncheon.rsi
    state: icon
  - type: MeleeWeapon
    wideAnimationRotation: -135
    damage:
      types:
        Blunt: 20
    soundHit:
      collection: MetalThud
    bluntStaminaDamageFactor: 1.5
  - type: Item
    size: Normal
  - type: Tag
    tags:
    - Truncheon
  - type: Clothing
    sprite: Objects/Weapons/Melee/truncheon.rsi
    quickEquip: false
    slots:
    - Belt
  - type: DisarmMalus
    malus: 0.225
  - type: Appearance
  - type: StaticPrice
    price: 80
  - type: GuideHelp
    guides:
    - Security
    - Antagonists

- type: entity
  name: flash
  parent: [BaseItem, BaseSecurityScienceCommandContraband]
  id: Flash
  description: An ultrabright flashbulb with a trigger, which causes the victim to be dazed and lose their eyesight for a moment. Useless when burnt out.
  components:
    - type: Sprite
      sprite: Objects/Weapons/Melee/flash.rsi
      layers:
      - state: flash
        map: [ "enum.FlashVisualLayers.BaseLayer" ]
      - state: flashing
        map: [ "enum.FlashVisualLayers.LightLayer" ]
        visible: false
        shader: unshaded
    - type: Flash
    - type: LimitedCharges
      maxCharges: 5
    - type: MeleeWeapon
      wideAnimationRotation: 180
      damage:
        types:
          Blunt: 0 # melee weapon to allow flashing individual targets
      angle: 10
    - type: Item
      size: Small
      sprite: Objects/Weapons/Melee/flash.rsi
    - type: UseDelay
      delay: 4 # has to be the same as the FlashingTime datafield in FlashComponent
    - type: UseDelayOnMeleeHit
    - type: StaticPrice
      price: 40
    - type: Appearance
    - type: GenericVisualizer
      visuals:
        enum.FlashVisuals.Burnt:
          enum.FlashVisualLayers.BaseLayer:
            True: {state: burnt}
        enum.FlashVisuals.Flashing:
          enum.FlashVisualLayers.LightLayer:
            True: {visible: true}
            False: {visible: false}
    - type: GuideHelp
      guides:
      - Security
      - Antagonists

- type: entity
  name: flash
  parent: Flash
  suffix: 2 charges
  id: SciFlash
  components:
    - type: LimitedCharges
      maxCharges: 2

- type: entity
  name: portable flasher
  parent: [BaseMachine, BaseSecurityContraband]
  id: PortableFlasher
  description: An ultrabright flashbulb with a proximity trigger, useful for making an area security-only.
  components:
    - type: EmitSoundOnTrigger
      predicted: true
      sound:
        path: /Audio/Weapons/flash.ogg
    - type: FlashOnTrigger
      range: 3
    - type: TriggerOnProximity
      enabled: true
      cooldown: 5
      shape:
        !type:PhysShapeCircle
          radius: 2
      repeating: true
    - type: Sprite
      sprite: Objects/Weapons/pflash.rsi
      layers:
        - state: "off"
          map: ["enum.ProximityTriggerVisualLayers.Base"]
    - type: Fixtures
      fixtures:
        fix1:
          shape:
            !type:PhysShapeAabb
            bounds: "-0.15,-0.3,0.15,0.3"
          mask:
          - MachineMask
          layer:
          - MachineLayer
          density: 380
    - type: Appearance
    - type: AnimationPlayer
    - type: PointLight
      energy: 2.0
      radius: 0
      softness: 0
      enabled: true
    - type: GuideHelp
      guides:
      - Security
      - Antagonists
