Advertisement
EmZee712

im not gay

Feb 10th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1.  
  2. // defines for scripts
  3. #define SC_DEBUG 1
  4. #define SC_PREPARE_BATTLE 2
  5. #define SC_MAP_CONTROL_CYCLE 3
  6. #define SC_PLAYER_CHECK 4
  7. #define SC_DEATH 7
  8. #define SC_LAST_PLAYER 8
  9.  
  10. //timer
  11. #define SEC 35 // 35 tics = 1 second (don't change)
  12. #define MONSTER_SPAWN_TICS 10 // time between monsters spawn (in tics)
  13. #define PREPARE_TIME 60 // time before the monsters are counted
  14.  
  15. //tags
  16. #define MONSTER_TID 666 // TID for counting monsters
  17.  
  18.  
  19. #define MIN_MONSTERS 70 // minimum monsters
  20.  
  21.  
  22. // TIDs for the spawn points of the monsters
  23. #define MAX_SPAWN_TID 9
  24. int spawn_tid[MAX_SPAWN_TID] = {4, 5, 6, 7, 8, 9, 10, 11, 12};
  25.  
  26. // monster defines: http://zdoom.org/wiki/Doom_spawn_numbers
  27. #define MAX_MONSTER_ARRAY 25
  28. int monster[MAX_MONSTER_ARRAY] =
  29. {T_SHOTGUY, T_SHOTGUY, T_IMP, T_CACODEMON, T_IMP,
  30. T_ZOMBIE, T_IMP, T_IMP, T_DEMON, T_CACODEMON,
  31. T_CHAINGUY, T_DEMON};
  32.  
  33.  
  34. int numbers[10] =
  35. {"NUMB0", "NUMB1", "NUMB2", "NUMB3", "NUMB4",
  36. "NUMB5", "NUMB6", "NUMB7", "NUMB8", "NUMB9"};
  37.  
  38.  
  39.  
  40. int players;
  41. int monsters;
  42. bool prepare_done;
  43. bool map_control_active;
  44.  
  45. script SC_PREPARE_BATTLE (void)
  46. {
  47. ThingCount(0, MONSTER_TID);
  48. Delay(SEC*PREPARE_TIME);
  49. prepare_done = TRUE;
  50. }
  51.  
  52.  
  53. // spawns the monsters
  54. script SC_MAP_CONTROL_CYCLE (void)
  55. {
  56. int ran1;
  57. int ran2;
  58.  
  59. if (map_control_active)
  60. terminate;
  61. Print(s:"Welcome to Invasion!");
  62. Delay(SEC*3);
  63. Print(s:"To win you must be the last player alive");
  64. Delay(SEC*4);
  65. Print(s:"Good Luck!");
  66. Delay(SEC*2);
  67. Print(s:"Invasion begins in - 10");
  68. Delay(SEC);
  69. Print(s:"Invasion begins in - 9");
  70. Delay(SEC);
  71. Print(s:"Invasion begins in - 8");
  72. Delay(SEC);
  73. Print(s:"Invasion begins in - 7");
  74. Delay(SEC);
  75. Print(s:"Invasion begins in - 6");
  76. Delay(SEC);
  77. Print(s:"Invasion begins in - 5");
  78. Delay(SEC);
  79. Print(s:"Invasion begins in - 4");
  80. Delay(SEC);
  81. Print(s:"Invasion begins in - 3");
  82. Delay(SEC);
  83. Print(s:"Invasion begins in - 2");
  84. Delay(SEC);
  85. Print(s:"Invasion begins in - 1");
  86. Delay(SEC);
  87. LocalAmbientSound("lofight",128);
  88. Print(s:"Fight!");
  89.  
  90.  
  91. map_control_active = TRUE;
  92. ACS_Execute(SC_PREPARE_BATTLE, 0, 0, 0, 0);
  93.  
  94. while((Players > 1) || (prepare_done == false))
  95. {
  96. //print(s:"monsters left ", d:monsters); For debug purposes
  97. monsters = ThingCount(0, MONSTER_TID);
  98. if (monsters < MIN_MONSTERS)
  99. {
  100. ran1 = (Random(1, MAX_SPAWN_TID)-1); // 0..MAX_SPAWN_TID-1
  101. ran2 = (Random(1, MAX_MONSTER_ARRAY)-1); // 0..MAX_MONSTER_ARRAY-1
  102.  
  103. // only 2 Archie
  104. if ((monster[ran2] == T_VILE) && (ThingCount(T_VILE, 0) >= 2))
  105. Thing_SpawnFacing(spawn_tid[ran1], T_IMP, FALSE, MONSTER_TID);
  106. else //normal
  107. Thing_SpawnFacing(spawn_tid[ran1], monster[ran2], FALSE, MONSTER_TID);
  108.  
  109. }
  110. Delay(MONSTER_SPAWN_TICS);
  111. }
  112.  
  113. monsters = ThingCount(0, MONSTER_TID);
  114.  
  115. while (monsters>0)
  116. {
  117. monsters = ThingCount(0, MONSTER_TID);
  118. Delay(SEC);
  119. }
  120. Delay(2*SEC);
  121.  
  122. while (PlayerCount() < 1)
  123. {
  124. Delay(SEC); // if Player dies after last monster,
  125. } // survial mode will restart round.
  126.  
  127. Exit_Normal(0);
  128. }
  129.  
  130.  
  131.  
  132. // counts the players
  133. script SC_PLAYER_CHECK open
  134. {
  135. players = PlayerCount();
  136. Delay(SEC);
  137. Restart;
  138. }
  139.  
  140. // This tells the last player how many monsters are left
  141. script SC_LAST_PLAYER (void)
  142. {
  143. print(s:"monsters left ", d:monsters);
  144. }
  145.  
  146. // light colors
  147. script 15 open
  148. {
  149. Sector_setcolor (20, 65, 65, 255);
  150. }
  151.  
  152. script 16 open
  153. {
  154. Sector_setcolor (21, 235, 75, 85);
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement