Actor NailgunSG : Weapon
{
  Weapon.AmmoUse 1
  Weapon.AmmoGive 25
  Weapon.KickBack 40
  Weapon.SlotNumber 2
  Weapon.AmmoType "Nails"
  Inventory.PickUpSound "misc/w_pkup"
  Inventory.PickUpMessage "You got the NailGun!"
  Obituary "%o was nailed by %k"
  AttackSound "Weapons/NailFire"
  States
  {
  Spawn:
    GWNG D -1
    Loop
  Select:
    GWNG A 1 A_Raise
    Loop
  Deselect:
    GWNG A 1 A_Lower
    Loop
  Ready:
    GWNG A 1 A_WeaponReady
    Loop
  Fire:
    GWNG A 0 A_PlayWeaponSound("Weapons/NailSGFire")
    GWNG B 2 Bright A_FireCustomMissile("CenterSGNail", 0, 1, 0, 0)
    GWNG C 2 Bright A_Light2
    GWNG A 2 A_Light1
    GWNG A 12 A_Light0
    Goto Ready
  }
}

Actor Nails : Ammo
{
  Radius 16
  Height 8
  Inventory.PickupMessage "Picked up a Box of Nails"
  Inventory.Icon "NLPJI0"
  Inventory.Amount 25
  Inventory.MaxAmount 125
  Ammo.BackpackAmount 25
  Ammo.BackpackMaxAmount 250
  States
  {
  Spawn:
    NBOX A -1
    Stop
  }
}

Actor SGNail
{
  Projectile
  Radius 2
  Height 8
  Speed 88
  Damage 10
  +BloodSplatter
  SeeSound ""
  DeathSound ""
  Decal Bulletchip
  States
  {
  Spawn:
    NLPJ A 1 A_SpawnItemEx("NailBlur", 0, 0, 0, 0.2, 0, 0, 180, 128)
    NLPJ A 0 A_PlaySound("Weapons/NailFlight")
    NLPJ A 1 A_SpawnItemEx("NailBlur", 0, 0, 0, 0.2, 0, 0, 180, 128)
    Loop
  Crash:
    NLPJ B 0 A_PlaySound("Weapons/NailHit")
    NLPJ BCDEFG 2
    Stop
  XDeath:
    NLPJ B 0 A_PlaySound("Weapons/NailHitBleed")
    NLPJ BCDEFG 2
    Stop
  Death:
    NLPJ B 0 A_PlaySound("Weapons/NailHit")
    NLPJ BCDEFG 2
    Stop
  }
}

Actor CenterSGNail : SGNail
{
  Speed 40
  Damage 6
}

Actor NailBlur       
{
  Height 8
  Radius 1
  Damage 0
  Speed 0.2
  RenderStyle Translucent
  Alpha 0.5
  +NoGravity
  +DropOff
  States
  {
  Spawn:
    DART A 1 A_FadeOut(0.1)
    Loop
  }
}
