
// *** MODIFIED BY CHEBMASTER
// I mark places modified by me with //***Che 


#include EDAYMARINES_MkII.txt

//#include EDAYMARINES_DEPRECATED.txt








//***Che replaced them all with my synth marines!
Actor Map21MarinesReplacer: Marine_Rifle_Guarding 4304 {} 
Actor Map21MarinesVariation1Replacer: Marine_Rifle_Guarding 4105 {} // helmetless -- not anymore
ACTOR Map21MarinesVariation2Replacer: Marine_Athena_Guarding 4106 {} // female -- can't tell now
ACTOR Map21MarinesVariation3Replacer: Marine_AfroGuy_Guarding 4107 {} // dark skinned
ACTOR StationaryMarineGuardingArea: Marine_Rifle_Guarding 4316 {}
ACTOR StationaryMarineGuardingArea2: Marine_Rifle_Guarding 4317 {} // helmetless -- not anymore
ACTOR StationaryMarineGuardingArea3: Marine_Athena_Guarding 4318 {} // female -- can't tell now
ACTOR StationaryMarineGuardingArea4: Marine_AfroGuy_Guarding 4319 {} // dark skinned 
Actor MarineGuarding: Marine_Rifle_Guarding 8992 {}

//***Che no slackers on my watch! These ones were doind nothing.
Actor MarineCrouchingReplacer: Marine_Rifle_Guarding 4795 {}



//***Che fixed his algorithms and switched him to use map scripts
// (i was too lazy to learn compiling scripts using acc at the time I fixed this,
//  was moving everything to map scripts compiled using Builder's built-in compiler)

//P.S. Changed him to a full NPC (mortal!)

Actor MarineOnEvacSite: Marine_Rifle 8993
{
	+NOPAIN
	States
	{
		Spawn:
			MWAV J 0 NODELAY A_SetUserVar("user_npc_type", 0)
			"----" A 0 A_SetUserVar("user_default_weapon", 4) // rifle
			"----" A 0 A_SetUserVar("user_melee_weapon", 1) // punch
			"----" A 0 A_SetUserVar("user_non_commandable", 1) // cannot be ordered to follow or stay
			// He is made dormant from the map editor,
			// 	a script activates him when a player steps close
			MWAV J 0 A_PlaySound("KYVO_Q_1", 1) // 15 seconds long
			MWAV J 0 ACS_NamedExecuteAlways("EdayTXT01Che")
			MWAV JKLM 8
			MWAV NMNMNM 35 // 6s
			MR7S ABCABCABC 35 // 9s
			Goto SetupDefaults
/*			
	he is now switched to the talkz state by the map script	
		Idle:	
			M A 1 ACS_NamedExecuteWithResult("FaceClosestPlayer")
			SGUA AAAAA 10 A_Look
			TNT1 A 0 A_JumpIfInventory("EdayToken01", 1, "Talkz")
			Loop
*/			
		Talkz:
			TNT1 A 0
			MWAV B 5
			MWAV B 1 ACS_NamedExecuteWithResult("FaceClosestPlayer")
			TNT1 A 0 A_CheckSight("Talkz") // keep idling until any player enters line of sight
			TNT1 A 0 A_JumpIf(!CallAcs("FBD_GetIsAnyPlayerAlive"), "Talkz")
			TNT1 A 0 A_PlaySound("KYVO_Q_2", 1)
			TNT1 A 0 ACS_NamedExecuteWithResult("EDAYTXT02Che")
			MWAV B 90
			Goto Idle
	}
}




ACTOR FriendlyTank 4305  

//***Che: this is tank turret, to be placed on top of tank body made of map geometry
//  used in maps 15 and 16 (was also used a lot in map 22 but I changed that one too much)

{
	Game Doom
	Monster
	+FLOORCLIP
	+FRIENDLY
	+MISSILEMORE
	+MISSILEEVENMORE
	+DONTHURTSPECIES
	+MTHRUSPECIES
	+NOBLOCKMONST
	+THRUSPECIES
	MaxTargetRange 99999
	Species "Marines"
	damagefactor "Taunt", 0.0	damagefactor "Head", 0.0	damagefactor "CancelTeleportFog", 0.0
	damagefactor "HelperMarineFatallity", 0.0	damagefactor "Leg", 0.0
	damagefactor "SpawnMarine", 0.0	damagefactor "TeleportRemover", 0.0
	DamageFactor "CauseObjectsToSplash", 0.0	damagefactor "GibRemoving", 0.0
	damagefactor "KillMe", 0.0	damagefactor "FriendBullet", 0.0
	damagefactor "kick", 0.0 damagefactor "Stomp", 0.0	
	
	
	Health 4000
	
	Radius 32
	Height 56
	Scale 1.5
	Mass 9999999999999
	Speed 0
	+NOPAIN
	+LOOKALLAROUND
	+NOBLOOD
	+DONTHURTSPECIES
	States
	{
		Spawn:
			TANK A 1 A_Look
			Goto See
		Spawn2:	
			TANK A 1 A_Look
			Goto See
		See:
			TNT1 A 0
			TANK AAAAAAAA 1 A_Chase
			TNT1 A 0 A_ClearTarget
			Goto Spawn2
		Missile:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "WrongTarget")
			TANK A 4 A_FaceTarget
			TNT1 A 0 A_PlaySound("TANKFI")
			TANK B 4 BRIGHT A_CustomMissile("FriendlyTankProjectile", 32, 0, 0, 1, random(-3, 3))
			TANK A 100
			TNT1 A 0 A_ClearTarget
			Goto See
		WrongTarget:
			TANK A 1
			TNT1 A 0 A_ClearTarget
			Goto See
		Death:
			TNT1 A 0 A_SpawnItem("SmokePillar")
			TNT1 A 0 A_SpawnItem("FirePitsOfHell")
			TNT1 A 0 A_Explode(500, 300)
			TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("BarrelExplosion",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("BarrelKaboom",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 AAAAAAA 0 A_CustomMissile ("ExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleSFX", 0, 0, random (0, 360), 2, random (0, 180))
			TNT1 AAAAAA 0 A_CustomMissile ("ExplosionParticleSFX", 0, 0, random (0, 360), 2, random (0, 180))
			TNT1 A 0 A_CustomMissile ("SFXBigExplosionFlamesSpawner", 10, 0, random (0, 360), 2, random (80, 90))
			TNT1 AAA 0 A_CustomMissile ("SFXBigExplosionFlamesSpawner2", 10, 0, random (0, 360), 2, random (0, 40))
			TNT1 AAAAAAAA 0 A_CustomMissile ("SFXBigExplosionFlamesNoSmoke", 10, 0, random (0, 360), 2, random (0, 40))
			
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece", 50, random (-15, 15))
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece2", 50, random (-35, 35))
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece3", 50, random (-45, 35))
			TNT1 AA 0 A_CustomMissile ("BarrelShrapnel1", 75, 0, random (0, 360), 2, random (40, 90))
			TNT1 AAA 0 A_CustomMissile ("BarrelShrapnel2", 65, 0, random (0, 360), 2, random (40, 90))
			TNT1 AAA 0 A_CustomMissile ("BarrelShrapnel3", 45, 0, random (0, 360), 2, random (40, 90))
			TNT1 AAA 0 A_CustomMissile ("BarrelShrapnel4", 45, 0, random (0, 360), 2, random (40, 90))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleSFX", 40, 0, random (0, 360), 2, random (40, 90))
			EXPL A 0 Radius_Quake (3, 48, 0, 30, 0)
			BEXP B 0 BRIGHT A_Scream
			TNT1 A 0 A_ALertMonsters
			TNT1 AAAAAAAAAAAAAA 0 A_CustomMissile ("SFXSpawnedExplosion1", 0, 0, random (0, 360), 2, random (0, 20))
			TNT1 A 6 A_CustomMissile ("SFXExplosionSpawner1", 0, 0, random (0, 360), 2, random (80, 90))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ShrapnelParticle2", 0, 0, random (0, 360), 2, random (5, 90))
			TNT1 A 1
			THRF A 0 A_SpawnItemEx ("Rocket",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 1
			THRF A 0 A_SpawnItemEx ("Detonator",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0
			THRF A 0 A_SpawnItemEx ("Detonator",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 1
			THRF A 0 A_SpawnItemEx ("Rocket",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 1
			THRF A 0 A_SpawnItemEx ("Detonator",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0
			THRF A 0 A_SpawnItemEx ("Detonator",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 AAAAAAAAAAAAAAA 8
			Stop
	}
}




Actor Map21MarineTracer: FastProjectile
{
	Projectile
	+RANDOMIZE
	+FORCEXYBILLBOARD
	+DONTSPLASH
    +BLOODSPLATTER 
    +NOEXTREMEDEATH
	damage 1
	radius 2
	height 2
	speed 200
	renderstyle ADD
	alpha 0.9
	scale .15
	species "Marines"
	+THRUSPECIES
		states
		{
		Spawn:
			TRAC A 1 BRIGHT
			Loop
		Death:
			TNT1 A 1 A_SpawnItem("HitPuff")
			Stop
		XDeath:
		TNT1 A 0
		Stop
	}
}


//***Che this is a fix for the MOST ANNOYING bug in EDAY 
// with friendly tanks killing you with their splash damage

Actor FriendlyBarrelExplosion: BarrelExplosion // a custom part of FriendlyTankProjectile's explosion
{
	+DONTHARMSPECIES
	+FRIENDLY
	-FORCERADIUSDMG
	Species "Marines"
	damagetype "FriendlyExplosion"
}

Actor FriendlyTankProjectile: FastProjectile //Map21MarineTracer
{
	Projectile
	+RANDOMIZE
	+FORCEXYBILLBOARD
	+DONTSPLASH
    +BLOODSPLATTER 
    +NOEXTREMEDEATH
	radius 2
	height 2
	renderstyle ADD
	species "Marines"	
	Scale 2.0
	Damage 100
	Speed 70
	Alpha 1.0
	//DamageType "ExplosiveImpact"
	damagetype "FriendlyExplosion"
	// damage 100, splash 500, second splash 160 (ignores boss immunity). Total 760 (260 against bosses)
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_SpawnItem("TankShellTrails")
			TNT1 A 1
			TNT1 A 0 A_SpawnItem("TankShellSmoke")
			TNT1 A 0 A_SpawnItem("TankShellMuzzle")
		Spawn2:
			TNT1 A 1 BRIGHT
			TNT1 A 0 A_SpawnItem("TankShellTrails")
			Loop
		XDeath:	
		Death:
			TNT1 A 0
			TNT1 AAAAAAAAAAAAAA 0 A_CustomMissile ("SFXSpawnedExplosion1", 0, 0, random (0, 360), 2, random (0, 30))
			TNT1 A 0 A_CustomMissile ("SFXExplosionSpawner2", 0, 0, random (0, 360), 2, random (80, 90))
			TNT1 A 0 A_Explode(500, 200, 0)
			TNT1 A 0 A_SpawnItem ("BigRicoChet", 0, -15)
			TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)

			//this one actually does 160 damage in a radius 200 that ignores bosses immunity to splash
			//had to redefine it as well!
			//TNT1 A 0 A_SpawnItemEx ("BarrelExplosion",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItemEx ("FriendlyBarrelExplosion",0,0,30,0,0,0,0,SXF_NOCHECKPOSITION,0)
			
			TNT1 A 0 A_SpawnItemEx ("BarrelKaboom",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 AAAAAAA 0 A_CustomMissile ("ExplosionFlames", 0, 0, random (0, 360), 2, random (0, 360))
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleSFX", 0, 0, random (0, 360), 2, random (0, 180))
			TNT1 AAAAAA 0 A_CustomMissile ("ExplosionParticleSFX", 0, 0, random (0, 360), 2, random (0, 180))
			EXPL A 0 Radius_Quake (4, 36, 0, 15, 0)
			BEXP B 0 BRIGHT A_Scream
			TNT1 A 0 A_ALertMonsters
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ShrapnelParticle2", 0, 0, random (0, 360), 2, random (5, 90))
			TNT1 A 0 A_PlaySound("FAREXPL", 3)
			EXP1 ABCDEFGHIJKLMN 3 BRIGHT
			Stop
	}
}



Actor TankShellTrails
{
Scale 1.0
+CLIENTSIDEONLY
+NOINTERACTION
Renderstyle Add
Alpha 1.0
states
	{
	Spawn:
	    TNSH A 1 BRIGHT
		TNSH AAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_FadeOut(0.12)
		Stop
	}
}


Actor TankShellSmoke
{
Scale 5.0
+CLIENTSIDEONLY
+NOINTERACTION
Renderstyle Translucent
Alpha 0.5
states
	{
	Spawn:
		PUF2 AABCDEFGHIJKLMNOPQRSTUVWXYZ 2
		PUF3 ABC 2
		Stop
	}
}


Actor TankShellMuzzle
{
Scale 1.0
+CLIENTSIDEONLY
+NOINTERACTION
Renderstyle Add
Alpha 1
states
	{
	Spawn:
		TANK C 4 BRIGHT
		TNT1 A 5
		TNT1 A 0 A_SpawnItem("TankShellSmoke")
		Stop
	}
}







Actor WoundedMarine: Box 1484
{

Scale 1.0
states
	{
	Spawn:
	    WCIV A 1
		WCIV A -1
		Stop
	}
}


Actor WoundedCivilian1: Box 1485
{

Scale 0.5
states
	{
	Spawn:
	    WCIV B 1
		WCIV B -1
		Stop
	}
}

Actor WoundedCivilian2: Box 1486
{

Scale 0.5
states
	{
	Spawn:
	    WCIV C 1
		WCIV C -1
		Stop
	}
}

Actor WoundedCivilian3: Box 1487
{

Scale 0.5
Height 50
states
	{
	Spawn:
	    WCIV D 1
		WCIV D -1
		Stop
	}
}


Actor WoundedCivilian4: Box 1488
{

Scale 0.5
Height 50
states
	{
	Spawn:
	    WCIV E 1
		WCIV E -1
		Stop
	}
}

Actor WoundedCivilian5: Box 1489
{

Scale 0.5
Height 50
states
	{
	Spawn:
	    WCIV F 1
		WCIV F -1
		Stop
	}
}



