# Does not inherit from simplemob
- type: entity
  abstract: true
  name: GuardianBase
  id: MobGuardianBase
  description: guardian
  save: false
  components:
    - type: LagCompensation
    - type: GhostRole
      allowMovement: true
      allowSpeech: true
      makeSentient: true
      name: ghost-role-information-guardian-name
      description: ghost-role-information-guardian-description
      rules: ghost-role-information-familiar-rules
      mindRoles:
      - MindRoleGhostRoleFamiliar
      raffle:
        settings: default
    - type: GhostTakeoverAvailable
    - type: Input
      context: "human"
    - type: MobMover
    - type: InputMover
    - type: MovementSpeedModifier
      baseWalkSpeed: 4
      baseSprintSpeed: 5.5
    - type: DamageOnHighSpeedImpact
      damage:
        types:
          Blunt: 5
      soundHit:
        collection: MetalThud
    - type: RandomSprite
      available:
        - enum.DamageStateVisualLayers.Base:
            magic_base: ""
          enum.DamageStateVisualLayers.BaseUnshaded:
            magic_flare: Sixteen
        - enum.DamageStateVisualLayers.Base:
            miner_base: ""
          enum.DamageStateVisualLayers.BaseUnshaded:
            miner_flare: Sixteen
        - enum.DamageStateVisualLayers.Base:
            tech_base: ""
          enum.DamageStateVisualLayers.BaseUnshaded:
            tech_flare: Sixteen
    - type: Sprite
      drawdepth: Mobs
      sprite: Mobs/Aliens/Guardians/guardians.rsi
      layers:
        - state: tech_base
          map: [ "enum.DamageStateVisualLayers.Base" ]
        - state: tech_flare
          map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
          color: "#40a7d7"
          shader: unshaded
      noRot: true
    - type: Clickable
    - type: InteractionOutline
    - type: Physics
      bodyType: KinematicController
    - type: Fixtures
      fixtures:
        fix1:
          shape:
            !type:PhysShapeCircle
            radius: 0.35
          density: 25
          mask:
            - FlyingMobMask
          layer:
            - Opaque
    - type: Damageable
      damageContainer: Biological
    - type: MobState
      allowedStates:
        - Alive
    - type: CombatMode
    - type: Internals
    - type: Examiner
    - type: Speech
      speechVerb: Robotic
    - type: TypingIndicator
      proto: guardian
    - type: Pullable
    - type: MeleeWeapon
      hidden: false
      altDisarm: false
      animation: WeaponArcFist
      attackRate: 1.8
      autoAttack: true
      soundHit:
        collection: Punch
      damage:
        types:
          Blunt: 20
          Structural: 20
    - type: MeleeSpeech
    - type: UserInterface
      interfaces:
        enum.MeleeSpeechUiKey.Key:
          type: MeleeSpeechBoundUserInterface
    - type: Actions
    - type: Guardian
    - type: InteractionPopup
      interactSuccessString: petting-success-holo
      interactFailureString: petting-failure-holo
      successChance: 0.7
    - type: Tag
      tags:
        - CannotSuicide
        - StunImmune
        - SlowImmune

# From the uplink injector
- type: entity
  name: Holoparasite
  id: MobHoloparasiteGuardian
  parent: MobGuardianBase
  description: A mesmerising whirl of hard-light patterns weaves a marvelous, yet oddly familiar visage. It stands proud, tuning into its owner's life to sustain itself.
  components:
    - type: GhostRole
      allowMovement: true
      allowSpeech: true
      makeSentient: true
      name: ghost-role-information-holoparasite-name
      description: ghost-role-information-holoparasite-description
      rules: ghost-role-information-familiar-rules
      raffle:
        settings: default
    - type: GhostTakeoverAvailable
    - type: NameIdentifier
      group: Holoparasite
    - type: TypingIndicator
      proto: holo
    - type: Sprite
      layers:
        - state: tech_base
          map: [ "enum.DamageStateVisualLayers.Base" ]
        - state: tech_flare
          map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
          color: "#40a7d7"
          shader: unshaded
    - type: HTN
      rootTask:
        task: SimpleHumanoidHostileCompound

# From Wizard deck of cards
- type: entity
  name: Ifrit
  parent: MobGuardianBase
  id: MobIfritGuardian
  description: A corrupted jinn, ripped from fitra to serve the wizard's petty needs. It stands wicked, tuning into its owner's life to sustain itself.
  components:
    - type: GhostRole
      allowMovement: true
      allowSpeech: true
      makeSentient: true
      name: ghost-role-information-ifrit-name
      description: ghost-role-information-ifrit-description
      rules: ghost-role-information-familiar-rules
      raffle:
        settings: default
    - type: GhostTakeoverAvailable
    - type: RandomSprite
      available:
        - enum.DamageStateVisualLayers.BaseUnshaded:
            magic_flare: Sixteen
    - type: Sprite
      layers:
        - state: magic_base
          map: [ "enum.DamageStateVisualLayers.Base" ]
        - state: magic_flare
          map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
          color: "#40a7d7"
          shader: unshaded

- type: entity
  name: HoloClown
  id: MobHoloClownGuardian
  parent: [MobGuardianBase, InventoryBase]
  description: A mesmerising whirl of hard-light patterns weaves a blue colored clown of dubious origin.
  components:
    - type: GhostRole
      allowMovement: true
      allowSpeech: true
      makeSentient: true
      name: ghost-role-information-holoclown-name
      description: ghost-role-information-holoclown-description
      rules: ghost-role-information-familiar-rules
      raffle:
        settings: default
    - type: GhostTakeoverAvailable
    - type: NameIdentifier
      group: Holoparasite
    - type: FootstepModifier
      footstepSoundCollection:
        collection: FootstepClown
    - type: Speech
      speechVerb: Cluwne
    - type: TypingIndicator
      proto: holo
    - type: RandomSprite
      available:
        - enum.DamageStateVisualLayers.Base:
            holoclown_base: ""
          enum.DamageStateVisualLayers.BaseUnshaded:
            holoclown_flare: Sixteen
        - enum.DamageStateVisualLayers.Base:
            holoclown_base: ""
          enum.DamageStateVisualLayers.BaseUnshaded:
            holoclown_flare: Sixteen
        - enum.DamageStateVisualLayers.Base:
            holoclown_base: ""
          enum.DamageStateVisualLayers.BaseUnshaded:
            holoclown_flare: Sixteen
    - type: Sprite
      layers:
        - state: holoclown_base
          map: [ "enum.DamageStateVisualLayers.Base" ]
        - state: holoclown_flare
          map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
          color: "#8adaff"
          shader: unshaded
    - type: Tag
      tags:
        - CannotSuicide
        - FootstepSound
    - type: Inventory
      templateId: holoclown
    - type: Hands
      activeHandId: Hand
      hands:
        Hand:
          location: Left
    - type: ComplexInteraction
    - type: MeleeWeapon
      angle: 30
      animation: WeaponArcFist
      attackRate: 1.8
      soundHit:
        collection: BikeHorn
      damage:
        types:
          Blunt: 5
    - type: Loadout
      prototypes: [ HoloClownGear ]
    - type: RandomMetadata
      nameSegments:
      - NamesClown
    - type: HTN
      rootTask:
        task: SimpleHumanoidHostileCompound

- type: entity
  parent: BaseMentalAction
  id: ActionToggleGuardian
  name: Toggle Guardian
  description: Either manifests the guardian or recalls it back into your body
  components:
  - type: Action
    icon: Interface/Actions/manifest.png
    useDelay: 2
  - type: InstantAction
    event: !type:GuardianToggleActionEvent
