Actor D4EvilMarine : D4AbstractMonster
{
	Translation 0
	Health 300
	Speed 8
	Radius 20
	Height 56
	PainChance 30
	Monster
	+FLOORCLIP	
	SeeSound "marine/sight"
	ActiveSound "marine/active"
	DeathSound "marine/death"
	PainSound "marine/pain"
	Obituary "%o was zapped by an evil marine."
	DropItem "ZombieGrenadeDrop", 5
	DropItem "PistolModDropper", 16
	DamageFactor "PlasmaExploder", 0.3	//because otherwise, zombiemen would be killing everyone else easily
	PainChance "StunBomb", 255
	PainChance "GloryKill", 255
	WoundHealth 60
	Tag "Evil Marine"
	States
	{
	Spawn:
		PLAY A 0 NODELAY A_SetUserVar(user_bigmonstersound,0)
		Goto Super::Spawn
	Idle:
		PLAY AB 10 A_Look
		Loop
	See:
		PLAY AABBCCDD 1 A_Chase
		Loop
	Missile:
		PLAY E 1 A_FaceTarget
		PLAY F 2 A_CustomMissile("ArachnoPlasma")
		PLAY E 1 A_FaceTarget
		PLAY F 2 A_CustomMissile("ArachnoPlasma")
		PLAY E 1 A_FaceTarget
		PLAY F 2 A_CustomMissile("ArachnoPlasma")
		PLAY E 2 A_facetarget
		Goto See
	Pain:
		PLAY G 4
		PLAY G 4 A_Pain
		Goto See
	Death:
		"####" "#" 0 A_SpawnItemEx("SituationalPinata",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		PLAY H 10
		PLAY I 10 A_Scream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N -1
		Stop
	Raise:
		PLAY MLKJIH 5
		Goto See
	//-------------------------
	// Regular chainsaw kill
	Death.ChainsawKill:
		TNT1 A 0 A_SpawnItemEx("D4PinataHealth",0,0,0,frandom(-4,4),frandom(-4,4),frandom(1,5),0,SXF_NOCHECKPOSITION)
		Goto XDeath
	//-------------------------
	// Chainsaw execution	
	Death.ChainsawPinata:	
		TNT1 A 0 A_GiveToTarget("SuccessfulExecutionToken",1)
		TNT1 A 0 A_SpawnItemEx("ChainsawExecutionPinata",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		Goto XDeath
	//-------------------------		
	// BerserkKill
	Death.BerserkKill:
		TNT1 AA 0 A_SpawnItemEx("D4PinataHealth",0,0,0,frandom(-4,4),frandom(-4,4),frandom(1,5),0,SXF_NOCHECKPOSITION)
		Goto XDeath
		
	//------------------------------------------------------------------------
	// Start of Stagger / Glory Kill states
	//------------------------------------------------------------------------
	Wound:
		PLAY X 0 A_SetUserVar(user_healto,30)
		Goto WoundStagger	// see MonsterBase.AED
		
	Death.GloryKill:
		PLAY Y 0
		Goto GloryKillGeneric // see MonsterBase.AED
		
	GloryEnd:	//depending on the monster, is what and how much will spawn
		TNT1 A 1 A_SpawnItemEx("GloryKillPinata",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		Goto XDeath
	}
}
