# One bullet to bring them all into the darkness and bind them
- type: entity
  id: BulletBase
  name: bulletbase
  description: If you can see this you're probably dead!
  abstract: true
  components:
  - type: Clickable
  - type: Sprite
    netsync: false
    noRot: false
    sprite: Objects/Weapons/Guns/Projectiles/bullet.rsi
    state: bullet
  - type: Physics
    bodyType: Dynamic
    linearDamping: 0
    angularDamping: 0
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.1,-0.1,0.1,0.1"
      hard: false
      mask:
      - Impassable
      layer:
      - MobImpassable
  - type: Projectile
    damage:
      types:
        Piercing: 20
    soundHit:
      path: /Audio/Weapons/Guns/Hits/bullet_hit.ogg

- type: entity
  id: TriggerBulletBase # Trigger-on-collide bullets
  parent: BulletBase
  abstract: true
  components:
  - type: TriggerOnCollide
  - type: Projectile
    damage:
      types:
        Blunt: 7 # more damage than a punch.
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.15,-0.45,0.15,0.15"
      hard: false
      mask:
      - Impassable
      layer:
      - MobImpassable

- type: entity
  id: BulletBaseFlash
  name: base bullet flash
  parent: TriggerBulletBase
  abstract: true
  components:
  - type: Projectile
    soundHit:
      path: /Audio/Weapons/Guns/Hits/snap.ogg
  - type: FlashOnTrigger
    range: 1
  - type: EmitSoundOnTrigger
    sound:
      path: "/Audio/Effects/flash_bang.ogg"

- type: entity
  id: BulletBaseHV
  name: base bullet high-velocity
  parent: BulletBase
  abstract: true
  components:
  - type: Projectile
    damage:
      types:
        Piercing: 12

- type: entity
  id: BulletBasePractice
  name: base bullet practice
  parent: BulletBase
  abstract: true
  components:
  - type: Projectile
    damage:
      types:
        Blunt: 2

- type: entity
  id: BulletBaseRubber
  name: base bullet rubber
  parent: BulletBase
  abstract: true
  components:
  - type: Projectile
    damage:
      types:
        Blunt: 3
    soundHit:
      path: /Audio/Weapons/Guns/Hits/snap.ogg
  - type: StunOnCollide
    stunAmount: 2
    knockdownAmount: 2

# Energy projectiles
- type: entity
  name : taser bolt
  id: BulletTaser
  parent: BulletBase
  abstract: true
  components:
  - type: Sprite
    noRot: true
    sprite: Objects/Weapons/Guns/Projectiles/spark.rsi
    color: "#ffff33"
    layers:
    - state: spark
      shader: unshaded
  - type: Physics
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.2,-0.2,0.2,0.2"
      hard: false
      mask:
      - Impassable
      layer:
      - MobImpassable
  - type: Ammo
    isProjectile: true
    ammoVelocity: 20
    caliber: Energy
  - type: Projectile
    damage:
      types:
        Heat: 5
    soundHit:
      path: "/Audio/Weapons/Guns/Hits/taser_hit.ogg"
  - type: StunOnCollide
    stunAmount: 5
    knockdownAmount: 5

- type: entity
  name: emitter bolt
  id: EmitterBolt
  parent: BulletBase
  abstract: true
  components:
  - type: Sprite
    color: "#ffff33"
    sprite: Structures/Power/Generation/Singularity/emitter.rsi
    state: 'projectile'
  - type: Physics
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.2,-0.2,0.2,0.2"
      hard: false
      mask:
        - Opaque
  - type: Projectile
    damage:
      types:
        Heat: 20
    soundHit:
      path: /Audio/Weapons/Guns/Hits/bullet_hit.ogg
  - type: Tag
    tags:
    - EmitterBolt

# Launcher projectiles (grenade / rocket)
- type: entity
  id: BulletRocket
  name: rocket
  parent: TriggerBulletBase
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Weapons/Guns/Projectiles/rocket.rsi
    state: frag
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Default
    maxIntensity: 40
    intensitySlope: 6
    totalIntensity: 200
  - type: PointLight
    radius: 3.5
    color: orange
    energy: 0.5

- type: entity
  id: WeakBulletRocket
  name: weak rocket
  parent: TriggerBulletBase
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Weapons/Guns/Projectiles/rocket.rsi
    state: frag
  - type: ExplodeOnTrigger
  - type: Explosive
    devastationRange: 0
    heavyImpactRange: 0
    lightImpactRange: 1
    flashRange: 10
  - type: PointLight
    radius: 3.5
    color: orange
    energy: 0.5


- type: entity
  id: BulletGrenadeBaton
  name: baton grenade
  parent: BulletBase
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi
    state: grenade
  - type: Projectile
    deleteOnCollide: false
    damage:
      types:
        Blunt: 1
    soundHit:
      path: /Audio/Effects/gen_hit.ogg
  - type: StunOnCollide
    stunAmount: 8
    knockdownAmount: 8

- type: entity
  id: BulletGrenadeBlast
  name: blast grenade
  parent: TriggerBulletBase
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi
    state: grenade
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Default
    totalIntensity: 500 # a ~7 tile radius. This is pretty big.
    maxIntensity: 10 # caps at 150 damage

- type: entity
  id: BulletGrenadeFlash
  name: flash grenade
  parent: BulletBaseFlash
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi
    state: grenade
  - type: FlashOnTrigger
    range: 7

# This is supposed to spawn shrapnel and stuff so uhh... TODO?
- type: entity
  id: BulletGrenadeFrag
  name: frag grenade
  parent: TriggerBulletBase
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi
    state: grenade
  - type: ExplodeOnTrigger
  - type: Explosive
    explosionType: Default
    totalIntensity: 64 # about a ~4 tile radius

- type: entity
  id: BulletFoam
  name: foam dart
  parent: BulletBase
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Fun/toys.rsi
    state: foamdart
  - type: Projectile
    deleteOnCollide: true
    damage:
      types:
        Blunt: 2
    soundHit:
      path: /Audio/Weapons/Guns/Hits/snap.ogg

- type: entity
  id: BulletCap
  name: cap bullet
  parent: BulletBase
  abstract: true
  components:
  - type: Sprite
    netsync: false
    sprite: Objects/Fun/toys.rsi
    state: capbullet
  - type: Projectile
    deleteOnCollide: true
    damage:
      types:
        Piercing: 0
