ACTOR MyrmidonPlayer : PlayerPawn //Sadly nothing like a Fire Emblem Myrmidon... :(
{
	Health 150
	Player.MaxHealth 150
	PainChance 255
	Radius 16
	Height 56
	Speed 1.1
	+NOSKIN
	+NODAMAGETHRUST
	+NOTHRUSTWHENINVUL
	+FLOORCLIP
	PainSound "PlayerFighterPain"
	DamageFactor "Hammer", 0
	DamageFactor "Blast", 0
	DamageFactor "Wind", 0
	RadiusDamageFactor 0.25
	Species "PlayerAlly"
	Player.JumpZ 9
	Player.Viewheight 48
	Player.SpawnClass "Fighter"
	Player.DisplayName "Baratus the Myrmidon"
	Player.SoundClass "fighter"
	Player.ScoreIcon "FITEFACE"
	Player.HealRadiusType "Armor"
	Player.Portrait "CHASMYR2"
	//Player.Portrait "MYRWALK1"
	Player.Hexenarmor 15, 40, 20, 30, 20 //Iraldatine Vest/Drayke Boots/Stylish Helm/Shield Amulet (/5 for AC)
	Player.StartItem "Queensbury"
	Player.StartItem "ChainHook"
	Player.StartItem "DoneStartupProcessWalp"
	//Player.StartItem "WandofHitScan"
	//Player.StartItem "BasicArmor" 
	//Player.StartItem "Whetstone", 3
	Player.ForwardMove 1.1, 1.1
	Player.SideMove 1.1, 1.1
	Player.WeaponSlot 1, Queensbury
	Player.WeaponSlot 2, VorpalAxe
	Player.WeaponSlot 3, HammerOfR
	Player.WeaponSlot 4, QuietusX
	States
	{
	Spawn:
		TNT1 A 0 
		TNT1 A 0 A_JumpIfInventory("DoneStartupProcessWalp",1,"DoStartUp")
		FIGH A 1 //Fighter had his sprite name changed for Doom Compatibility
		FIGH A 0 
		{
			If(CountInv("MaceCharge") >= 1)	//MaceCharge is used in the axe to tell if the axe is thrown
			{																//If the player has StopStam or MaceCharge then the player is given Arcane Blood as a counter
				A_GiveInventory("Walpurgisnacht", 1);								//This is so that if something goes wrong the player won't be left
			}																//without an axe permanently or unable to generate stamina
			else	//If the player gets the axe back or loses stopstam then it resets the counter
			{
				A_TakeInventory("Walpurgisnacht");
			}
			If(CountInv("Walpurgisnacht") == 70)
			{
				A_TakeInventory("MaceCharge");
				A_TakeInventory("Walpurgisnacht");
			}
		}
		Loop
	DoStartUp:
		TNT1 A 0 {
		if (GameType() & GAME_Hexen) 
			{A_GiveInventory("HexenCounter",1);}
		else if (GameType() & GAME_Doom) 
			{A_GiveInventory("DoomCounter",1);
				if(GetCVar("walp_hitscanwand")==1)	
				{A_GiveInventory("WandofHitScan",1);}
			}
		else if (GameType() & GAME_Heretic) 
			{A_GiveInventory("HereticCounter",1);}
			}
		TNT1 A 0 {
		if(GetCVar("walp_doomsouls")==1)	
			{A_GiveInventory("DoomedSoulsMode",1);
			A_GiveInventory("EstusFlask",GetCVar("walp_kestuslevel")); }}
		TNT1 A 0 {if(GetCVar("screenblocks")!=11)	
			{		A_Print("$SCREENWRONG", 8);}}
		TNT1 A 0 A_TakeInventory("DoneStartupProcessWalp")
		Goto Spawn
	See:
		FIGH ABCD 4 
		{	If(CountInv("MaceCharge") >= 1)	//This is the same as the one in the other state
			{
				A_GiveInventory("Walpurgisnacht", 1);
			}
			else
			{
				A_TakeInventory("Walpurgisnacht");
			}
			If(CountInv("Walpurgisnacht") == 70)
			{
				A_TakeInventory("MaceCharge");
				A_TakeInventory("Walpurgisnacht");
			}
		}
		Loop
	Missile:
	Melee:
		FIGH EEEEFFFF 3
		{
			If(CountInv("MaceCharge") >= 1)
			{
				A_GiveInventory("Walpurgisnacht", 1);
			}
			else
			{
				A_TakeInventory("Walpurgisnacht");
			}
			If(CountInv("Walpurgisnacht") == 70)
			{
				A_TakeInventory("MaceCharge");
				A_TakeInventory("Walpurgisnacht");
			}
		}
		Goto Spawn
	Pain:
		FIGH G 4 A_SetBlend("DarkRed",0.6,20)
		FIGH G 4 A_Pain
		Goto Spawn
	Pain.Fire:
		"####" G 4 A_SetBlend("DarkOrange",0.7,25)
		"####" G 4 A_Pain
		Goto Spawn
	Pain.Smoke:
		FIGH G 4 {A_SetBlend("Black",0.9,25); A_Playsound("MyrmCough",3,0.9);}
		FIGH G 4 A_Pain
		Goto Spawn
	Pain.AcidDemon:
		FIGH G 4 A_SetBlend("DarkGreen",0.8,25)
		FIGH G 4 A_Pain
		Goto Spawn
	Pain.Acid:
		FIGH G 4 A_SetBlend("DarkGreen",0.8,25)
		FIGH G 4 A_Pain
		Goto Spawn
	Pain.Purple:
		"####" G 4 A_SetBlend("Purple",0.8,25)
		"####" G 4 A_Pain
		Goto Spawn
	Death:
		FIGH H 6
		FIGH I 6 A_PlayerScream
		FIGH JK 6
		FIGH L 6 A_NoBlocking
		FIGH M 6
		FIGH N -1
		Stop		
	XDeath:
		FIGH O 5 A_PlayerScream
		FIGH P 5 A_SkullPop("BloodyFighterSkull")
		FIGH R 5 A_NoBlocking
		FIGH STUV 5
		FIGH W -1
		Stop
	Ice:
		FIGH X 5 A_FreezeDeath
		FIGH X 1 A_FreezeDeathChunks
		Wait
	Burn:
		FDTH A 5 BRIGHT A_PlaySound("*burndeath")
		FDTH B 4 BRIGHT
		FDTH G 5 BRIGHT
		FDTH H 4 BRIGHT //A_PlayerScream
		FDTH I 5 BRIGHT
		FDTH J 4 BRIGHT
		FDTH K 5 BRIGHT
		FDTH L 4 BRIGHT
		FDTH M 5 BRIGHT
		FDTH N 4 BRIGHT
		FDTH O 5 BRIGHT
		FDTH P 4 BRIGHT
		FDTH Q 5 BRIGHT
		FDTH R 4 BRIGHT
		FDTH S 5 BRIGHT A_NoBlocking
		FDTH T 4 BRIGHT
		FDTH U 5 BRIGHT
		FDTH V 4 BRIGHT
		ACLO E 35 A_CheckPlayerDone
		Wait
		ACLO E 8
		Stop
	}
}

ACTOR MyrmidonWeapon : Weapon
{
  Weapon.Kickback 150
  Inventory.ForbiddenTo MagisterPlayer, DruidPlayer, CrusaderPlayer
  States
  {
	UpgradeBarX:
		UPG8 VU 2
	UpgradeBarLoopX:
		UPG8 T 1
		UPG8 T 0 A_JumpIfInventory("UpgradeBarKill",1,"UpgradeKill")
		Loop
	UpgradeKillX:
		UPG8 U 0 A_TakeInventory("UpgradeBarKill")
		UPG8 UV 2
		Stop
  }
}