Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (If you are a mapper reviewing this, certain codes that you can changed are wrapped in *'s)
- #include "zcommon.acs"
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * COOP Last Man Standing
- *
- * run this wad only in survival mode with maxlives 1
- * don't use Red Skull, it is used to help counting the players
- *
- * + - - - - - - - - - - - +
- * | start room | <--- START_ROOM_TAG
- * | |
- * + - - - - - - - - - -- + <--- Script Execute MAP_CONTROL_CYCLE
- * | crusher | <--- CRUSHER_TAG
- * + - - - - - - - - - -- +
- * | |
- * | main area o | <--- monster spawn point with spawn_tid
- * | |
- * | o | <--- monster spawn point with spawn_tid
- * + - - - - - - - - - -- +
- *
- *
- * _________________
- * < script by Krawa >
- * -----------------
- * \ ^__^
- * \ (@@)\_______
- * (__)\ )\/\
- * ||----w |
- * || ||
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- */
- // 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
- //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] = | For if you can't find certain things
- **********************************************************************
- {(In these brackets you can put what monsters you want to spawn
- in your map EG:) T_IMP, 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
- // This tells how many Archviles are allowed in the map
- ******************************************************************************
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement