# SPDX-FileCopyrightText: 2025 ActiveMammmoth <140334666+ActiveMammmoth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 ActiveMammmoth <kmcsmooth@gmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
# SPDX-FileCopyrightText: 2025 keronshb <54602815+keronshb@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseEntitySpellAction
  id: ActionAnimateSpell
  name: Animate
  description: Bring an inanimate object to life!
  components:
  - type: Action
    useDelay: 0
    sound: !type:SoundPathSpecifier
      path: /Audio/Magic/staff_animation.ogg
    icon:
      sprite: Objects/Magic/magicactions.rsi
      state: spell_default
  - type: EntityTargetAction
    whitelist:
      components:
      - Animateable # Currently on: SeatBase, TableBase, ClosetBase, BaseMachine, ConstructibleMachine, BaseComputer, BaseItem, CrateGeneric, StorageTank, GasCanister
    blacklist:
      components:
      - MindContainer
      - NukeDisk
      - GravityGenerator
      - AnomalyGenerator
      - TegGenerator
      - TegCirculator
      - XenoArtifact
      - MaterialReclaimer
    event: !type:ChangeComponentsSpellEvent
      toAdd:
      - type: Animate
      - type: MindContainer
      - type: InputMover
      - type: MobMover
      - type: MovementSpeedModifier
      - type: HTN
        rootTask:
          task: SimpleHostileCompound
      - type: CombatMode
      - type: MeleeWeapon
        animation: WeaponArcPunch
        wideAnimation: WeaponArcPunch
        altDisarm: false
        soundHit: /Audio/Weapons/smash.ogg
        range: 1.2
        angle: 0.0
        damage:
          types:
            Blunt: 10
      - type: NpcFactionMember
        factions:
        - Wizard
      - type: NoSlip
      - type: MovementAlwaysTouching
      - type: CanMoveInAir
      - type: Damageable
        damageContainer: ManifestedSpirit
        damageModifierSet: ManifestedSpirit
      - type: Destructible
        thresholds:
        - trigger:
            !type:DamageTrigger
            damage: 100
          behaviors:
          - !type:DoActsBehavior
            acts: ["Destruction"]
          - !type:PlaySoundBehavior
            sound:
              collection: MetalBreak
      - type: Hands
      - type: CanEscapeInventory
      - type: MobCollision
      toRemove:
      - RequireProjectileTarget
      - BlockMovement
      - Item
      - MeleeRequiresWield
