Actor KyleThermalDetonators : Weapon
{
    +WIMPY_WEAPON
	+NOALERT
	+NOAUTOFIRE
	+AMMO_OPTIONAL
	+ALT_AMMO_OPTIONAL
	+UNDROPPABLE
	+NOAUTOAIM
	Weapon.AmmoUse1 1
	Weapon.AmmoType1 "ThermalDetonators"
	Weapon.AmmoUse2 1
	Weapon.AmmoType2 "ThermalDetonators"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 0.9	
	States
	{
	Ready:
	    DF03 A 0 A_JumpIfNoAmmo("ReadyOutOfAmmo")//Don't change the sprite name or weapon not worked!)
	    DF03 A 1 A_WeaponReady
	    Loop
	//---------Ready for out ammo--------------//	
	ReadyOutOfAmmo:
	    DF00 A 0 A_JumpIfInventory("ThermalDetonators", 1, "PickedAmmo")
	    DF00 A 1 A_WeaponReady
		Loop
	//------------------------------------------//	
	//----If ammo out and player picked up ammo, using it animation---//
	//----And Going to Normal Ready state-----------------------------//
	PickedAmmo:	
		DF03 A 1 offset(27, 68)
		DF03 A 1 offset(21, 60)
		DF03 A 1 offset(15, 52)
		DF03 A 1 offset(9, 44)
		DF03 A 1 offset(3, 36)
	    Goto Ready
	//----------------------------------------------------------------//	
	Select:
	    NULL A 0 A_JumpIfNoAmmo("SelectOutOfAmmo")
		DF03 A 1 offset(27, 68)
		DF03 A 1 offset(21, 60)
		DF03 A 1 offset(15, 52)
		DF03 A 1 offset(9, 44)
		DF03 A 1 offset(3, 36)	
		DF03 AAAAAAAAAAAAAAAAAAAA 0 A_Raise
	    DF03 A 1 A_Raise
	    Goto Select+6
	//-------If ammo out, using it animation------//	
	SelectOutOfAmmo:
		DF00 A 1 offset(27, 68)
		DF00 A 1 offset(21, 60)
		DF00 A 1 offset(15, 52)
		DF00 A 1 offset(9, 44)
		DF00 A 1 offset(3, 36)	
		DF00 AAAAAAAAAAAAAAAAAAAA 0 A_Raise
	    DF00 A 1 A_Raise
	    Goto Select+5
	//---------------------------------------------//	
	Deselect:
	    NULL A 0 A_ClearReFire
		NULL A 0 A_TakeInventory("ShotPower", 25)
	    NULL A 0 A_JumpIfNoAmmo("DeselectOutOfAmmo")
	    DF03 A 1 offset(3, 36)
		DF03 A 1 offset(9, 44)
		DF03 A 1 offset(15, 52)
		DF03 A 1 offset(21, 60)
		DF03 A 1 offset(27, 68)
		DF03 AAAAAAAAAAAAAAAAAAA 0 A_Lower
	    DF03 A 1 A_Lower
		Goto Deselect+8
	//--------If ammo out, using it animation----//	
	DeselectOutOfAmmo:
	    NULL A 0 A_ClearReFire
		NULL A 0 A_TakeInventory("ShotPower", 25)
	    DF00 A 1 offset(3, 36)
		DF00 A 1 offset(9, 44)
		DF00 A 1 offset(15, 52)
		DF00 A 1 offset(21, 60)
		DF00 A 1 offset(27, 68)
		DF00 AAAAAAAAAAAAAAAAAAA 0 A_Lower
	    DF00 A 1 A_Lower
		Goto Deselect+7
	//------------------------------------------------//	
	//------------------Big Fire States--------------------//
	//-----Detonatorns are not bounce and explode----------//
	Fire:
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
	    DF03 B 2
		NULL A 1
		NULL A 0 A_ReFire 
		DF03 C 1 A_FireCustomMissile("ThermalDetonator", 0, 1, 10, 5, 0, 13)
		DF03 C 11
		DF03 B 8
		DF03 A 3
		NULL A 0 A_JumpIfNoAmmo("ReadyOutOfAmmo")
	    Goto Ready	
	Hold:
	    NULL A 1
		NULL A 1 A_GiveInventory("ShotPower", 1)
		NULL A 0 A_ReFire
		//--------------------------------------------------//
		NULL A 0 A_JumpIfInventory("ShotPower", 20, "Throw20")
		NULL A 0 A_JumpIfInventory("ShotPower", 19, "Throw19")
		NULL A 0 A_JumpIfInventory("ShotPower", 18, "Throw18")
		NULL A 0 A_JumpIfInventory("ShotPower", 17, "Throw17")
		NULL A 0 A_JumpIfInventory("ShotPower", 16, "Throw16")
		NULL A 0 A_JumpIfInventory("ShotPower", 15, "Throw15")
		NULL A 0 A_JumpIfInventory("ShotPower", 14, "Throw14")
		NULL A 0 A_JumpIfInventory("ShotPower", 13, "Throw13")
		NULL A 0 A_JumpIfInventory("ShotPower", 12, "Throw12")
		NULL A 0 A_JumpIfInventory("ShotPower", 11, "Throw11")
		NULL A 0 A_JumpIfInventory("ShotPower", 10, "Throw10")
		NULL A 0 A_JumpIfInventory("ShotPower", 9, "Throw9")
		NULL A 0 A_JumpIfInventory("ShotPower", 8, "Throw8")
		NULL A 0 A_JumpIfInventory("ShotPower", 7, "Throw7")
		NULL A 0 A_JumpIfInventory("ShotPower", 6, "Throw6")
		NULL A 0 A_JumpIfInventory("ShotPower", 5, "Throw5")
		NULL A 0 A_JumpIfInventory("ShotPower", 4, "Throw4")
		NULL A 0 A_JumpIfInventory("ShotPower", 3, "Throw3")
		NULL A 0 A_JumpIfInventory("ShotPower", 2, "Throw2")
		NULL A 0 A_JumpIfInventory("ShotPower", 1, "Throw1")
		//--------------------------------------------------//
	Throw1:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator16", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw2:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator17", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw3:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator18", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw4:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator19", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw5:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator20", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw6:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator21", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw7:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator22", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw8:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator23", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw9:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator24", 0, 1, 10, 5, 0, 13)
	    Goto ThrowEnd
	Throw10:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator25", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd	
	Throw11:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator26", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw12:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator27", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw13:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator28", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw14:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator29", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw15:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator30", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw16:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator31", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw17:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator32", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw18:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator33", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw19:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator34", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	Throw20:
	    DF03 C 1 A_FireCustomMissile("ThermalDetonator35", 0, 1, 10, 5, 0, 13)
        Goto ThrowEnd
	ThrowEnd:
	    NULL A 0 A_ClearReFire
		NULL A 0 A_TakeInventory("ShotPower", 25)
	    DF03 C 11
		NULL A 0 A_JumpIfNoAmmo("ReadyOutOfAmmo")
		DF03 B 8
		DF03 A 3
		Goto Ready
	//----------------------------------------------------------//	
	//-------Out of ammo-------//	
	OutOfAmmo:
	    DF00 A 1 A_WeaponReady
		Goto ReadyOutOfAmmo
	//-------------------------//	
	//------------Big Alt Fire---------------------------------//
	//--------Detonators are bouncing--------------------------//
	AltFire:
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
	    DF03 B 2
		NULL A 1
		NULL A 0 A_ReFire 
		DF03 C 1 A_FireCustomMissile("BonceThermalDetonator", 0, 1, 10, 5, 0, 13)
		DF03 C 11
		DF03 B 8
		DF03 A 3
		NULL A 0 A_JumpIfNoAmmo("ReadyOutOfAmmo")
	    Goto Ready	
	AltHold:
	    NULL A 2
		NULL A 1 A_GiveInventory("ShotPower", 1)
		NULL A 0 A_ReFire
		//-----------------------------------------------------//
		NULL A 0 A_JumpIfInventory("ShotPower", 20, "AltThrow20")
		NULL A 0 A_JumpIfInventory("ShotPower", 19, "AltThrow19")
		NULL A 0 A_JumpIfInventory("ShotPower", 18, "AltThrow18")
		NULL A 0 A_JumpIfInventory("ShotPower", 17, "AltThrow17")
		NULL A 0 A_JumpIfInventory("ShotPower", 16, "AltThrow16")
		NULL A 0 A_JumpIfInventory("ShotPower", 15, "AltThrow15")
		NULL A 0 A_JumpIfInventory("ShotPower", 14, "AltThrow14")
		NULL A 0 A_JumpIfInventory("ShotPower", 13, "AltThrow13")
		NULL A 0 A_JumpIfInventory("ShotPower", 12, "AltThrow12")
		NULL A 0 A_JumpIfInventory("ShotPower", 11, "AltThrow11")
		NULL A 0 A_JumpIfInventory("ShotPower", 10, "AltThrow10")
		NULL A 0 A_JumpIfInventory("ShotPower", 9, "AltThrow9")
		NULL A 0 A_JumpIfInventory("ShotPower", 8, "AltThrow8")
		NULL A 0 A_JumpIfInventory("ShotPower", 7, "AltThrow7")
		NULL A 0 A_JumpIfInventory("ShotPower", 6, "AltThrow6")
		NULL A 0 A_JumpIfInventory("ShotPower", 5, "AltThrow5")
		NULL A 0 A_JumpIfInventory("ShotPower", 4, "AltThrow4")
		NULL A 0 A_JumpIfInventory("ShotPower", 3, "AltThrow3")
		NULL A 0 A_JumpIfInventory("ShotPower", 2, "AltThrow2")
		NULL A 0 A_JumpIfInventory("ShotPower", 1, "AltThrow1")
		//-----------------------------------------------------//
	AltThrow1:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator16", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow2:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator17", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow3:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator18", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow4:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator19", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow5:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator20", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow6:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator21", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow7:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator22", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow8:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator23", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow9:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator24", 0, 1, 10, 5, 0, 13)
	    Goto AltThrowEnd
	AltThrow10:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator25", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd	
	AltThrow11:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator26", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow12:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator27", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow13:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator28", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow14:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator29", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow15:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator30", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow16:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator31", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow17:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator32", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow18:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator33", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow19:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator34", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrow20:
	    DF03 C 1 A_FireCustomMissile("BonceThermalDetonator35", 0, 1, 10, 5, 0, 13)
        Goto AltThrowEnd
	AltThrowEnd:
	    NULL A 0 A_ClearReFire
		NULL A 0 A_TakeInventory("ShotPower", 25)
	    DF03 C 11
		NULL A 0 A_JumpIfNoAmmo("ReadyOutOfAmmo")
		DF03 B 8
		DF03 A 3
		Goto Ready
	//----You crazy?) It weapons never spawn on map)---//
	//----But on map spawn ammo for weapon xd)---------//
	 //Spawn:
	    //Stop
	//-------------------------------------------------//
	}
}
//------It's Detonator for normal Fire-----------------------//
//This actor will be the initial basis for other detonators. 
//If the player will clamp down Fire, the weapons necessary 
//to shoot projectiles, according to the specified Inventory ShotPower
Actor ThermalDetonator
{
	Radius 4
	Height 4
	Speed 15
	scale 1.0
	Damage(22)
	Projectile
	-NOGRAVITY
	DeathSound "DetonatorExplode"
	States
	{
	Spawn: 
		DFP4 M 1 Bright
		Loop
	Death:
	    NULL A 1 A_Explode(22, 200)
		DFP4 ABCDEFGHIJKL 3 Bright
		Stop
	XDeath:
	    NULL A 1 A_Explode(22, 200)
		DFP4 ABCDEFGHIJKL 3 Bright
		Stop	
	}
}
//----------------------------------//

//----------------Derivative actors------------------//
Actor ThermalDetonator16 : ThermalDetonator { Speed 16}
Actor ThermalDetonator17 : ThermalDetonator { Speed 17}
Actor ThermalDetonator18 : ThermalDetonator { Speed 18}
Actor ThermalDetonator19 : ThermalDetonator { Speed 19}
Actor ThermalDetonator20 : ThermalDetonator { Speed 20}
Actor ThermalDetonator21 : ThermalDetonator { Speed 21}
Actor ThermalDetonator22 : ThermalDetonator { Speed 22}
Actor ThermalDetonator23 : ThermalDetonator { Speed 23}
Actor ThermalDetonator24 : ThermalDetonator { Speed 24}
Actor ThermalDetonator25 : ThermalDetonator { Speed 25}
Actor ThermalDetonator26 : ThermalDetonator { Speed 26}
Actor ThermalDetonator27 : ThermalDetonator { Speed 27}
Actor ThermalDetonator28 : ThermalDetonator { Speed 28}
Actor ThermalDetonator29 : ThermalDetonator { Speed 29}
Actor ThermalDetonator30 : ThermalDetonator { Speed 30}
Actor ThermalDetonator31 : ThermalDetonator { Speed 31}
Actor ThermalDetonator32 : ThermalDetonator { Speed 32}
Actor ThermalDetonator33 : ThermalDetonator { Speed 33}
Actor ThermalDetonator34 : ThermalDetonator { Speed 34}
Actor ThermalDetonator35 : ThermalDetonator { Speed 35}
//---------------------------------------------------//

//-------It's Detonator for Alt-Fire----------------//
//-----Here detonators bouncing---------------------//
Actor BonceThermalDetonator
{
	Radius 4
	Height 4
	Speed 15
	scale 1.0
	Damage (22)
	Projectile
	BounceFactor 0.5
	-NOGRAVITY
	BounceType "Doom"
	BounceSound "DetBounce"
	DeathSound "DetonatorExplode"
	States
	{
	Spawn:
		DFP4 M 1 Bright
		Loop
	Death:
	    NULL A 1 A_Explode(22, 200)
		DFP4 ABCDEFGHIJKL 3 Bright
		Stop
	XDeath:
	    NULL A 1 A_Explode(22, 200)
		DFP4 ABCDEFGHIJKL 3 Bright
		Stop	
	}
}
//---------------------------------------------------//

//---Derivative actors for Bonce Thermal Detonator---//
Actor BonceThermalDetonator16 : BonceThermalDetonator { Speed 16}
Actor BonceThermalDetonator17 : BonceThermalDetonator { Speed 17}
Actor BonceThermalDetonator18 : BonceThermalDetonator { Speed 18}
Actor BonceThermalDetonator19 : BonceThermalDetonator { Speed 19}
Actor BonceThermalDetonator20 : BonceThermalDetonator { Speed 20}
Actor BonceThermalDetonator21 : BonceThermalDetonator { Speed 21}
Actor BonceThermalDetonator22 : BonceThermalDetonator { Speed 22}
Actor BonceThermalDetonator23 : BonceThermalDetonator { Speed 23}
Actor BonceThermalDetonator24 : BonceThermalDetonator { Speed 24}
Actor BonceThermalDetonator25 : BonceThermalDetonator { Speed 25}
Actor BonceThermalDetonator26 : BonceThermalDetonator { Speed 26}
Actor BonceThermalDetonator27 : BonceThermalDetonator { Speed 27}
Actor BonceThermalDetonator28 : BonceThermalDetonator { Speed 28}
Actor BonceThermalDetonator29 : BonceThermalDetonator { Speed 29}
Actor BonceThermalDetonator30 : BonceThermalDetonator { Speed 30}
Actor BonceThermalDetonator31 : BonceThermalDetonator { Speed 31}
Actor BonceThermalDetonator32 : BonceThermalDetonator { Speed 32}
Actor BonceThermalDetonator33 : BonceThermalDetonator { Speed 33}
Actor BonceThermalDetonator34 : BonceThermalDetonator { Speed 34}
Actor BonceThermalDetonator35 : BonceThermalDetonator { Speed 35}
//---------------------------------------------------//


//--------------Inventory ShotPower----------------//
Actor ShotPower : Inventory { inventory.maxamount 20 }
//-------------------------------------------------//