ACTOR Queensbury : MyrmidonWeapon 23806 //Put up your Dukes! Queensbury Rules!
{
	//The chain helps the Myrm out in places where he can't reach.
	//It can drag foes off ledges to be punched!
	Inventory.RestrictedTo MyrmidonPlayer
	Weapon.SelectionOrder 4
	Weapon.SlotNumber 1
	Weapon.SlotPriority 0
	+WEAPON.NOALERT
	+WEAPON.MELEEWEAPON
	+WEAPON.AMMO_OPTIONAL
	+WEAPON.WIMPY_WEAPON
	+UNDROPPABLE
	Weapon.YAdjust 6
	Obituary "$OB_MPFWEAPAXE"
	Inventory.PickupMessage "\c[white]That's where my \c[brick]gauntlets got to\c[white]! Let's fight!"
	Inventory.PickupSound "Pickup/WeaponBlunt"
	Tag "Gauntlets & Greaves"
	Obituary "%o learnt pit-fighting the hard way."
	States
	{
	Spawn:
		THOT A -1 	///THOT  I got frustrated because this sprite wasn't showing up properly 
		Stop		/// No matter what I named it. So it ended up with this. << This was 4page's comment but its hilarious.
	Select:
		TNT1 A 1
		TNT1 A 0 {A_GiveInventory("FistsInHand",1); A_WeaponOffset(5,65);}
		Goto Select2
	Deselect:
		TNT1 A 0 {A_TakeInventory("FistsInHand"); A_WeaponOffset(5,65);}
		Goto Deselect2
	Select2:
		THOT A 1 A_Raise
		Loop
	Deselect2:
		THOT A 1 A_Lower
		Loop
	Ready:
		THOT A 1 A_WeaponReady(WRF_ALLOWRELOAD)	//Allows the reload function
		TNT1 A 0 A_TakeInventory("PunchRight") //Randomises the punching order.
		TNT1 A 0 A_TakeInventory("ComboCounter")//This resets the combo back to its first punch
		TNT1 A 0 A_TakeInventory("PunchLeft") //This ensures uppercut comes first after a rest.
		Loop
	Zoom:
		TNT1 A 0 A_TakeInventory("DAMCOUNTER")
		Goto Ready
	Fire:
		TNT1 A 0 
		Goto ComboStart
	ComboStart:
		THOT A 0 A_JumpIfInventory ("ComboCounter", 2, "Shoryuken")
		THOT A 0 A_JumpIfInventory ("ComboCounter", 1, "ComboDecide1")
		THOT A 0 {
		if (random(1,4) < 3) 
		{	A_GiveInventory("PunchRight",1); }
		Else {}
		}
		Goto ComboDecide
	
//////// COMBO PUNCH /////////
	ComboDecide:	
		TNT1 A 0 A_JumpIfInventory ("PunchRight", 1, "ComboPunch1")
		Goto ComboPunch
	ComboPunch: //Right Jab
		FPCH B 1 Offset (25, 36) {if(random(1,3) == 1 && (GetCVar("walp_silentprotagonists")==0) && (CountInv("PowerShutItWilson")) == 0)
				{A_StartSound("MyrmExertsLight",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}}
		FPCH B 1 Offset (-15, 36) 
		FPCH C 1 Offset (-10, 36) A_StartSound("SwingItNow",1,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,1.1)
		FPCH D 2 Offset (5, 36) A_CustomPunch (0, true, CPF_NOTURN, "PunchPuffWalp", 104, 0)	//This nondamaging punch is to supply the sound and visuals
		FPCH D 1 Offset (5, 36) 
				{
				if(CountInv("FistsUpgrade") == 1 || CountInv("FistsUpgrade") == 4 || CountInv("FistsUpgrade") == 6 || CountInv("FistsUpgrade") == 9)
				{
				A_FireProjectile("DecorativeZapFists",0,false,0,0,FPF_NOAUTOAIM);
				A_StartSound("Thunderpunch",6,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,1);
				A_CustomPunch (13 * random(3, 5), 1, CPF_NOTURN, "ComboPuff", 114, 0);
				A_CustomPunch (1, 1, CPF_NOTURN, "ShockPunchPuff", 114, 0);
				}
				else
				{
				A_CustomPunch (11 * random(3, 5), 1, CPF_NOTURN, "ComboPuff", 114, 0);
				}
				}
		FPCH C 2 Offset (5, 36)
		FPCH B 1 Offset (5, 36) 
			{	if(GetCVar("walp_punchcombo")==0)	
			{	A_GiveInventory("ComboCounter",1);	}	} 
		TNT1 A 1 Offset (5, 36) A_ReFire("Fire")
		TNT1 A 1 Offset (5, 150) A_WeaponReady(WRF_NOBOB)	//All these allow any attack during the wind down animation
		THOT A 2 Offset (5, 55) A_WeaponReady(WRF_NOBOB)
		THOT A 2 Offset (4, 50) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (3, 45)  A_TakeInventory("ComboCounter")
		THOT A 1 Offset (2, 40) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (1, 35) A_WeaponReady(WRF_NOBOB)
		Goto Ready
	ComboDecide1:	//Left Jab
		TNT1 A 0 A_JumpIfInventory ("PunchRight", 1, "ComboPunch")
		Goto ComboPunch1
	ComboPunch1:
		FPCH F 1 Offset (5, 36) {if(random(1,3) == 1 && (GetCVar("walp_silentprotagonists")==0) && (CountInv("PowerShutItWilson")) == 0)
				{A_StartSound("MyrmExertsLight",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}}
		FPCH F 1 Offset (5, 36)
		FPCH G 1 Offset (5, 36) A_StartSound("SwingItNow",1,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,1.1)
		FPCH H 2 Offset (5, 36) A_CustomPunch (0, true, CPF_NOTURN, "PunchPuffWalp", 104, 0)
		FPCH H 1 Offset (5, 36) 
				{
				if(CountInv("FistsUpgrade") == 1 || CountInv("FistsUpgrade") == 4 || CountInv("FistsUpgrade") == 6 || CountInv("FistsUpgrade") == 9)
				{
				A_FireProjectile("DecorativeZapFists",0,false,0,0,FPF_NOAUTOAIM);
				A_CustomPunch (13 * random(3, 5), 1, CPF_NOTURN, "ComboPuff", 114, 0);
				A_CustomPunch (1, 1, CPF_NOTURN, "ShockPunchPuff", 114, 0);
				A_StartSound("Thunderpunch",6,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,1);
				}
				else
				{
				A_CustomPunch (11 * random(3, 5), 1, CPF_NOTURN, "ComboPuff", 114, 0);
				}
				}
		FPCH G 2 Offset (5, 36) {	if(GetCVar("walp_punchcombo")==0)	
			{	A_GiveInventory("ComboCounter",1);	}	} 
		FPCH F 1 Offset (5, 36) 
		TNT1 A 1 Offset (5, 36) A_ReFire("Fire")
		TNT1 A 1 Offset (5, 150) A_WeaponReady(WRF_NOBOB)	//All these allow any attack during the wind down animation
		THOT A 2 Offset (5, 55) A_WeaponReady(WRF_NOBOB)
		THOT A 2 Offset (4, 50) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (3, 45)  A_TakeInventory("ComboCounter")
		THOT A 1 Offset (2, 40) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (1, 35) A_WeaponReady(WRF_NOBOB)
		Goto Ready
	Shoryuken:	//Uppercut! 
		TNT1 A 0 A_JumpIfInventory ("PunchLeft", 1, "MightyBoot")
		TNT1 A 0 
		UPCT A 5 
		UPCT A 2 
		UPCT B 2 Offset (0,30) A_StartSound("SwingItNow",1,CHANF_OVERLAP|CHANF_LOCAL,1,ATTN_STATIC,1)
		UPCT C 2 
		{
			A_CustomPunch(30,1,CPF_NOTURN,"PunchPuffWalp",120);
			A_CustomPunch (18 * random (3, 6), true, CPF_NOTURN, "ComboPuff", 114, 0);
			A_RadiusThrust(250,radius+114,RTF_NOTMISSILE,166);
			A_QuakeEx(0,0,5,20,0,1,"-",QF_SCALEDOWN);
			if (GetCVar("walp_silentprotagonists")==0)
				{A_StartSound("MyrmExertsLight",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}
		}
		UPCT D 2 
		UPCT D 3 Offset (0,30) A_TakeInventory("ComboCounter")
		UPCT C 3 Offset (0,30) A_GiveInventory("PunchLeft",1)
		UPCT B 3 Offset (0,30) A_TakeInventory("PunchRight")
		UPCT A 3 Offset (0,30) A_Refire("Fire")
		TNT1 A 1 Offset (5, 150) A_WeaponReady(WRF_NOBOB)	//All these allow any attack during the wind down animation
		THOT A 2 Offset (5, 55) A_WeaponReady(WRF_NOBOB)
		THOT A 2 Offset (4, 50) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (3, 45)  A_TakeInventory("ComboCounter")
		THOT A 1 Offset (2, 40) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (1, 35) A_WeaponReady(WRF_NOBOB)
		Goto Ready
	MightyBoot:
		TNT1 A 0 
		{			
			if(GetCvar("walp_shinyshoes")==FALSE) 
			{
				return A_Jump(256,"DirtyBoot");
			}
			Return state("");
		}
		TNT1 A 3 
		KICK A 1 Offset (5,37)
		KICK A 1 A_WeaponOffset(0,32)
		KICK B 3 A_TakeInventory("ComboCounter")
		KICK C 3 {if(GetCVar("walp_silentprotagonists")==0)
				{A_StartSound("MyrmExertsLight",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}}
		KICK D 2 
		{
			if(CountInv("FistsUpgrade") == 5 || CountInv("FistsUpgrade") == 6 || CountInv("FistsUpgrade") == 8 || CountInv("FistsUpgrade") == 9)
			{
			A_CustomPunch(37,1,CPF_NOTURN,"ShockPunchPuff",120);
			A_CustomPunch (19 * random (3, 6), true, CPF_NOTURN, "ComboPuff", 134, 0);
			}
			else
			{		
			A_CustomPunch(30,1,CPF_NOTURN,"ShockPunchPuff",120);
			A_CustomPunch (15 * random (3, 6), true, CPF_NOTURN, "ComboPuff", 134, 0);
			}
			A_RadiusThrust(250,radius+134,RTF_NOTMISSILE,166);
			A_QuakeEx(3,0,2,20,0,2,"-",QF_SCALEDOWN);	
			A_StartSound("SwingItNow",1,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,0.9);
		}
		KICK D 1 Offset (0, 29) 
		KICK E 2 A_WeaponOffset(0,32)
		KICK F 2
		KICK F 1 Offset (2, 38) A_TakeInventory("PunchRight")
		KICK F 1 Offset (5, 42) A_TakeInventory("PunchLeft")
		TNT1 A 1 A_WeaponOffset(0,32)
		TNT1 A 4 Offset (5, 100) A_Refire("Fire")
		TNT1 A 1 Offset (5, 150) A_WeaponReady(WRF_NOBOB)	//All these allow any attack during the wind down animation
		THOT A 2 Offset (5, 55) A_WeaponReady(WRF_NOBOB)
		THOT A 2 Offset (4, 50) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (3, 45)  A_TakeInventory("ComboCounter")
		THOT A 1 Offset (2, 40) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (1, 35) A_WeaponReady(WRF_NOBOB)
		Goto Ready
	DirtyBoot:
		TNT1 A 3 
		DKIK A 1 Offset (5,37)
		DKIK A 1 A_WeaponOffset(0,32) 
		DKIK B 3 A_TakeInventory("ComboCounter")
		DKIK C 3 {if(GetCVar("walp_silentprotagonists")==0)
				{A_StartSound("MyrmExerts",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}}
		DKIK D 2 
		{
			if(CountInv("FistsUpgrade") == 5 || CountInv("FistsUpgrade") == 6 || CountInv("FistsUpgrade") == 8 || CountInv("FistsUpgrade") == 9)
			{
			A_CustomPunch(37,1,CPF_NOTURN,"ShockPunchPuff",120);
			A_CustomPunch (19 * random (3, 6), true, CPF_NOTURN, "ComboPuff", 134, 0);
			}
			else
			{		
			A_CustomPunch(30,1,CPF_NOTURN,"ShockPunchPuff",120);
			A_CustomPunch (15 * random (3, 6), true, CPF_NOTURN, "ComboPuff", 134, 0);
			}
			A_RadiusThrust(250,radius+134,RTF_NOTMISSILE,166);
			A_QuakeEx(3,0,2,20,0,2,"-",QF_SCALEDOWN);	
			A_StartSound("SwingItNow",1,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,0.9);
		}
		DKIK D 1 Offset (0, 29) 
		DKIK E 2 A_WeaponOffset(0,32)
		DKIK F 2
		DKIK F 1 Offset (2, 38) A_TakeInventory("PunchRight")
		DKIK F 1 Offset (5, 42) A_TakeInventory("PunchLeft")
		TNT1 A 1 A_WeaponOffset(0,32)
		TNT1 A 4 Offset (5, 100) A_Refire("Fire")
		TNT1 A 1 Offset (5, 150) A_WeaponReady(WRF_NOBOB)	//All these allow any attack during the wind down animation
		THOT A 2 Offset (5, 55) A_WeaponReady(WRF_NOBOB)
		THOT A 2 Offset (4, 50) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (3, 45)  A_TakeInventory("ComboCounter")
		THOT A 1 Offset (2, 40) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (1, 35) A_WeaponReady(WRF_NOBOB)
		Goto Ready
	Haymaker:
		FPCH B 2 Offset (30, 36)
		FPCH B 1 Offset (45, 36)//1
		FPCH B 1 Offset (50, 36) //1
		FPCH B 1 Offset (55, 36) //1
		FPCH B 4 Offset (60, 36) A_TakeInventory("PunchRight")
		FPCH D 1 Offset (25, 36) A_PlaySound("PlayerFighterFailedUse",7,2,false,ATTN_STATIC)
		FPCH E 3 Offset (15, 60) A_TakeInventory("ComboCounter")
		FPCH E 1 Offset (15, 70) 
		{
			A_CustomPunch(30,1,CPF_NOTURN,"PunchPuff",120);
			A_CustomPunch (15 * random (3, 6), 1, CPF_NOTURN, "ComboPuff", 114, 0);
			A_RadiusThrust(250,radius+166,RTF_NOTMISSILE,166);
			A_QuakeEx(3,0,2,20,0,2,"-",QF_SCALEDOWN);	
			A_StartSound("SwingItNow",1,CHANF_OVERLAP|CHANF_LOCAL,0.9,ATTN_STATIC,0.9);
		}
		FPCH E 1 Offset (12, 75) A_TakeInventory("PunchLeft")
		FPCH EEEE 1 Offset (5, 100) 
		FPCH D 3 Offset (5, 100) A_Refire("Fire")
		TNT1 A 1 Offset (5, 150) A_WeaponReady(WRF_NOBOB)	//All these allow any attack during the wind down animation
		THOT A 2 Offset (5, 55) A_WeaponReady(WRF_NOBOB)
		THOT A 2 Offset (4, 50) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (3, 45)  A_TakeInventory("ComboCounter")
		THOT A 1 Offset (2, 40) A_WeaponReady(WRF_NOBOB)
		THOT A 1 Offset (1, 35) A_WeaponReady(WRF_NOBOB)
		Goto Ready
	ComboPunch2:	//Overlay Jab
		TNT1 A 0 A_OverlayOffset(434,0,-60,WOF_KEEPX|WOF_ADD)
		FPCH F 1 Offset (-2, -10) 
		FPCH H 1 Offset (-2, -10)
		FPCH D 0 Offset (-2, -10) A_CustomPunch (0, 1, CPF_NOTURN, "PunchPuff", 104, 0)
		FPCH H 2 Offset (-2, -10) A_CustomPunch (12 * random (3, 5), 1, CPF_NOTURN, "ComboPuff", 114, 0)
		FPCH G 2 Offset (-2, -10) 
		FPCH F 1 Offset (-2, -10) //A_ReFire("Fire")
		TNT1 A 1 Offset (-2, -10)
		Stop
		
//////// combo punch END /////////
	AltFire:
		THOT A 0 A_JumpIfInventory("ChainHook", 1, "ChainThrow") //Prevent Duplicate Chains!
		Goto Fire
	ChainThrow: //Throw yer chain boyz, we gotz a winner!
		MYCH X 2 A_JumpIfCloser(radius+150,"ChainLash") //If enemy too close, lashes instead.
		MYCH A 2 {if(GetCVar("walp_silentprotagonists")==0)
				{A_StartSound("MyrmExerts",CHAN_AUTO,CHANF_OVERLAP,0.9,ATTN_NONE,frandom(0.97,1.04));}}
		MYCH B 2 A_TakeInventory("ChainHook")
		MYCH C 2 
		MYCH D 4 {
				if(CountInv("FistsUpgrade") == 3 || CountInv("FistsUpgrade") == 4 || CountInv("FistsUpgrade") == 8 || CountInv("FistsUpgrade") == 9)
				{
				A_FireProjectile("MyrmGrapplePower",0,0,6,0,FPF_NOAUTOAIM,-6);
				}
				else
				{
				A_FireProjectile("MyrmGrapple",0,0,6,0,FPF_NOAUTOAIM,-6);
				}
				}
		Goto ChainLoop
	ChainLoop:	
		MYCH E 1 A_JumpIfInventory("MaceCharge", 1, "ChainDone")
		Loop
	ChainDone: 
		MYCH F 1 A_TakeInventory("MaceCharge")
		MYCH X 1 A_JumpIfInventory("ComboCounter", 2, "MightyBoot")
		Goto Ready
	ChainLash: //If enemy close, whip them instead.
		MYCH A 3 A_PlaySound("MyrmExertsHeavy",2,1,false,ATTN_STATIC)
		MYCH B 3 
		{
			A_CustomPunch(30,1,CPF_NOTURN,"PunchPuff",166);
			A_RadiusThrust(200,radius+166,RTF_NOTMISSILE,166);
			A_FireProjectile("SlamPush",0,0,0,0,FPF_NOAUTOAIM);
			A_QuakeEx(3,0,2,20,0,2,"-",QF_SCALEDOWN);	
			A_PlaySound("ChainSmack",5,2,false,ATTN_STATIC);
		}
		MYCH C 3 
		MYCH X 2
		TNT1 A 6
		Goto Ready
	Reload:	 
		THOT A 0 {
			if(CountInv("FistsUpgrade") == 5 || CountInv("FistsUpgrade") == 6 || CountInv("FistsUpgrade") == 8 || CountInv("FistsUpgrade") == 9)
			{
			A_GiveInventory("QUFLMCounter",1);  
			}
			else
			{		}
			}
		THOT A 0 A_JumpIfInventory("QUFLMCounter", 1, "StompyBootz") //If upgraded, use Stomp Attack!
		THOT A 0 A_JumpIfInventory("ChainHook", 1, "ChainThrow") //Prevent Duplicate Chains!
		Goto Fire	
	StompyBootz:
		TNT1 A 0 
		{			
			if(GetCvar("walp_shinyshoes")==FALSE) 
			{
				return A_Jump(256,"DirtyStompyBoots");
			}
			Return state("");
		}
		KICK A 1 Offset (5,37)
		KICK A 0 A_SetPitch(50,SPF_INTERPOLATE)
		KICK A 1 A_WeaponOffset(0,32)
		KICK B 3 A_TakeInventory("ComboCounter")
		KICK C 3 A_PlaySound("PlayerFighterFailedUse",7,2,false,ATTN_STATIC)
		KICK D 2 
		{
			A_SpawnProjectile("StompyGlow", 0, 0, 0, 0, FPF_NOAUTOAIM,0);
			A_RadiusThrust(1550,radius+164,RTF_NOTMISSILE|RTF_THRUSTZ,196);
			A_QuakeEx(3,0,2,20,0,2,"-",QF_SCALEDOWN);	
			A_PlaySound("StompFoot",2,1);
		}
		KICK D 1 Offset (0, 29) 
		KICK E 2 A_WeaponOffset(0,32)
		KICK F 2 A_TakeInventory("QUFLMCounter")
		KICK F 1 Offset (2, 38) A_TakeInventory("PunchRight")
		KICK F 1 Offset (5, 42) A_TakeInventory("PunchLeft")
		THOT A 6 A_SetPitch(pitch-50,SPF_INTERPOLATE)
		Goto Ready
	DirtyStompyBootz:
		DKIK A 1 Offset (5,37)
		DKIK A 0 A_SetPitch(50,SPF_INTERPOLATE)
		DKIK A 1 A_WeaponOffset(0,32)
		DKIK B 3 A_TakeInventory("ComboCounter")
		DKIK C 3 A_PlaySound("PlayerFighterFailedUse",7,2,false,ATTN_STATIC)
		DKIK D 2 
		{
			A_SpawnProjectile("StompyGlow", 0, 0, 0, 0, FPF_NOAUTOAIM,0);
			A_RadiusThrust(1550,radius+164,RTF_NOTMISSILE|RTF_THRUSTZ,196);
			A_QuakeEx(3,0,2,20,0,2,"-",QF_SCALEDOWN);	
			A_PlaySound("StompFoot",2,1);
		}
		DKIK D 1 Offset (0, 29) 
		DKIK E 2 A_WeaponOffset(0,32)
		DKIK F 2 A_TakeInventory("QUFLMCounter")
		DKIK F 1 Offset (2, 38) A_TakeInventory("PunchRight")
		DKIK F 1 Offset (5, 42) A_TakeInventory("PunchLeft")
		THOT A 0 A_SetPitch(pitch-50,SPF_INTERPOLATE)
		Goto Ready
	}
}

ACTOR ComboPuff	//This is the damage-less puff that sorts out the combo
{
	+PUFFONACTORS
	+ALWAYSPUFF
	+PAINLESS
	+PUFFGETSOWNER
	//SeeSound "SwordHit"
	//ActiveSound "SwordSwing"
	//AttackSound "SwordWall"
	States
	{
		Spawn:
			TNT1 A 0 Nodelay A_AlertMonsters
			TNT1 A 1 {	if(GetCVar("walp_punchcombo")==1)	
			{	A_GiveInventory("ComboCounter",1,AAPTR_TARGET);	}	}
			TNT1 A 0 
			stop
		Crash:
			TNT1 A 0 A_AlertMonsters
			TNT1 A 1 {	if(GetCVar("walp_punchcombo")==1)	
			{	A_TakeInventory("ComboCounter",10,0,AAPTR_TARGET);	
				A_TakeInventory("PunchRight",10,0,AAPTR_TARGET);
				A_TakeInventory("PunchLeft",10,0,AAPTR_TARGET);}	}
			stop
	}
}

ACTOR PunchPuffWalp
{
  +NOBLOCKMAP
  +NOGRAVITY
  +PUFFONACTORS
  +ROLLSPRITE
  +ROLLCENTER
  RenderStyle Translucent
  Alpha 0.4
  Scale 0.8
  AttackSound "FighterPunchHitWall"
  VSpeed 1
  States
  {
  Spawn:
    TNT1 A 0 Nodelay A_StartSound("PunchOut",7,CHANF_OVERLAP|CHANF_LOCAL,4,ATTN_STATIC,0.9)
	TNT1 A 0 A_Setroll(random(0,180))
	FHFX STUVW 4
    Stop
  }
}

ACTOR ShockPunchPuff : PunchPuffWalp
{
+FORCEPAIN
}

ACTOR Xvelocity : Inventory  //For Pushing purposes
{
	inventory.MaxAmount 450
}

ACTOR Yvelocity : Inventory  //For Pushing purposes
{
	inventory.MaxAmount 450
}

ACTOR Xnegative : Inventory  //For Pushing purposes
{
	inventory.MaxAmount 1
}

ACTOR Ynegative : Inventory  //For Pushing purposes
{
	inventory.MaxAmount 1
}

ACTOR SlamPush //This handles the pushing effects for the Kick and Shoryuken
{
	radius 10
	height 20
	Speed 6
	//Damage (Random(100,125))
	Projectile
	ProjectileKickBack 1500
	+INVISIBLE
	+HITTRACER
	States
	{
		Spawn:
			TNT1 A 0
			THAX A 1
			{
				A_ScaleVelocity(20);
				if(Velx < 1)	//These store the x and y velocities of the projectile to give to the enemy
				{
					A_GiveInventory("Xnegative", 1);
					A_GiveInventory("Xvelocity", (velx * (-1)));
				}
				else
				{
					A_GiveInventory("Xvelocity", (velx));
				}
				if(Vely < 1)
				{
					A_GiveInventory("Ynegative", 1);
					A_GiveInventory("Yvelocity", (vely * (-1)));
				}
				else
				{
					A_GiveInventory("Yvelocity", (vely));
				}
			}
			THAX AAAA 1 A_Fadeout(0.2)
			Stop
		Crash:	
			TNT1 A 0
		XDeath:
			THAX A 1 
			{
				A_Playsound("SwordHit");
				if (CountInv("Xnegative") > 0)
				{
					A_ChangeVelocity(.5*(-1)*CountInv("Xvelocity"),0,0,0,AAPTR_TRACER);
				}
				Else
				{
					A_ChangeVelocity(.5*CountInv("Xvelocity"),0,0,0,AAPTR_TRACER);
				}
				if (CountInv("Ynegative") > 0)
				{
					A_ChangeVelocity(0,.5*(-1)*CountInv("Yvelocity"),0,0,AAPTR_TRACER);
				}
				Else
				{
					A_ChangeVelocity(0,.5*CountInv("Yvelocity"),0,0,AAPTR_TRACER);
				}
				A_ChangeVelocity(-0,0,9,CVF_REPLACE,AAPTR_TRACER);
				A_RadiusThrust(50,35,RTF_THRUSTZ);
			}
			Stop
		Death:
			FHFX STUVW 2 
			Stop
	}
}

ACTOR MyrmGrapple : LoreShot
{
	Speed 18
	Height 10 //30
	Radius 10 //30
	Projectile
	-STRIFEDAMAGE
	-NOGRAVITY
	+WINDTHRUST
	+THRUGHOST
	+MTHRUSPECIES 
	+NODAMAGETHRUST
	+DONTBLAST
	+HITTRACER
	+SKYEXPLODE //weird but needed
	+SEEKERMISSILE
	+ROLLSPRITE
	+ROLLCENTER
	Gravity 0.1
	Mass 2
	Damage 1 //Apparently it has to do damage to function
	States
	{
	Spawn:
		HOOK A 0 Nodelay
		{	A_PlaySound("ChainFire",5,2,false,ATTN_STATIC);
			A_PlaySound("ChainLoop",6,1,true,ATTN_NONE);
			A_AlertMonsters;}
		Goto Grapple
	Grapple:
		HOOK A 1 {
			A_SpawnItemEX("GrappleChain",-1,0,0,0,0,0,0,SXF_SETMASTER); //drops chain items.
			A_Setroll(roll-random(10,20));}
		HOOK A 1 {
			A_SpawnItemEX("GrappleChain",-1,0,0,0,0,0,0,SXF_SETMASTER); //drops chain items.
			A_Setroll(roll-random(10,20));}
		HOOK A 1 {
			A_SpawnItemEX("GrappleChain",-1,0,0,0,0,0,0,SXF_SETMASTER); //drops chain items.
			A_Setroll(roll-random(10,20));}
		HOOK A 0 A_SeekerMissile(8,4,SMF_LOOK|SMF_PRECISE,128,2) //It very slightly homes in to help close grabs not failing.
		HOOK A 0 A_GiveInventory("ChainBolt",1)
		HOOK A 0 A_JumpIfInventory ("ChainBolt", 18, "Crash") //If it hasn't hit something in 36 tics, it returns anyways.
		Goto Grapple
	Crash:
		HOOK A 1
		{	
			A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET);
			A_ChangeVelocity((velx-(velx*2)),(vely-(vely*2)),(velz-(velz*2)),CVF_REPLACE|CVF_RELATIVE);
			A_ChangeFlag("FORCEXYBILLBOARD", TRUE);	
			A_ChangeFlag("NOGRAVITY", TRUE);	
			A_ChangeFlag("NOCLIP",TRUE);
			A_SpawnItemEX("HammerBlastSpark",0);
			A_PlaySound("ChainMiss",5,2,false,ATTN_STATIC);
			A_GiveInventory("MaceCharge", 1, AAPTR_TARGET); //This tells the player that the hook failed
			A_StopSound(6);
			if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 1)
				{	//If the speed ever falls below 1 then it resets the speed to 5
					A_ChangeVelocity(5,0,0,CVF_RELATIVE | CVF_REPLACE);
				}	
			if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 18)
				{	//While the speed is below 18, this speeds it up
					A_ScaleVelocity(1.4);
					A_SeekerMissile(90,90,SMF_PRECISE | SMF_CURSPEED);	//And this seeks the player
				}
		}
		Goto BackFlight
	XDeath:
		HOOK A 1
		{	
			A_ChangeVelocity((velx-(velx*2)),(vely-(vely*2)),(velz-(velz*2)),CVF_REPLACE|CVF_RELATIVE);
			A_ChangeFlag("FORCEXYBILLBOARD", TRUE);	
			A_ChangeFlag("NOGRAVITY", TRUE);	
			A_GiveInventory("MaceCharge", 1, AAPTR_TARGET); //This tells the player that the hook is pulling
			A_GiveInventory("ComboCounter", 2, AAPTR_TARGET); //a target back; so that he kicks it as it arrives.
			A_StopSound(6);
			A_PlaySound("ChainSmack",5,2,false,ATTN_STATIC); 
		}
		Goto ReelIn		
	BackFlight:
		HOOK A 1
		{
		if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 1)
				{	//If the speed ever falls below 1 then it resets the speed to 9
					A_ChangeVelocity(9,0,0,CVF_RELATIVE | CVF_REPLACE);
				}	
		if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 18)
				{	//While the speed is below 18, this speeds it up
					A_ScaleVelocity(1.4);
					A_SeekerMissile(90,90,SMF_PRECISE | SMF_CURSPEED);	//And this seeks the player
				}
		A_FaceTracer;
		A_SeekerMissile(90,90,SMF_PRECISE | SMF_CURSPEED);
		A_SpawnItemEX("GrappleChain",-1);
		A_SpawnItemEX("GrappleChain",-2);
		A_SpawnItemEX("GrappleChain",-3);
		A_Setroll(roll-random(5,20));
		}
		HOOK A 1 A_CheckProximity("RealDeath","MyrmidonPlayer",110,1) //Kills itself if close to Player
		Loop
	ReelIn:
		HOOK A 12
		{	A_StopSound(6);
			A_GiveInventory("ChainHook", 1, AAPTR_TARGET);
			A_Warp(AAPTR_TRACER,30,0,32,0,WARPF_COPYVELOCITY|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION);}
		Stop
	Death:
		Goto Crash
	Death.Sky: 
		Goto Crash
	RealDeath:
		TNT1 A 0 A_GiveInventory("ChainHook", 1, AAPTR_TARGET)
		HOOK A 6 A_StopSound(6)
		Stop
	}
}

Actor MyrmGrapplePower : LoreShot //apparently it doesn't work being derived from itself. Weird.
{
	Speed 18
	Height 10 //30
	Radius 10 //30
	Projectile
	-STRIFEDAMAGE
	-NOGRAVITY
	+WINDTHRUST
	+THRUGHOST
	+MTHRUSPECIES 
	+NODAMAGETHRUST
	+DONTBLAST
	+HITTRACER
	+SKYEXPLODE //weird but needed
	+SEEKERMISSILE
	+ROLLSPRITE
	+ROLLCENTER
	Gravity 0.1
	Mass 2
	Damage 6 //Upgrade adds some DoT
	PoisonDamage 8,3,0
	Damagetype "Fire"
	States
	{
	Spawn:
		HOOK A 0 Nodelay
		{	A_PlaySound("ChainFire",5,2,false,ATTN_STATIC);
			A_PlaySound("ChainLoop",6,1,true,ATTN_NONE);
			A_AlertMonsters;}
		Goto Grapple
	Grapple:
		HOOK A 1 {
			A_SpawnItemEX("GrappleChainPlus",-1,0,0,0,0,0,0,SXF_SETMASTER); //drops chain items.
			A_Setroll(roll-random(10,20));}
		HOOK A 1 {
			A_SpawnItemEX("GrappleChainPlus",-1,0,0,0,0,0,0,SXF_SETMASTER); //drops chain items.
			A_Setroll(roll-random(10,20));}
		HOOK A 1 {
			A_SpawnItemEX("GrappleChainPlus",-1,0,0,0,0,0,0,SXF_SETMASTER); //drops chain items.
			A_Setroll(roll-random(10,20));}
		HOOK A 0 A_SeekerMissile(20,25,SMF_LOOK|SMF_PRECISE,128,2) //It very slightly homes in to help close grabs not failing.
		HOOK A 0 A_GiveInventory("ChainBolt",1)
		HOOK A 0 A_JumpIfInventory ("ChainBolt", 18, "Crash") //If it hasn't hit something in 36 tics, it returns anyways.
		Goto Grapple
	Crash:
		HOOK A 1
		{	
			A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET);
			A_ChangeVelocity((velx-(velx*2)),(vely-(vely*2)),(velz-(velz*2)),CVF_REPLACE|CVF_RELATIVE);
			A_ChangeFlag("FORCEXYBILLBOARD", TRUE);	
			A_ChangeFlag("NOGRAVITY", TRUE);	
			A_ChangeFlag("NOCLIP",TRUE);
			A_SpawnItemEX("HammerBlastSpark",0);
			A_PlaySound("ChainMiss",5,2,false,ATTN_STATIC);
			A_GiveInventory("MaceCharge", 1, AAPTR_TARGET); //This tells the player that the hook failed
			A_StopSound(6);
			if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 1)
				{	//If the speed ever falls below 1 then it resets the speed to 5
					A_ChangeVelocity(5,0,0,CVF_RELATIVE | CVF_REPLACE);
				}	
			if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 18)
				{	//While the speed is below 18, this speeds it up
					A_ScaleVelocity(1.4);
					A_SeekerMissile(90,90,SMF_PRECISE | SMF_CURSPEED);	//And this seeks the player
				}
		}
		Goto BackFlight
	XDeath:
		HOOK A 1
		{	
			A_ChangeVelocity((velx-(velx*2)),(vely-(vely*2)),(velz-(velz*2)),CVF_REPLACE|CVF_RELATIVE);
			A_ChangeFlag("FORCEXYBILLBOARD", TRUE);	
			A_ChangeFlag("NOGRAVITY", TRUE);	
			A_GiveInventory("MaceCharge", 1, AAPTR_TARGET); //This tells the player that the hook is pulling
			A_GiveInventory("ComboCounter", 2, AAPTR_TARGET); //a target back; so that he kicks it as it arrives.
			A_StopSound(6);
			A_PlaySound("ChainSmack",5,2,false,ATTN_STATIC); 
		}
		Goto ReelIn		
	BackFlight:
		HOOK A 1
		{
		if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 1)
				{	//If the speed ever falls below 1 then it resets the speed to 9
					A_ChangeVelocity(9,0,0,CVF_RELATIVE | CVF_REPLACE);
				}	
		if((sqrt((sqrt((velx * velx)+(vely * vely)) * sqrt((velx * velx)+(vely * vely)))+(velz * velz))) <= 18)
				{	//While the speed is below 18, this speeds it up
					A_ScaleVelocity(1.4);
					A_SeekerMissile(90,90,SMF_PRECISE | SMF_CURSPEED);	//And this seeks the player
				}
		A_FaceTracer;
		A_SeekerMissile(90,90,SMF_PRECISE | SMF_CURSPEED);
		A_SpawnItemEX("GrappleChainPlus",-1);
		A_SpawnItemEX("GrappleChainPlus",-2);
		A_SpawnItemEX("GrappleChainPlus",-3);
		A_Setroll(roll-random(10,20));
		}
		HOOK A 1 A_CheckProximity("RealDeath","MyrmidonPlayer",110,1) //Kills itself if close to Player
		Loop
	ReelIn:
		HOOK A 12
		{	A_StopSound(6);
			A_GiveInventory("ChainHook", 1, AAPTR_TARGET);
			A_Warp(AAPTR_TRACER,30,0,32,0,WARPF_COPYVELOCITY|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION);}
		Stop
	Death:
		Goto Crash
	Death.Sky: 
		Goto Crash
	RealDeath:
		TNT1 A 0 A_GiveInventory("ChainHook", 1, AAPTR_TARGET)
		HOOK A 6 A_StopSound(6)
		Stop
	}
}

ACTOR GrappleChain
{
	+NOBLOCKMAP
	+NOGRAVITY
	+NOINTERACTION
	+CLIENTSIDEONLY 
	+DONTBLAST
	+ROLLSPRITE
	+ROLLCENTER
	States
	{
	Spawn:
		CHIN A 2 A_Setroll(roll-random(20,35))
		CHIN A 0 A_CheckProximity("Spawn","MyrmGrapple",650,1) //This kills it if the grapple item dies.
		CHIN A 0 A_GiveInventory("ChainBolt",1) //This makes it also die if its somehow still around & the hook is stuck
		CHIN A 0 A_JumpIfInventory ("ChainBolt", 20, "Death")
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

ACTOR GrappleChainPlus : GrappleChain
{
	States
	{
	Spawn:
		CHIN B 2 A_Setroll(roll-random(20,35))
		CHIN B 0 {
			if (random(1,8) == 1) // Occasionally spawns an ember effect
			{
				A_SpawnItemEx("HammerBlastSpark",random(-4,4),random(-4,4),1,-2,random(-3,3),1);
			}}		
		CHIN B 0 A_CheckProximity("Spawn","MyrmGrapplePower",950,1) //This kills it if the grapple item dies.
		CHIN B 0 A_GiveInventory("ChainBolt",1) //This makes it also die if its somehow still around & the hook is stuck
		CHIN B 0 A_JumpIfInventory ("ChainBolt", 20, "Death")
		Goto Death
	}
}

ACTOR StompyGlow : AxePuffGlow
{
	+ALWAYSPUFF
	+FORCERADIUSDMG
	+FORCEXYBILLBOARD
	//SeeSound "HammerBoom"
	States
	{
	Spawn:
		TNT1 A 0 A_Explode (15, 333)	
		TNT1 A 2  
		{
			A_PlaySound ("HammerBoom",5,2.5,false,ATTN_NONE);
			A_Quake (15, 25, 0, 185, "-");	//quakes the screen
			While(CountInv("Mana1") < 24) //JT- reduced by half
			{
				A_SpawnItemEx ("HammerFlames", 0, 0, 0, 3, 0, 0, (CountInv("Mana1")*15), 0, 0);
				A_GiveInventory("Mana1",1);
			}
			A_TakeInventory("Mana1");
		}
		TNT1 A 2 A_Explode (random(20,40), 466, 0, FALSE, 150)	//JT- NERFED alot! It was crazy OP!!
		TNT1 A 0 A_RadiusThrust(330, 466, RTF_THRUSTZ|RTF_AFFECTSOURCE)
		TNT1 A 0 A_ChangeFlag("INVISIBLE", TRUE)
		FHFX I 0 A_StopSound(5)
		Stop
	}
}