ACTOR Stinger : IDMWeapon
{
	Weapon.SelectionOrder 50
	Weapon.AmmoGive 200
	Weapon.AmmoUse 4
	Weapon.AmmoType "IDMClip"
	//Weapon.PreferredSkin "ChaingunMarine"
	Inventory.PickupMessage "Stinger! (Slot 4)"
	Tag "Stinger"
	Obituary "%o was stung a lot by %k's Stinger."
	+EXTREMEDEATH
	+WEAPON.BFG
	+WEAPON.NOLMS
	Decal "BulletChip"
	//Damagetype "StingNail"
	States
	{
	Ready:
      STCN A 1 A_WeaponReady
      Loop
	Deselect:
	  TNT1 A 0 A_StopSound(CHAN_7)
      STCN A 1 A_Lower
	  TNT1 A 0 A_StopSound(CHAN_7)
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      STCN A 1 A_Raise
      Loop
	Fire:
	  STCN A 4 Bright A_Playsound("weapons/stingloop",CHAN_7,1,1)
	  STCN CDEF 3 Bright
	  STCN ACDEF 2 Bright
	  STCN ACDEF 1 Bright
	Hold:
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
      TNT1 A 0 A_FireCustomMissile("StingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("StingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("StingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("StingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      STCN A 1 Bright
	  TNT1 A 0 A_Playsound("weapons/stingloop",CHAN_7,1,1)
	  STCN C 1 Bright
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 A 0 A_FireCustomMissile("StingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("StingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("StingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("StingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
	  TNT1 A 0 A_CheckReload
	  STCN D 1 Bright
	  STCN E 1 Bright
	  STCN F 1 Bright
	FireEnd:
	  TNT1 A 0 A_CheckReload
      TNT1 A 0 A_ReFire
	  TNT1 A 0 A_Playsound("weapons/stingstop",CHAN_7)
	  STCN ACD 2
	  STCN EF 3
	  STCN A 15
	  Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      STCN A 1 Bright
	  TNT1 A 0 A_Playsound("weapons/stingloop",CHAN_7,1,1)
	  STCN C 1 Bright
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
	  Goto Hold+13
	Level2:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN A 1 Bright
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN C 1 Bright
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN D 1 Bright
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN E 1 Bright
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN F 1 Bright
	  Goto FireEnd
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN A 1 Bright
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN C 1 Bright
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),1,0,0,0,frandom(-2,2))
      TNT1 A 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN D 1 Bright
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN E 1 Bright
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      TNT1 A 0 A_PlaySound("weapons/stingfire", CHAN_WEAPON)
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail1",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail2",frandom(-8,8),0,0,0,0,frandom(-2,2))
      TNT1 AA 0 A_FireCustomMissile("ExtremeStingNail3",frandom(-8,8),0,0,0,0,frandom(-2,2))
      STCN F 1 Bright
	  Goto FireEnd
	Spawn:
      STIN A -1 Bright
      Stop
    }
}

ACTOR StingNail1 : Nail
{
	Scale 0.5
	Radius 3
	Height 3
	Damage (30 * random(1,4))
	MissileType "StingBlur1"
	Obituary "%o was stung a lot by %k's Stinger."
	+EXTREMEDEATH
}

ACTOR ExtremeStingNail1 : StingNail1
{
	States
	{
	XDeath:
	  TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
	  NLPJ B 0 A_PlaySound("Weapons/NailHit")
	  TNT1 A 1 A_SpawnItemEx("BloodSplatter",0,0,0,random(0,2.5),random(0,2.5),random(0,2.5),random(0,360))
	  Stop
	}
}
	

ACTOR StingBlur1 : Nailblur
{
	Scale 0.5
}

ACTOR StingNail2 : Nail
{
	Scale 0.65
	Radius 6
	Height 6
	Damage (40 * random(1,4))
	MissileType "StingBlur2"
	Obituary "%o was stung a lot by %k's Stinger."
	+EXTREMEDEATH
}

ACTOR ExtremeStingNail2 : StingNail2
{
	States
	{
	XDeath:
	  TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
	  NLPJ B 0 A_PlaySound("Weapons/NailHit")
	  TNT1 A 1 A_SpawnItemEx("BloodSplatter",0,0,0,random(0,2.5),random(0,2.5),random(0,2.5),random(0,360))
	  Stop
	}
}
	
ACTOR StingBlur2 : Nailblur
{
	Scale 0.65
}

ACTOR StingNail3 : Nail
{
	Scale 0.8
	Radius 9
	Height 9
	Damage (50 * random(1,4))
	MissileType "StingBlur3"
	Obituary "%o was stung a lot by %k's Stinger."
	+EXTREMEDEATH
}

ACTOR ExtremeStingNail3 : StingNail3
{
	States
	{
	XDeath:
	  TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
	  NLPJ B 0 A_PlaySound("Weapons/NailHit")
	  TNT1 A 1 A_SpawnItemEx("BloodSplatter",0,0,0,random(0,2.5),random(0,2.5),random(0,2.5),random(0,360))
	  Stop
	}
}
	
ACTOR StingBlur3 : Nailblur
{
	Scale 0.8
}
