ACTOR PrePlacedMarineHML
{
MONSTER
-COUNTKILL
Height 56
Radius 16
Translation "112:127=[60,60,60]:[0,0,0]"
    States
	{
	Spawn:
	MHML A 1
	TNT1 A 0 A_NoBlocking
	MHML A 1
	TNT1 A 0 A_SpawnItemEx ("Marine_HMLSpawn",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	Stop
    }
}

ACTOR Marine_HMLSpawn: RedTorch
{
    Radius 10
    Height 48
	MONSTER
	-SHOOTABLE
	-COUNTKILL
	-FRIENDLY
	Translation "112:127=[60,60,60]:[0,0,0]"
	States
    {
    Spawn:
	    MHML A 10
		MHML A 1 A_CheckSight("DontSpawn")
		TNT1 A 0 A_Chase
		TNT1 A 0 A_Look
	See:
		TNT1 A 0 ACS_NamedExecute("AddMarineHML")
		TNT1 A 0 A_SpawnItemEx ("Marine_HML",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
        Stop
	DontSpawn:
	    MHML A 1
		Goto Spawn
    }
}

ACTOR Marine_HML: Marine_Rifle
{
	Health 110
	MaxTargetRange 4096
	DropItem "HMLSpawner"
	Translation "112:127=[60,60,60]:[0,0,0]"
	States
	{
	Active:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile ("OrderTitle2", 50, 0, 0, 2, 90)
		TNT1 A 0 A_PlaySound("MarineGuard", 2)
		TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
		MHML A 30
		TNT1 A 0 A_SpawnItemEx ("HMLMarineGuarding",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 Thing_Remove(0)
		Stop

	Spawn:
		TNT1 A 0
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ChangeFLag("SOLID", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		TNT1 A 0 A_GiveInventory("TargetIsAMarine")
		MHML A 4 A_Look
		Goto FindPlayer

	ForgetTarget:
		TNT1 A 0
		TNT1 A 0 A_ClearTarget
		Goto Spawn

	ForgetActiveTarget:
		TNT1 A 0
		TNT1 A 0 A_StopSound(5)
		TNT1 A 0 A_PlaySound("CHAINSTO", 5)
		PL42 E 60 A_Look
		TNT1 A 0 A_ClearTarget
		Goto Spawn

	See:
		TNT1 A 0
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ChangeFLag("SOLID", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		MHML AAA 1 A_Chase

		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		MHML BBB 1 A_Chase
		TNT1 A 0 A_JumpIfInventory("evmarinenoway", 1, "CheckIfCanJumpSee")

		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		MHML CCC 1 A_Chase
		TNT1 A 0 A_CustomMissile("EvilMarineCheckFront", 28, 0, 0, 2, 0)

		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		MHML BBB 1 A_Chase
		TNT1 A 0 A_CustomMissile("EvilMarineCheckJump", 64, 0, 0, CMF_AIMDIRECTION, 45)

		TNT1 A 0 A_CheckSight("ForgetTarget")
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFLag("SOLID", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 0)

		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML AAA 1 A_Chase("","")
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBA 1 A_Chase("","")

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")

		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML CCC 1 A_Chase("","")
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBB 1 A_Chase("","")

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")

		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML AAA 1 A_Chase("","")
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBB 1 A_Chase("","")
		TNT1 A 0 A_JumpIfInventory("evmarinenoway", 1, "CheckIfCanJumpFollow")

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")

		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML CCC 1 A_Chase("","")
		TNT1 A 0 A_CustomMissile("EvilMarineCheckFront", 28, 0, 0, 2, 0)
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBB 1 A_Chase("","")
		TNT1 A 0 A_CustomMissile("EvilMarineCheckJump", 64, 0, 0, CMF_AIMDIRECTION, 45)

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		Loop

	CheckIfCanJumpSee:
		TNT1 A 0
		MHML D 2 A_FaceTarget
		TNT1 A 0 A_TakeInventory("evmarinenoway", 1)
		TNT1 A 0 A_JumpIfInventory("evmarinecanjump", 1, "Jump")
		Goto See

	CheckIfCanJumpFollow:
		TNT1 A 0
		MHML D 2 A_FaceTarget
		TNT1 A 0 A_TakeInventory("evmarinenoway", 1)
		TNT1 A 0 A_JumpIfInventory("evmarinecanjump", 1, "Jump")
		Goto FollowPlayer

	FindPlayer:
		TNT1 A 0
	    TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFLag("SOLID", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 0)
		MHML D 12 A_LookEx(0,0,0,0,360,"FollowPlayer")
		MHML AAA 1 A_Wander
		MHML BBB 1 A_Wander
		MHML CCC 1 A_Wander
		MHML BBB 1 A_Wander

	    TNT1 A 0 A_ChangeFlag("FRIENDLY", 1)
		TNT1 A 0 A_ChangeFLag("SOLID", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		MHML D 12 A_Look
		MHML AAA 1 A_Wander
		MHML BBB 1 A_Wander
		MHML CCC 1 A_Wander
		MHML BBB 1 A_Wander
		Loop

	FollowPlayer:
		TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML AAA 1 A_Chase("","")
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBA 1 A_Chase("","")

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")

		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML CCC 1 A_Chase("","")
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBB 1 A_Chase("","")

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")

		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML AAA 1 A_Chase("","")
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBB 1 A_Chase("","")
		TNT1 A 0 A_JumpIfInventory("evmarinenoway", 1, "CheckIfCanJumpFollow")

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")

		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML CCC 1 A_Chase("","")
		TNT1 A 0 A_CustomMissile("EvilMarineCheckFront", 28, 0, 0, 2, 0)
		TNT1 A 0 A_JumpIfCloser(256, "Waits")
		MHML BBB 1 A_Chase("","")
		TNT1 A 0 A_CustomMissile("EvilMarineCheckJump", 64, 0, 0, CMF_AIMDIRECTION, 45)

		TNT1 A 0 A_CheckSight("CheckIfPlayerSee")
		Goto FollowPlayer

	CheckIfPlayerSee:
		TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(256, 1)
		Goto Pathfind
		TNT1 AAA 0
		Goto FollowPlayer

	Pathfind:
		TNT1 A 0
		TNT1 A 0 A_JumpIFInTargetInventory("IsPLayer", 1, 1)
		Goto FindPlayer
		TNT1 AAA 0
		TNT1 A 0 A_SpawnItemEx ("Marine_HMLPathfinder",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		Stop

	Waits:
		MHML D 0
		MHML D 8 A_FaceTarget
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, 1)
		Goto ForgetTarget
		TNT1 A 0 A_Jump(32, "Waits2", "Waits3")
		MHML D 8 A_FaceTarget
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		MHML DD 16 A_Look
		TNT1 A 0 A_JumpIfHealthLower(110,"Heal")
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 0)
		TNT1 A 0 A_CheckSight("FollowPlayer")
		MHML D 8 A_LookEx(0,0,0,0,360,"FollowPlayer")
		Goto FindPlayer

	Waits2:
		MHML D 0
		TNT1 A 0 A_PlaySound("MRNWT", 2)
		MHML D 8 A_SetAngle(90 + angle)
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		MHML DD 16 A_Look
		TNT1 A 0 A_JumpIfHealthLower(110,"Heal")
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 0)
		TNT1 A 0 A_CheckSight("FollowPlayer")
		MHML D 8 A_LookEx(0,0,0,0,360,"FollowPlayer")
		Goto FindPlayer

	Waits3:
		MHML D 0
		TNT1 A 0 A_JumpIfInTargetInventory("Clip2", 30, 1)
		Goto GiveAmmo
		TNT1 A 0 A_PlaySound("MRNWC", 2)
		MHML D 8 A_SetAngle(-90 + angle)
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 1)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 1)
		MHML DD 16 A_Look
		TNT1 A 0 A_JumpIfHealthLower(110,"Heal")
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 0)
		TNT1 A 0 A_CheckSight("FollowPlayer")
		MHML D 8 A_LookEx(0,0,0,0,360,"FollowPlayer")
		Goto FindPlayer

	Heal:
		TNT1 A 0
		TNT1 A 0 HealThing(1)
		TNT1 A 0 A_CustomMissile ("OrderTitle4", 50, 0, 0, 2, 90)
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEMORE", 0)
		TNT1 A 0 A_ChangeFlag("MISSILEEVENMORE", 0)
		MHML D 8 A_LookEx(0,0,0,0,360,"FollowPlayer")
		Goto FindPlayer

	GiveAmmo:
		TNT1 A 0
		MHML D 10 A_FaceTarget
		TNT1 A 0 A_PlaySound("MRNGI1")
		MHML D 15 A_FaceTarget
		PLA1 H 1 A_FaceTarget
		PLA1 E 4 A_SpawnItemEx("Clip2Spawner",16,0,32,5)
		PLA1 H 1 A_FaceTarget
		MHML D 6 A_FaceTarget
		Goto Waits

	Missile:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsACyberdemon", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMastermind", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsABaronOfHell", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMancubus", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_PlaySound("MRNAT", 2)

		TNT1 A 0 A_Jump(128, "MissileLeft", "MissileRight")
		TNT1 A 0 A_JumpIfCloser(256,"MissileClose")
		TNT1 A 0 A_JumpIfCloser(1024,"MissileMid")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileMid:
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileClose:
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsACyberdemon", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMastermind", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsABaronOfHell", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMancubus", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_Jump(128, "MissileCloseLeft", "MissileCloseRight")
		PL42 E 1 A_FaceTarget
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		TNT1 A 0 A_MonsterRefire(0,"ForgetActiveTarget")
		Goto MissileClose

	MissileLeft:
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfCloser(256,"MissileCloseLeft")
		TNT1 A 0 A_JumpIfCloser(1024,"MissileMidLeft")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileMidLeft:
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileCloseLeft:
		PL42 E 1 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		TNT1 A 0 A_MonsterRefire(0,"ForgetActiveTarget")
		Goto MissileClose

	MissileRight:
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfCloser(256,"MissileCloseRight")
		TNT1 A 0 A_JumpIfCloser(1024,"MissileMidRight")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileMidRight:
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileCloseRight:
		PL42 E 1 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		TNT1 A 0 A_MonsterRefire(0,"ForgetActiveTarget")
		Goto MissileClose

	CheckRetreat:
		TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(256, "Retreat")
		TNT1 A 0 A_Jump(255, "MissileRight", "MissileLeft")
		Goto MissileRight

	Retreat:
		TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(256,"RetreatClose")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		Goto Pain.Avoid

	RetreatClose:
		PL42 E 4 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		PL42 E 3 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		PL42 E 2 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		PL42 E 1 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		Goto Pain.Avoid

	Melee:
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsACyberdemon", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMastermind", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsABaronOfHell", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMancubus", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "FollowPlayer")
		TNT1 A 0 A_PlaySound("MRNAT", 2)

		MHML D 3 A_FaceTarget
		PKIK AB 3 A_FastChase
		PKIK C 3 A_CustomMissile("MarineKick",32,0,0,0)
		PKIK B 3 A_FastChase
		MHML D 3 A_FaceTarget
		Goto See

	Jump:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("evmarinecanjump", 1)
		TNT1 A 0 ThrustThingZ(0, 32, 0, 1)
		TNT1 A 0 A_Recoil(-6)
		MHML J 3
		TNT1 A 0 A_CheckSight("WaitforLand")
		MHML J 1
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "WaitForLand")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "WaitForLand")
		TNT1 A 0 A_JumpIfTargetInLOS(1)
		Goto FollowPlayer
		TNT1 AAA 0
		TNT1 A 0 A_JumpIfCloser(128, "JumpKick")
		Goto Missile

	WaitforLand:
		TNT1 A 0
		MHML JJJJJJJJJJJ 3 A_Checkfloor("See")
		Goto See

	JumpBack:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("evmarinecanjump", 1)
		TNT1 A 0 ThrustThingZ(0, 32, 0, 1)
		TNT1 A 0 A_Recoil(6)
		MHML J 3
		TNT1 A 0 A_CheckSight("WaitforLand")
		MHML J 1
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "WaitForLand")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "WaitForLand")
		TNT1 A 0 A_JumpIfTargetInLOS(1)
		Goto WaitForLand
		TNT1 AAA 0
		TNT1 A 0 A_JumpIfCloser(128, "JumpKick")
		Goto WaitForLand

	Pain:
	    MHML E 3
		TNT1 A 0 A_Jump(128,"Pain.Avoid")
		MHML E 3 A_Pain
		Goto FollowPlayer

	Pain.Kick:
	Pain.ExtremePunches:
		MHML E 3 A_Pain
		Goto See

	Pain.Avoid:
		TNT1 A 0
		TNT1 A 0 A_Jump(192, "RollLeft", "RollRight")
		Goto JumpBack

	RollLeft:
		TNT1 A 0
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 10, 0, 0)
		PROL EDCBA 3
		Goto See

	RollRight:
		TNT1 A 0
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 10, 0, 0)
		PROL ABCDE 3
		Goto See

	Death:
	Death.Bullet:
		TNT1 A 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		PLAY H 10 A_PlayerScream

		PLAY I 10 A_NoBlocking
		PLAY J 10
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
		PLAY KLM 10
		TNT1 A 0 A_SpawnItem ("MediumBloodSpot")
		PLAY N -1
		Stop

    Death.Eat:
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 A 0 A_GiveToTarget("EatMe",1)
		TNT1 A 0 A_CustomMissile ("XDeath1", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath4", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        XPL1 A 10 A_XScream
        XPL1 B 20 A_NoBlocking
        XPL1 CDE 10
		TNT1 A 0 A_SpawnItem ("MediumBloodSpot")
        XPL1 E -1
        Stop

    Death.Cut:
	Death.Saw:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 A 0 A_CustomMissile ("XDeath1", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath2", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath3", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath4", 1, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("RipGuts", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("XDeathHalfMarine", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 A 10 A_XScream
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 B 20 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 C 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 DE 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem ("MediumBloodSpot")
        XPL2 E -1
        Stop

    Death.Slime:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 A 0 A_PlaySound("BIGSCREA")
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        PMET ABCDEFGHI 10 A_CustomMissile ("PlasmaSmoke", 25, 0, random (0, 180), 2, random (0, 180))
        PMET JJJKKKLLL 3 A_CustomMissile ("PlasmaSmoke", 25, 0, random (0, 180), 2, random (0, 180))
        NULL A 0 A_NoBlocking
        PMET M -1
        Stop

    Death.Minigun:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 A 0 A_Jump (128, 3)
        Goto Death
        TNT1 AAA 0
		TNT1 A 0 A_CustomMissile ("XDeath1", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath2", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath3", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath4", 1, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("RipGuts", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("XDeathHalfMarine", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 A 10 A_XScream
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 B 20 A_NoBlocking
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 C 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 AA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL2 DE 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem ("MediumBloodSpot")
        XPL2 E -1
        Stop

    Death.Rip:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 AAAAAAAAAAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL3 A 10 A_XScream
        TNT1 AAAAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL3 B 20 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        TNT1 A 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL3 C 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL3 D 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL3 E 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL3 F 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL3 F 10 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem ("MediumBloodSpot")
        XPL3 F -1
        Stop
	Death.Massacre:
	Death.Explosive:
	XDeath:
		TNT1 A 0 ThrustThingZ(0,60,0,1)
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 A 0 A_CustomMissile ("MarineXDeath", 0, 0, random (0, 360), 2, random (0, 160))
		PPOD A 0 A_SpawnItemEx("BasicMarineGib1", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
		PPOD A 0 A_SpawnItemEx("BasicMarineGib2", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
		PPOD A 0 A_SpawnItemEx("BasicMarineGib3", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
		PPOD A 0 A_SpawnItemEx("BasicMarineGib4", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
        MHEA A 7 A_XScream
        MHEA B 7 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        MHEA CD 7
        MHEA E -1
		Stop

	 Crush:
	 Death.Stomp:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
	    TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail8", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAAAA 0 bright A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
		TNT1 AAAAAA 0 bright A_CustomMissile ("XDeath1", 5, 0, random (0, 360), 2, random (30, 180))
		TNT1 AA 0 bright A_CustomMissile ("XDeath2", 55, 0, random (0, 360), 2, random (30, 180))
		TNT1 AA 0 bright A_CustomMissile ("XDeath3", 55, 0, random (0, 360), 2, random (30, 180))
		TNT1 A 0 A_SpawnItem ("GrowingBloodPool")
		TNT1 A 0 A_SpawnItem ("CrushedRemains")
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
		TNT1 A 1
		TNT1 A 1 A_XScream
		TNT1 A 1 A_NoBlocking
		Stop

	Death.SuperPunch:
	Death.SSG:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
	    MHML O 2 A_FaceTarget
        TNT1 AAAA 0 A_CustomMissile ("XDeath1", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 AAAA 0 A_CustomMissile ("XDeath2", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 AAAA 0 A_CustomMissile ("XDeath3", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodFaster", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 AAAA 0 A_CustomMissile ("SuperWallRedBlood", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 AAAA 0 A_CustomMissile ("SuperWallRedBlood", 46, 0, random (170, 190), 2, random (0, 40))
		TNT1 A 0 A_CustomMissile ("XDeathArm1", 32, 0, random (170, 190), 2, random (0, 40))
        TNT1 A 0 A_XScream
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        MHML OPQRSTU 8
		TNT1 A 0 A_SpawnItem ("MediumBloodSpot")
        MHML U -1
        Stop

    Death.Rape:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 AAAAAAAAAAAAAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
		XPL4 A 20 A_XScream
		 TNT1 A 0 A_CustomMissile ("XDeath1", 1, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeath2", 1, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeath3", 1, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeath4", 1, 0, random (0, 360), 2, random (0, 160))
        TNT1 AAAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL4 B 20 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        TNT1 AAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL4 C 20
        TNT1 AAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL4 D 20
        TNT1 AAAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL4 E 20
        TNT1 AAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
        XPL4 F 20
        TNT1 AAAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem ("MediumBloodSpot")
        XPL4 F -1
        Stop

    Death.plasma:
        TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 A 0 A_XScream
        TNT1 A 0 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        TNT1 AAA 0 A_CustomMissile ("Brutal_FlyingBlood", 50, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedArm", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedLeg", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedSkull", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat2", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat3", 32, 0, random (0, 360), 2, random (0, 160))
		EXPL AAAAAA 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
        TNT1 A 1
        TNT1 A -1
        Stop

		Death.GreenFire:
        TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 A 0 A_XScream
        TNT1 A 0 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        TNT1 AAAA 0 A_CustomMissile ("Brutal_Blood", 30, 0, random (0, 360), 2, random (0, 160))

	    TNT1 A 0 A_CustomMissile ("XDeathBurnedArm", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedLeg", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedSkull", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat2", 32, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat3", 32, 0, random (0, 360), 2, random (0, 160))

		EXPL AAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("GreenFlameTrails", 50, 0, random (0, 360), 2, random (0, 360))
		XBRN AAAA 2 BRIGHT A_SpawnItem("GreenFlare",0,43)
        Stop

    Death.burn:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
	 PBUR A 1
      PBUR A 1 A_Scream
      PBUR A 1 A_NoBlocking
	  TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
       PBUR AAAABBBBCCCC 2 A_CustomMissile ("SmallFlameTrails", 32, 0, random (0, 180), 2, random (0, 180))
	    PBUR DDDDEEEE 2 A_CustomMissile ("SmallFlameTrails", 16, 0, random (0, 180), 2, random (0, 180))
        PBUR EEEEE 4 A_CustomMissile ("SmallFlameTrails", 8, 0, random (0, 180), 2, random (0, 180))
		PBUR EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 6 A_CustomMissile ("PlasmaSmoke", 8, 0, random (0, 180), 2, random (0, 180))
        PBUR E -1
        Stop

    Death.Fire:
	Death.Flames:
	Death.Burn:
	TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
        TNT1 A 0 A_PlaySound("BIGSCREA")
      BURN W 6 A_Scream
      BURN X 6 A_NoBlocking
	  TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
       BUR2 ABCD 6 BRIGHT A_CustomMissile ("PlasmaSmoke", 8, 0, random (0, 180), 2, random (0, 180))
       BURN FGHIJKL 6 BRIGHT A_CustomMissile ("PlasmaSmoke", 8, 0, random (0, 180), 2, random (0, 180))
       BURN MNOPQRSTUV 6 BRIGHT A_CustomMissile ("PlasmaSmoke", 8, 0, random (0, 180), 2, random (0, 180))
        BURN VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 6 A_CustomMissile ("PlasmaSmoke", 8, 0, random (0, 180), 2, random (0, 180))
        BURN V -1
      Stop

	  Death.ExplosiveImpact:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		NULL A 0 ThrustThingZ(0,30,0,1)
		NULL AAAA 0 A_CustomMissile ("Brains1", 50, 0, random (0, 360), 2, random (0, 160))
		NULL A 0 A_CustomMissile ("Brains2", 50, 0, random (0, 360), 2, random (0, 160))
		NULL A 0 A_CustomMissile ("Brains3", 50, 0, random (0, 360), 2, random (0, 160))
		NULL A 0 A_CustomMissile ("Brains4", 50, 0, random (0, 360), 2, random (0, 160))
		NULL A 0 A_CustomMissile ("Brains5", 50, 0, random (0, 360), 2, random (0, 160))
		NULL AAAA 0 A_CustomMissile ("SmallBrainPiece", random (45, 55), random (5, -5), random (170, 190), 2, random (0, 40))
		NULL AAAA 0 A_CustomMissile ("SmallBrainPiece", 50, 0, random (0, 360), 2, random (0, 160))
		NULL AA 0 A_CustomMissile ("SuperWallRedBlood", 46, 0, random (170, 190), 2, random (0, 40))
        NULL AAAAAAAAAAA 0 A_CustomMissile ("BrainBlood", 50, 0, random (0, 360), 2, random (0, 160))
	    NULL A 0 A_CustomMissile ("XDeathArm1", 35, 0, random (0, 360), 2, random (0, 160))
	    NULL A 0 A_CustomMissile ("XDeath3", 40, 0, random (0, 360), 2, random (0, 160))
	    PPOD A 0 A_SpawnItemEx("BasicMarineGib1", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
        NULL AAAA 0 A_CustomMissile ("XDeath1", 40, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
		NULL A 0 A_XScream
        XPL6 A 5
		NULL A 0 A_NoBlocking
        XPL6 BCDE 5
        XPL6 F -1
        Stop

    Crush:
        TNT1 A 0 A_PlaySound("misc/xdeath4")
        CRS1 A 5
        CRS1 A -1
        Stop

    Death.HKFT:
	Death.BHFT:
	Death.RVFT:
		TNT1 A 1 A_Scream
		TNT1 A 1 A_NoBlocking
        TNT1 A 0 A_GiveToTarget("Curbstomp_Marine",1)
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)	TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
		TNT1 A -1
        Stop

    Death.FatalityMarine:
		TNT1 A 1 A_PlayerScream
		TNT1 A 0 A_GiveToTarget("GoFatality", 1)
		TNT1 A 1 A_NoBlocking
		TNT1 A 0 ACS_NamedExecute("RemoveMarineHML")
        TNT1 A 0 A_GiveToTarget("Fatality_Marine",1)
		TNT1 A -1
        Stop
	}
}

ACTOR HMLMarineGuarding: Marine_HML
{
	Speed 0
	FastSpeed 0
	MaxStepHeight 0
	+MISSILEMORE
	+NODROPOFF
	+MISSILEEVENMORE
	States
	{
	Active:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile ("OrderTitle1", 50, 0, 0, 2, 90)
		TNT1 A 0 A_PlaySound("MarineFollow", 2)
		TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
		MHML A 30
		TNT1 A 0 A_SpawnItemEx ("Marine_HML",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 Thing_Remove(0)
		Stop

	Spawn:
		TNT1 A 0
		TNT1 A 0 A_ChangeFLag("FRIENDLY", 1)
		TNT1 A 0 A_ChangeFLag("SOLID", 0)
		TNT1 A 0 A_GiveInventory("TargetIsAMarine")
		MHML AAAAAAAA 4 A_Look
		TNT1 A 0 A_JumpIfHealthLower(110,"Heal")
		Loop

	ForgetTarget:
		TNT1 A 0
		TNT1 A 0 A_ClearTarget
		Goto Spawn

	ForgetActiveTarget:
		TNT1 A 0
		TNT1 A 0 A_StopSound(5)
		TNT1 A 0 A_PlaySound("CHAINSTO", 5)
		PL42 E 60 A_Look
		TNT1 A 0 A_ClearTarget
		Goto Spawn

	Heal:
		TNT1 A 0
		TNT1 A 0 HealThing(1)
		TNT1 A 0 A_CustomMissile ("OrderTitle4", 50, 0, 0, 2, 90)
		Goto Spawn

	See:
		MHML DDDDDDDDDDDD 1 A_Chase
		TNT1 A 0 A_ClearTarget
		Goto Spawn

	Missile:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsACyberdemon", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMastermind", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsABaronOfHell", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMancubus", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "Spawn")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "Spawn")
		TNT1 A 0 A_PlaySound("MRNAT", 2)

		TNT1 A 0 A_Jump(128, "MissileLeft", "MissileRight")
		TNT1 A 0 A_JumpIfCloser(256,"MissileClose")
		TNT1 A 0 A_JumpIfCloser(1024,"MissileMid")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileMid:
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileClose:
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsACyberdemon", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMastermind", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsABaronOfHell", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMancubus", 1, "CheckRetreat")
		TNT1 A 0 A_Jump(128, "MissileCloseLeft", "MissileCloseRight")
		PL42 E 1 A_FaceTarget
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		TNT1 A 0 A_MonsterRefire(0,"ForgetActiveTarget")
		Goto MissileClose

	MissileLeft:
		TNT1 A 0 A_JumpIfCloser(256,"MissileCloseLeft")
		TNT1 A 0 A_JumpIfCloser(1024,"MissileMidLeft")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileMidLeft:
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileCloseLeft:
		PL42 E 1 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 3, 0, 0)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		TNT1 A 0 A_MonsterRefire(0,"ForgetActiveTarget")
		Goto MissileClose

	MissileRight:
		TNT1 A 0 A_JumpIfCloser(256,"MissileCloseRight")
		TNT1 A 0 A_JumpIfCloser(1024,"MissileMidRight")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, 16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile", 48, -16)
		MHML D 3 BRIGHT A_FaceTarget
		MHML A 6

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileMidRight:
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")
		Goto Missile

	MissileCloseRight:
		PL42 E 1 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 3, 0, 0)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		TNT1 A 0 A_MonsterRefire(0,"ForgetActiveTarget")
		Goto MissileClose

	CheckRetreat:
		TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(256, "Retreat")
		TNT1 A 0 A_Jump(255, "MissileRight", "MissileLeft")
		Goto MissileRight

	Retreat:
		TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(256,"RetreatClose")
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, 16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		TNT1 A 0 A_MonsterRefire(0,"ForgetTarget")

		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_PlaySound("RLANSHOT", 1)
		TNT1 A 0 A_CustomMissile("MarineMuzzle1", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		TNT1 A 0 A_CustomMissile("MarineSeekerMissile2", 48, -16)
		MHML D 2 BRIGHT A_FaceTarget
		MHML A 4

		Goto Pain.Avoid

	RetreatClose:
		PL42 E 4 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("Alerter",48)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		PL42 E 3 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		PL42 E 2 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		PL42 E 1 A_FaceTarget
		TNT1 A 0 A_Recoil(5)
		PL42 H 1 BRIGHT A_CustomMissile("MarineMuzzle1", 32)
		TNT1 A 0 A_AlertMonsters(0, AMF_TARGETEMITTER)
		TNT1 A 0 A_CustomMissile("DistantFireSoundMachinegun", 32, 0, 0, 1, 0)
		TNT1 A 0 A_PlaySound("CHGNSHOT", 5)
		TNT1 A 0 A_CustomMissile("MarineMinigunTracer", 48, 0, random(-2,2), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)

		Goto Pain.Avoid

	Melee:
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsACyberdemon", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMastermind", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsABaronOfHell", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMancubus", 1, "CheckRetreat")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "Spawn")
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "Spawn")
		TNT1 A 0 A_PlaySound("MRNAT", 2)

		MHML D 3 A_FaceTarget
		PKIK AB 3 A_FastChase
		PKIK C 3 A_CustomMissile("MarineKick",32,0,0,0)
		PKIK B 3 A_FastChase
		MHML D 3 A_FaceTarget
		Goto See

	WaitforLand:
		TNT1 A 0
		MHML JJJJJJJJJJJ 3 A_Checkfloor("See")
		Goto See

	JumpBack:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("evmarinecanjump", 1)
		TNT1 A 0 ThrustThingZ(0, 32, 0, 1)
		TNT1 A 0 A_Recoil(6)
		MHML J 3
		TNT1 A 0 A_CheckSight("WaitforLand")
		MHML J 1
		TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "WaitForLand")
		TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "WaitForLand")
		TNT1 A 0 A_JumpIfTargetInLOS(1)
		Goto WaitForLand
		TNT1 AAA 0
		TNT1 A 0 A_JumpIfCloser(128, "JumpKick")
		Goto WaitForLand

	JumpKick:
		TNT1 A 0
		PKIK ABC 2 A_Facetarget
		TNT1 A 0 A_Recoil(-6)
		AKIK A 2 A_CustomMissile("MarineAirKick",28,0,0,0)
		PKIK CBA 2 A_Facetarget
		Goto WaitforLand

	Pain:
	    MHML E 3
		TNT1 A 0 A_Jump(128,"Pain.Avoid")
		MHML E 3 A_Pain
		Goto See

	Pain.Kick:
	Pain.ExtremePunches:
		MHML E 3 A_Pain
		Goto See

	Pain.Avoid:
		TNT1 A 0
		TNT1 A 0 A_Jump(192, "RollLeft", "RollRight")
		Goto JumpBack

	RollLeft:
		TNT1 A 0
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+192, 10, 0, 0)
		PROL EDCBA 3
		Goto See

	RollRight:
		TNT1 A 0
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 ThrustThing(angle*256/360+64, 10, 0, 0)
		PROL ABCDE 3
		Goto See
	}
}

ACTOR Marine_HMLPathfinder
{
	Radius 16
	Height 56
	Speed 50
	PainChance 255
	Monster
	damagefactor "SpawnMarine", 8000.0
	-COUNTKILL
	+NODROPOFF
	+NOTARGET
	+THRUACTORS
	+MISSILEMORE
	+MISSILEEVENMORE
    +DONTSPLASH
	-SHOOTABLE
	-FRIENDLY
	+NOCLIP
	+LOOKALLAROUND
	+NOINFIGHTING
	+FIXMAPTHINGPOS
	States
	{
	Spawn:
		TNT1 A 0 A_GiveInventory("TargetIsAMarine", 1)
		TNT1 A 4 A_LookEx(0,0,0,0,360,"See")
		Loop

    See:
		TNT1 A 0 A_ChangeFlag("NOCLIP", 1)
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_Chase
		Goto Spawn

	Melee:
	Missile:
		TNT1 A 1 A_FaceTarget
		TNT1 A 0 A_ChangeFlag("NOCLIP", 0)
		TNT1 A 0 A_Recoil(4)
		TNT1 A 4 A_FaceTarget
		TNT1 A 0 A_JumpIf(((VelY == 0)&&(VelX == 0)), "CheckAgain")
	SpawnMarine:
		TNT1 A 0
		TNT1 A 2 A_NoBlocking
		TNT1 A 0 A_SpawnItemEx("Marine_HML",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItem("FriendlymarineTFog")
		Stop
	CheckAgain:
		TNT1 A 0
		TNT1 A 1 A_FaceTarget
		TNT1 A 0 A_JumpIf(((VelY == 0)&&(VelX == 0)), "See")
		Goto SpawnMarine
	}
}