Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // defines for scripts
- #define SC_DEBUG 1
- #define SC_PREPARE_BATTLE 2
- #define SC_MAP_CONTROL_CYCLE 3
- #define SC_PLAYER_CHECK 4
- #define SC_DEATH 7
- #define SC_LAST_PLAYER 8
- //timer
- #define SEC 35 // 35 tics = 1 second (don't change)
- #define MONSTER_SPAWN_TICS 10 // time between monsters spawn (in tics)
- #define PREPARE_TIME 60 // time before the monsters are counted
- //tags
- #define MONSTER_TID 666 // TID for counting monsters
- #define MIN_MONSTERS 70 // minimum monsters
- // TIDs for the spawn points of the monsters
- #define MAX_SPAWN_TID 9
- int spawn_tid[MAX_SPAWN_TID] = {4, 5, 6, 7, 8, 9, 10, 11, 12};
- // monster defines: http://zdoom.org/wiki/Doom_spawn_numbers
- #define MAX_MONSTER_ARRAY 25
- int monster[MAX_MONSTER_ARRAY] =
- {T_SHOTGUY, T_SHOTGUY, T_IMP, T_CACODEMON, T_IMP,
- T_ZOMBIE, T_IMP, T_IMP, T_DEMON, T_CACODEMON,
- T_CHAINGUY, T_DEMON};
- int numbers[10] =
- {"NUMB0", "NUMB1", "NUMB2", "NUMB3", "NUMB4",
- "NUMB5", "NUMB6", "NUMB7", "NUMB8", "NUMB9"};
- int players;
- int monsters;
- bool prepare_done;
- bool map_control_active;
- script SC_PREPARE_BATTLE (void)
- {
- ThingCount(0, MONSTER_TID);
- Delay(SEC*PREPARE_TIME);
- prepare_done = TRUE;
- }
- // spawns the monsters
- script SC_MAP_CONTROL_CYCLE (void)
- {
- int ran1;
- int ran2;
- if (map_control_active)
- terminate;
- Print(s:"Welcome to Invasion!");
- Delay(SEC*3);
- Print(s:"To win you must be the last player alive");
- Delay(SEC*4);
- Print(s:"Good Luck!");
- Delay(SEC*2);
- Print(s:"Invasion begins in - 10");
- Delay(SEC);
- Print(s:"Invasion begins in - 9");
- Delay(SEC);
- Print(s:"Invasion begins in - 8");
- Delay(SEC);
- Print(s:"Invasion begins in - 7");
- Delay(SEC);
- Print(s:"Invasion begins in - 6");
- Delay(SEC);
- Print(s:"Invasion begins in - 5");
- Delay(SEC);
- Print(s:"Invasion begins in - 4");
- Delay(SEC);
- Print(s:"Invasion begins in - 3");
- Delay(SEC);
- Print(s:"Invasion begins in - 2");
- Delay(SEC);
- Print(s:"Invasion begins in - 1");
- Delay(SEC);
- LocalAmbientSound("lofight",128);
- Print(s:"Fight!");
- map_control_active = TRUE;
- ACS_Execute(SC_PREPARE_BATTLE, 0, 0, 0, 0);
- while((Players > 1) || (prepare_done == false))
- {
- //print(s:"monsters left ", d:monsters); For debug purposes
- monsters = ThingCount(0, MONSTER_TID);
- if (monsters < MIN_MONSTERS)
- {
- ran1 = (Random(1, MAX_SPAWN_TID)-1); // 0..MAX_SPAWN_TID-1
- ran2 = (Random(1, MAX_MONSTER_ARRAY)-1); // 0..MAX_MONSTER_ARRAY-1
- // only 2 Archie
- if ((monster[ran2] == T_VILE) && (ThingCount(T_VILE, 0) >= 2))
- Thing_SpawnFacing(spawn_tid[ran1], T_IMP, FALSE, MONSTER_TID);
- else //normal
- Thing_SpawnFacing(spawn_tid[ran1], monster[ran2], FALSE, MONSTER_TID);
- }
- Delay(MONSTER_SPAWN_TICS);
- }
- monsters = ThingCount(0, MONSTER_TID);
- while (monsters>0)
- {
- monsters = ThingCount(0, MONSTER_TID);
- Delay(SEC);
- }
- Delay(2*SEC);
- while (PlayerCount() < 1)
- {
- Delay(SEC); // if Player dies after last monster,
- } // survial mode will restart round.
- Exit_Normal(0);
- }
- // counts the players
- script SC_PLAYER_CHECK open
- {
- players = PlayerCount();
- Delay(SEC);
- Restart;
- }
- // This tells the last player how many monsters are left
- script SC_LAST_PLAYER (void)
- {
- print(s:"monsters left ", d:monsters);
- }
- // light colors
- script 15 open
- {
- Sector_setcolor (20, 65, 65, 255);
- }
- script 16 open
- {
- Sector_setcolor (21, 235, 75, 85);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement