# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Lumminal <81829924+Lumminal@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent:
    - SimpleSpaceMobBase
    - MobPolymorphable
  id: BaseMobSlaughterDemon
  name: slaughter demon
  suffix: ""
  description: A large, menacing creature covered in armored black scales. You should run.
  components:
  - type: Sprite
    sprite: _Goobstation/SlaughterDemon/demon.rsi
    state: daemon
  - type: Stamina
    critThreshold: 150
  - type: NightVision
    color: "#AA4A44"
    activateSound: null
    deactivateSound: null
  - type: Insulated
  - type: Damageable
    damageContainer: Biological
    damageModifierSet: SlaughterDemon
  - type: StatusEffects # Overwriting basesimplemob to remove flash
    allowed:
    - SlowedDown
    - Stutter
    - Electrocution
    - ForcedSleep
    - TemporaryBlindness
    - Pacified
    - RadiationProtection
    - Drowsiness
    - Adrenaline
  - type: MobMover
  - type: InputMover
  - type: Input
    context: "human"
  - type: InteractionOutline
  - type: NoSlip
  - type: Clickable
  - type: GhostRole
    allowMovement: true
    allowSpeech: true
    makeSentient: true
    name: ghost-role-information-slaughter-demon-name
    description: ghost-role-information-slaughter-demon-description
    rules: ghost-role-information-slaughter-demon-rules
    mindRoles:
    - MindRoleGhostRoleSoloAntagonist
    raffle:
      settings: default
    requirements:
    - !type:OverallPlaytimeRequirement
      time: 18000
  - type: GhostTakeoverAvailable
  - type: Physics
    bodyType: KinematicController
  - type: MobState
  - type: MobThresholds
    thresholds:
      0: Alive
      200: Dead
  - type: Examiner
  - type: CombatMode
  - type: MeleeWeapon
    soundHit:
      path: /Audio/Effects/demon_attack1.ogg
    animation: WeaponArcPunch
    damage:
      types:
        Slash: 25
        Structural: 50
  - type: SlaughterDemon # main component
    speedModWalk: 2.5
    speedModRun: 2.5
    bloodCrawlSounds:
      collection: bloodCrawl
      params:
        volume: 2
  - type: SlaughterDevour # allows the demon to devour
    toHeal: # Healing done when eating someone
      groups:
        Brute: -100
        Burn: -100
        Airloss: -100
        Toxin: -100
        Genetic: -100
        Metaphysical: -100
    toHealNonCrew: # Healing done when eating a robot
      groups:
        Brute: -50
        Burn: -50
        Airloss: -50
        Toxin: -50
        Genetic: -50
        Metaphysical: -50
    toHealAnythingElse:  # Healing when previous conditions weren't met
      groups:
        Brute: -25
        Burn: -25
        Airloss: -25
        Toxin: -25
        Genetic: -25
        Metaphysical: -25
    doAfterDelay: 2
  - type: DemonicWhisper # allows the demon to demonic whisper
  - type: DemonicAccent # the accent
  - type: Puller
    stageChangeCooldown: 0.5
    grabThrowDamageModifier: 6.0
    throwingDistance: 30
    needsHands: false
  - type: Targeting
  - type: Speech
    speechVerb: SlaughterDemon
    speechSounds: SlaughterDemon
  - type: TypingIndicator
    proto: guardian
  - type: Gibbable
  - type: LayingDown
  - type: RotationVisuals
    defaultRotation: 90
    horizontalRotation: 90
  - type: Body
    prototype: SlaughterDemon
  - type: StandingState
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.35
        density: 666
        mask:
        - MobMask
        layer:
        - MobLayer
  - type: MovementSpeedModifier
    baseWalkSpeed: 2
    baseSprintSpeed: 2
  - type: NpcFactionMember
    factions:
    - DevilFaction
  - type: ActionGrant
    actions:
      - DemonicWhisperAction
  - type: ReplacementAccent
    accent: slaughterDemon
  - type: GrantHellRip
  - type: WeakToHoly
    alwaysTakeHoly: true
  - type: Hands
  - type: PressureImmunity
  - type: TriggerOnMobstateChange
    mobState:
    - Dead
  - type: EmitSoundOnTrigger
    sound:
      path: /Audio/Effects/demon_dies.ogg
  - type: Vocal
    sounds:
      Male: SlaughterDemon
      Female: SlaughterDemon
      Unsexed: SlaughterDemon
  - type: ZombieImmune
  - type: SlowOnDamage
    speedModifierThresholds:
      200: 1
  - type: Bloodstream
    bloodMaxVolume: 300
    bloodReagent: Sulfur
    bleedReductionAmount: 5
  - type: Temperature
    coldDamage:
      types:
        Cold: 0
    heatDamage:
      types:
        Heat: 0
    heatDamageThreshold: 666
    coldDamageThreshold: 66

# laughter demon
- type: entity
  parent: BaseMobSlaughterDemon
  id: MobLaughterDemon
  name: laughter demon
  description: A large, adorable creature covered in armor with pink bows.
  components:
  - type: Sprite
    sprite: _Goobstation/SlaughterDemon/demon.rsi
    state: bowmon
  - type: MobThresholds
    thresholds:
      0: Alive
      190: Dead
  - type: SlaughterDevour
    feastSound: /Audio/_Goobstation/Misc/scary_horn2.ogg
  - type: SlaughterDemon
    isLaughter: true
  - type: Speech
    speechVerb: Cluwne
  - type: MeleeWeapon
    soundHit:
      path: /Audio/Items/bikehorn.ogg
    animation: WeaponArcPunch
    damage:
      types:
        Slash: 20
        Structural: 50
  - type: GhostRole
    allowMovement: true
    allowSpeech: true
    makeSentient: true
    name: ghost-role-information-laughter-demon-name
    description: ghost-role-information-laughter-demon-description
    rules: ghost-role-information-slaughter-demon-rules
    mindRoles:
    - MindRoleGhostRoleSoloAntagonist
    raffle:
      settings: default
    requirements:
    - !type:OverallPlaytimeRequirement
      time: 18000
  - type: EmitSoundOnTrigger
    sound:
      path: /Audio/Effects/sadtrombone.ogg

# midround roll
- type: entity
  parent: BaseMobSlaughterDemon
  id: MobLesserSlaughterDemon
  name: lesser slaughter demon
  components:
  - type: MobThresholds
    thresholds:
      0: Alive
      180: Dead
