# base actions

# base prototype for all action entities
- type: entity
  abstract: true
  id: BaseAction
  components:
  - type: Action
  - type: Sprite
    layers:
    - map: ["enum.ActionVisuals.Icon"]
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ActionState.Toggled:
        enum.ActionVisuals.Icon:
          True: { visible: false }
          False: { visible: true }
        enum.ActionVisuals.IconToggled:
          True: { visible: true }
          False: { visible: false }
      enum.LimitedChargesState.HasCharges:
        enum.ActionVisuals.Icon:
          True: { color: White }
          False: { color: DimGray }
        enum.ActionVisuals.IconToggled:
          True: { color: White }
          False: { color: DimGray }

# base proto for an action that requires a DoAfter
- type: entity
  abstract: true
  parent: BaseAction
  id: BaseDoAfterAction
  components:
  - type: DoAfterArgs

# an action that is done all in le head and cant be prevented by any means
- type: entity
  abstract: true
  parent: BaseAction
  id: BaseMentalAction
  components:
  - type: Action
    checkCanInteract: false
    checkConsciousness: false

- type: entity
  abstract: true
  parent: BaseMentalAction
  id: BaseSuicideAction
  components:
  - type: ConfirmableAction
    popup: suicide-action-popup

- type: entity
  abstract: true
  parent: BaseAction
  id: BaseImplantAction
  components:
  - type: InstantAction
    event: !type:ActivateImplantEvent

- type: entity
  abstract: true
  parent: BaseAction
  id: BaseToggleAction
  components:
  - type: InstantAction
    event: !type:ToggleActionEvent

# actions

- type: entity
  parent: BaseAction
  id: ActionScream
  name: Scream
  description: AAAAAAAAAAAAAAAAAAAAAAAAA
  components:
  - type: Action
    useDelay: 10
    checkCanInteract: false
  - type: Sprite
    layers:
    - texture: Interface/Actions/scream.png
  - type: InstantAction
    event: !type:EmoteActionEvent
      emote: Scream

- type: entity
  parent: BaseMentalAction
  id: ActionTurnUndead
  name: Turn Undead
  description: Succumb to your infection and become a zombie.
  components:
  - type: Action
  - type: Sprite
    layers:
    - texture: Interface/Actions/zombie-turn.png
  - type: InstantAction
    event: !type:ZombifySelfActionEvent

- type: entity
  parent: BaseToggleAction
  id: ActionToggleLight
  name: Toggle Light
  description: Turn the light on and off.
  components:
  - type: Action
    useDelay: 1
  - type: Sprite
    sprite: Objects/Tools/flashlight.rsi
    layers:
    - state: flashlight
      map: ["enum.ActionVisuals.Icon"]
    - state: flashlight-on
      map: ["enum.ActionVisuals.IconToggled"]
      visible: false

- type: entity
  parent: BaseAction
  id: ActionOpenStorageImplant
  name: Toggle Storage Implant
  description: Opens or closes the storage implant embedded under your skin
  components:
  - type: Action
    itemIconStyle: BigAction
    priority: -20
    useDelay: 1
  - type: Sprite
    sprite: Clothing/Back/Backpacks/backpack.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:OpenStorageImplantEvent

- type: entity
  parent: [BaseSuicideAction, BaseImplantAction]
  id: ActionActivateMicroBomb
  name: Activate Microbomb
  description: Activates your internal microbomb, completely destroying you and your equipment
  components:
  - type: DangerousAction
  - type: Action
    itemIconStyle: BigAction
    priority: -20
  - type: Sprite
    sprite: Actions/Implants/implants.rsi
    layers:
    - state: explosive

- type: entity
  parent: [BaseSuicideAction, BaseImplantAction]
  id: ActionActivateDeathAcidifier
  name: Activate Death-Acidifier
  description: Activates your death-acidifier, completely melting you and your equipment
  components:
  - type: Action
    itemIconStyle: BigAction
    priority: -20
  - type: Sprite
    sprite: Objects/Magic/magicactions.rsi
    layers:
    - state: gib

- type: entity
  parent: BaseImplantAction
  id: ActionActivateFreedomImplant
  name: Break Free
  description: Activating your freedom implant will free you from any hand restraints
  components:
  - type: LimitedCharges
    maxCharges: 3
  - type: Action
    checkCanInteract: false
    itemIconStyle: BigAction
    priority: -20
  - type: Sprite
    sprite: Actions/Implants/implants.rsi
    layers:
    - state: freedom
      map: ["enum.ActionVisuals.Icon"]

- type: entity
  parent: BaseAction
  id: ActionOpenUplinkImplant
  name: Open Uplink
  description: Opens the syndicate uplink embedded under your skin
  components:
  - type: Action
    itemIconStyle: BigAction
    priority: -20
  - type: Sprite
    sprite: Objects/Devices/communication.rsi
    layers:
    - state: old-radio
  - type: InstantAction
    event: !type:OpenUplinkImplantEvent

- type: entity
  parent: BaseImplantAction
  id: ActionActivateEmpImplant
  name: Activate EMP
  description: Triggers a small EMP pulse around you
  components:
  - type: LimitedCharges
    maxCharges: 3
  - type: Action
    checkCanInteract: false
    useDelay: 5
    itemIconStyle: BigAction
    priority: -20
  - type: Sprite
    sprite: Objects/Weapons/Grenades/empgrenade.rsi
    layers:
    - state: icon
      map: ["enum.ActionVisuals.Icon"]

- type: entity
  parent: BaseImplantAction
  id: ActionActivateScramImplant
  name: SCRAM!
  description: Randomly teleports you within a large distance.
  components:
  - type: LimitedCharges
    maxCharges: 2
  - type: Action
    checkCanInteract: false
    useDelay: 5
    itemIconStyle: BigAction
    priority: -20
  - type: Sprite
    sprite: Structures/Specific/anomaly.rsi
    layers:
    - state: anom4
      map: ["enum.ActionVisuals.Icon"]

- type: entity
  parent: BaseImplantAction
  id: ActionActivateDnaScramblerImplant
  name: Scramble DNA
  description:  Randomly changes your name and appearance.
  components:
  - type: ConfirmableAction
    popup: dna-scrambler-action-popup
  - type: LimitedCharges
    maxCharges: 1
  - type: Action
    itemIconStyle: BigAction
    priority: -20
  - type: Sprite
    sprite: Clothing/OuterClothing/Hardsuits/lingspacesuit.rsi
    layers:
    - state: icon
      map: ["enum.ActionVisuals.Icon"]

- type: entity
  parent: BaseAction
  id: ActionToggleSuitPiece
  name: Toggle Suit Piece
  description: Remember to equip the important pieces of your suit before going into action.
  components:
  - type: Action
    itemIconStyle: BigItem
    useDelay: 1 # equip noise spam.
  - type: InstantAction
    event: !type:ToggleClothingEvent

- type: entity
  parent: BaseMentalAction
  id: ActionCombatModeToggle
  name: "[color=red]Combat Mode[/color]"
  description: Enter combat mode
  components:
  - type: Action
    priority: -100
  - type: Sprite
    layers:
    - texture: Interface/Actions/harmOff.png
      map: ["enum.ActionVisuals.Icon"]
    - texture: Interface/Actions/harm.png
      map: ["enum.ActionVisuals.IconToggled"]
      visible: false
  - type: InstantAction
    event: !type:ToggleCombatActionEvent

- type: entity
  parent: ActionCombatModeToggle
  id: ActionCombatModeToggleOff
  components:
  - type: Action
    enabled: false
    autoPopulate: false

- type: entity
  parent: BaseAction
  id: ActionChangeVoiceMask
  name: Set name
  description: Change the name others hear to something else.
  components:
  - type: Action
  - type: Sprite
    sprite: Interface/Actions/voice-mask.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:VoiceMaskSetNameEvent

- type: entity
  parent: BaseAction
  id: ActionShootWater
  name: Spray water!
  description: Spray water towards your enemies.
  components:
  - type: Action
  - type: Sprite
    sprite: Clothing/Neck/Misc/pins.rsi
    layers:
    - state: flower
  - type: InstantAction
    event: !type:SprayLiquidEvent

- type: entity
  parent: BaseAction
  id: ActionVendingThrow
  name: Dispense Item
  description: Randomly dispense an item from your stock.
  components:
  - type: Action
    useDelay: 30
  - type: InstantAction
    event: !type:VendingMachineSelfDispenseEvent

- type: entity
  parent: BaseToggleAction
  id: ActionToggleBlock
  name: Block
  description: Raise or lower your shield.
  components:
  - type: Action
  - type: Sprite
    sprite: Objects/Weapons/Melee/shields.rsi
    layers:
    - state: teleriot-icon
      map: ["enum.ActionVisuals.Icon"]
    - state: teleriot-on
      map: ["enum.ActionVisuals.IconToggled"]
      visible: false

- type: entity
  parent: BaseMentalAction
  id: ActionClearNetworkLinkOverlays
  name: Clear network link overlays
  description: Clear network link overlays.
  components:
  - type: Action
    clientExclusive: true
    temporary: true
  - type: Sprite
    sprite: Objects/Tools/multitool.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:ClearAllOverlaysEvent

- type: entity
  parent: BaseAction
  id: ActionAnimalLayEgg
  name: Lay egg
  description: Uses hunger to lay an egg.
  components:
  - type: Action
    useDelay: 60
  - type: Sprite
    sprite: Objects/Consumable/Food/egg.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:EggLayInstantActionEvent

- type: entity
  parent: BaseMentalAction
  id: ActionSleep
  name: Sleep
  description: Go to sleep.
  components:
  - type: Action
  - type: Sprite
    sprite: Clothing/Head/Hats/pyjamasyndicatered.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:SleepActionEvent

- type: entity
  parent: BaseMentalAction
  id: ActionWake
  name: Wake up
  description: Stop sleeping.
  components:
  - type: Action
    startDelay: true
    useDelay: 2
  - type: Sprite
    sprite: Clothing/Head/Hats/pyjamasyndicatered.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:WakeActionEvent

- type: entity
  parent: BaseImplantAction
  id: ActionActivateHonkImplant
  name: Honk
  description: Activates your honking implant, which will produce the signature sound of the clown.
  components:
  - type: Action
    useDelay: 1
  - type: Sprite
    sprite: Objects/Fun/bikehorn.rsi
    layers:
    - state: icon

- type: entity
  parent: BaseAction
  id: ActionFireStarter
  name: Ignite
  description: Ignites enemies in a radius around you.
  components:
  - type: Action
    priority: -1
    useDelay: 30
  - type: Sprite
    layers:
    - texture: Interface/Actions/firestarter.png
  - type: InstantAction
    event: !type:FireStarterActionEvent

- type: entity
  parent: BaseMentalAction
  id: ActionToggleEyes
  name: Open/Close eyes
  description: Close your eyes to protect your peepers, or open your eyes to enjoy the pretty lights.
  components:
  - type: Action
    useDelay: 1 # so u cant give yourself and observers eyestrain by rapidly spamming the action
  - type: Sprite
    layers:
    - texture: Interface/Actions/eyeopen.png
      map: ["enum.ActionVisuals.Icon"]
    - texture: Interface/Actions/eyeclose.png
      map: ["enum.ActionVisuals.IconToggled"]
      visible: false
  - type: InstantAction
    event: !type:ToggleEyesActionEvent

- type: entity
  parent: BaseToggleAction
  id: ActionToggleWagging
  name: Wagging Tail
  description: Start or stop wagging your tail.
  components:
  - type: Action
    itemIconStyle: NoItem
    useDelay: 1 # emote spam
    checkCanInteract: false
  - type: Sprite
    sprite: Mobs/Customization/reptilian_parts.rsi
    layers:
    - state: tail_smooth_behind

- type: entity
  parent: BaseAction
  id: FakeMindShieldToggleAction
  name: '[color=green]Toggle Fake Mindshield[/color]'
  description: Turn the Fake Mindshield implant's transmission on/off
  components:
  - type: Action
    itemIconStyle: NoItem
    useDelay: 1
    raiseOnUser: true
  - type: Sprite
    sprite: Interface/Actions/actions_fakemindshield.rsi
    layers:
    - state: icon
      map: ["enum.ActionVisuals.Icon"]
    - state: icon-on
      map: ["enum.ActionVisuals.IconToggled"]
      visible: false
  - type: InstantAction
    event: !type:FakeMindShieldToggleEvent
  - type: Tag
    tags:
    - FakeMindShieldImplant

- type: entity
  parent: BaseToggleAction
  id: ActionToggleParamedicSiren
  name: Toggle Paramedic Siren
  description: Toggles the paramedic siren on and off.
  components:
  - type: Action
    useDelay: 1
    itemIconStyle: BigAction
  - type: Sprite
    sprite: Clothing/OuterClothing/Hardsuits/paramed.rsi
    layers:
    - state: icon-siren

- type: entity
  parent: BaseAction
  id: ActionToggleNightVision
  name: Toggle night vision
  description: Toggles the night vision on and off.
  components:
  - type: Action
    useDelay: 2
  - type: Sprite
    sprite: Interface/Actions/night_vision.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:ToggleNightVisionEvent {}

- type: entity
  parent: ActionToggleWagging
  id: ActionToggleWaggingVulpkanin
  components:
  - type: Action
    itemIconStyle: NoItem
    useDelay: 1 # Prevents Emote Spam
  - type: Sprite
    sprite: Mobs/Customization/Vulpkanin/tail_markings.rsi
    layers:
    - state: tail-wag-icon

- type: entity
  parent: BaseAction
  id: ActionGravityJump
  name: Jump
  description: Activating the advanced propulsion system, you propel yourself a short distance in the direction of your gaze.
  components:
  - type: Action
    useDelay: 8
  - type: Sprite
    sprite: Interface/Actions/jump.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:GravityJumpEvent {}

- type: entity
  parent: ActionGravityJump
  id: ActionJumpBoost
  name: Jump boost
  components:
  - type: Action
    useDelay: 16
  - type: Sprite
    sprite: Interface/Actions/actions_borg.rsi
    layers:
    - state: xenoborg-jump-module

- type: entity
  parent: BaseAction
  id: ActionVulpkaninGravityJump
  name: Leap
  description: Use your agile legs to leap a short distance. Be careful not to bump into anything!
  components:
  - type: Action
    useDelay: 12
  - type: Sprite
    sprite: Interface/Actions/jump.rsi
    layers:
    - state: icon
  - type: InstantAction
    event: !type:GravityJumpEvent {}

- type: entity
  parent: BaseToggleAction
  id: ActionToggleRootable
  name: Rootable
  description: Begin or stop being rooted to the floor.
  components:
  - type: Action
    itemIconStyle: NoItem
    useDelay: 1
  - type: Sprite
    layers:
    - texture: Interface/Actions/rooting.png

- type: entity
  id: ActionChameleonController
  name: Control clothing
  description: Change your entire outfit fast!
  components:
  - type: Action
    priority: -20
    itemIconStyle: BigAction
  - type: Sprite
    sprite: Actions/Implants/implants.rsi
    layers:
    - state: chameleon
  - type: InstantAction
    event: !type:ChameleonControllerOpenMenuEvent

- type: entity
  parent: BaseMentalAction
  id: ActionIntrinsicStore
  name: Store
  description: Opens the store
  components:
  - type: Action
  - type: Sprite
    layers:
    - texture: Interface/Actions/shop.png
  - type: InstantAction
    event: !type:IntrinsicStoreActionEvent

- type: entity
  parent: ActionChangeVoiceMask
  id: ActionChangeVoiceMaskImplant
  components:
  - type: Action
    itemIconStyle: BigAction
  - type: Sprite
    sprite: Interface/Actions/voice-mask.rsi
    layers:
    - state: icon
