- type: entity
  id: ProjectileFireball
  name: fireball
  description: You better GITTAH WEIGH.
  parent: BulletRocket
  categories: [ HideSpawnMenu ]
  components:
  - type: PointLight
    color: "#E25822"
    radius: 2.0
    energy: 5.0
  - type: Projectile
    damage:
      types:
        Heat: 10
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/magic.rsi
    layers:
    - state: fireball
      shader: unshaded
  - type: Explosive
    explosionType: Default
    maxIntensity: 40
    intensitySlope: 6
    totalIntensity: 200
    maxTileBreak: 0
  - type: IgnitionSource
    temperature: 400
    ignited: true
  - type: IgniteOnCollide
    fireStacks: 0.35

- type: entity
  categories: [ HideSpawnMenu ]
  parent: BaseBulletTrigger
  id: ProjectileDragonsBreath
  name: dragon's breath
  description: Try not to get toasted.
  components:
  - type: PointLight
    color: "#E25822"
    radius: 3.0
    energy: 5.0
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/magic.rsi
    layers:
    - state: fireball
      shader: unshaded
  - type: IgnitionSource
    temperature: 1000
    ignited: true
  - type: RepeatingTrigger
    delay: 0.5 # line of fire as well as if it hits something
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: FireBomb
    totalIntensity: 5 # low intensity, the point is to burn attackers not to break open walls, dragons can just eat them
    intensitySlope: 1
    maxIntensity: 3
    canCreateVacuum: false
    deleteAfterExplosion: false
    repeatable: true
  - type: TimedDespawn
    lifetime: 5

- type: entity
  id: ProjectileAnomalyFireball
  name: fireball
  description: Hovering blob of flame.
  parent: ProjectileFireball
  categories: [ HideSpawnMenu ]
  components:
  - type: TimedDespawn
    lifetime: 30
  - type: Explosive
    explosionType: Default
    maxIntensity: 100
    intensitySlope: 0.1
    totalIntensity: 0.3
    maxTileBreak: 0

- type: entity
  id: ProjectileLocker
  name: cursed locker
  description: A cursed magical locker! Can you resist?
  parent: ClosetSteelBase
  categories: [ HideSpawnMenu ]
  components:
  - type: ResistLocker
    resistTime: 30
  - type: StoreOnCollide
    lockOnCollide: true
    disableWhenFirstOpened: true
    whitelist:
      components:
        - MobState
  - type: LockVisuals
    stateLocked: cursed_door
    stateUnlocked: decursed_door
  - type: Lock
    breakOnAccessBreaker: false
  - type: AccessReader
    access: [["Wizard"]]
    breakOnAccessBreaker: false
  - type: Projectile
    deleteOnCollide: false
    onlyCollideWhenShot: true
    damage:
      types:
        Brute: 0
  - type: Sprite
    noRot: true
    sprite: Structures/Storage/closet.rsi
    layers:
    - state: cursed
      map: [ "enum.StorageVisualLayers.Base" ]
    - state: decursed_door
      map: [ "enum.StorageVisualLayers.Door" ]
    - state: paper
      visible: false
      sprite: Structures/Storage/closet_labels.rsi
      map: [ "enum.PaperLabelVisuals.Layer" ]
    - state: cursed_door
      map: [ "enum.LockVisualLayers.Lock" ]
    - state: welded
      visible: false
      map: [ "enum.WeldableLayers.BaseWelded" ]
  #TODO: Will have to eventually make a custom visualizer for cursed lockers
  - type: EntityStorageVisuals
    stateBaseClosed: decursed
    stateDoorOpen: decursed_open
    stateDoorClosed: decursed_door
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.25,-0.48,0.25,0.48"
        density: 75
        mask:
        - MachineMask
        layer:
        - MachineLayer
      projectile:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.15,-0.45,0.15,0.15"
        hard: false
        mask:
        - Impassable
        - BulletImpassable
      fly-by: &flybyfixture
        shape: !type:PhysShapeCircle
          radius: 0.6
        layer:
        - Impassable
        - MidImpassable
        - HighImpassable
        - LowImpassable
        hard: false

- type: entity
  id: ProjectilePolyboltBase
  abstract: true
  parent: BaseBullet
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/magic.rsi
    layers:
    - state: spell
      color: '#00FF00'
  - type: Projectile
    damage:
      types:
        Poison: 5
  - type: TriggerOnCollide
    fixtureID: projectile
    # Projectile.DeleteOnCollide is true, but allow this to hit multiple entities if they're
    # stacked up (they will all trigger a collide), so this isn't frustrating to use
    maxTriggers: null
  - type: PolymorphOnTrigger
    targetUser: true

- type: entity
  id: ProjectilePolyboltCarp
  parent: ProjectilePolyboltBase
  name: carp polybolt
  description: Nooo, I don't wanna be fish!
  categories: [ HideSpawnMenu ]
  components:
  - type: PolymorphOnTrigger
    polymorph: WizardForcedCarp
  - type: WhitelistTriggerCondition
    userWhitelist:
      components:
      - MobState

- type: entity
  id: ProjectilePolyboltMonkey
  parent: ProjectilePolyboltBase
  name: monkey polybolt
  description: Nooo, I don't wanna be monkey!
  categories: [ HideSpawnMenu ]
  components:
  - type: PolymorphOnTrigger
    polymorph: WizardForcedMonkey
  - type: WhitelistTriggerCondition
    userWhitelist:
      components:
      - MobState

- type: entity
  id: ProjectilePolyboltDoor
  parent: ProjectilePolyboltBase
  name: door polybolt
  description: Nooo, I don't wanna be door!
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/magic.rsi
    layers:
    - state: spell
      color: brown
  - type: PolymorphOnTrigger
    polymorph: WizardWallDoor
  - type: WhitelistTriggerCondition
    userWhitelist:
      components:
      - Airlock
      - Firelock
      tags:
      - Wall

- type: entity
  id: ProjectileHealingBolt
  name: healing bolt
  description: I COMMAND YOU TO LIVE!
  parent: BaseBullet
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Projectiles/magic.rsi
    layers:
    - state: spell
      color: white
  - type: Projectile
    damage:
      groups: # good enough. Maybe make it call the rejuvenate command later.
        Brute: -900
        Burn: -900
        Airloss: -600
        Toxin: -600
    ignoreResistances: true

- type: entity
  id: BulletInstakillMagic
  name: magical lead cylinder
  parent: BaseBullet
  categories: [ HideSpawnMenu ]
  description: This looks familiar.
  components:
  - type: Projectile
    damage:
      types:
        Piercing: 300
    ignoreResistances: true

- type: entity
  id: ProjectilePolyboltCluwne
  parent: ProjectilePolyboltBase
  name: cluwne polybolt
  description: KnoH KnoH!
  categories: [ HideSpawnMenu ]
  components:
  - type: PolymorphOnTrigger
    polymorph: WizardForcedCluwne
  - type: WhitelistTriggerCondition
    userWhitelist:
      components:
      - MobState

- type: entity
  id: ProjectileIcicle
  parent: BaseBullet
  name: icicle
  description: Brrrrr.
  categories: [ HideSpawnMenu ]
  components:
  - type: Sprite
    sprite: Structures/Specific/Anomalies/ice_anom.rsi
  - type: Projectile
    damage:
      types:
        Piercing: 20
        Cold: 20
        Structural: 50

- type: entity
  parent: ProjectilePolyboltBase
  id: ProjectilePolyboltBread
  name: bread polybolt
  description: Nooo, I don't wanna be bread!
  categories: [ HideSpawnMenu ]
  components:
  - type: PolymorphOnTrigger
    polymorph: BreadMorph
  - type: WhitelistTriggerCondition
    userWhitelist:
      components:
      - MobState
