/*

==BLAZTER==
A wrist-mounted cannon attached to Blaz's Gauntlet, this
weapon is actually the spirit of Zelos, a high ranking
demon Blaz had defeated in combat. After the fight, Zelos
had chosen to ally himself with Blaz, as the whole point
of their fight was to ensure he was strong enough to defeat
Ruceal.

The Blazter is capable of firing solid crystalline bullets,
while they deal little damage, a solid impact from one of
these projectiles is enough to put anyone into a daze for 
a short time.


This weapon can also be augmented with a few select parts,
such as the shatter addon which causes the crystal bullets
to fragment into painful shrapnel upon impacting with a wall.
The overload causes the bullets to explode into raw kinetic
energy if they collide with anything that's already in a daze.

Finally the crystal bullets can be charged with Zelos' presence,
which erupts forth when the crystal is broken. This spectre
of the demon is enough to put most other demons into a state
of terror, causing them to flee and plummeting their willingness
to fight for a brief moment.

Zelos being attached to Blaz's gauntlet has another perk:
damaging monsters in melee combat helps charge the 
cannon's power reserves, keeping Blaz well stocked with 
ammunition as long as he stays in melee.

It doesn't take much to motivate Blaz to punch demons.
*/

ACTOR Blazter : NewZarach
{
	weapon.ammotype "BlazterEnergy"
	Inventory.RestrictedTo "LordBlaz"
	Weapon.SelectionOrder 2000
	tag "Blazter"
	+WEAPON.AMMO_OPTIONAL
	+WEAPON.ALT_AMMO_OPTIONAL  
	Inventory.PickupMessage "You picked up your Gauntlet you somehow dropped, butterfingers."
	-BLOODSPLATTER
	+cheatnotweapon
	+NOAUTOAIM
	//+noautofire
	+UNDROPPABLE
	Weapon.YAdjust 0
	weapon.bobstyle smooth
	weapon.bobrangex 0.2
	weapon.bobrangey 0.2
	weapon.bobspeed 1
  
	States
	{
	Spawn:
		RWND K -1
		Stop
	Select:
		TNT1 A 0
        TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_Raise
        TNT1 A 1 A_Raise
		goto ready
		
	//Equip Animations
	Ready:
		TNT1 A 0
		TNT1 A 0 A_PlaySound ("Blazter/Raise",0)
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck", 1, "UnarmedUp")
		TNT1 A 0 A_JumpIfInventory ("PowerSwordCheck", 1, "PowerSwordUp")
		BZX1 ABC 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_NOSWITCH|WRF_ALLOWZOOM)
		BZT1 A 7 A_WeaponReady (WRF_ALLOWRELOAD|WRF_NOSWITCH|WRF_ALLOWZOOM)
		Goto RealReady
	PowerSwordUp:
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZX2 ABC 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_NOSWITCH|WRF_ALLOWZOOM)
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZT1 B 7 A_WeaponReady (WRF_ALLOWRELOAD|WRF_NOSWITCH|WRF_ALLOWZOOM)
		Goto PowerSwordReady
	UnarmedUp:
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZX3 ABC 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_NOSWITCH|WRF_ALLOWZOOM)
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZT1 C 7 A_WeaponReady (WRF_ALLOWRELOAD|WRF_NOSWITCH|WRF_ALLOWZOOM)
		Goto UnarmedReady
		
	
	//Unequip Animations
	Deselect:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory ("FatalDrawGo", 99)
		TNT1 A 0 A_TakeInventory ("FatalDrawToken",99)
		TNT1 A 0 A_JumpIfHealthLower (1, "DeadLower")
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck", 1, "UnarmedDeselect")
		TNT1 A 0 A_JumpIfInventory ("PowerSwordCheck", 1, "PowerswordDeselect")
		BZX1 CBA 2
		TNT1 A 0 A_PlaySound ("Blazter/Lower",0)
		Goto Holster
	PowerSwordDeselect:
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZX2 CBA 2
		TNT1 A 0 A_PlaySound ("Blazter/Lower",0)
		Goto Holster
	UnarmedDeselect:
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZX3 CBA 2
		TNT1 A 0 A_PlaySound ("Blazter/Lower",0)
		Goto Holster
	Holster:
		TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_lower
		TNT1 A 1 A_lower
		loop

		
	RealReady:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck", 1, "UnarmedReady")
		TNT1 A 0 A_JumpIfInventory ("FatalDrawGo", 1, "FatalDrawSheathe")
		TNT1 A 0 A_JumpIfInventory ("PowerSwordHUDFlash",1, "SwordPowerUp")
		TNT1 A 0 A_JumpIfInventory ("PowerSwordCheck",1, "PowerSwordReady")
		BZT1 A 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		loop	
	PowerSwordReady:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("FatalDrawGo", 1, "FatalDrawSheathe")
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZT1 B 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		TNT1 A 0 A_JumpIfInventory ("ArcaneForce",4,"PowerSwordReady")
		goto SwordPowerDown
	UnarmedReady:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("FatalDrawGo", 1, "FatalFist")	
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "SelectBarrel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "SelectGoldenBarrel")
		BZT1 C 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck", 1, "UnarmedReady")
		goto SwordRecall


	SwordPowerUp:
		TNT1 A 0
		BZT3 B 1 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 1 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 0 A_GiveInventory ("PowerSwordCheck", 1)
		ZCH1 ABC 1 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 0 A_PlaySound ("Sword/Powerup")
		ZCH1 DEF 1 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		ZCH1 GH 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		ZCH1 I 7 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		ZCH1 JKL 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 3 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		BZT6 BA 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		goto PowerSwordReady
	SwordPowerDown:
		BZT6 B 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 1 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 0 A_TakeInventory ("PowerSwordCheck", 99)
		ZCH2 ABCDE 1 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 0 A_PlaySound ("Sword/Powerdown")
		ZCH2 FGHIJ 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		ZCH2 J 4 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		ZCH2 KL 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		TNT1 A 3 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		BZT3 BA 1 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOBOB)
		goto RealReady	



	SwordRecall:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 A_ClearReFire
		UNAR ABCD 1
		TNT1 A 0 A_ClearReFire
		TNT1 A 0 A_TakeInventory ("UnarmedCheck", 1)
		FDSH HGFE 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		TNT1 A 0 A_PlaySound ("Sword/draw")
		FDSH DCBA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		TNT1 A 2 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory ("PowerSwordCheck", 1, "PowerSwordRecall")
		SLWR DBA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		BZT3 BA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		goto RealReady
	PowerSwordRecall:
		PLWR DBA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		BZT6 BA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		goto RealReady

	Fire:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 A_GiveInventory ("UsingSword",1)
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "BarrelToss")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "GoldenBarrelToss")
		SRDG A 0 A_JumpIfInventory ("FatalDrawtoken", 1, "FatalDraw")
		SRDG A 0 A_JumpIfInventory ("UnarmedCheck", 1, "Jab")
		SRDG A 0 A_JumpIfInventory ("PowerSwordCheck", 1, "PowerSwordfire")		
		BZR3 AB 1
		TNT1 A 0 A_Jump (256,"Thrust")
		goto Thrust

	SwordAttackEnd:
		TNT1 A 0
		BZT3 BBAA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		BZT2 G 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		Goto RealReady
	PunchAttackEnd:
		BZT9 BBAA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		BZT8 G 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		Goto RealReady
	PowerSwordAttackEnd:
		BZT6 BBAA 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		BZT5 G 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		Goto RealReady

	
	Reload:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck", 1, "KnuckleCrack")
		SRDG A 0 A_JumpIfInventory ("PowerSwordCheck", 1, "PowerSwordThrowStart")		
		Goto NormalThrowStart
	NormalThrowStart:
		BZT2 G 1 A_WeaponReady (WRF_NOBOB|WRF_NOSWITCH|WRF_NOFIRE)
		BZT3 A 1 A_WeaponReady (WRF_NOBOB|WRF_NOSWITCH|WRF_NOFIRE)
		BZT3 B 1 A_WeaponReady (WRF_NOBOB|WRF_NOSWITCH|WRF_NOFIRE)
		TNT1 A 0 A_Jump (256,"SwordThrow")
		Goto SwordThrow
	PowerSwordThrowStart:
		BZT5 G 1 A_WeaponReady (WRF_NOBOB|WRF_NOSWITCH|WRF_NOFIRE)
		BZT6 A 1 A_WeaponReady (WRF_NOBOB|WRF_NOSWITCH|WRF_NOFIRE)
		BZT6 B 1 A_WeaponReady (WRF_NOBOB|WRF_NOSWITCH|WRF_NOFIRE)
		TNT1 A 0 A_Jump (256,"PowerSwordThrow")
		Goto PowerSwordThrow

//-------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------


//******************************************************************************************************
//******************************************************************************************************
// RELOAD ACTIONS
//******************************************************************************************************
//******************************************************************************************************

	
	KnuckleCrack:
		TNT1 A 0
		TNT1 A 0
		BZT9 AB 1
		TNT1 A 2
		BZKC ABCD 1
		TNT1 A 0 A_TakeInventory ("ThrownSwordCooldown",600)
		BZKC EF 2 A_WeaponReady 
		BZKC G 1 A_PlaySound ("Fists/KnuckleCrack",0)
		BZKC HIJKLMNBA 2 A_WeaponReady
		TNT1 A 3 A_WeaponReady 
		BZT9 BA 1 A_WeaponReady 
		goto RealReady


//-------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------
//******************************************************************************************************
//******************************************************************************************************
// ZOOM ACTIONS
//******************************************************************************************************
//******************************************************************************************************



	//Using the grapple chain
	Zoom:
		TNT1 A 0
		TNT1 A 1 A_Jump (256,"GrappleWhip")		
		Goto GrappleWhip
	GrappleFinish:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck", 1, "UnarmedGrappleEnd")
		TNT1 A 0 A_JumpIfInventory ("PowerSwordCheck", 1, "PowerSwordGrappleEnd")
		BZT3 BA 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Goto RealReady
	PowerSwordGrappleEnd:
		BZT6 BA 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Goto PowerSwordReady
	UnarmedGrappleEnd:
		BZT9 BA 1 A_WeaponReady (WRF_ALLOWRELOAD)
		Goto UnarmedReady
		


//-------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------

//******************************************************************************************************
//******************************************************************************************************
// ALTFIRE ACTIONS
//******************************************************************************************************
//******************************************************************************************************

		
		
	//BLAZTER ATTACKS
	AltFire:
		TNT1 A 0 
		TNT1 A 0 
		SRDG A 0 A_JumpIfInventory ("FatalDrawtoken", 1, "DrawCancel")
		TNT1 A 0 A_JumpIfInventory ("BarrelToken", 1, "BarrelCancel")
		TNT1 A 0 A_JumpIfInventory ("GoldenBarrelToken", 1, "GoldenBarrelCancel")
		TNT1 A 0 A_GiveInventory ("UsingBlazter", 1)
		TNT1 A 0 A_JumpIfInventory ("BlazterAmmoHUDCounter",1,"StunShotStateCheck")
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck",1,"UnarmedStunFail")
		TNT1 A 0 A_JumpIfInventory ("PowerSwordCheck",1,"PowerSwordStunFail")
		TNT1 A 0 A_PlaySound ("gauntlet/steam",0,0.60)
		TNT1 A 0 A_PlaySound ("SubWeapons/noaltfire",0)
		BZT4 ABCDE 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOFIRE)
		BZT1 A 20 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOSECONDARY)
		GoTo RealReady
	PowerSwordStunFail:
		TNT1 A 0 A_PlaySound ("gauntlet/steam",0,0.60)
		TNT1 A 0 A_PlaySound ("SubWeapons/noaltfire",0)
		BZT7 ABCDE 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOSECONDARY)
		BZT1 B 20 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOSECONDARY)
		GoTo PowerSwordReady
	UnarmedStunFail:
		TNT1 A 0 A_PlaySound ("gauntlet/steam",0,0.60)
		TNT1 A 0 A_PlaySound ("SubWeapons/noaltfire",0)
		BZ10 ABCDE 2 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOSECONDARY)
		BZT1 C 20 A_WeaponReady (WRF_ALLOWZOOM|WRF_ALLOWRELOAD|WRF_NOSECONDARY)
		Goto UnarmedReady
		

	
	//You got ammo? Okay what state is your melee in?
	StunShotStateCheck:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("UnarmedCheck",1,"UnarmedStunShot")
		TNT1 A 0 A_JumpIfInventory ("PowerSwordCheck",1,"PowerSwordStunShot")
		Goto StunShot
	
	//Shooting with normal sword
	StunShot:
		TNT1 A 0
		BZT2 A 1
		TNT1 A 0 A_PlaySound ("gauntlet/lowshot",CHAN_WEAPON)
		TNT1 A 0 A_FireBullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_FireBullets (2,3,20,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_FireBullets (3,4,35,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_Quake(1, 3, 0, 22)
		TNT1 A 0 A_TakeInventory ("BlazterEnergy",10)
		TNT1 A 0 A_GunFlash ("SplitShotCheck",GFF_NOEXTCHANGE)
		TNT1 A 0 A_FireCustomMissile ("BlazBullet",0,0,-5)
		BZT2 BC 1 bright 
		BZT2 D 1
		BZT2 E 2 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		BZT2 FG 2 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		BZT1 A 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		Goto RealReady

	//Shooting with power sword
	PowerSwordStunShot:
		TNT1 A 0
		BZT5 A 1
		TNT1 A 0 A_PlaySound ("gauntlet/lowshot",CHAN_WEAPON)
		TNT1 A 0 A_FireBullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_FireBullets (2,3,20,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_FireBullets (3,4,35,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_Quake(1, 3, 0, 22)
		TNT1 A 0 A_TakeInventory ("BlazterEnergy",10)
		TNT1 A 0 A_GunFlash ("SplitShotCheck",GFF_NOEXTCHANGE)
		TNT1 A 0 A_FireCustomMissile ("BlazBullet",0,0,-5)
		BZT5 BC 1 bright 
		BZT5 D 1
		BZT5 E 2 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		BZT5 FG 2 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		BZT1 B 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		Goto PowerSwordReady

	//Shooting while unarmed
	UnarmedStunShot:
		TNT1 A 0
		BZT8 A 1
		TNT1 A 0 A_PlaySound ("gauntlet/lowshot",CHAN_WEAPON)
		TNT1 A 0 A_FireBullets (0,0,1,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_FireBullets (2,3,20,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_FireBullets (3,4,35,0,"flickpuff",FBF_NOFLASH)
		TNT1 A 0 A_Quake(1, 3, 0, 22)
		TNT1 A 0 A_TakeInventory ("BlazterEnergy",10)
		TNT1 A 0 A_GunFlash ("SplitShotCheck",GFF_NOEXTCHANGE)
		TNT1 A 0 A_FireCustomMissile ("BlazBullet",0,0,-5)
		BZT8 BC 1 bright 
		BZT8 D 1
		BZT8 E 2 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		BZT8 FG 2 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		BZT1 C 1 A_WeaponReady (WRF_ALLOWRELOAD|WRF_ALLOWZOOM|WRF_NOSECONDARY)
		Goto UnarmedReady
	
	//Gunflash for firing the split shot
	SplitShotCheck:
		TNT1 A 0
		TNT1 A 1 A_JumpIfInventory ("ShatterUpgrade",1,"SplitShot")
		stop
	SplitShot:
		TNT1 A 0
		TNT1 A 0 A_FireCustomMissile("BlazSplitBullet",-10)
		TNT1 A 0 A_FireCustomMissile("BlazSplitBullet",10)
		TNT1 A 1
		stop
	
	/*
	SelectBarrel:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 A_TakeInventory ("UsingSword", 99)		
		TNT1 A 0 A_TakeInventory ("FatalDrawGo", 99)
		TNT1 A 0 A_TakeInventory ("FatalDrawtoken",99)
		TNT1 A 0 A_StopSound (6)
		TNT1 A 2
		TNT1 A 0 A_ClearReFire
		TNT1 A 0 A_PlaySound ("blaz/barrellift")
		BLBR ABCDEF 1 A_WeaponReady (WRF_NOSWITCH|WRF_NOBOB)
		goto BarrelWaiting
	BarrelWaiting:
		BLBR F 1 A_WeaponReady (WRF_NOSWITCH|WRF_NOBOB)
		loop

	BarrelToss:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_PlaySound ("bomberknight/throw", 0)
		TNT1 A 6 A_FireCustomMissile ("BlazThrownBarrel")
		TNT1 A 1 A_TakeInventory ("BarrelToken",1)
		goto Ready
	BarrelCancel:
		TNT1 A 0
		TNT1 A 4 A_FireCustomMissile ("DroppedBarrel")
		TNT1 A 1 A_TakeInventory ("BarrelToken",1)
		TNT1 A 3 A_WeaponReady (WRF_NOSECONDARY|WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
		goto GrappleFinish */
	}
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


//--Gauntlet PROJECTILES--//


//Bullet

actor BlazBullet
{
	+notimefreeze
	projectile
	species "friendly"
	+thruspecies
	+FORCEXYBILLBOARD	
	+bloodsplatter
	+LOOKALLAROUND
	+FORCEPAIN
	+BRIGHT
	+DONTREFLECT
	+HITTRACER
	+FORCERADIUSDMG
	height 8
	radius 8
	speed 45
	Damagetype "Dazer"
	damage (15)
	Renderstyle Add
	Alpha 0.90
	Scale 1.50
	states
	{
	Spawn: 
		GBLT A 1
		loop
	death:
		TNT1 A 0 A_Stop
		TNT1 A 0 A_PlaySound ("Gauntlet/miss",0)
		TNT1 A 0 A_RadiusGive ("BossBrainSmoother", 250, RGF_OBJECTS, 1)
		TNT1 A 0 A_SpawnItemEx ("ZelosTerror",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		TNT1 A 0 A_SetScale (0.90)
		BZP2 ABCDEFGH 1
		stop
	crash:
		TNT1 A 0 A_Stop
		TNT1 A 0 A_PlaySound ("Gauntlet/miss",0)
		TNT1 A 0 A_SpawnItemEx ("ZelosTerror",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		TNT1 A 0 A_RadiusGive ("BossBrainSmoother", 250, RGF_OBJECTS, 1)
		TNT1 A 0 A_SetScale (0.90)
		BZP2 ABCDEFGH 1
		stop
	xdeath:
		TNT1 A 0
		TNT1 A 0 A_PlaySound ("Gauntlet/hit",0)
		TNT1 A 0 A_PlaySound ("Subweapons/Straighthit",0)
		TNT1 A 0 Radius_Quake (2,3,0,10,0)
		TNT1 A 0 A_SpawnItemEx ("ZelosTerror",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		TNT1 A 0 A_JumpIfInventory ("OverloadUpgrade",1,"OverloadCheck",AAPTR_TARGET)
		BZP1 ABCDEFG 1
		stop
	OverloadCheck:
		TNT1 A 0
		TNT1 A 1 A_JumpIfInventory ("StunMarker",1,"Explode",AAPTR_TRACER)
		BZP1 ABCDEFG 1
		stop
	Explode:
		TNT1 A 1
		BEXP C 0 Radius_Quake (3,20,0,80,0)
		TNT1 A 0 A_TakeInventory ("StunMarker",999,0,AAPTR_TRACER)
		TNT1 A 0 A_Explode (1,150,0,1,150)
		TNT1 A 0 A_SetDamageType ("Normal")
		TNT1 A 0 A_Explode (120,20,0,1,20)
		TNT1 A 0 A_PlaySound ("Subweapons/BoomerangFlash",0,1,0,0.70)
		TNT1 A 0 Radius_Quake(2,10,0,20,0)
		TNT1 AAAAAA 0 A_SpawnItemEx ("FlashBoltParticle", frandom(-90,90),frandom(-90,90),frandom(-85,85), 0,0,0, 0, SXF_NOCHECKPOSITION)
		
		TNT1 A 0 A_PlaySound ("Subweapons/scattershot",0,1,0,0.40)
		BFL1 CDDEEFF 2 
		stop
	}
}


actor BlazSplitBullet : BlazBullet
{
	speed 35
	Damagetype "Dazer"
	damage (15)
	Renderstyle Add
	Alpha 0.80
	Scale 1.50
	states
	{
	Spawn: 
		SNK1 A 1
		loop
	death:
		TNT1 A 0 A_Stop
		TNT1 A 0 A_PlaySound ("Gauntlet/miss",0)
		TNT1 A 0 A_SetScale (0.50)
		BZP2 ABCDEFGH 1
		stop
	crash:
		TNT1 A 0 A_Stop
		TNT1 A 0 A_PlaySound ("Gauntlet/miss",0)
		TNT1 A 0 A_SetScale (0.50)
		BZP2 ABCDEFGH 1
		stop
	xdeath:
		TNT1 A 0
		TNT1 A 0 A_PlaySound ("Gauntlet/hit",0)
		TNT1 A 0 A_PlaySound ("Subweapons/Straighthit",0)
		TNT1 A 0 Radius_Quake (2,3,0,10,0)
		TNT1 A 0 A_SetScale (0.60)
		BZP1 ABCDEFG 1
		stop
	}
}



//================================================================================
//---ZELOS TERROR EFFECT---
//================================================================================

//Number one: That's terror
Actor ZelosTerror
{
	Projectile
	+NOCLIP
	+THRUACTORS
	states
	{
	Spawn:
		TNT1 A 1
		TNT1 A 0 A_JumpifInventory ("TerrorUpgrade", 1, "APPLYTERROR",AAPTR_TARGET)
		stop
	APPLYTERROR:
		TNT1 A 1 A_RadiusGive ("TerrorEffect",300,RGF_MONSTERS,1)
		TNT1 A 1
		Wait
	Death:
		TNT1 A 1
		stop
	}
}

Actor TerrorEffect : custominventory
{
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	states
	{
	Pickup:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("PowerTerrorStatus",1,"NoStars")
		TNT1 A 0 A_ChangeFlag ("FRIGHTENED", 1)
		TNT1 A 0 A_GiveInventory ("TerrorGiver",1)
		TNT1 A 0 A_ThrowGrenade ("FearTracker",3)
	NoStars:
		TNT1 A 0 A_GiveInventory ("TerrorGiver",1)
		TNT1 A 0 A_GiveInventory ("TerrorSkullSpawner",1)
		stop
	}
}

actor TerrorGiver : powerupgiver
{
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	powerup.type "TerrorStatus"
}


actor PowerTerrorStatus : powerspeed
{
	Powerup.Duration -5
	Speed 1
}

Actor FearTracker
{
	+noclip
	+nointeraction
	+bright
	states
	{
	spawn:
		TNT1 A 0
        TNT1 A 1
		TNT1 A 0 A_GiveInventory ("TerrorSweatSpawner",1,AAPTR_TARGET)
		TNT1 A 0 A_Warp (AAPTR_TARGET,10,0,10,0,WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE|WARPF_COPYINTERPOLATION)
		TNT1 A 0 A_JumpIfInTargetInventory ("PowerTerrorStatus",1,"Spawn")
		goto death
	death:
		TNT1 A 0
		TNT1 A 1 A_GiveInventory ("TerrorEnder",1,AAPTR_TARGET)
		stop
	}
}

actor TerrorSkullSpawner : custominventory
{
	+inventory.alwayspickup
	+INVENTORY.AUTOACTIVATE
	states
	{
	pickup:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx ("TerrorSkull",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION)
		stop
	}
}

Actor TerrorSkull
{
	+NOCLIP
	+NOINTERACTION
	+NOTELEPORT
	Scale 0.25
	RenderStyle ADD
	Alpha 0.70
	states
	{
	spawn:
		TNT1 A 0
		ZLS1 A 1
		ZLS1 A 2 A_SetScale (0.30)
		TNT1 A 0 A_PlaySound ("Blazter/ZelosTerror",0)
		ZLS1 A 2 A_SetScale (0.50)
		ZLS1 A 2 A_SetScale (0.90)
		ZLS1 A 2 A_SetScale (0.65)
		TNT1 A 0 A_ScaleVelocity (0.80)
		ZLS1 A 2 A_SetScale (0.70)
		ZLS1 A 2 A_Fadeout (0.05)
		stop
	death:
		TNT1 A 1
		stop
	}
}


actor TerrorSweatSpawner : custominventory
{
	+inventory.alwayspickup
	+INVENTORY.AUTOACTIVATE
	states
	{
	pickup:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx ("TerrorSweat",0,0,height,random(-6,6),random(-7,7),random(3,5),0,SXF_NOCHECKPOSITION,180)
		stop
	}
}

Actor TerrorSweat
{
	+THRUACTORS
	+MISSILE
	-NOGRAVITY
	+NOTELEPORT
	+bright
	Radius 4
	Height 5
	speed 3
	Renderstyle Translucent
	Alpha 0.95
	scale 1
	Gravity 1
	states
	{
	spawn:
		TNT1 A 0
		SW3T A 1
		SW3T A random(4,8)
		stop
	death:
		TNT1 A 1
		stop
	}
}


ACTOR TerrorEnder : CustomInventory
{
	-COUNTITEM
	+INVENTORY.AUTOACTIVATE
	Inventory.PickupMessage ""
	Inventory.PickupSound ""
	States
	{
	Pickup:
		TNT1 A 0 A_ChangeFlag ("FRIGHTENED",0)
		Stop
	}
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


actor MAXparticle
{
	projectile
	+clientsideonly
	speed 10
	+NOINTERACTION
	+NOTELEPORT
	states
	{
	spawn:	
		PDBR AAAAAA 1  Bright A_SetTranslucent(.6,1)
		TNT1 AA 1  Bright 
		PDBR AA 1 Bright 
		TNT1 AA 1  Bright 
		PDBR A 1 Bright 
		TNT1 A 1  Bright 
		PDBR A 1 Bright 
		Stop
	}
}