# Based on https://github.com/space-wizards/space-station-14/pull/26883 by @Vonsant, sprites by belay5 (discord)
# region BASE
- type: entity
  abstract: true
  parent: [ MobStaminaSpecial, MobMovementSpeedModifierMelee, MobNonHumanHostileBase ]
  id: BaseMobDinosaurExpeditions
  name: dinosaur
  description: Enigmatic behemoths from a bygone era, known for their imposing stature and formidable presence.
  components:
  - type: HTN
    rootTask:
       task: SimpleHostileCompound
    blackboard:
      NavClimb: !type:Bool
        false
      NavInteract: !type:Bool
        true
      NavPry: !type:Bool
        true
      NavSmash: !type:Bool
        true
  - type: NpcFactionMember
    factions:
    - DinosaursNF
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/anki.rsi
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.40 # Lowered the value, to allow them to fit through the airlocks
        density: 1000
        mask:
          - MobMask
        layer:
          - MobLayer
  - type: ReplacementAccent
    accent: genericAggressive
  - type: Bloodstream
    bloodReagent: Blood
    bloodMaxVolume: 250
    bloodlossDamage:
      types:
        Bloodloss:
          0.5
    bloodlossHealDamage:
      types:
        Bloodloss:
          -1
  - type: MobThresholds
    thresholds:
      0: Alive
      40: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      24: 0.7
      32: 0.5
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepThud
  - type: SpamEmitSound
    minInterval: 10
    maxInterval: 60
    sound:
      collection: NFDinosaurBreath
      params:
        variation: 0.125
  - type: SoundWhileAlive
  - type: Tag
    tags:
    - FootstepSound
    - DoorBumpOpener

# MOBS
# Sorted by health pool (less health ~= faster and harder hitting)
# region compsognathus
- type: entity
  parent: [ MobMovementSpeedModifierSpecial, BaseMobDinosaurExpeditions ]
  id: MobDinosaurCompyExpeditions
  categories: [ HideSpawnMenu ]
  name: compsognathus
  description: Compsognathus is a genus of small, bipedal, carnivorous theropods. They have long hind legs and longer tails, which they used for balance during locomotion. Their forelimbs are small but beware of their claws.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/compy.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: compy
      scale: 0.6, 0.6
  - type: DamageStateVisuals
    states:
      Alive:
        Base: compy
      Critical:
        Base: compy_dead
      Dead:
        Base: compy_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Slash: 8
        Structural: 20
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepAsteroid
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurCompy
      amount: 1

# region dilophosaurus
- type: entity
  parent: [ MobMovementSpeedModifierSpecial, BaseMobDinosaurExpeditions ]
  id: MobDinosaurDiloExpeditions
  categories: [ HideSpawnMenu ]
  name: dilophosaurus
  description: With a name meaning "two-crested lizard", these measure in at about 7 m in length and 400 kg in weight. Slender and lightly built, these are very agile.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/dilo.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: dilo
  - type: DamageStateVisuals
    states:
      Alive:
        Base: dilo
      Critical:
        Base: dilo_dead
      Dead:
        Base: dilo_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcBite
    damage:
      types:
        Slash: 8
        Caustic: 2
        Structural: 25
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurDilo
      amount: 1

# region velociraptor
- type: entity
  parent: [ MobMovementSpeedModifierSpecial, BaseMobDinosaurExpeditions ]
  id: MobDinosaurRaptorExpeditions
  categories: [ HideSpawnMenu ]
  name: velociraptor
  description: A bipedal, featherless carnivore with a long tail. Each of its hindfeet has an enlarged sickle-shaped claw, which is used to tackle and restrain prey. Very fast, exercise caution.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/raptor.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: raptor
  - type: MobThresholds
    thresholds:
      0: Alive
      64: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      38: 0.7
      52: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: raptor
      Critical:
        Base: raptor_dead
      Dead:
        Base: raptor_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Slash: 18
        Structural: 30
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurRaptor
      amount: 1

# region parasaurolophus
- type: entity
  parent: BaseMobDinosaurExpeditions
  id: MobDinosaurParaExpeditions
  categories: [ HideSpawnMenu ]
  name: parasaurolophus
  description: A large carnivore that can reach over 9 metres (30 ft) long and weigh over 5 metric tons (5.5 short tons), these can move on two legs or four. Reasonably fast for its size, but comparatively fragile and weak.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/para.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: para
  - type: MobThresholds
    thresholds:
      0: Alive
      80: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      48: 0.7
      64: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: para
      Critical:
        Base: para_dead
      Dead:
        Base: para_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Blunt: 6
        Structural: 20
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurPara
      amount: 1

# region kentrosaurus
- type: entity
  parent: [ MobMovementSpeedModifierRanged, BaseMobDinosaurExpeditions ]
  id: MobDinosaurKentroExpeditions
  categories: [ HideSpawnMenu ]
  name: kentrosaurus
  description: On the smaller side of dinosaurs, Kentrosaurus generally measure around 4–4.5 m, and weigh about 700–1,600 kg. Its elongated head and beak are used to bite off plant material or tear off limbs.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/kentro.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: kentro
  - type: MobThresholds
    thresholds:
      0: Alive
      120: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      72: 0.7
      96: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: kentro
      Critical:
        Base: kentro_dead
      Dead:
        Base: kentro_dead
  - type: MeleeWeapon
    soundHit:
      collection: MetalThud
    angle: 0
    animation: WeaponArcPunch
    damage:
      types:
        Blunt: 10
        Structural: 20
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurKentro
      amount: 1

# region triceratops
- type: entity
  parent: [ MobMovementSpeedModifierRanged, BaseMobDinosaurExpeditions ]
  id: MobDinosaurTrikeExpeditions
  categories: [ HideSpawnMenu ]
  name: triceratops
  description: Bearing a large bony frill with three horns on its skull, this massive quadruped is one of the most recognizable of all dinosaurs and the best-known ceratopsian. Typically tries to gore whatever it attacks.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/trike.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: trike
  - type: MobThresholds
    thresholds:
      0: Alive
      160: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      96: 0.7
      130: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: trike
      Critical:
        Base: trike_dead
      Dead:
        Base: trike_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Piercing: 12
        Structural: 20
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurTrike
      amount: 1

# region ankylosaurus
- type: entity
  parent: [ MobMovementSpeedModifierRanged, BaseMobDinosaurExpeditions ]
  id: MobDinosaurAnkiExpeditions
  categories: [ HideSpawnMenu ]
  name: ankylosaurus
  description: Typically between between 6 and 8 meters long and between 4.8 and 8 tons in weight, this lumbering beast shouldn't be underestimated. Its wide, low skull and robust body can take a beating and still survive, and the large club on the end of its tail can be used as a weapon.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/anki.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: anki
  - type: MobThresholds
    thresholds:
      0: Alive
      200: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      120: 0.7
      160: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: anki
      Critical:
        Base: anki_dead
      Dead:
        Base: anki_dead
  - type: MeleeWeapon
    soundHit:
      collection: MetalThud
    angle: 0
    animation: WeaponArcPunch
    damage:
      types:
        Blunt: 12
        Structural: 20
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurAnki
      amount: 1

# region spinosaurus
- type: entity
  parent: BaseMobDinosaurExpeditions
  id: MobDinosaurSpinoExpeditions
  categories: [ HideSpawnMenu ]
  name: spinosaurus
  description: With a typical length of 14 m and a mass of 7.4 tons, Spinosaurus has large, robust forelimbs. Each of its hands has three-fingers, with an enlarged claw on the first digit. Surprisingly quick for its size, this giant can take a lot of punishment.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/spino.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: spino
  - type: MobThresholds
    thresholds:
      0: Alive
      280: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      170: 0.7
      225: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: spino
      Critical:
        Base: spino_dead
      Dead:
        Base: spino_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcBite
    damage:
      types:
        Blunt: 12
        Structural: 20
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurSpino
      amount: 1

# region stegosaurus
- type: entity
  parent: [ MobMovementSpeedModifierRanged, BaseMobDinosaurExpeditions ]
  id: MobDinosaurStegoExpeditions
  categories: [ HideSpawnMenu ]
  name: stegosaurus
  description: Large and heavily built, these herbivorous quadrupeds have rounded backs, short fore limbs, long hind limbs, and tails held high in the air. Lumbering, but lethal up close.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/stego.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: stego
  - type: MobThresholds
    thresholds:
      0: Alive
      280: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      170: 0.7
      225: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: stego
      Critical:
        Base: stego_dead
      Dead:
        Base: stego_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcClaw
    damage:
      types:
        Blunt: 12
        Piercing: 8
        Structural: 20
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurStego
      amount: 1

#region tyrannosaurus (boss)
- type: entity
  parent: [ MobHostileBossBase, BaseMobDinosaurExpeditions ]
  id: MobDinosaurTrexExpeditions
  categories: [ HideSpawnMenu ]
  name: tyrannosaurus
  description: A massive therapod, its giant thorax is balanced by a long, heavy tail. Relative to its large and powerful hind limbs, the forelimbs of Tyrannosaurus are short but incredible powerful for their size, and they have two clawed digits.
  components:
  - type: Sprite
    drawdepth: Mobs
    sprite: _NF/Mobs/Dinosaurs/trex.rsi
    layers:
    - map: [ "enum.DamageStateVisualLayers.Base" ]
      state: trex
  - type: MobThresholds
    thresholds:
      0: Alive
      360: Dead
  - type: SlowOnDamage
    speedModifierThresholds:
      220: 0.7
      290: 0.5
  - type: DamageStateVisuals
    states:
      Alive:
        Base: trex
      Critical:
        Base: trex_dead
      Dead:
        Base: trex_dead
  - type: MeleeWeapon
    soundHit:
        path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
    angle: 0
    animation: WeaponArcBite
    damage:
      types:
        Slash: 15
        Piercing: 10
        Structural: 20
  - type: Butcherable
    spawned:
    - id: SpawnDungeonLootNpcDinosaurTrex
      amount: 1
  # Ghost role stuff
  - type: GhostRole
    allowMovement: true
    name: ghost-role-information-t-rex-dungeon-name
    description: ghost-role-information-t-rex-dungeon-description
    rules: ghost-role-information-dungeon-boss-rules
    raffle:
      settings: default
    mindRoles:
    - MindRoleGhostRoleTeamAntagonist
  - type: GhostTakeoverAvailable
  - type: ActionGun
    action: ActionTRexRoar
    gunProto: TRexRoarGun

- type: entity
  id: TRexRoarGun
  name: TRex Roar Gun
  description: Needed to emit the roar.
  categories: [ HideSpawnMenu ]
  components:
  - type: RechargeBasicEntityAmmo
    rechargeCooldown: 40
  - type: BasicEntityAmmoProvider
    proto: BulletTRexRoar
    capacity: 1
    count: 1
  - type: Gun
    minAngle: 5
    maxAngle: 15
    fireRate: 1
    selectedMode: FullAuto
    availableModes:
      - FullAuto
    soundGunshot: null
    soundEmpty: null
    projectileSpeed: 5

- type: entity
  id: ActionTRexRoar
  parent: BaseAction
  categories: [ HideSpawnMenu ]
  name: "[color=yellow]Roar[/color]"
  description: "Emits a powerful roar, intimidating and stunning nearby foe. [color=yellow]40 second cooldown.[/color]"
  components:
  - type: Action
    icon: { sprite: _NF/Effects/sonic_wave.rsi, state: icon }
    iconColor: "#0099FF"
    priority: 2
    itemIconStyle: BigAction
    useDelay: 40
    sound:
      path: /Audio/Animals/space_dragon_roar.ogg
  - type: TargetAction
    checkCanAccess: false
    range: 0
  - type: WorldTargetAction
    event: !type:ActionGunShootEvent
