
// ------------------------------------------------------------
//   Rifleman and derivatives
// ------------------------------------------------------------

ACTOR RiflemanBase
{
	Translation "112:120=152:159","121:127=9:12"
	Height 52
	Radius 16
	Health 180
	Speed 14
	maxdropoffheight 48
	maxstepheight 48
	mass 100
	MONSTER
	+FRIENDLY
	+PUSHABLE
	+MISSILEMORE
	+MISSILEEVENMORE
	+donthurtspecies
	Decal "BulletScratch"
	SeeSound "marine/sight"
	PainSound "marine/pain"
	DeathSound "marine/death"
	GibHealth 100
	PainChance 240
	AttackSound ""
	MeleeSound "weapons/smack"
	MeleeDamage 6
	DropItem ZM66GrenadeRifle
	DropItem Clip 256 12
	DropItem Clip 66 30
	DropItem HDPistolDrop 32
	Obituary "%o was shot up by a marine."
	HitObituary "%o violated a marine's personal space."
	States
	{
	Spawn:
		PLAY AAAABBB 4 A_Look
		PLAY E 0 HealThing (1)
		Loop
	See:
		TNT1 A 0 A_JumpIfHealthLower (20, 2)
		TNT1 A 0 A_Jump (256, 4)
		TNT1 A 0 A_ChangeFlag ("nopain", 1)
		TNT1 A 0 DamageThing (random(1,4)*5)
		TNT1 A 0 A_ChangeFlag ("nopain", 0)
		PLAY AABBCCDD 2 A_Chase
		PLAY E 0 A_SetSolid
		PLAY E 0 HealThing (1)
		Loop
	Missile:
		PLAY E 4 A_Jump (128, 1)
	Missile2:
		PLAY E 12 A_FaceTarget
		PLAY E 0 A_JumpIfCloser (600, "Rifle")
	Grenade:
		PLAY E 0 A_Jump (160, "Rifle")
		PLAY E 0 A_JumpIfCloser (760, 2)
		PLAY E 0 A_Jump (256, "Rifle")
		PLAY E 0 A_PlaySound ("weapons/grenadeshot")
		PLAY E 12 A_CustomMissile ("DelayedRocquette", 44, 0, 0, 0, 14)
		goto See
	Rifle:
		PLAY E 4 A_JumpIfCloser (600, "RifleCQB")
		PLAY E 0 A_Jump (256, "RifleSnipe")
	RifleSnipe:
		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (0.4, 1, 1, 10, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (24, "PostSnipe")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (1, 2, 1, 9, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (168, "PostSnipe")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (2, 2, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (96, "PostSnipe")
		TNT1 A 0 A_Jump (256, "PostSnipe")
	PostSnipe:
		PLAY E 6
		Goto See
	RifleCQB:
		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (1, 2, 1, 10, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (2, 3, 1, 9, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (32, "PostCQB")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (3, 4, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (96, "PostCQB")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (4, 5, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1
		TNT1 A 0 A_Jump (256, "PostCQB")

	PostCQB:
		PLAY E 0 A_Jump (96, 2)
		PLAY E 12 A_CPosRefire
		Goto Missile2
		PLAY E 6
		Goto See
	Melee:
		PLAY C 8 A_FaceTarget
		PLAY D 4
		PLAY E 4 A_MeleeAttack

		PLAY E 3 A_JumpIfCloser (64, 3)

		PLAY E 4 A_FaceTarget
		TNT1 A 0 A_Jump (256, "Missile2")

		PLAY A 4
		Goto See

	Pain:
		PLAY G 4
		PLAY G 4 A_Pain
		PLAY G 0 A_Jump (100, "See")
		PLAY AB 2 A_FaceTarget
		PLAY CD 3 A_FastChase
		PLAY G 0 A_CPosRefire
		TNT1 A 0 A_Jump (256, "Missile")
	Death:
		TNT1 A 0 A_ChangeFlag ("pushable", 0)
		PLAY H 5 A_SpawnItemEx ("tempshield", 0,0,0, velx,vely,velz, 0,40)
		PLAY I 5 A_Scream
		PLAY J 5 A_NoBlocking
		PLAY KLM 5
		TNT1 A 0 A_Jump (256, "Dead")
	//Dead:
		PLAY N -1
		Stop
	XDeath:
		PLAY O 5 A_ChangeFlag ("shootable", 0)
		PLAY O 0 A_SpawnItem ("MegaBloodSplatter", 1, 34, 0, 0)
		PLAY P 5 A_XScream
		PLAY P 0 A_SpawnItem ("MegaBloodSplatter", 1, 34, 0, 0)
		PLAY Q 5 A_NoBlocking
		PLAY Q 0 A_SpawnItem ("MegaBloodSplatter", 1, 34, 0, 0)
		PLAY RSTUV 5
		TNT1 A 0 A_Jump (256, "XDead")
	//XDead:
		PLAY W -1
		Stop
	Dead:
		PLAY N 0 A_SpawnItemEx ("DeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
	XDead:
		PLAY N 0 A_SpawnItemEx ("ReallyDeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
	//Raise:
		PLAY MLKJIH 4
		TNT1 A 0 A_ChangeFlag ("pushable", 1)
		Goto See
	}
}
actor BlackRifleman : RiflemanBase
{
	Translation "112:120=152:159","121:127=9:12", "48:79=66:79", "18:21=68:68", "213:213=66:66"
}
actor BrownRifleman : RiflemanBase
{
	Translation "112:120=152:159","121:127=9:12", "48:79=61:79", "18:21=63:63", "213:213=63:63"
}
actor WhiteRifleman : RiflemanBase{}
actor Rifleman : RandomSpawner
{
	+friendly
	height 56
	radius 16
	DropItem "BlackRifleman"
	DropItem "BrownRifleman"
	DropItem "WhiteRifleman"
}

ACTOR SWATBase : RiflemanBase
{
	Translation "112:113=92:98","114:120=99:111","121:127=5:8"
	Health 200
	Speed 16
	Decal "BulletScratch"
	+SHORTMISSILERANGE
	DropItem Hunter
	DropItem Shells 66 8
	DropItem HDPistolDrop 32
	States
	{
	Missile:
		PLAY E 10 A_FaceTarget
		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/hunter")
		PLAY F 1 BRIGHT

//		PLAY F 1 BRIGHT A_CustomBulletAttack (3, 3, 9, 5, "BulletPuffSmall")
		PLAY E 0 A_CustomBulletAttack (4, 4, 1, 0, "ShotGuyTarget",6)
		PLAY F 1 BRIGHT A_ChangeFlag ("shootable",0)
		TNT1 A 0 A_ChangeFlag ("shootable",1)

		PLAY F 2 BRIGHT A_SpawnItem ("DistantShotgun", 1, 1, 0, 0)
		PLAY E 12
		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/shotgr")
		Goto See
	Melee:
		PLAY D 6 A_FaceTarget
		PLAY D 4
		PLAY E 4 A_MeleeAttack

		PLAY E 3 A_JumpIfCloser (56, 2)

		PLAY E 3 A_FaceTarget
		Goto Missile+1

		PLAY A 3
		Goto See
	Pain:
		TNT1 A 0 A_JumpIfHealthLower (40, 3)
		PLAY G 3 A_ChangeFlag("NODROPOFF", 1)
		PLAY G 3 A_Pain
		PLAY AB 2 A_FaceTarget
		PLAY CDAB 3 A_FastChase
		PLAY G 0 A_CPosRefire
		Goto Missile
	}
}
actor BlackSWAT : SWATBase
{
	Translation "112:113=92:98","114:120=99:111","121:127=5:8", "48:79=66:79", "18:21=68:68", "213:213=66:66"
}
actor BrownSWAT : SWATBase
{
	Translation "112:113=92:98","114:120=99:111","121:127=5:8", "48:79=61:79", "18:21=63:63", "213:213=63:63"
}
actor WhiteSWAT : SWATBase{}
actor SWAT : Rifleman
{
	DropItem "BlackSWAT"
	DropItem "BrownSWAT"
	DropItem "WhiteSWAT"
}

actor RocketeerBase : RiflemanBase
{
	translation "112:115=128:139","116:119=144:151","120:127=236:239"
	health 180
	speed 12
	dropitem RocketLauncher
	dropitem RocketAmmo 96
	dropitem RocketAmmo 96
	DropItem HDPistolDrop 72
	meleedamage 6
	meleesound "weapons/smack"
	obituary "%o was fragged by a marine."
	States
	{
	See:
		TNT1 A 0 A_JumpIfHealthLower (20, 2)
		TNT1 A 0 A_Jump (256, 4)
		TNT1 A 0 A_ChangeFlag ("nopain", 1)
		TNT1 A 0 DamageThing (random(1,4)*5)
		TNT1 A 0 A_ChangeFlag ("nopain", 0)

		PLAY A 0 A_JumpIfCloser (64, 4)
		PLAY A 0 A_JumpIfCloser (172, 2)
		PLAY A 0 A_Jump (256, 2)
		PLAY A 0 A_ChangeFlag ("frightened", 1)
		goto See2
		PLAY A 0 A_ChangeFlag ("frightened", 0)
		goto See2
	See2:
		PLAY AABBCCDD 2 A_Chase
		PLAY D 0 HealThing (1)
		goto See
	Missile:
		PLAY A 0 A_JumpIfCloser (120, 3)
		PLAY E 12 A_FaceTarget
		PLAY F 12 BRIGHT A_CustomMissile ("Rocquette", 32, 0, 0)
		PLAY E 6 A_Recoil (4)
		goto See
	Melee:
		PLAY D 6 A_FaceTarget
		PLAY D 4
		PLAY E 4 A_MeleeAttack
		PLAY A 3
		goto See
	Pain:
		TNT1 A 0 A_JumpIfHealthLower (40, 3)
		PLAY G 3
		PLAY G 3 A_Pain
		PLAY AB 2 A_FaceTarget
		PLAY CD 3 A_FastChase
		Goto See
	}
}
actor BlackRocketeer : RocketeerBase
{
	Translation "112:115=128:139","116:119=144:151","120:127=236:239", "48:79=66:79", "18:21=68:68", "213:213=66:66"
}
actor BrownRocketeer : RocketeerBase
{
	Translation "112:115=128:139","116:119=144:151","120:127=236:239", "48:79=61:79", "18:21=63:63", "213:213=63:63"
}
actor WhiteRocketeer : RocketeerBase{}
actor Rocketeer : Rifleman
{
	DropItem "BlackRocketeer"
	DropItem "BrownRocketeer"
	DropItem "WhiteRocketeer"
}

ACTOR TangoBase : RiflemanBase
{
	-friendly
	-pushable
	translation "112:116=163:167","117:124=72:79","125:127=5:8"
	obituary "%o lost the war against terrorism."
	hitobituary "%o supports your war of terror."
	decal "BulletScratch"
	DropItem GrenadeRifle
	DropItem Clip 256 12
	DropItem Clip 66 30
	DropItem HDPistolDrop 32
	states
	{
	Raise:
		PLAY LKJIH 5
		TNT1 A 0 A_ChangeFlag ("pushable", 0)
		Goto See
	Dead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,28)
		PLAY N 0 A_SpawnItemEx ("DeadRifleman",0,0,0,velx,vely,velz,0,41)
		stop
		PLAY N -1
		Stop
	XDead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,28)
		PLAY N 0 A_SpawnItemEx ("ReallyDeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
		PLAY W -1
	}
}
actor BlackTango : TangoBase
{
	Translation "112:116=163:167","117:124=72:79","125:127=5:8", "48:79=66:79", "18:21=68:68", "213:213=66:66"
}
actor BrownTango : TangoBase
{
	Translation "112:116=163:167","117:124=72:79","125:127=5:8", "48:79=61:79", "18:21=63:63", "213:213=63:63"
}
actor WhiteTango : TangoBase{}
actor Tango : RandomSpawner 23005
{
	height 56
	radius 16
	DropItem "BlackTango"
	DropItem "BrownTango"
	DropItem "WhiteTango"
}

ACTOR ShotTangoBase : SWATBase
{
	-friendly
	-pushable
	translation "112:116=163:167","117:124=72:79","125:127=5:8"
	obituary "%o lost the war against terrorism."
	hitobituary "%o supports your war of terror."
	decal "BulletScratch"
	DropItem Hunter
	DropItem Shells 66 8
	DropItem HDPistolDrop 32
	states
	{
	Raise:
		PLAY LKJIH 5
		TNT1 A 0 A_ChangeFlag ("pushable", 0)
		Goto See
	Dead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,28)
		PLAY N 0 A_SpawnItemEx ("DeadRifleman",0,0,0,velx,vely,velz,0,41)
		stop
		PLAY N -1
		Stop
	XDead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,28)
		PLAY N 0 A_SpawnItemEx ("ReallyDeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
		PLAY W -1
		Stop
	}
}
actor BlackShotTango : ShotTangoBase
{
	Translation "112:116=163:167","117:124=72:79","125:127=5:8", "48:79=66:79", "18:21=68:68", "213:213=66:66"
}
actor BrownShotTango : ShotTangoBase
{
	Translation "112:116=163:167","117:124=72:79","125:127=5:8", "48:79=61:79", "18:21=63:63", "213:213=63:63"
}
actor WhiteShotTango : ShotTangoBase{}
actor ShotTango : Tango 23006
{
	DropItem "BlackShotTango"
	DropItem "BrownShotTango"
	DropItem "WhiteShotTango"
}

ACTOR RocketTangoBase : RocketeerBase
{
	-friendly
	-pushable
	translation "112:116=163:167","117:124=72:79","125:127=5:8"
	obituary "%o lost the war against terrorism."
	hitobituary "%o supports your war of terror."
	dropitem RocketLauncher
	dropitem RocketAmmo 96
	dropitem RocketAmmo 96
	DropItem HDPistolDrop 72
	states
	{
	Raise:
		PLAY LKJIH 5
		TNT1 A 0 A_ChangeFlag ("pushable", 0)
		Goto See
	Dead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,28)
		PLAY N 0 A_SpawnItemEx ("DeadRifleman",0,0,0,velx,vely,velz,0,41)
		stop
		PLAY N -1
		Stop
	XDead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,28)
		PLAY N 0 A_SpawnItemEx ("ReallyDeadRifleman",0,0,0,velx,vely,velz,0,41)
		stop
		PLAY W -1
		Stop
	}
}
actor BlackRocketTango : RocketTangoBase
{
	Translation "112:116=163:167","117:124=72:79","125:127=5:8", "48:79=66:79", "18:21=68:68", "213:213=66:66"
}
actor BrownRocketTango : RocketTangoBase
{
	Translation "112:116=163:167","117:124=72:79","125:127=5:8", "48:79=61:79", "18:21=63:63", "213:213=63:63"
}
actor WhiteRocketTango : RocketTangoBase{}
actor RocketTango : Tango 23007
{
	DropItem "BlackRocketTango"
	DropItem "BrownRocketTango"
	DropItem "WhiteRocketTango"
}



// ------------------------------------------------------------
//   Marine corpse used by player pawn
// ------------------------------------------------------------

actor DeadRifleman replaces DeadMarine
{
	translation "112:120=152:159","121:127=9:12"
	-solid
	+shootable
	+ismonster
	mass 100
	radius 16
	height 56
	health 1
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Die
		loop
	XDeath:
	Death:
		PLAY N 1 A_NoBlocking
		PLAY N -1
		stop
	Raise:
		TNT1 A 0 A_SetSolid
		PLAY MLKJH 5
		TNT1 A 0 A_UnsetSolid
		PLAY H 0 A_Jump (96, 1, 2)
		PLAY H 0 A_SpawnItemEx ("UndeadRifleman", 0, 0, 0, 0, 0, 0, 0, 49)
		stop
		PLAY H 0 A_SpawnItemEx ("RiflemanBase", 0, 0, 0, 0, 0, 0, 0, 49)
		stop
	}
}
actor ReallyDeadRifleman : DeadRifleman
{
	States
	{
	XDeath:
	Death:
		PLAY W 1 A_NoBlocking
		PLAY W -1
		stop
	Raise:
		TNT1 A 0 A_SetSolid
		TNT1 A 0 A_Jump (172, "RaiseZombie")
		PLAY WVUTSRQPO 3
		TNT1 A 0 A_UnsetSolid
		PLAY H 0 A_SpawnItemEx ("UndeadRifleman", 0, 0, 0, 0, 0, 0, 0, 49)
		stop
	RaiseZombie:
		POSS UTSRQPONM 3
		TNT1 A 0 A_UnsetSolid
		PLAY H 0 A_SpawnItemEx ("ZombieStormtrooper", 0, 0, 0, 0, 0, 0, 0, 48)
		stop
	}
}


// ------------------------------------------------------------
//   Undead marines
// ------------------------------------------------------------

actor UndeadRifleman : TangoBase
{
	Health 120
	SeeSound "grunt/sight"
	PainSound "grunt/pain"
	DeathSound "grunt/death"
	ActiveSound "grunt/active"
	Obituary "%o was shot up by an undead marine."
	HitObituary "%o was beat up by an undead marine."
	States
	{
	Missile:
		PLAY E 4 A_Jump (128, 1)
		PLAY E 4 A_Jump (128, 1)
		PLAY E 12 A_FaceTarget
		PLAY E 0 A_JumpIfCloser (500, "CQBBurst")
	SnipeBurst:
		PLAY E 6
		PLAY F 0 A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 bright A_CustomBulletAttack (2, 2, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_ChangeFlag ("frightened", 0)
		PLAY E 0 A_Jump (100, "PostSnipeBurst")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 0 bright A_CustomBulletAttack (2, 3, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (100, "PostSnipeBurst")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (3, 4, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (164, "PostSnipeBurst")

		goto AggroPost
	CQBBurst:
		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (3, 4, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_ChangeFlag ("frightened", 0)

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (4, 5, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (64, "PostCQBBurst")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (5, 6, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (96, "PostCQBBurst")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (6, 7, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (96, "PostCQBBurst")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (7, 8, 1, 8, "BulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (96, "PostCQBBurst")

		goto AggroPost
	PostSnipeBurst:
		PLAY E 12 A_Jump (60, "AggroPost")
		Goto See
	PostCQBBurst:
		PLAY E 6 A_Jump (80, "AggroPost")
		Goto See
	AggroPost:
		PLAY E 12 A_CPosRefire
		Goto Missile+1
	Dead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,11)
		PLAY N 0 A_SpawnItemEx ("ReDeadRifleman",0,0,0,velx,vely,velz,0,41)
		stop
		PLAY N -1
		Stop
	XDead:
		TNT1 A 0 A_GivetoTarget("HDKillCount",1)
		TNT1 A 0 ACS_ExecuteAlways(558,0,0,1,11)
		PLAY N 0 A_SpawnItemEx ("ReallyReDeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
	}
}
actor ReDeadRifleman : DeadRifleman
{
	States
	{
	Raise:
		TNT1 A 0 A_SetSolid
		PLAY MLKJH 5
		TNT1 A 0 A_Jump(80,"RaiseBotch")
		TNT1 A 0 A_UnsetSolid
		PLAY H 0 A_SpawnItemEx ("UndeadRifleman", 0, 0, 0, 0, 0, 0, 0, 49)
		stop
	RaiseBotch:
		PLAY O 5 A_ChangeFlag ("shootable", 0)
		PLAY O 0 A_SpawnItem ("MegaBloodSplatter", 1, 34, 0, 0)
		PLAY P 5 A_XScream
		PLAY P 0 A_SpawnItem ("MegaBloodSplatter", 1, 34, 0, 0)
		PLAY Q 5 A_NoBlocking
		PLAY Q 0 A_SpawnItem ("MegaBloodSplatter", 1, 34, 0, 0)
		PLAY RSTUV 5
		PLAY N 0 A_SpawnItemEx ("ReallyReDeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
	}
}
actor ReallyReDeadRifleman : ReallyDeadRifleman
{
	States
	{
	Raise:
		TNT1 A 0 A_SetSolid
		TNT1 A 0 A_Jump (216, "RaiseZombie")
		PLAY WVUTSRQPO 3
		TNT1 A 0 A_UnsetSolid
		PLAY H 0 A_SpawnItemEx ("UndeadRifleman", 0, 0, 0, 0, 0, 0, 0, 49)
		stop
	}
}


// ------------------------------------------------------------
//   Summoned marines - no friendly fire
// ------------------------------------------------------------

actor SquadRiflemanBase : RiflemanBase
{
	damagefactor "BFGBallAttack", 0
	maxdropoffheight 56
	maxstepheight 56
	+ghost
	States
	{
	Missile:
		PLAY E 4 A_Jump (128, 1)
	Missile2:
		PLAY E 12 A_FaceTarget
		PLAY E 0 A_JumpIfCloser (500, "Rifle")
	Grenade:
		PLAY E 0 A_Jump (160, "Rifle")
		PLAY E 0 A_JumpIfCloser (760, 2)
		PLAY E 0 A_Jump (256, "Rifle")
		PLAY E 0 A_PlaySound ("weapons/grenadeshot")
		PLAY E 12 A_CustomMissile ("SquadDelayedRocquette", 44, 0, 0, 0, 14)
		goto See
	Rifle:
		PLAY E 4 A_JumpIfCloser (600, "RifleCQB")
		PLAY E 0 A_Jump (256, "RifleSnipe")
	RifleSnipe:
		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (0.4, 1, 1, 10, "SquadBulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (24, "PostSnipe")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (1, 2, 1, 9, "SquadBulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (168, "PostSnipe")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (2, 2, 1, 8, "SquadBulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (96, "PostSnipe")

		TNT1 A 0 A_Jump (256, "PostSnipe")
	RifleCQB:
		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (1, 2, 1, 10, "SquadBulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (2, 3, 1, 9, "SquadBulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (32, "PostCQB")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (3, 4, 1, 8, "SquadBulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1 A_Jump (96, "PostCQB")

		PLAY F 0 BRIGHT A_PlayWeaponSound ("weapons/rifle")
		PLAY F 2 BRIGHT A_CustomBulletAttack (4, 5, 1, 8, "SquadBulletPuffBig")
		TNT1 A 0 A_SpawnItem ("DistantRifle", 1, 1, 0, 0)
		PLAY E 1
		TNT1 A 0 A_Jump (256, "PostCQB")
	PostCQB:
		PLAY E 0 A_Jump (96, 2)
		PLAY E 12 A_CPosRefire
		Goto Missile2
		PLAY E 6
		Goto See
	Melee:
		PLAY C 8 A_FaceTarget
		PLAY D 4
		PLAY E 4 A_MeleeAttack

		PLAY E 3 A_JumpIfCloser (64, 3)

		PLAY E 4 A_FaceTarget
		TNT1 A 0 A_Jump (256, "Missile2")

		PLAY A 4
		Goto See

	Pain:
		PLAY G 4
		PLAY G 4 A_Pain
		PLAY G 0 A_Jump (100, "See")
		PLAY AB 2 A_FaceTarget
		PLAY CD 3 A_FastChase
		PLAY G 0 A_CPosRefire
		TNT1 A 0 A_Jump (256, "Missile")
	Dead:
		PLAY N 0 A_SpawnItemEx ("DeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
	XDead:
		PLAY N 0 A_SpawnItemEx ("ReallyDeadRifleman",0,0,0,velx,vely,velz,0,41)
		Stop
	Raise:
		TNT1 A 0
		Stop
	}
}
actor BlackSquadRifleman : SquadRiflemanBase
{
	Translation "112:120=152:159","121:127=9:12", "48:79=66:79", "18:21=68:68", "213:213=66:66"
}
actor BrownSquadRifleman : SquadRiflemanBase
{
	Translation "112:120=152:159","121:127=9:12", "48:79=61:79", "18:21=63:63", "213:213=63:63"
}
actor WhiteSquadRifleman : SquadRiflemanBase{}
actor SquadRifleman : RandomSpawner
{
	+friendly
	height 56
	radius 16
	DropItem "BlackSquadRifleman"
	DropItem "BrownSquadRifleman"
	DropItem "WhiteSquadRifleman"
}
actor SquadBulletPuffBig : BulletPuffBig
{
	damagetype "BFGBallAttack"
}
actor SquadFragPuff : FragPuff
{
	damagetype "BFGBallAttack"
}
ACTOR SquadGrenadeRocquette : GrenadeRocquette
{
	damagetype "BFGBallAttack"
	states
	{
	Death:
	Explode:
		MISX A 0 bright A_NoGravity
		MISX AAAAAAAAAAAA 0 A_SpawnItemEx ("HugeWallChunk", 0, 0, 0, random(-6,6),random(-6,6),random(6,18),random(0,360),160)
		MISX A 2 bright A_Explode (random(120,180), random(140,200))
	Death1:
		MISL BBBBBBBBBBBBBBBBBBBBBBBBBBBBB 0 A_SpawnItemEx ("BigWallChunk", 0, 0, 0, random(-4,4),random(-4,4),random(4,18),random(0,360),160)
	Death2:
		MISX A 0 ThrustThingZ (0, random(4, 12), 0, 0)
		MISX AAA 0 A_SpawnItemEx ("HDSmoke", random(-6,6), random(-6,6), random(-3,12), 0,0,0, 0,160)
		MISX A 0 A_SetTranslucent (1, 1)
		MISX A 0 A_AlertMonsters
		MISL B 2 A_SpawnItemEx ("SquadFrags", 0,0,0, 0,0,0, 0,32)
		MISL B 0 A_SpawnItemEx ("DistantRocket", 0,0,0, 0,0,0, 0,32)
		MISL B 4 BRIGHT Radius_Quake (2, 21, 0, 3, 0)
		MISL BCCDDD 2 BRIGHT A_FadeOut (0.2)
		Stop
	}
}
ACTOR SquadDelayedRocquette : DelayedRocquette
{
	damagetype "BFGBallAttack"
	States
	{
	Spawn:
		ROCQ A 0
		ROCQ A 0 A_Pain
		ROCQ ABAB 1
		ROCQ B 0 A_SpawnItemEx("SquadGrenadeRocquette",0,0,0,velx,vely,velz,0,40,0)
		stop
	}
}
actor SquadFrags : Frags
{
	damagetype "BFGBallAttack"
	states
	{
	death:
		TNT1 A 0
		TNT1 A 0 A_CustomBulletAttack (360, 94, 30, random(1, 12), "SquadFragPuff")
		stop
	}
}
