#include "zcommon.acs"
#import "strnghld.acs"

//	STR11's script. Milestone gamemode.

script 100 open
{
	// Change these variables to suit your map, match the right tids, etc.
	Waves	= 10;
	HateEpicenter	= 996;

//	EventScript	= 101;	// Similar to old script 667, but a bit different
				// Called when new wave X is announced message disappears, as items
				// for wave X spawn.
				// First argument given to script is the integer X

	MileScript	= 102;	// Similar to EventScript, but called when a milestone is reached by the
				// monsters. A map can use both an EventScript and a MileScript together.

	ExitPos		= 0;	// Spawn position of player for next map.
				// When this map is over, Exit_Normal(ExitPos) will be called.

	// Prison Stuff - If you use the same prison from STR02, none of this will neeed changes
	PrisonSpot	= 678;	// There should be multiple teleport spots with this tid
				// (Not a series of tids as in older versions!)
				// Set to 0 (or don't set it at all as it is the default) if map doesn't use a prison
	PrisonExit	= 699;

	PrisonCamStart	= 691;	// This is the tid of the first camera for the jail. The next 5 tids should also be cameras.
				// These will be set as the cameras for the CT_1 through CT_6 textures.

	PrisonTeleporterLineId	= 99;

	PrisonTeleporterThrustAngle = 0;	// Angle the teleporter thrusts when it is off
	PrisonExitThrustAngle	= 128;	// Angle prison exit thrusts when there are players still in game

	TeleporterOnLight	= 99;	// This will be activated when prison teleporter is on
	TeleporterOffLight	= 98;	// This will be activated when prison teleporter is off

	// Corner A, corner b, first patrol node, milestone #
	// You define a zone by setting two map spots to form the opposite corners of a rectangle that will be
	// the zone that monsters spawn in. The difference in height between the mapspots will also be taken into
	// account to define the height of the rectangle (useful for flying enemies). The angle the monsters face
	// is the angle of the first mapspot given here.
	// Milestone # 0 is for the first set of zones. #1 will be used once the first milestone has been reached,
	// and so on.
	AddZoneMile(	7,	8,	13,	0	);
	AddZoneMile(	9,	10,	14,	1	);
	AddZoneMile(	11,	12,	17,	2	);
	AddZoneMile(	23,	24,	19,	3	);

//	Monsters
//			wave,	   actor,	number to spawn
	WaveEnemy(	1,	"Zombieman",	12	);
	WaveEnemy(	1,	 "ShotgunGuy",	16	);
	WaveEnemy(	1,	"DoomImp",	8	);

	WaveEnemy(	2,	"Demon",	6	);
	WaveEnemy(	2,	"ShotgunGuy",	10	);
	WaveEnemy(	2,	"DoomImp",	20	);

	WaveEnemy(	3,	"Spectre",	12	);
	WaveEnemy(	3,	"ShotgunGuy",	4	);
	WaveEnemy(	3,	"ChaingunGuy",	12	);
	WaveEnemy(	3,	"Catharsi",	6	);
	WaveEnemy(	3,	"DoomImp",	12	);

	WaveEnemy(	4,	"Spectre",	16	);
	WaveEnemy(	4,	"Demon",	12 );
	WaveEnemy(	4,	"Catharsi",	12	);
	WaveEnemy(	4,	"DoomImp",	16	);

	WaveEnemy(	5,	"SuicideBomber",	16	);
	WaveEnemy(	5,	"BloodDemon",	12	);
	WaveEnemy(	5,	"HellKnight",	4	);

	WaveEnemy(	6,	"BaronOfHell",	8	);
	WaveEnemy(	6,	"HellKnight",	8	);
	WaveEnemy(	6,	"EnhancedCaco",	6	);

	WaveEnemy(	7,	"CacoDemon",	16	);
	WaveEnemy(	7,	"EnhancedCaco",	10	);
	WaveEnemy(	7,	"PainElemental",	2	);

	WaveEnemy(	8,	"HellKnight",	24	);
	WaveEnemy(	8,	"BaronOfHell",	16	);
	WaveEnemy(	8,	"Cybruiser",	6	);

	WaveEnemy(	9,	"Fatso",	12	);
	WaveEnemy(	9,	"SuicideBomber",	32	);
	WaveEnemy(	9,	"BloodDemon",	28	);

	WaveEnemy(	10,	"BloodDemon",	28	);
	WaveEnemy(	10,	"CyberDemon",	3	);

//	Messages

	RadioName[0] =	RADIO_RANDOM;	// RADIO_RANDOM is default for all indexes, so this line isn't strictly needed
//	RadioName[1] =	RADIO_CLOUD;

//	First argument is ID. Positive values correspond to the beginning of that number wave. 0 is not usable.
//	Second argument tells who gives the message
//	Third argument is the message. Length per line shouldn't be more than 25 characters, use \n for newline!
	WaveMessage(	2,	0,	"Did you hold them behind\nthe first milestone?"	);
	WaveMessage(	2,	0,	"Ambush those bastards\nin \cjZone 3!"	);

	WaveMessage(	3,	0,	"That was a close call."	);
	WaveMessage(	3,	0,	"Don't let them reach the\nthe milestones."	);

	WaveMessage(	4,	0,	"Check back at the supply\nroom."	);
	WaveMessage(	4,	0,	"Some handy \chsupplies \cfare\nwaiting, and an\n\ciautoshotgun."	);

	WaveMessage(	5,	0,	"Some \ciland mines \cfshould\ngive you time to ease\ntheir numbers."	);
	WaveMessage(	5,	0,	"Stock up quickly, now.\n\caBombers \cfare charging your\nway."	);

	WaveMessage(	6,	0,	"\caHell nobles \cfare\napproaching."	);
	WaveMessage(	6,	0,	"But make sure to take out\nthe \caaerial units \cffirst."	);

	WaveMessage(	7,	0,	"You'll need some more\n\ciweapons \cfto take out the\n\cagas ball demons."	);
	WaveMessage(	7,	0,	"We've sent you a \cirocket\n\cilauncher."	);

	WaveMessage(	8,	0,	"Uh oh, \cacybruisers \cfare\napproaching."	);
	WaveMessage(	8,	0,	"They're slow, but durable\nand deadly. Grab a\n\cirailgun."	);

	WaveMessage(	9,	0,	"A \cistunner rifle \cfshould be\nof use against the\nbombers."	);
	WaveMessage(	9,	0,	"Hold on a little more,\nwe're almost through!"	);

	WaveMessage(	10,	0,	"They're sending their\nfinal wave through."	);
	WaveMessage(	10,	0,	"Get the \cirepeater, \cfyou'll\nneed it against the\n\cacyberdemons!"	);

	WaveMessage(	11,	0,	"Masterfully done, marine!\nThis sector is CLEARED!"	);
	WaveMessage(	11,	0,	"\cjTier three \cfis now\navailable to you!"	);

//	WaveMessageEnd(	11,	0	);

//	Items and stuff

	WavePowerup(	2,	"GreenArmor",	1	);
	WavePowerup(	3,	"Backpack",	1	);
	WavePowerup(	5,	"Backpack",	1	);
	WavePowerup(	6,	"BlueArmor",	1	);
	WavePowerup(	8,	"Soulsphere",	1	);
	WavePowerup(	10,	"Megasphere",	1	);

	WaveMedic(	1,	"Stimpack",	4	);
	WaveMedic(	2,	"Stimpack",	4	);
	WaveMedic(	3,	"Stimpack",	5	);
	WaveMedic(	4,	"Stimpack",	5	);
	WaveMedic(	5,	"Stimpack",	6	);
	WaveMedic(	6,	"Stimpack",	6	);

	WaveMedic(	7,	"Stimpack",	2	);
	WaveMedic(	7,	"MediKit",	2	);

	WaveMedic(	8,	"Stimpack",	2	);
	WaveMedic(	8,	"MediKit",	2	);

	WaveMedic(	9,	"Stimpack",	3	);
	WaveMedic(	9,	"MediKit",	2	);

	WaveMedic(	10,	"Stimpack",	3	);
	WaveMedic(	10,	"MediKit",	2	);

	WaveWeapon(	2,	"Chaingun"	);
	WaveWeapon(	3,	"SuperShotgun"	);
	WaveWeapon(	4,	"AutoShotgun"	);
	WaveWeapon(	5,	"LandMineLayer"	);

	WaveWeapon(	7,	"RocketLauncher"	);
	WaveWeapon(	8,	"RailGun"	);
	WaveWeapon(	9,	"StunnerRifle"	);
	WaveWeapon(	10,	"Repeater"	);

//	Ammo
//	The amount given here is the actual amount of ammo spawned. The script knows about all
//	of the ammo pickups and how much is in each, and correctly spawns the right types.
//	WaveAmmo(	2,	BULLETS,	50	);
//	WaveAmmo(	2,	SHELLS,	8	);
//	WaveAmmo(	2,	ROCKETS,	0	);
//	WaveAmmo(	2,	CELLS,	0	);
//	WaveAmmo(	2,	GAS,	0	);
//	WaveAmmo(	2,	MINES,	0	);

	WaveAmmo(	1,	BULLETS,	20	);

	WaveAmmo(	2,	BULLETS,	60	);
	WaveAmmo(	2,	SHELLS,	40	);

	WaveAmmo(	3,	BULLETS,	100	);
	WaveAmmo(	3,	SHELLS,	60	);

	WaveAmmo(	4,	BULLETS,	100	);
	WaveAmmo(	4,	SHELLS,	72	);

	WaveAmmo(	5,	BULLETS,	75	);
	WaveAmmo(	5,	SHELLS,	84	);
	WaveAmmo(	5,	ROCKETS,	5	);

	WaveAmmo(	6,	BULLETS,	100	);
	WaveAmmo(	6,	SHELLS,	80	);
	WaveAmmo(	6,	ROCKETS,	5	);
	WaveAmmo(	6,	CELLS,	60	);

	WaveAmmo(	7,	BULLETS,	120	);
	WaveAmmo(	7,	SHELLS,	80	);
	WaveAmmo(	7,	ROCKETS,	12	);
	WaveAmmo(	7,	CELLS,	100	);

	WaveAmmo(	8,	BULLETS,	120	);
	WaveAmmo(	8,	SHELLS,	100	);
	WaveAmmo(	8,	ROCKETS,	24	);
	WaveAmmo(	8,	CELLS,	120	);

	WaveAmmo(	9,	BULLETS,	140	);
	WaveAmmo(	9,	SHELLS,	100	);
	WaveAmmo(	9,	ROCKETS,	32	);
	WaveAmmo(	9,	CELLS,	200	);

	WaveAmmo(	10,	BULLETS,	140	);
	WaveAmmo(	10,	SHELLS,	150	);
	WaveAmmo(	10,	ROCKETS,	36	);
	WaveAmmo(	9,	CELLS,	120	);

//	Spots
//	The tids of the mapspots at each of the spawners are given here.
	AddMedicSpot	( 100 );
	AddAmmoSpot	( 101 );
	AddPowerupSpot	( 102 );
	AddWeaponSpot	( 103 );
 
//	Time to do stuff

	ACS_ExecuteWait(S_MILESTONE,0,0);	// Runs the main deadline script

//	The player has beaten the deadline mode!

	ACS_Execute(S_MISSION_COMPLETE,0,0);	// Says "Mission Complete", screen fades out, and Exit_Normal(0) is called
}

//	This script is called shortly before the wave starts, with the wave number passed to it.
script 101 (int wave)
{
	switch(wave)
	{
	}
}

//	This script is responsible for actions that happen after a milestone is breached. Case 1 is
//	what happens when the first milestone is breached, case 2 for the second and so on
script 102 (int mile)
{
	switch(mile)
	{
	case 1:
		RemoveWaveMessage(2);
		WaveMessage(	2,	0,	"Did you hold them behind\nthe first milestone?"	);
		WaveMessage(	2,	0,	"Ambush those bastards\nin the canyon!"	);

		RemoveWaveMessage(3);
		WaveMessage(	3,	0,	"That was a close call."	);
		WaveMessage(	3,	0,	"Don't let them reach the\nrest of the milestones."	);

		Door_Close(25, 40);
		break;
	case 2:
		RemoveWaveMessage(2);
		WaveMessage(	2,	0,	"Did you hold them behind\nthe first milestone?"	);
		WaveMessage(	2,	0,	"Make sure they don't get\nto \cjZone 1!"	);

		Door_Close(26, 40);
		break;
	case 3:
		RemoveWaveMessage(2);
		WaveMessage(	2,	0,	"Did you hold them behind\nthe first milestone?"	);
		WaveMessage(	2,	0,	"Double-time it marine!\nHold them away from the deadline!"	);

		RemoveWaveMessage(3);
		WaveMessage(	3,	0,	"You aren't doing too well."	);
		WaveMessage(	3,	0,	"Don't let them reach the\ndeadline!"	);

		Door_Close(27, 40);
		break;
	}
}
