ACTOR GezzdtStinger : UWeapon
{
	Weapon.SelectionOrder 400
	Weapon.SlotNumber 3
	Weapon.AmmoType "UStingerAmmo"
	Weapon.AmmoUse 1
	Weapon.AmmoGive 40
	Weapon.AmmoType2 "UStingerAmmo"
	Weapon.AmmoUse2 1
	Weapon.AmmoGive2 0
	Inventory.PickupMessage "You got the Stinger"
	Obituary "%o was perforated by %k's Stinger."
	Tag "Stinger"
	Inventory.Icon "1001A0"
	scale 0.1
	States
	{
	Select:
		TNT1 A 0 A_PlaySound("TurokRageWars/Weapons/TekCrossbowUp",6)
		STIN AA 1 A_Raise
		STIN A 1 Offset(67, 100)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(54, 81)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(32, 69)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(22, 58)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(10, 47)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(7, 39)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(2, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		Goto Ready
	Deselect:
		TNT1 A 0 A_Stopsound(7)
		TNT1 A 0 a_playsound ("weapons/holster", 0)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(2, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(7, 39)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(10, 47)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(22, 58)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(32, 69)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(54, 81)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		STIN A 1 Offset(67, 100)
		TNT1 A 1 A_Lower
		Wait
	Ready:
		TNT1 A 0 A_JumpIfInventory("stingercooldown",1,"ReadyCD")
		STIN A 1 A_Weaponready
		loop
	ReadyCD:
		STIN A 1 A_Weaponready(WRF_NOSECONDARY)
		TNT1 A 0 A_JumpIfInventory("stingercooldown",1,"ReadyCD")
		goto ready
	Fire:
		TNT1 A 0 A_Playsound("stinger/fire",7)
		TNT1 A 0 A_FireCustomMissile("Tarydiumshard",frandom(-2.4,2.6),1,8,0,0,frandom(-1.3,1.1))
		TNT1 A 0 A_Gunflash
		STIN B 2
		STIN C 2
		STIN D 2
		STIN E 2
		STIN F 2
		TNT1 A 0 A_Refire("Fireloop")
		Goto FireEnd
	Fireloop:
		TNT1 A 0 A_Playsound("stinger/refire",7,1,true)
	Fireloop2:
		TNT1 A 0 A_FireCustomMissile("Tarydiumshard",frandom(-2.4,2.6),1,8,0,0,frandom(-1.3,1.1))
		TNT1 A 0 A_Gunflash
		STIN B 1
		STIN C 1
		STIN D 1
		STIN E 1
		STIN F 1
		TNT1 A 0 A_Refire("Fireloop2")
		TNT1 A 0 A_Stopsound(7)
		TNT1 A 0 A_Playsound("stinger/endfire",7)
		Goto FireEnd
	FireEnd:
		STIN G 2
		STIN H 2
		Goto Ready
	AltFire:
		TNT1 A 0 A_Playsound("stinger/altfire",7)
		TNT1 AAAAA 0 A_FireCustomMissile("Tarydiumshard",frandom(-4.4,4.6),1,random(6,10),random(0,-2),0,frandom(-4.4,4.6))
		TNT1 A 0 A_Gunflash
		STIN B 2
		STIN C 2
		STIN D 2
		STIN E 2
		STIN F 2
		STIN G 2
		STIN H 2
		TNT1 A 0 A_GiveInventory("stingercooldown")
		Goto Ready
	Flash:
		STMF A 1
		Goto LightDone
	Spawn:
		STIN I -1
		Stop
	}
}

ACTOR Stingercooldown : Powerup
{
  Powerup.Duration 25
}

ACTOR Tarydiumshard : FastProjectile
{
	Damage (random(11,17))
	Speed 50
	Radius 2
	Height 2
	PROJECTILE
	+BLOODSPLATTER
	+FORCEXYBILLBOARD
	Obituary "%o was perforated by %k's Stinger."
	Scale 0.2
	alpha 0.6
	States
	{
	Spawn:
	    TNT1 A 1 NoDelay
	Spawnloop:
		STIN O 15 bright
		Loop
	Death:
	Crash:
		TNT1 A 0
		TNT1 A 0 A_Playsound("stinger/rico",6,1,0,4)
		TNT1 A 0 A_SpawnDebris("UStingerAmmopark",0,frandom(0.3,1.2),0.5)
		Stop
	XDeath:
		TNT1 A 0
		stop
	}
}

ACTOR UStingerAmmopark
{
	Health 10
	radius 5
	height 5
	speed 1
	Alpha 0.50
	Scale 0.2
	+missile
	+FORCEXYBILLBOARD
	+FLOORCLIP
	+DONTSPLASH
	+NOTELEPORT
	States
	{
	spawn:
		TNT1 A 0 NoDelay A_Jump(256,"Spawning","Spawn1","Spawn2","Spawn3")
	spawning:
		SPRK GGGGGGGG 1 BRIGHT A_SetTranslucent(.8,1)
		SPRK GGGGGGGG 1 BRIGHT A_SetTranslucent(.5,1)
		SPRK GGGGGGGG 1 BRIGHT A_SetTranslucent(.3,1)
		SPRK GGGGGGGG 1 BRIGHT A_SetTranslucent(.1,1)
		Stop
	Spawn1:
		TNT1 A 0 A_Setscale(-0.2,0.2)
		goto spawning
	Spawn2:
		TNT1 A 0 A_Setscale(0.2,-0.2)
		goto spawning
	Spawn3:
		TNT1 A 0 A_Setscale(-0.2,-0.2)
		goto spawning
	}
}