ACTOR GZDA_DoomPlayer : DoomPlayer
{
	Game Doom 
	Speed 1
	Health 100
	Radius 16
	Height 56
	Mass 100
	PainChance 255
	Player.ColorRange 112, 127
	Player.DisplayName "Marine"
	Player.CrouchSprite "PLYC"
	Player.StartItem EliPistol
	Player.StartItem PistolMagCheck 17
	Player.StartItem PistolAmmo 34
	Player.StartItem ReloadActive
	Player.StartItem ReloadCancel
	Player.StartItem ChangeAmmoTypeActive
	Player.StartItem ChangeAmmoTypeCancel
	Player.StartItem FireModeToggle
	States
	{
	Spawn:
		PLAY A -1
		Loop
	See:
		PLAY ABCD 4
		Loop
	Missile:
		PLAY E 6
		Goto Spawn
	Melee:
		PLAY F 6 BRIGHT
		Goto Missile
	Pain:
		PLAY G 4
		PLAY G 4 A_Pain
		Goto Spawn
	Death:
		PLAY H 10 //A_PlayerSkinCheck(AltSkinDeath)
		PLAY I 10 A_PlayerScream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N -1
		Stop
	XDeath:
		PLAY O 5 //A_PlayerSkinCheck(AltSkinXDeath)
		PLAY P 5 A_XScream
		PLAY Q 5 A_NoBlocking
		PLAY RSTUV 5
		PLAY W -1
		Stop
	//AltSkinDeath:
		PLAY H 6
		PLAY I 6 A_PlayerScream
		PLAY JK 6
		PLAY L 6 A_NoBlocking
		PLAY MNO 6
		PLAY P -1
		Stop
	//AltSkinXDeath:
		PLAY Q 5 A_PlayerScream
		PLAY R 0 A_NoBlocking
		PLAY R 5 A_SkullPop
		PLAY STUVWX 5
		PLAY Y -1
		Stop
	}
}

ACTOR Reload : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
}

ACTOR ReloadActive : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR 
	States
	{
		Use:
		NULL A 0 A_GiveInventory("Reload",1)
		Fail
	} 
}

ACTOR ReloadCancel : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
	States
	{
		Use:
		NULL A 0 A_TakeInventory("Reload",1)
		Fail
	}
}

ACTOR ChangeAmmoType : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
}

ACTOR ChangeAmmoTypeActive : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR 
	States
	{
		Use:
		NULL A 0 A_GiveInventory("ChangeAmmoType",1)
		Fail
	} 
}

ACTOR ChangeAmmoTypeCancel : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
	States
	{
		Use:
		NULL A 0 A_TakeInventory("ChangeAmmoType",1)
		Fail
	}
}

ACTOR FireMode2 : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
}

ACTOR FireMode31 : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
}

ACTOR FireMode32 : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
}

ACTOR FireMode4 : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 9
	-INVBAR
}

ACTOR FireModeToggle : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	-INVBAR
	States
	{
	Use:
		NULL A 0 A_JumpIf(ACS_ExecuteWithResult(288,0,0,0)==2,"MachinePistolEnable")
		//NULL A 0 A_JumpIf(ACS_ExecuteWithResult(288,0,0,0)==31,"AutoShotgunEnable")
		NULL A 0 A_JumpIf(ACS_ExecuteWithResult(288,0,0,0)==4,"MicrogunEnable")	  
		Fail
	MachinePistolEnable:
		NULL A 0 A_JumpIfInventory("FireMode2",1,"Disable")
		NULL A 0 A_GiveInventory("FireMode2",1)   
		NULL A 0 A_Print("Semi Auto")
		Fail
	AutoShotgunEnable:
		NULL A 0 A_JumpIfInventory("FireMode31",1,"Disable")
		NULL A 0 A_GiveInventory("FireMode31",1)   
		NULL A 0 A_Print("Full Auto")
		Fail 
	MicrogunEnable:
		NULL A 0 A_JumpIfInventory("FireMode4",9,"Disable") 
		NULL A 0 A_JumpIfInventory("FireMode4",8,32)
		NULL A 0 A_JumpIfInventory("FireMode4",7,28)
		NULL A 0 A_JumpIfInventory("FireMode4",6,24)
		NULL A 0 A_JumpIfInventory("FireMode4",5,20)
		NULL A 0 A_JumpIfInventory("FireMode4",4,16)
		NULL A 0 A_JumpIfInventory("FireMode4",3,12)
		NULL A 0 A_JumpIfInventory("FireMode4",2,8)
		NULL A 0 A_JumpIfInventory("FireMode4",1,4)
		NULL A 0 A_GiveInventory("FireMode4",1) 
		NULL A 0 A_Print("800rpm")
		NULL A 0 A_Jump(256,3)
		NULL A 0 A_GiveInventory("FireMode4",1)
		NULL A 0 A_Print("1200rpm")
		NULL A 0 A_Jump(256,3)  
		NULL A 0 A_GiveInventory("FireMode4",1) 
		NULL A 0 A_Print("1600rpm")
		NULL A 0 A_Jump(256,3)  
		NULL A 0 A_GiveInventory("FireMode4",1) 
		NULL A 0 A_Print("2000rpm")
		NULL A 0 A_Jump(256,3)  
		NULL A 0 A_GiveInventory("FireMode4",1) 
		NULL A 0 A_Print("2400rpm")
		NULL A 0 A_Jump(256,3)  
		NULL A 0 A_GiveInventory("FireMode4",1) 
		NULL A 0 A_Print("2800rpm")
		NULL A 0 A_Jump(256,3)  
		NULL A 0 A_GiveInventory("FireMode4",1) 
		NULL A 0 A_Print("3200rpm")
		NULL A 0 A_Jump(256,3)  
		NULL A 0 A_GiveInventory("FireMode4",1) 
		NULL A 0 A_Print("3600rpm")
		NULL A 0 A_Jump(256,3)  
		NULL A 0 A_GiveInventory("FireMode4",1)  
		NULL A 0 A_Print("4000rpm")	  
		NULL A 0
		Fail
	Disable:
		NULL A 0 A_JumpIf(ACS_ExecuteWithResult(288,0,0,0)==2,"MachinePistolDisable")
		//NULL A 0 A_JumpIf(ACS_ExecuteWithResult(288,0,0,0)==31,"AutoShotgunDisable")
		NULL A 0 A_JumpIf(ACS_ExecuteWithResult(288,0,0,0)==4,"MicrogunDisable")
		Fail
	MachinePistolDisable:
		NULL A 0 A_TakeInventory("FireMode2",1)   
		NULL A 0 A_Print("Full Auto")
		Fail
	AutoShotgunDisable:
		NULL A 0 A_TakeInventory("FireMode31",1)   
		NULL A 0 A_Print("Semi Auto")
		Fail
	MicrogunDisable:
		NULL A 0 A_TakeInventory("FireMode4",9)   
		NULL A 0 A_Print("400rpm")
		Fail
	}
}