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

script 100 open
{
	Waves	= 7;
	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

	GoalScript	= 102;	// Script that's run every time a goal is destroyed.

	// 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
	// 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.
	AddZone( 30, 31, 1 );

//	Monsters
//			wave,	   actor,	number to spawn
	WaveEnemy(	1,	"Zombieman",	12	);
	WaveEnemy(	1,	"Shotgunguy",	12	);
	WaveEnemy(	1,	"Catharsi",	8	);
	WaveEnemy(	1,	"SuicideBomber",	10	);
 	WaveEnemy(	1,	"BaronOfHell",	2	);

	WaveEnemy(	2,	"Demon",	8	);
	WaveEnemy(	2,	"DoomImp",	10	);
	WaveEnemy(	2,	"Revenant",	6	);
	WaveEnemy(	2,	"SuicideBomber",	20	);

	WaveEnemy(	3,	"Blooddemon",	10	);
	WaveEnemy(	3,	"HellKnight",	8	);
	WaveEnemy(	3,	"Catharsi",	16	);
	WaveEnemy(	3,	"Spectre",	10	);
  	WaveEnemy(3,	"Cybruiser",	2	);

	WaveEnemy(	4,	"RocketGuy",	20	);
	WaveEnemy(	4,	"SuicideBomber",	30	);
	WaveEnemy(	4,	"Arachnotron",	12	);
	WaveEnemy(	4,	"FusionSpider",	8	);

	WaveEnemy(	5,	"Fatso",	10	);
	WaveEnemy(	5,	"BloodDemon",	25	);
	WaveEnemy(	5,	"ArchonOfHell",	5	);
	WaveEnemy(	5,	"Shadow",	35	);

	WaveEnemy(	6,	"Wicked",	14	);
	WaveEnemy(	6,	"Revenant",	24	);
	WaveEnemy(	6,	"Hectebus",	5	);
	WaveEnemy(	6,	"Pyrodemon",	3	);

	WaveEnemy(	7,	"Guardian",	30	);
	WaveEnemy(	7,	"HellWarrior",	15	);
	WaveEnemy(	7,	"Terminator",	-3	);
	WaveEnemy(	7,	"PhaseImp",	40	);

//	Messages

//	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,	"Good going, marine. Keep\nan eye out for those\n\casuicide bombers."	);
	WaveMessage(	2,	0,	"Check the powerup pad for\na \chbackpack\cf, and the\nweapon pad for a \ciplasma\n\cirifle."	);

	WaveMessage(	3,	0,	"Okay, some \chblue armor\njust spawned."	);
	WaveMessage(	3,	0,	"\caBlood demons\cf, \cahell\n\caknights \cfand a \cacybruiser\nare on their way."	);

	WaveMessage(	4,	0,	"The monsters are getting\ntougher."	);
	WaveMessage(	4,	0,	"We're sending a \cichaingun.\nHave some \chhealth\cf, too."	);

	WaveMessage(	5,	0,	"Careful, now. \caMancubi \cfand\n\caarchons \cfare coming\nthrough the entrances."	);
	WaveMessage(	5,	0,	"Be sure to grab a\n\chtime freezer \cfand \cirailgun\nfrom the pads!"	);

	WaveMessage(	6,	0,	"It's about to get a lot\nharder. Hope you've\ndefended the \cjgoals \cfas\nbest you can."	);
	WaveMessage(	6,	0,	"\caHectebi \cfand \capyrodemons\nare approaching! Grab a\n\chmegasphere \cfand \cirepeater!"	);

	WaveMessage(	7,	0,	"The final wave lies\nahead. Grab everything\nyou can."	);
	WaveMessage(	7,	0,	"You're gonna have to hold\nback three \caterminators \cfand\na horde of other demons!\nIt's all up to you!"	);

	WaveMessage(	8,	0,	"Skillfully done, marine!\nThis sector is CLEARED!"	);
	WaveMessage(	8,	0,	"The \cjfinal tier \cfis now\navailable to you!"	);

//	Items and stuff

	WavePowerup(	2,	"Backpack",	1	);
	WavePowerup(	3,	"BlueArmor",	1	);
	WavePowerup(	4,	"Soulsphere",	1	);
	WavePowerup(	5,	"TimeFreezerPickup",	1	);
	WavePowerup(	5,	"BlueArmor",	1	);
	WavePowerup(	6,	"Megasphere",	1	);
	WavePowerup(	7,	"QuadDamagePowerup",	1	);

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

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

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

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

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

	WaveWeapon(	2,	"PlasmaRifle"	);
	WaveWeapon(	3,	"AutoShotgun"	);
	WaveWeapon(	4,	"Chaingun"	);
	WaveWeapon(	5,	"Railgun"	);
	WaveWeapon(	6,	"Repeater"	);
	WaveWeapon(	7,	"BFG9000"	);

//	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(	1,	BULLETS,	120	);
	WaveAmmo(	1,	SHELLS, 32	);

	WaveAmmo(	2,	BULLETS,	240	);
	WaveAmmo(	2,	SHELLS,	80	);
	WaveAmmo(	2,	CELLS,	40	);

	WaveAmmo(	3,	BULLETS,	280	);
	WaveAmmo(	3,	SHELLS,	120	);
	WaveAmmo(	3,	CELLS,	80	);

	WaveAmmo(	4,	BULLETS,	320	);
	WaveAmmo(	4,	SHELLS,	144	);
	WaveAmmo(	4,	CELLS,	144	);

	WaveAmmo(	5,	BULLETS,	360	);
	WaveAmmo(	5,	SHELLS,	300	);
	WaveAmmo(	5,	CELLS,	240	);

	WaveAmmo(	6,	BULLETS,	500	);
	WaveAmmo(	6,	SHELLS,	384	);
	WaveAmmo(	6,	CELLS,	480	);

	WaveAmmo(	7,	BULLETS,	600	);
	WaveAmmo(	7,	SHELLS,	384	);
	WaveAmmo(	7,	CELLS,	600	);

//	Spots
//	The tids of the mapspots at each of the spawners are given here.
	AddMedicSpot	( 100 );
	AddMedicSpot	( 41 );
	AddMedicSpot	( 42 );

	AddAmmoSpot	( 101 );
	AddAmmoSpot	( 43 );
	AddAmmoSpot	( 44 );

	AddPowerupSpot	( 102 );
	AddWeaponSpot	( 103 );
    
//	Time to do stuff

	ACS_ExecuteWait(S_GOAL_GAME,0,0);

//	The player has beaten the level!

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

script 101 (int wave)
{
	switch(wave)
	{
	case 8: // After Wave 7 - as wave 8 is about to start
		Floor_LowerByValue(3, 20, 120);
		AddZone( 32, 33, 16 );
		AddZone( 34, 35, 15 );
		break;
	}
}

// Activates whenever a goal (core) is destroyed
script 102 (int coresLeft)
{
	switch(coresLeft)
	{
	case 4:
		AddZone( 32, 33, 16 );
		break;
	case 3:
		AddZone( 34, 35, 15 );
		break;
	}
}