Advertisement
Guest User

Untitled

a guest
Dec 18th, 2019
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.69 KB | None | 0 0
  1. #Include "Zcommon.acs"
  2.  
  3. //With the definitions, it is always best to add a number everytime you add something new in, I have had that glitch out before back when I was still
  4. //Learning, for example if you add in 1 barricade, you should add 1 number to DEF_COUNTBARRICADES
  5.  
  6.  
  7. //Game definitons
  8.  
  9. #define DEF_COUNT_BARRICADES 13
  10. #define DEF_COUNT_PERKS 5
  11. #define DEF_COUNT_WALLITEMS 10
  12. #define DEF_COUNT_DOORS 4
  13. #define DEF_COUNT_TRAPS 2
  14. #define DEF_COUNT_BOXITEMS 30
  15. #define DEF_COUNT_ZOMBIESPAWNS 14
  16. #define DEF_COUNT_DOGSPAWNS 1
  17.  
  18. //Spawn definitions
  19.  
  20. #define DEF_round_safetime 70
  21. #define DEF_round_intermission 200
  22. #define DEF_round_enddelay 35
  23. #define DEF_zombies_initialzombies 5
  24. #define DEF_zombies_increaseamount 5
  25. #define DEF_zombies_maxonmap 24
  26. #define DEF_zombies_initialhp 50
  27. #define DEF_zombies_increasehp 23
  28. #define DEF_zombies_initialspeed 1.8
  29. #define DEF_zombies_increasespeed 0.2
  30. #define DEF_zombies_spawnrate 28
  31. #define DEF_dogs_exist 0
  32. #define DEF_dogs_minround 4
  33. #define DEF_dogs_maxround 8
  34. #define DEF_dogs_initialdogs 1
  35. #define DEF_dogs_increaseamount 2
  36. #define DEF_dogs_maxonmap 4
  37. #define DEF_dogs_initialhp 50
  38. #define DEF_dogs_increasehp 5
  39. #define DEF_dogs_spawnrate 40
  40.  
  41. //First of all, most of these are controlled by alternate scripts, however you are able to tweak some of the stuff here pretty much without knowing a hell
  42. //Of a lot about programming and it's going to be explained to you if you don't get it let me (WhiteAce) know and I'll try my best to explain it a bit more
  43. //In detail
  44.  
  45. //Startup and game event variables, text that pops up during the start, you can disable them by just using replacing the text with ""
  46.  
  47. str GAME_startuptext[4] ={ "Berlin, Germany", //First line (By default) is used to specify a country location
  48. "Verruckt", //Second line (By default) is used to specify a specific location or map name
  49. "July 14th, 1946", //Third line (By default) as you can see is usually used to specify a date
  50. "Created by: TankDempsey" }; //Fourth line (By default) is used to specify who created the map
  51. int DEBUG_enabled =0;
  52. int DEBUG_round =19;
  53. int GAME_musicenabled=0; //(Debug purposes) When the variable reaches a certain limit (3 I think) music plays
  54. str GAME_songname="Music2"; //Choose which song plays with this, just make sure to define it in soundsequence
  55. int GAME_gameover=0; //(Debug purposes) Setting this to 1 will take away certain elements of the hud (Is used so that way the game over screen
  56. //Appears with no hud but rather just player score)
  57. int GAME_power=0; //Setting this to 1 will ofcourse allow you to purchase everything in the game that requires power pretty much without turning
  58. //the power on in game
  59. int GAME_powertid=27; //(Unused currently) Will be used to pop up text on the screen when the player is standing on a sector that turns on power
  60. int GAME_RandomNumber=2; //(Unused currently) Was used to pick what luck the player would have with dogs spawning so they would spawn different rounds
  61. //will put it back in later, just need to re-write it and make it randomize 2 = Dogs at round 6, 1 = dogs at round 5, etc
  62.  
  63. //Variables for rounds (mostly debug)
  64.  
  65. int GAME_round_number =1; //I think you know what this is, it's the round number the player starts on (Debug purposes)
  66. int GAME_round_doground =0; //So basically if you wanted to start a doground at the start, change the 0 to a 1 (Debug purposes)
  67. int GAME_round_dogs =1;
  68. int GAME_round_untildogs =DEF_dogs_minround; //External script controlled no need to worry about this one (Yet)
  69. int GAME_round_zombiesleft =DEF_zombies_initialzombies; //Or this
  70. int GAME_round_zombiescount =DEF_zombies_initialzombies; //Or this
  71. int GAME_round_dogscount =DEF_dogs_initialdogs; //Or this
  72. int GAME_round_tics =0; //Or this
  73. int GAME_round_secs =0; //(Hell on earth only) Controls the amount of seconds that have passed
  74. int GAME_round_mins =0; //(Hell on earth only) Controls the amount of minutes that have passed
  75. str GAME_round_startsound="game/ROUND"; //The sound that plays when a round starts
  76. str GAME_round_endsound="game/END"; //The sound that plays when a round ends
  77.  
  78. //Player variables
  79.  
  80. int PLAYER_heal_time =35; //The time it takes for the player to heal (pretty self explainatory)
  81. int PLAYER_money[4] ={ 500, 500, 500, 500 }; //Mainly for debugging purposes but you can change the amount of money the player starts with here
  82. int PLAYER_kills[4] ={ 0, 0, 0, 0 }; //Again, usually for debugging but this is the total amount of kills the player has
  83. int PLAYER_dead[4] ={ 0, 0, 0, 0 }; //If somehow the player is dead mark as 1 (Actually, might have to double check that one later
  84. //This slightly gives me a headache I don't know if it counts the amount of times died or if it
  85. //Simply tells the game, the player is dead)
  86. int PLAYER_downed[4] ={ 0, 0, 0, 0 }; //If somehow the player is dead, this is marked as 1 (Same as above though, headaches man)
  87.  
  88. //Purchasable weapon variables (Wallitems)
  89.  
  90. str WALLITEM_names[10] ={ "Gewehr 43",
  91. "Kar98k",
  92. "M1 Garand",
  93. "MP40",
  94. "Double Barrel",
  95. "Bouncing Betties",
  96. "M1897 Trench Gun",
  97. "STG-44",
  98. "Sawn-off Shotgun",
  99. "BAR" }; //The name of the weapon the player is purchasing, shows up on hud
  100.  
  101. //For the names of each weapon, refer to the PK3.
  102. str WALLITEM_actors[2][10] ={{ "Gewehr43",
  103. "Kar98k",
  104. "M1Garand",
  105. "MP40",
  106. "DoubleBarrel",
  107. "BouncingBettyAmmo",
  108. "TrenchGun",
  109. "STG-44",
  110. "SawnOffShotgun",
  111. "BAR" },
  112. { "Reserve_Gewehr",
  113. "Reserve_Kar",
  114. "Reserve_M1",
  115. "Reserve_MP40",
  116. "Reserve_Double",
  117. "BouncingBettyAmmo",
  118. "Reserve_Trenchgun",
  119. "Reserve_STG",
  120. "Reserve_SawnOff",
  121. "Reserve_BAR" }}; //These are the actors, it's what the player receives when purchasing them
  122. int WALLITEM_prices[10] ={ 600, 200, 600, 1000, 1200, 1000, 1500, 1200, 1200, 1200 }; //Pretty self explainatory, this is the prices for the weapons
  123. int WALLITEM_tids[10] ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; //The sector tag in which the player stands on in order to purchase the weapons
  124.  
  125. //Zombie/Dog spawns, spawn in via a map spot with following tags
  126.  
  127. int ZOMBIESPAWN_spawn[2] ={ "Zombie_Normal", //This makes it much easier for someone to replace the zombies with something else
  128. "Zombie_Sprinter" };
  129. int ZOMBIESPAWN_tids[14] ={ 1,2,3,4, 5,6, 7,8, 9,10, 11,12,13,14 };
  130. int DOGSPAWN_spawn[3] ={ "DogSpawn_", //DogSpawn_ is a special effect
  131. "Dog_Normal", //you can also replace the dogs
  132. "Dog_Flamer" };
  133. int DOGSPAWN_tids[1] ={};
  134.  
  135. //Zombie/Dog room spawn id's, these control which room they spawn in if it's open, 0 is starting room
  136.  
  137. int ZOMBIESPAWN_roomid[14] ={ 0,0,0,0, 1,1, 2,2, 3,3, 4, 5,5,5 };
  138. int DOGSPAWN_roomid[1] ={};
  139.  
  140. //Door variables
  141.  
  142. int DOOR_opened[4] ={0,0,0,0}; //0 means door not opened, 1 means door opened (Doesn't count first room because first is always open)
  143. int DOOR_tids[4] ={80,81,82,83}; //These are the sector tags where the player can purchase the door
  144. int DOOR_type[4] ={0,1,1,1}; //Affects the text appear on screen when player is in the sector
  145. //0 (By default): "hold USE to lower the gate"
  146. //1 (By default): "hold USE to open the door"
  147. //2 (By default): "hold USE to clear the debris" (Not yet implemented, remember to implement future NachtIntellect)
  148. int DOOR_prices[4] ={1000, 750, 1000, 1000}; //Controls how much money the player has to pay to open the door
  149. int DOOR_roomid[4][2] ={{0,1},
  150. {1,2},
  151. {2,3},
  152. {3,4}}; //Say for example you were in the start room, 0 is the number of the start room, the player buys the door to the east
  153. //You should put 0,1 1 being the second room now if the player was to buy another room after that in 1 (Not start)
  154. //Then put 1,2, likewise if there was a room to the west and the player was in the starting room, put 0,2 it is a
  155. //Little confusing at first, might need better explaination
  156. int DOOR_scriptno =200; //First door uses script 200 (By default) anything more add 1 onto the script number, try not to put traps and doors
  157. //With the same script number and leave room for other scripts
  158. int ROOM_opened[5] ={1,0,0,0,0}; //ROOM_opened always has 1 extra digit that's because it counts the start room, if the player is in the start room put
  159. //1 then 0 for every other room that isn't open yet
  160.  
  161. //Barricade variables, will eventually be adding in more variables for this to increase maxhealth and etc.
  162.  
  163. int BARRICADE_texture[7] ={ "NBAR1", "NBAR2", "NBAR3", "NBAR4", "NBAR5", "NBAR6", "" }; //Change the barricade textures here, the "" is when there is
  164. //no texture
  165. int BARRICADE_health[13] ={ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }; //This might be obvious but this is the amount of health the barricades have, for now you can only have a max of
  166. //6 but I am hoping to add more variables in order to change that
  167. int BARRICADE_lineid[13] ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; //This is the line identification for the barricades, if you don't put this on where your barricades are, it
  168. //The barricade won't show any damage and zombies can just waltz through, you can set this by using the
  169. //Line Identification action in the map editor you use (I use GZDoomBuilder and this is built on Hexen format)
  170. int BARRICADE_sectorid[13] ={ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132 }; //This sector tag goes on the side that you repair from
  171. int BARRICADE_attackid[13] ={ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172 }; //This sector tag goes on the side that the zombies attack from when at a barricade
  172. int BARRICADE_updatetime[13] ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; //(Debug purposes) Makes the barricades repair themselves
  173.  
  174. //Box control variables, a little complex
  175.  
  176. str BOX_items[30] ={ "Kar98k", //Self explanatory, these are the actors (Spawn names) that the player can receive from the box
  177. "Springfield",
  178. "M1A1Carbine",
  179. "M1Garand",
  180. "TrenchGun",
  181. "Gewehr43",
  182. "SawnOffShotgun",
  183. "MP40",
  184. "STG-44",
  185. "357Magnum",
  186. "Thompson",
  187. "BAR",
  188. "Colt45",
  189. "DualColt45s",
  190. "Panzerschreck",
  191. "MG42",
  192. "M2Flamethrower",
  193. "FG42",
  194. "PPSh41",
  195. "Browningm1919",
  196. "Luger",
  197. "Nailgun",
  198. "Thundergun",
  199. "Raygun",
  200. "Glock18",
  201. "Sterlingl2a3",
  202. "DoubleBarrel",
  203. "Nambu",
  204. "DP-28",
  205. "SpringfieldScoped" };
  206. str BOX_itemnames[30] ={ "Kar98k", //These are used for the text that pops up when the player is at the mystery box for example
  207. "Springfield", //"hold USE to pick up the M1A1 Carbine" and etc you could even make it say "hold use to pick up the
  208. "M1A1 Carbine", //stick" in place instead of M1A1 Carbine
  209. "M1 Garand",
  210. "M1897 Trench Gun",
  211. "Gewehr 43",
  212. "Sawn-Off Shotgun",
  213. "MP40",
  214. "StG-44",
  215. ".357 Magnum",
  216. "Thompson",
  217. "BAR",
  218. "Colt M1911",
  219. "Dual M1911s",
  220. "Panzerschreck",
  221. "MG42",
  222. "M2 Flamethrower",
  223. "FG42",
  224. "PPSh 41",
  225. "Browning M1919",
  226. "Luger",
  227. "Nailgun",
  228. "Thundergun",
  229. "Raygun",
  230. "Glock 18",
  231. "Sterling L2A3",
  232. "Double-Barrel shotgun",
  233. "Type 14 Nambu",
  234. "DP-28",
  235. "Springfield W/ Scope" };
  236. int BOX_active =0; //(Debug purposes) If the number is 1, the box is rolling
  237. int BOX_activator =0; //(Debug purposes) Basically, the TID of the player who rolled the box, activator is set via an
  238. //External script however, the TID for players is 1000 + 1 for each player
  239. int BOX_itemtaken =0; //(Debug purposes) Determines if someone has taken the item they rolled from the box, if so is set
  240. //To 1 then the mystery box returns back to it's normal position
  241. int BOX_tag =220; //The sector tag where the box can be activated
  242. int BOX_weaponstid =200; //The TID where the weapons will show up
  243. int BOX_spinsound ="game/MYSTERY"; //The sound that is played when the box is activated
  244. int BOX_currentitem =1; //The current item is set to one, so it always rolls 1 first then cycles through other things
  245.  
  246. //Perk variables
  247.  
  248. str PERK_names[5] ={ "Juggernog", //The names that pop up on the hud when you walk into the sector tag they are assigned to
  249. "Speed Cola",
  250. "Double Tap Root Beer",
  251. "Quick Revive",
  252. "Machete" };
  253. str PERK_actors[5] ={ "Jugg", //What actors (Rather perk bottles) the player receives when purchasing a perk
  254. "SpdCola",
  255. "DoubTap",
  256. "QckRvve",
  257. "Machete" };
  258. int PERK_prices[5] ={ 2500, //Self explainatory, the prices of each perk
  259. 3000,
  260. 2000,
  261. 500,
  262. 3000 };
  263. str PERK_Inventory[5] ={ "PowerJuggernog", //These check to see if the player has the perks in their inventory, if they do they won't be able to
  264. "SpeedCola", //Purchase the perks they already have
  265. "DoubleTap",
  266. "PowerQuickRevive",
  267. "Machete" };
  268. int PERK_tids[5] ={ 40, 41, 42, 43, 44 }; //The sector tags for each perk which are what the player stands on to buy the perk
  269.  
  270. //Trap variables
  271.  
  272. int TRAP_active[2] ={ 0, 0 }; //(Debug purposes) If a trap is active, is set to 1, external scripts make the traps reset after a while
  273. int TRAP_tids[2] ={ 47, 48 }; //The sector tags for each trap which allow the player to purchase a trap
  274. int TRAP_prices[2] ={ 1000, 2000 }; //Self explainatory, the prices for each trap
  275. int TRAP_type[2] ={ 0, 1 };
  276. int TRAP_scriptno =220; //Allows you to set the first script number for a trap, controlled by external scripts for each trap will add 1
  277. //Onto this number which means the script for the next trap will be 211, next 212 and so on (pretty much
  278. //Same with doors)
  279.  
  280. SCRIPT 1 OPEN
  281. {
  282. if(PlayerCount()==0) { delay(35); restart; }
  283.  
  284. int OPEN_zombie_speed;
  285. int OPEN_zombie_health;
  286. int OPEN_dog_health;
  287. int TEMP_round_delay;
  288. int TEMP_draw_delay;
  289.  
  290. OPEN_zombie_speed=DEF_zombies_initialspeed;
  291. OPEN_zombie_health=DEF_zombies_initialhp;
  292. OPEN_dog_health=DEF_dogs_initialhp;
  293. TEMP_round_delay=DEF_round_safetime;
  294. TEMP_draw_delay=204;
  295.  
  296. ACS_Execute(10,0,0,0,0); // Handle how the game begins
  297. ACS_Execute(12,0,0,0,0); // Control barricades
  298.  
  299. while(true)
  300. {
  301.  
  302. if(TEMP_draw_delay<1 && GAME_gameover==0)
  303. {
  304. SetFont("BIGFONT");
  305. SetHudSize(320,240,0);
  306. if(GameSkill()<4)
  307. {
  308. HudMessage(d:GAME_round_number;HUDMSG_PLAIN,1,CR_RED,32.0,216.0,0.1);
  309. }
  310. else
  311. {
  312. HudMessage(d:GAME_round_mins,s:":",d:GAME_round_secs;HUDMSG_PLAIN,1,CR_RED,32.0,216.0,0.1);
  313. }
  314. SetHudSize(0,0,0);
  315. }
  316. else
  317. {
  318. TEMP_draw_delay-=1;
  319. }
  320.  
  321.  
  322. /*
  323. ** Control spawning
  324. */
  325.  
  326. if(TEMP_round_delay>0) {TEMP_round_delay-=1;}
  327. else
  328. {
  329. if(!GAME_round_doground)
  330. {
  331. if(GAME_round_zombiesleft>0 && random(1,DEF_zombies_spawnrate)==1
  332. && (ThingCountName(ZOMBIESPAWN_spawn[0],0)+ThingCountName(ZOMBIESPAWN_spawn[1],0)<DEF_zombies_maxonmap))
  333. {
  334. int whileA;
  335. whileA=random(0,DEF_COUNT_ZOMBIESPAWNS);
  336. if(ROOM_opened[ZOMBIESPAWN_roomid[whileA]])
  337. {
  338. if(OPEN_zombie_speed==4.0) {SpawnSpot(ZOMBIESPAWN_spawn[1],ZOMBIESPAWN_tids[whileA],667,random(0,360));}
  339. else
  340. {
  341. if(OPEN_zombie_speed>=3.0)
  342. {
  343. if(random(0,2)==0) {SpawnSpot(ZOMBIESPAWN_spawn[1],ZOMBIESPAWN_tids[whileA],667,random(0,360));}
  344. else {SpawnSpot(ZOMBIESPAWN_spawn[0],ZOMBIESPAWN_tids[whileA],667,random(0,360));}
  345. }
  346. else
  347. {
  348. SpawnSpot(ZOMBIESPAWN_spawn[0],ZOMBIESPAWN_tids[whileA],667,random(0,360));
  349. }
  350. }
  351. //SpawnSpot("Zombie",ZOMBIESPAWN_tids[whileA],667,random(0,360));
  352. //print(s:"spawned zombie, spawn id ",d:whileA);
  353.  
  354. SetActorProperty(667,APROP_HEALTH,OPEN_zombie_health);
  355. //Thing_Hate(667,1000+random(1,PlayerCount()),3);
  356. if(OPEN_zombie_speed<4.0) {SetActorProperty(667,APROP_SPEED,random(DEF_zombies_initialspeed,OPEN_zombie_speed));}
  357. else {SetActorProperty(667,APROP_SPEED,OPEN_zombie_speed);}
  358. Thing_ChangeTID(667,1500+GAME_round_zombiesleft);
  359. GAME_round_zombiesleft-=1;
  360.  
  361. TEMP_round_delay=10;
  362. }
  363. }
  364. }
  365. else
  366. {
  367. if(GAME_round_zombiesleft>0 && random(1,DEF_dogs_spawnrate)==1
  368. && (ThingCountName(DOGSPAWN_spawn[1],0)+ThingCountName(DOGSPAWN_spawn[2],0)<DEF_dogs_maxonmap))
  369. {
  370. int whileB;
  371. whileB=random(0,DEF_COUNT_DOGSPAWNS);
  372. if(ROOM_opened[DOGSPAWN_roomid[whileB]])
  373. {
  374. SpawnSpot(DOGSPAWN_spawn[0],DOGSPAWN_tids[whileB],0,random(0,360));
  375. if(random(0,4)==0) { SpawnSpot(DOGSPAWN_spawn[2],DOGSPAWN_tids[whileB],667,random(0,360)); }
  376. else { SpawnSpot(DOGSPAWN_spawn[1],DOGSPAWN_tids[whileB],667,random(0,360)); }
  377.  
  378. SetActorProperty(667,APROP_HEALTH,OPEN_dog_health);
  379. //Thing_Hate(667,1000+random(1,PlayerCount()),3);
  380. Thing_ChangeTID(667,1500+GAME_round_zombiesleft);
  381. GAME_round_zombiesleft-=1;
  382.  
  383. TEMP_round_delay=10;
  384. }
  385. }
  386.  
  387. }
  388.  
  389. }
  390.  
  391. if(((ThingCountName(ZOMBIESPAWN_spawn[0],0)==0 && ThingCountName(ZOMBIESPAWN_spawn[1],0)==0)
  392. && (ThingCountName(DOGSPAWN_spawn[1],0)==0 && ThingCountName(DOGSPAWN_spawn[2],0)==0)
  393. && GAME_round_zombiesleft==0) && GameSkill()<4)
  394. {
  395. delay(35);
  396. if(!GAME_round_doground)
  397. {
  398. SetFont("SMALLFONT");
  399. SetHudSize(320,240,0);
  400. HudMessage(s:"round";HUDMSG_FADEINOUT,0,CR_WHITE,160.0,120.0,2.0,1.0,1.0);
  401. HudMessage(s:"complete";HUDMSG_FADEINOUT,0,CR_WHITE,160.0,128.0,2.0,1.0,1.0);
  402. SetHudSize(0,0,0);
  403. }
  404. for(int F1_dead=0;F1_dead<4;F1_dead++)
  405. {
  406. PLAYER_dead[F1_dead]=0;
  407. }
  408. ACS_ExecuteAlways(502,0,GAME_round_number*10,1000,0);
  409. ACS_ExecuteAlways(502,0,GAME_round_number*10,1001,0);
  410. ACS_ExecuteAlways(502,0,GAME_round_number*10,1002,0);
  411. ACS_ExecuteAlways(502,0,GAME_round_number*10,1003,0);
  412. ACS_ExecuteAlways(502,0,GAME_round_number*10,1004,0);
  413.  
  414. delay(DEF_round_enddelay);
  415. ACS_Execute(11,0,0,0,0);
  416. delay(DEF_round_intermission);
  417. if(OPEN_zombie_speed<4.0) {OPEN_zombie_speed+=DEF_zombies_increasespeed;}
  418. OPEN_zombie_health+=DEF_zombies_increasehp*PlayerCount();
  419. OPEN_dog_health+=DEF_dogs_increasehp*PlayerCount();
  420. TEMP_round_delay=DEF_round_safetime;
  421.  
  422. }
  423.  
  424. /*
  425. ** Control Hell On Earth mode
  426. */
  427.  
  428. if(GameSkill()==4 || GameSkill()==5)
  429. {
  430. GAME_round_tics+=1;
  431. if(GAME_round_tics>=35) {GAME_round_tics-=35; GAME_round_secs+=1;}
  432. if(GAME_round_secs>=60)
  433. {
  434. GAME_round_secs-=60;
  435. GAME_round_mins+=1;
  436. ACS_ExecuteAlways(502,0,GAME_round_number*5,1000,0);
  437. ACS_ExecuteAlways(502,0,GAME_round_number*5,1001,0);
  438. ACS_ExecuteAlways(502,0,GAME_round_number*5,1002,0);
  439. ACS_ExecuteAlways(502,0,GAME_round_number*5,1003,0);
  440. ACS_ExecuteAlways(502,0,GAME_round_number*5,1004,0);
  441. if(OPEN_zombie_speed<4.0) {OPEN_zombie_speed+=DEF_zombies_increasespeed*2;}
  442. OPEN_zombie_health+=(DEF_zombies_increasehp*PlayerCount())*2;
  443. for(int FOR1_a=0;FOR1_a<4;FOR1_a++) { GiveActorInventory(1000+FOR1_a,"GrenadeAmmo",1); GiveActorInventory(1000+FOR1_a,"Bouncingbettyammo",1); ACS_ExecuteAlways(502,0,GAME_round_mins*10,0,0); }
  444. }
  445.  
  446. if(GAME_round_zombiesleft<1) {GAME_round_zombiesleft+=256;}
  447. }
  448. delay(1);
  449. }
  450.  
  451. }
  452.  
  453. SCRIPT 2 ENTER
  454. {
  455. if(PLAYER_dead[PlayerNumber()]==1)
  456. {
  457. if(GetActorProperty(ActivatorTID(),APROP_HEALTH)>0)
  458. {
  459. SetHudSize(320,240,0);
  460. SetFont("SMALLFONT");
  461. HudMessage(s:"you are dead.";HUDMSG_FADEINOUT,0,CR_RED,160.0,16.1,5.0,0.1,1.0);
  462. HudMessage(s:"you cannot spawn\nuntil the round is over.";HUDMSG_FADEINOUT,0,CR_RED,160.0,32.1,4.0,1.0,1.0);
  463. SetHudSize(0,0,0);
  464. Thing_Damage2(ActivatorTID(),999,"AlreadyDead");
  465. }
  466. if((ThingCountName(ZOMBIESPAWN_spawn[0],0)==0 && ThingCountName(ZOMBIESPAWN_spawn[1],0)==0)
  467. && (ThingCountName(DOGSPAWN_spawn[1],0)==0 && ThingCountName(DOGSPAWN_spawn[2],0)==0)
  468. && GAME_round_zombiesleft==0)
  469. {
  470. SetFont("SMALLFONT");
  471. HudMessage(s:"Round is over.\nYou can now rejoin.";HUDMSG_PLAIN,21,CR_BLUE,1.5,0.2,2.0);
  472. }
  473. }
  474. int TEMP_player_voicetime;
  475. int TEMP_player_footsteptime;
  476. int TEMP_player_killstreak;
  477. int TEMP_player_input;
  478. int TEMP_player_buytime;
  479. int TEMP_player_health;
  480. int TEMP_player_checktime;
  481. int TEMP_player_revivetime;
  482. int TEMP_player_revivewho;
  483. int TEMP_for_mode;
  484.  
  485. TEMP_player_voicetime=100;
  486. TEMP_player_footsteptime=24;
  487. TEMP_player_killstreak=1;
  488. TEMP_player_buytime=0;
  489. TEMP_player_health=100;
  490. TEMP_player_checktime=0;
  491. TEMP_player_revivetime=0;
  492. TEMP_player_revivewho=-1;
  493. TEMP_for_mode=0;
  494.  
  495. ClearInventory();
  496. Thing_ChangeTID(0,1000+PlayerNumber());
  497. GiveInventory("Points",500);
  498. GiveInventory("Colt45",1);
  499. TakeInventory("Reserve_M1911",80);
  500. GiveInventory("Reserve_M1911",32);
  501. GiveInventory("GrenadeAmmo",2);
  502. GiveInventory("WeaponsInInventory",1);
  503.  
  504. while(true)
  505. {
  506. SetActorProperty(0,APROP_INVULNERABLE,0);
  507. TEMP_player_input=GetPlayerInput(PlayerNumber(),INPUT_BUTTONS);
  508.  
  509. /*&SetFont("FOV");
  510. SetHudSize(256,256,0);
  511. HudMessage(s:"A";HUDMSG_PLAIN,99,CR_UNTRANSLATED,0.1,0.1,0.1);
  512. SetHudSize(0,0,0);*/
  513.  
  514. if(CheckInventory("money")>0) {PLAYER_money[PlayerNumber()]+=CheckInventory("money");TakeInventory("money",CheckInventory("money"));}
  515.  
  516. SetFont("CONFONT");
  517. SetHudSize(800,600,0);
  518. if(GAME_gameover==0)
  519. {
  520. HudMessage(d:PLAYER_money[0];HUDMSG_PLAIN,0,CR_WHITE,680.0,500.0,0.1);
  521. Hudmessage(n:1;HUDMSG_PLAIN,0,CR_WHITE,600.0,500.0,0.1);
  522. if(PlayerInGame(1))
  523. {
  524. HudMessage(d:PLAYER_money[1];HUDMSG_PLAIN,0,CR_WHITE,680.0,480.0,0.1);
  525. HudMessage(n:2;HUDMSG_PLAIN,0,CR_WHITE,600.0,480.0,0.1);
  526. }
  527. if(PlayerInGame(2))
  528. {
  529. HudMessage(d:PLAYER_money[2];HUDMSG_PLAIN,0,CR_WHITE,680.0,460.0,0.1);
  530. HudMessage(n:3;HUDMSG_PLAIN,0,CR_WHITE,600.0,460.0,0.1);
  531. }
  532. if(PlayerInGame(3))
  533. {
  534. HudMessage(d:PLAYER_money[3];HUDMSG_PLAIN,0,CR_WHITE,680.0,440.0,0.1);
  535. HudMessage(n:4;HUDMSG_PLAIN,0,CR_WHITE,600.0,440.0,0.1);
  536. }
  537. }
  538.  
  539. /*
  540. ** Health regeneration and the like.
  541. */
  542.  
  543. if(TEMP_player_checktime>0) {TEMP_player_checktime-=1;}
  544. else
  545. {
  546. if(GAME_gameover==0)
  547. {
  548. SetActorProperty(0,APROP_HEALTH,GetActorProperty(0,APROP_HEALTH)+3);
  549. if(GetActorProperty(0,APROP_HEALTH)>100) {SetActorProperty(0,APROP_HEALTH,100);}
  550. TEMP_player_health=GetActorProperty(0,APROP_HEALTH);
  551. TEMP_player_checktime=35;
  552. if(TEMP_player_health>30 && TEMP_player_health<70)
  553. {
  554. if(random(0,2)==0) {ActivatorSound("playersnds/hurt",127);}
  555. ACS_ExecuteAlways(20,0,0,0,0);
  556. TEMP_player_checktime=25;
  557. }
  558. if(GetActorProperty(0,APROP_HEALTH)<30)
  559. {
  560. ActivatorSound("playersnds/injured",127);
  561. ACS_ExecuteAlways(20,0,1,0,0);
  562. TEMP_player_checktime=53;
  563. }
  564. }
  565. }
  566. If(CheckInventory("Kills")>=8){TEMP_player_killstreak-=1;}
  567. if(TEMP_player_killstreak<=0)
  568. {
  569. TakeInventory("Kills",999);
  570. TEMP_player_Killstreak=1;
  571. ActivatorSound(Random(" ","playersnds/kill"),127);
  572. }
  573. if((TEMP_player_input & BT_FORWARD) || (TEMP_player_input & BT_BACK) ||
  574. (TEMP_player_input & BT_MOVELEFT) || (TEMP_player_input & BT_MOVERIGHT)) {if(TEMP_player_input & BT_SPEED){TEMP_player_footsteptime-=1;}else{TEMP_player_footsteptime-=2;}}
  575. if(TEMP_player_footsteptime<=0)
  576. {
  577. if(CheckInventory("ColtZoomed")==1
  578. || CheckInventory("NambuZoomed")==1
  579. || CheckInventory("G43Zoomed")==1
  580. || CheckInventory("K98KZoomed")==1
  581. || CheckInventory("SpriZoomed")==1
  582. || CheckInventory("STGZoomed")==1
  583. || CheckInventory("MP40Zoomed"))
  584. {
  585. TEMP_player_footsteptime=32;
  586. }
  587. else
  588. {
  589. TEMP_player_footsteptime=24;
  590. }
  591. if(GetActorZ(0)<=GetActorFloorZ(0) && !PLAYER_downed[PlayerNumber()] && !PLAYER_dead[PlayerNumber()])
  592. {
  593. If(TEMP_player_input & BT_CROUCH)
  594. {
  595. TEMP_player_footsteptime=32;
  596. ActivatorSound("player/footstep",40);
  597. if(random(0,1)==0) {ActivatorSound("player/gear",40);}
  598. }
  599. else
  600. {
  601. ActivatorSound("player/footstep",80);
  602. if(random(0,1)==0) {ActivatorSound("player/gear",80);}
  603. }
  604. }
  605. }
  606. //WallItems and Mystery Box
  607. if(PLAYER_downed[PlayerNumber()]==0 && PLAYER_dead[PlayerNumber()]==0) //Disallows downed or dead players from activating anything
  608. {
  609. if(TEMP_for_mode==0)
  610. {
  611. for(int forA=0;forA<DEF_COUNT_WALLITEMS;forA++)
  612. {
  613. if(ThingCountSector(T_NONE,ActivatorTID(),BOX_tag)==1)
  614. {
  615. if(!DEBUG_enabled)
  616. {
  617. SetFont("SMALLFONT");
  618. SetHudSize(800,600,0);
  619. if(BOX_active==0) {HudMessage(s:"hold \cfUSE \c-for a random weapon [price: 950]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  620. else if(BOX_active==2 && BOX_activator==ActivatorTID())
  621. {
  622. HudMessage(s:"hold \cfUSE \c-to trade for ",s:BOX_itemnames[BOX_currentitem];HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);
  623. }
  624. }
  625. if(TEMP_player_input & BT_USE)
  626. {
  627. TEMP_player_buytime+=1;
  628. if(TEMP_player_buytime>10)
  629. {
  630. TEMP_player_buytime=0;
  631. ACS_ExecuteAlways(350,0,0,0,0);
  632. }
  633. }
  634. }
  635. if(ThingCountSector(T_NONE,ActivatorTID(),WALLITEM_tids[forA])==1)
  636. {
  637. if(!DEBUG_enabled)
  638. {
  639. SetFont("SMALLFONT");
  640. if(!(WALLITEM_actors[0][forA]=="GrenadeAmmo"
  641. || WALLITEM_actors[0][forA]=="N74STAmmo"
  642. || WALLITEM_actors[0][forA]=="MolotovAmmo"
  643. || WALLITEM_actors[0][forA]=="BouncingBettyAmmo"))
  644. {
  645. SetHudSize(800,600,0);
  646. if(CheckInventory(WALLITEM_actors[0][forA])) {HudMessage(s:"hold \cfUSE \c-to buy ammo [price: ",d:WALLITEM_prices[forA]/2,s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  647. else {HudMessage(s:"hold \cfUSE \c-to buy ",s:WALLITEM_names[forA],s:" [price: ",d:WALLITEM_prices[forA],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  648. }
  649. else
  650. {
  651. SetHudSize(800,600,0);
  652. if(WALLITEM_actors[0][forA]=="GrenadeAmmo") {HudMessage(s:"hold \cfUSE \c-to buy frag grenades [price: ",d:WALLITEM_prices[forA],s:"]";
  653. HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  654. else if(WALLITEM_actors[0][forA]=="N74STAmmo") {HudMessage(s:"hold \cfUSE \c-to buy sticky grenades [price: ",d:WALLITEM_prices[forA],s:"]";
  655. HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  656. else if(WALLITEM_actors[0][forA]=="MolotovAmmo") {HudMessage(s:"hold \cfUSE \c-to buy molotov cocktails [price: ",d:WALLITEM_prices[forA],s:"]";
  657. HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  658. else if(WALLITEM_actors[0][forA]=="BouncingBettyAmmo") {HudMessage(s:"hold \cfUSE \c-to buy bouncing betties [one-time buy] [price: ",d:WALLITEM_prices[forA],s:"]";
  659. HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  660. }
  661. }
  662. if(TEMP_player_input & BT_USE)
  663. {
  664. TEMP_player_buytime+=1;
  665. if(TEMP_player_buytime>10)
  666. {
  667. TEMP_player_buytime=0;
  668. if(!(WALLITEM_actors[0][forA]=="GrenadeAmmo"
  669. || WALLITEM_actors[0][forA]=="N74STAmmo"
  670. || WALLITEM_actors[0][forA]=="MolotovAmmo"
  671. || WALLITEM_actors[0][forA]=="BouncingBettyAmmo"))
  672. {
  673. if(CheckInventory(WALLITEM_actors[0][forA]))
  674. {
  675. if(PLAYER_money[PlayerNumber()]>=(WALLITEM_prices[forA]/2))
  676. {
  677. ACS_ExecuteAlways(502,0,5,0,0);
  678. ACS_ExecuteAlways(502,0,1,0,2);
  679. PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA]/2;
  680. ActivatorSound("game/PURCHASE",127);
  681. GiveInventory(WALLITEM_actors[0][forA],1);
  682. }
  683. }
  684. else
  685. {
  686. if(PLAYER_money[PlayerNumber()]>=WALLITEM_prices[forA])
  687. {
  688. ActivatorSound("game/PURCHASE",127);
  689. ACS_ExecuteAlways(502,0,10,0,0);
  690. ACS_ExecuteAlways(502,0,1,0,2);
  691. PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA];
  692. if(CheckInventory("WeaponsInInventory")<2)
  693. {
  694. GiveInventory(WALLITEM_actors[0][forA],1);
  695. SetWeapon(WALLITEM_actors[0][forA]);
  696. GiveInventory("WeaponsInInventory",1);
  697. }
  698. else
  699. {
  700. TakeInventory(ACS_ExecuteWithResult(450,0,0,0),1);
  701. GiveInventory(WALLITEM_actors[0][forA],1);
  702. SetWeapon(WALLITEM_actors[0][forA]);
  703. }
  704. }
  705. }
  706. }
  707. else
  708. {
  709. if(PLAYER_money[PlayerNumber()]>=WALLITEM_prices[forA])
  710. {
  711. if(!WALLITEM_actors[0][forA]=="BouncingBettyAmmo")
  712. {
  713. ActivatorSound("game/PURCHASE",127);
  714. ACS_ExecuteAlways(502,0,10,0,0);
  715. PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA];
  716. if(!WALLITEM_actors[0][forA]=="GrenadeAmmo")
  717. {
  718. GiveInventory(WALLITEM_actors[0][forA],4);
  719. }
  720. }
  721. else
  722. {
  723. if(!CheckInventory("SpecGrenade_BouncingBetty"))
  724. {
  725. ActivatorSound("game/PURCHASE",127);
  726. ACS_ExecuteAlways(502,0,10,0,0);
  727. PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA];
  728. TakeInventory("SpecGrenade_N74ST",1);
  729. TakeInventory("N74STAmmo",4);
  730. TakeInventory("SpecGrenade_Molotov",1);
  731. TakeInventory("MolotovAmmo",4);
  732. GiveInventory("SpecGrenade_BouncingBetty",1);
  733. GiveInventory(WALLITEM_actors[0][forA],2);
  734. }
  735. }
  736. }
  737. }
  738. }
  739. }
  740. }
  741. }
  742.  
  743. //Doors
  744. TEMP_for_mode=1;
  745. }
  746. else if(TEMP_for_mode==1)
  747. {
  748. for(int forB=0;forB<DEF_COUNT_DOORS;forB++)
  749. {
  750. if(ThingCountSector(T_NONE,ActivatorTID(),DOOR_tids[forB])==1 && DOOR_opened[forB]==0)
  751. {
  752. if(!DEBUG_enabled)
  753. {
  754. SetFont("SMALLFONT");
  755. SetHudSize(800,600,0);
  756. //WhiteAce here, this should stop the hud from bugging out in mutliplayer, I hope
  757. if(DOOR_type[forB]==0) {HudMessage(s:"hold \cfUSE \c-to lower the gate [price: ",d:DOOR_prices[forB],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  758. else {HudMessage(s:"hold \cfUSE \c-to open the door [price: ",d:DOOR_prices[forB],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  759. }
  760. if(TEMP_player_input & BT_USE)
  761. {
  762. TEMP_player_buytime+=1;
  763. if(TEMP_player_buytime>10)
  764. {
  765. TEMP_player_buytime=0;
  766. if(PLAYER_money[PlayerNumber()]>=DOOR_prices[forB])
  767. {
  768. ACS_Execute(forB+DOOR_scriptno,0,0,0,0); // create your own scripts for handling how doors/debris is removed.
  769. ACS_ExecuteAlways(502,0,20,0,0);
  770. DOOR_opened[forB]=1;
  771. ROOM_opened[DOOR_roomid[forB][0]]=1;
  772. ROOM_opened[DOOR_roomid[forB][1]]=1;
  773. ROOM_opened[DOOR_roomid[forB][2]]=1;
  774. PLAYER_money[PlayerNumber()]-=DOOR_prices[forB];
  775. }
  776. }
  777. }
  778. }
  779. }
  780.  
  781. //Barricades
  782. TEMP_for_mode=2;
  783. }
  784. else if(TEMP_for_mode==2)
  785. {
  786. for(int forC=0;forC<DEF_COUNT_BARRICADES;forC++)
  787. {
  788. if(ThingCountSector(T_NONE,ActivatorTID(),BARRICADE_sectorid[forC])==1 && BARRICADE_health[forC]<6)
  789. {
  790. SetFont("SMALLFONT");
  791. if(TEMP_player_input & BT_USE)
  792. {
  793. TEMP_player_buytime+=2;
  794. if(TEMP_player_buytime>4)
  795. {
  796. TEMP_player_buytime=0;
  797. If(BARRICADE_updatetime[forC]<1)
  798. {
  799. BARRICADE_updatetime[forC]=25;
  800. BARRICADE_health[forC]+=1;
  801. ACS_ExecuteAlways(667,0,10,0,0);
  802. ACS_ExecuteAlways(502,0,1,0,0);
  803. ACS_ExecuteAlways(502,0,1,0,4);
  804. ActivatorSound("game/barpnt",127);
  805. }
  806. }
  807. }
  808. else
  809. {
  810. if(!DEBUG_enabled)
  811. {
  812. SetHudSize(800,600,0);
  813. HudMessage(s:"hold \cfUSE \c-to rebuild barrier";
  814. HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);
  815. }
  816. }
  817. }
  818. }
  819.  
  820. TEMP_for_mode=3; //Perks
  821. }
  822. else if(TEMP_for_mode==3)
  823. {
  824. for(int forD=0;forD<DEF_COUNT_PERKS;forD++)
  825. {
  826. if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && GAME_power==1 && CheckInventory(PERK_Inventory[forD])==0)
  827. {
  828. SetFont("SmallFont");
  829. SetHudSize(800,600,0);
  830. if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:"hold \cfUSE \c-to buy ",s:PERK_names[forD],s:" [price: ",d:PERK_prices[forD],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  831. if(TEMP_player_input & BT_USE)
  832. {
  833. TEMP_player_buytime+=1;
  834. if(TEMP_player_buytime>10)
  835. {
  836. TEMP_player_buytime=0;
  837. if(PLAYER_money[PlayerNumber()]>=PERK_prices[forD])
  838. {
  839. ActivatorSound("game/PURCHASE",127);
  840. ACS_ExecuteAlways(502,0,10,0,0);
  841. PLAYER_money[PlayerNumber()]-=PERK_prices[forD];
  842. GiveInventory(PERK_actors[forD],1);
  843. SetWeapon(PERK_actors[forD]);
  844. }
  845. }
  846. }
  847. }
  848. else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="Jugg" && GAME_power==0)
  849. {
  850. SetFont("SmallFont");
  851. SetHudSize(800,600,0);
  852. if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";
  853. HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  854. }
  855. else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="SpdCola" && GAME_power==0)
  856. {
  857. SetFont("SmallFont");
  858. SetHudSize(800,600,0);
  859. if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  860. }
  861. else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="DoubTap" && GAME_power==0)
  862. {
  863. SetFont("SmallFont");
  864. SetHudSize(800,600,0);
  865. if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  866. }
  867. else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="StamUp" && GAME_power==0)
  868. {
  869. SetFont("SmallFont");
  870. SetHudSize(800,600,0);
  871. if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";
  872. HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  873. }
  874. else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="Machete" && CheckInventory(PERK_Inventory[forD])==0)
  875. {
  876. SetFont("SmallFont");
  877. SetHudSize(800,600,0);
  878. if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:"hold \cfUSE \c-to buy ",s:PERK_names[forD],s:" [price: ",d:PERK_prices[forD],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  879. if(TEMP_player_input & BT_USE)
  880. {
  881. TEMP_player_buytime+=1;
  882. if(TEMP_player_buytime>10)
  883. {
  884. TEMP_player_buytime=0;
  885. if(PLAYER_money[PlayerNumber()]>=PERK_prices[forD])
  886. {
  887. ActivatorSound("game/PURCHASE",127);
  888. ACS_ExecuteAlways(502,0,10,0,0);
  889. PLAYER_money[PlayerNumber()]-=PERK_prices[forD];
  890. GiveInventory(PERK_actors[forD],1);
  891. SetWeapon(PERK_actors[forD]);
  892. }
  893. }
  894. }
  895. }
  896. else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="QckRvve" && PlayerCount()==1 && CheckInventory(PERK_Inventory[forD])==0)
  897. {
  898. SetFont("SmallFont");
  899. SetHudSize(800,600,0);
  900. if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:"hold \cfUSE \c-to buy ",s:PERK_names[forD],s:" [price: ",d:PERK_prices[forD],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  901. if(TEMP_player_input & BT_USE)
  902. {
  903. TEMP_player_buytime+=1;
  904. if(TEMP_player_buytime>10)
  905. {
  906. TEMP_player_buytime=0;
  907. if(PLAYER_money[PlayerNumber()]>=PERK_prices[forD])
  908. {
  909. ActivatorSound("game/PURCHASE",127);
  910. ACS_ExecuteAlways(502,0,10,0,0);
  911. PLAYER_money[PlayerNumber()]-=PERK_prices[forD];
  912. GiveInventory(PERK_actors[forD],1);
  913. SetWeapon(PERK_actors[forD]);
  914. }
  915. }
  916. }
  917. }
  918. }
  919.  
  920. TEMP_for_mode=4; //Traps
  921. }
  922. else if(TEMP_for_mode==4)
  923. {
  924. for(int forE=0;forE<DEF_COUNT_TRAPS;forE++)
  925. {
  926. If(ThingCountSector(T_NONE,ActivatorTID(),TRAP_tids[forE])==1 && GAME_power==0)
  927. {
  928. if(!DEBUG_enabled)
  929. {
  930. SetFont("SMALLFONT");
  931. SetHudSize(800,600,0);
  932. if(TRAP_tids[forE]) {HudMessage(s:" You must turn on the power first!";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  933. }
  934. }
  935. Else if(ThingCountSector(T_NONE,ActivatorTID(),TRAP_tids[forE])==1 && GAME_power==1 && TRAP_active[forE]==0)
  936. {
  937. if(!DEBUG_enabled)
  938. {
  939. SetFont("SMALLFONT");
  940. SetHudSize(800,600,0);
  941. if(TRAP_type[forE]==0) {HudMessage(s:"hold \cfUSE \c-to activate lockdown [price: ",d:TRAP_prices[forE],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  942. else {HudMessage(s:"hold \cfUSE \c-to activate turrets [price: ",d:TRAP_prices[forE],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
  943. }
  944. if(TEMP_player_input & BT_USE)
  945. {
  946. TEMP_player_buytime+=1;
  947. if(TEMP_player_buytime>10)
  948. {
  949. TEMP_player_buytime=0;
  950. if(PLAYER_money[PlayerNumber()]>=TRAP_prices[forE])
  951. {
  952. ACS_Execute(forE+TRAP_scriptno,0,0,0,0); // create your own scripts for activating traps
  953. TRAP_active[forE]=1;
  954. ActivatorSound("game/PURCHASE",127);
  955. PLAYER_money[PlayerNumber()]-=TRAP_prices[forE];
  956. }
  957. }
  958. }
  959. }
  960. }
  961. TEMP_for_mode=0;
  962. }
  963. }
  964. if(PlayerNumber()==0)
  965. {
  966. if(PlayerCount()>1) {DrawPlayerName(1001,768.0,2,768);}
  967. if(PlayerCount()>2) {DrawPlayerName(1002,768.0,3,769);}
  968. if(PlayerCount()>3) {DrawPlayerName(1003,768.0,4,770);}
  969. }
  970. else if(PlayerNumber()==1)
  971. {
  972. if(PlayerCount()>1) {DrawPlayerName(1000,768.0,1,768);}
  973. if(PlayerCount()>2) {DrawPlayerName(1002,768.0,3,769);}
  974. if(PlayerCount()>3) {DrawPlayerName(1003,768.0,4,770);}
  975. }
  976. else if(PlayerNumber()==2)
  977. {
  978. if(PlayerCount()>1) {DrawPlayerName(1000,768.0,1,768);}
  979. if(PlayerCount()>2) {DrawPlayerName(1001,768.0,2,769);}
  980. if(PlayerCount()>3) {DrawPlayerName(1003,768.0,4,770);}
  981. }
  982. else if(PlayerNumber()==3)
  983. {
  984. if(PlayerCount()>1) {DrawPlayerName(1000,768.0,1,768);}
  985. if(PlayerCount()>2) {DrawPlayerName(1001,768.0,2,769);}
  986. if(PlayerCount()>3) {DrawPlayerName(1002,768.0,3,770);}
  987. }
  988. Delay(1);
  989. }
  990. }
  991.  
  992. SCRIPT 5 (int ID) DISCONNECT { if(!GAME_round_number==1 && !GAME_round_mins<1) {PLAYER_dead[PlayerNumber()]=1;} PLAYER_downed[PlayerNumber()]=0; }
  993.  
  994. SCRIPT 10 (void)
  995. {
  996. int x;
  997. int y;
  998. x=0.0;
  999. y=0.0;
  1000.  
  1001. SetLineBlocking(80,BLOCKF_PLAYERS);
  1002. SetLineBlocking(120,BLOCKF_MONSTERS);
  1003. Thing_Deactivate(2);
  1004. Thing_Activate(6);
  1005.  
  1006. if(GameSkill()==4)
  1007. {
  1008.  
  1009. }
  1010.  
  1011. SetPlayerProperty(1,1,PROP_TOTALLYFROZEN);
  1012. SetMusic("",0);
  1013. FadeTo(0.0,0.0,0.0,1.0,0.1);
  1014. delay(35);
  1015. if(GameSkill()<4)
  1016. {
  1017. AmbientSound("game/HORDE",127);
  1018. SetMusic("music/HOR2",0);}
  1019. else
  1020. {
  1021. SetMusic("music/HORI1",0);
  1022. }
  1023. FadeTo(0.0,0.0,0.0,0.0,2.0);
  1024. delay(35*1);
  1025. SetFont("CONFONT");
  1026. HudMessage(s:GAME_startuptext[0];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.5,6.0,3.0,1.0);
  1027. HudMessage(s:GAME_startuptext[1];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.55,6.0,4.0,1.0);
  1028. HudMessage(s:GAME_startuptext[2];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.6,6.0,5.0,1.0);
  1029. HudMessage(s:GAME_startuptext[3];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.65,6.0,6.0,1.0);
  1030. AmbientSound(GAME_round_startsound,127);
  1031. SetPlayerProperty(1,0,PROP_TOTALLYFROZEN);
  1032. SetPlayerProperty(1,0,PROP_FROZEN);
  1033. SetFont("BIGFONT");
  1034. if(GameSkill()<4)
  1035. {
  1036. HudMessage(s:"round";HUDMSG_FADEOUT,0,CR_WHITE,1.5,0.4,3.0,1.0);
  1037. SetHudSize(320,240,0);
  1038. HudMessage(s:"1";HUDMSG_PLAIN,0,CR_RED,160.0,120.0,3.0);
  1039. delay(35*3);
  1040. while(x<196.0)
  1041. {
  1042. SetFont("BIGFONT");
  1043. SetHudSize(320,240,0);
  1044. HudMessage(s:"1";HUDMSG_PLAIN,1,CR_RED,160.0-x,120.0+y,0.1);
  1045. x+=4.0;
  1046. y+=3.0;
  1047. delay(1);
  1048. }
  1049. }
  1050. else
  1051. {
  1052. SetHudSize(320,240,0);
  1053. HudMessage(d:GAME_round_mins,s:":",d:GAME_round_secs;HUDMSG_PLAIN,0,CR_RED,160.0,120.0,3.0);
  1054. delay(35*3);
  1055. while(x<196.0)
  1056. {
  1057. SetFont("BIGFONT");
  1058. SetHudSize(320,240,0);
  1059. HudMessage(d:GAME_round_mins,s:":",d:GAME_round_secs;HUDMSG_PLAIN,1,CR_RED,160.0-x,120.0+y,0.1);
  1060. x+=4.0;
  1061. y+=3.0;
  1062. delay(1);
  1063. }
  1064. }
  1065. }
  1066.  
  1067. SCRIPT 11 (void)
  1068. {
  1069. if(GAME_round_doground)
  1070. {
  1071. AmbientSound("game/DOGEND",127);
  1072. GAME_round_doground=0;
  1073. }
  1074. else
  1075. {
  1076. AmbientSound(GAME_round_endsound,127);
  1077. GAME_round_untildogs-=1;
  1078. }
  1079. delay(DEF_round_intermission);
  1080.  
  1081. if(GAME_randomNumber==1)
  1082. {
  1083. if(GAME_Round_dogs==4)
  1084. {
  1085. GAME_round_doground=1;
  1086. AmbientSound("game/DOGROUND",127);
  1087. delay(35*4);
  1088. AmbientSound("game/DOGSOULS",127);
  1089. GAME_round_dogs=0;
  1090. GAME_randomNumber=Random(1,2);
  1091. }
  1092. }
  1093. Else if(GAME_randomNumber==2)
  1094. {
  1095. if(GAME_Round_dogs==5)
  1096. {
  1097. GAME_round_doground=1;
  1098. AmbientSound("game/DOGROUND",127);
  1099. delay(35*4);
  1100. AmbientSound("game/DOGSOULS",127);
  1101. GAME_round_dogs=0;
  1102. GAME_randomNumber=Random(1,2);
  1103. }
  1104. }
  1105. else { AmbientSound(GAME_round_startsound,127); }
  1106. AmbientSound(GAME_round_startsound,127);
  1107. GAME_round_number+=1;
  1108. GAME_round_dogs+=1;
  1109. GAME_round_zombiescount+=random(DEF_zombies_increaseamount*PlayerCount(),(DEF_zombies_increaseamount*2)*PlayerCount());
  1110. GAME_round_dogscount+=random(DEF_dogs_increaseamount*PlayerCount(),(DEF_dogs_increaseamount*2)*PlayerCount());
  1111. if(GAME_round_doground) { GAME_round_zombiesleft=GAME_round_dogscount; }
  1112. else { GAME_round_zombiesleft=GAME_round_zombiescount; }
  1113. for(int FOR11_a=0;FOR11_a<4;FOR11_a++)
  1114. {
  1115. GiveActorInventory(1000+FOR11_a,"GrenadeAmmo",2);
  1116. if(CheckActorInventory(1000+FOR11_a,"SpecGrenade_N74ST")) { GiveActorInventory(1000+FOR11_a,"N74STAmmo",2); }
  1117. if(CheckActorInventory(1000+FOR11_a,"SpecGrenade_Molotov")) { GiveActorInventory(1000+FOR11_a,"MolotovAmmo",2); }
  1118. if(CheckActorInventory(1000+FOR11_a,"SpecGrenade_BouncingBetty")) { GiveActorInventory(1000+FOR11_a,"BouncingBettyAmmo",2); }
  1119. }
  1120. if(!GAME_round_doground)
  1121. {
  1122. SetHudSize(320,240,0);
  1123. SetFont("SMALLFONT");
  1124. HudMessage(s:"round";HUDMSG_FADEINOUT,0,CR_WHITE,160.0,116.2,5.0,1.0,1.0);
  1125. SetFont("BIGFONT");
  1126. HudMessage(d:GAME_round_number;HUDMSG_FADEINOUT,0,CR_RED,160.0,120.1,5.0,1.0,1.0);
  1127. SetHudSize(0,0,0);
  1128. }
  1129. delay(35);
  1130. for(int F11_dead=0;F11_dead<4;F11_dead++)
  1131. {
  1132. if(ClassifyActor(1000+F11_dead)==ACTOR_DEAD) {PLAYER_dead[F11_dead]=1;}
  1133. }
  1134. }
  1135.  
  1136. SCRIPT 12 (void)
  1137. {
  1138. while(true)
  1139. {
  1140. for(int FOR12_a=0;FOR12_a<DEF_COUNT_BARRICADES;FOR12_a++)
  1141. {
  1142. if(BARRICADE_health[FOR12_a]==6) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[0]);
  1143. SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[0]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
  1144. else if(BARRICADE_health[FOR12_a]==5) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[1]);
  1145. SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[1]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
  1146. else if(BARRICADE_health[FOR12_a]==4) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[2]);
  1147. SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[2]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
  1148. else if(BARRICADE_health[FOR12_a]==3) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[3]);
  1149. SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[3]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
  1150. else if(BARRICADE_health[FOR12_a]==2) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[4]);
  1151. SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[4]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
  1152. else if(BARRICADE_health[FOR12_a]==1) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[5]);
  1153. SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[5]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
  1154. else {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[6]);
  1155. SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[6]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_PLAYERS,BLOCKF_CREATURES);}
  1156. if(BARRICADE_updatetime[FOR12_a]>0) {BARRICADE_updatetime[FOR12_a]-=1;}
  1157. }
  1158. delay(1);
  1159. }
  1160. }
  1161.  
  1162. SCRIPT 20 (int mode)
  1163. {
  1164. if(mode==0)
  1165. {
  1166. FadeTo(255,55,55,0.2,0.1);
  1167. delay(4);
  1168. FadeTo(0.0,0.0,0.0,0.0,0.8);
  1169. }
  1170. else
  1171. {
  1172. FadeTo(255,55,55,0.5,0.1);
  1173. delay(4);
  1174. FadeTo(0.0,0.0,0.0,0.0,2.0);
  1175. }
  1176. }
  1177.  
  1178. SCRIPT 50 (int mode)
  1179. {
  1180. if(mode==2 && !(ClassifyActor(0) & ACTOR_DEAD))
  1181. {
  1182. delay(35*20);
  1183. SetActorState(0,"CheckTarget",1);
  1184. }
  1185. else if(mode==3)
  1186. {
  1187. GAME_round_zombiesleft+=1;
  1188. Thing_Remove(0);
  1189. }
  1190. else
  1191. {
  1192. for(int FOR50_a=0;FOR50_a<DEF_COUNT_BARRICADES;FOR50_a++)
  1193. {
  1194. if(ThingCountSector(T_NONE,ActivatorTID(),BARRICADE_attackid[FOR50_a])==1)
  1195. {
  1196. if(mode==0 && BARRICADE_health[FOR50_a]>0)
  1197. {
  1198. SetActorState(ActivatorTID(),"AtBarricade",1);
  1199. }
  1200. else
  1201. {
  1202. if(BARRICADE_health[FOR50_a]<1)
  1203. {
  1204. SetActorState(ActivatorTID(),"See",1);
  1205. }
  1206. else
  1207. {
  1208. BARRICADE_health[FOR50_a]-=1;
  1209. ActivatorSound("game/barhit",127);
  1210. }
  1211. }
  1212. }
  1213. }
  1214. }
  1215. }
  1216.  
  1217. Script 200 (Void)
  1218. {
  1219. ActivatorSound("game/DOOR",127);
  1220. Floor_LowerByValue(200,16,152);
  1221. }
  1222. Script 201 (Void)
  1223. {
  1224. ActivatorSound("game/DOOR",127);
  1225. PolyObj_RotateLeft(1,8,64);
  1226. }
  1227. Script 202 (Void)
  1228. {
  1229. ActivatorSound("game/DOOR",127);
  1230. Polyobj_Move(2,16,192,64);
  1231. }
  1232. Script 203 (Void)
  1233. {
  1234. ActivatorSound("game/DOOR",127);
  1235. Polyobj_Move(2,16,192,64);
  1236. }
  1237.  
  1238. script 230 (VOID)
  1239. {
  1240. if(GAME_musicenabled<3) //If there is more than 3 lines, script won't do anything
  1241. {
  1242. GAME_musicenabled = GAME_musicenabled + 1; //Add 1 everytime script 230 is activated
  1243. ActivatorSound("game/MeteorAffirm",127); //Probably know what this is
  1244. }
  1245. if(GAME_musicenabled==3) {SoundSequence(GAME_songname);}//If variable reaches 3, plays the string variable if defined in soundsequence
  1246. }
  1247.  
  1248. Script 232 (void)
  1249. {
  1250. GAME_Power=1;
  1251. }
  1252.  
  1253. Script 246 OPEN //Gameover script
  1254. {
  1255. While(True)
  1256. {
  1257. if(GAME_round_doground==1 && GAME_round_dogscount<=2)
  1258. {
  1259. }
  1260. if(!PlayerCount()==0)
  1261. {
  1262. if(!PlayerInGame(0)) {PLAYER_dead[0]=1;}
  1263. if(!PlayerInGame(1)) {PLAYER_dead[1]=1;}
  1264. if(!PlayerInGame(2)) {PLAYER_dead[2]=1;}
  1265. if(!PlayerInGame(3)) {PLAYER_dead[3]=1;}
  1266. }
  1267. else {PLAYER_dead[0]=0; PLAYER_dead[1]=0; PLAYER_dead[2]=0; PLAYER_dead[3]=0;}
  1268. if((PLAYER_dead[0]==1)
  1269. && (PLAYER_dead[1]==1)
  1270. && (PLAYER_dead[2]==1)
  1271. && (PLAYER_dead[3]==1))
  1272. {
  1273. GAME_gameover=1;
  1274. Delay(35*1);
  1275. SetHudSize(320,240,0);
  1276. SetMusic("",0);
  1277. Delay(35*1);
  1278. AmbientSound("game/GAMEOVER",127);
  1279. Thing_Activate(28);
  1280. ChangeCamera(28,1,0);
  1281. SetHudSize(320,240,0);
  1282. SetFont("SMALLFONT");
  1283. If(GameSkill()>=4)
  1284. {HudMessage(s:"game over";HUDMSG_FADEINOUT,0,CR_RED,160.0,24.1,27.0,1.0,1.0);
  1285. HudMessage(s:"you survived \cj",d:GAME_round_mins,s:":",d:GAME_round_secs;
  1286. HUDMSG_FADEINOUT,0,CR_RED,160.0,34.1,27.0,1.0,1.0);}
  1287. Else
  1288. {HudMessage(s:"game over";HUDMSG_FADEINOUT,0,CR_RED,160.0,24.1,27.0,1.0,1.0);
  1289. if(GAME_round_number==1)
  1290. {HudMessage(s:"you survived \cj",d:GAME_round_number,s:"\c- round";
  1291. HUDMSG_FADEINOUT,0,CR_RED,160.0,34.1,27.0,1.0,1.0);}
  1292. else
  1293. {HudMessage(s:"you survived \cj",d:GAME_round_number,s:"\c- rounds";
  1294. HUDMSG_FADEINOUT,0,CR_RED,160.0,34.1,27.0,1.0,1.0);}}
  1295. HudMessage(s:"name";HUDMSG_FADEINOUT,0,CR_WHITE,32.1,48.1,27.0,1.0,1.0);
  1296. HudMessage(s:"points";HUDMSG_FADEINOUT,0,CR_WHITE,136.1,48.1,27.0,1.0,1.0);
  1297. HudMessage(s:"kills";HUDMSG_FADEINOUT,0,CR_WHITE,240.1,48.1,27.0,1.0,1.0);
  1298. if(PlayerCount()>0) {HudMessage(n:1;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,63.1,27.0,1.0,1.0);
  1299. HudMessage(d:CheckActorInventory(1000,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,63.1,27.0,1.0,1.0);
  1300. HudMessage(d:CheckActorInventory(1000,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,63.1,27.0,1.0,1.0);}
  1301. if(PlayerCount()>1) {HudMessage(n:2;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,78.1,27.0,1.0,1.0);
  1302. HudMessage(d:CheckActorInventory(1001,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,78.1,27.0,1.0,1.0);
  1303. HudMessage(d:CheckActorInventory(1001,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,78.1,27.0,1.0,1.0);}
  1304. if(PlayerCount()>2) {HudMessage(n:3;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,93.1,27.0,1.0,1.0);
  1305. HudMessage(d:CheckActorInventory(1002,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,93.1,27.0,1.0,1.0);
  1306. HudMessage(d:CheckActorInventory(1002,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,93.1,27.0,1.0,1.0);}
  1307. if(PlayerCount()>3) {HudMessage(n:4;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,108.1,27.0,1.0,1.0);
  1308. HudMessage(d:CheckActorInventory(1003,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,108.1,27.0,1.0,1.0);
  1309. HudMessage(d:CheckActorInventory(1003,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,108.1,27.0,1.0,1.0);}
  1310. SetHudSize(0,0,0);
  1311. delay(35*30);
  1312. ChangeLevel("MAP04", 0, CHANGELEVEL_NOINTERMISSION, -1);
  1313. }
  1314. Delay(1);
  1315. }
  1316. }
  1317.  
  1318. SCRIPT 270 (void) {Thing_Remove(0);}
  1319.  
  1320. SCRIPT 350 (void) //Actual Mystery box script
  1321. {
  1322. if(BOX_active==0 && PLAYER_money[PlayerNumber()]>949)
  1323. {
  1324. int X350;
  1325. X350=0;
  1326. BOX_active=1;
  1327. BOX_activator=ActivatorTID();
  1328. BOX_itemtaken=0;
  1329. ACS_ExecuteAlways(502,0,1,BOX_activator,1);
  1330. PLAYER_money[PlayerNumber()]-=950;
  1331. ACS_ExecuteAlways(502,0,5,0,0);
  1332. Floor_LowerByValue(26,8,12);
  1333. Ceiling_LowerByValue(26,8,12);
  1334. delay(20);
  1335. SetActivator(BOX_weaponstid);
  1336. ActivatorSound(BOX_spinsound,127);
  1337. while(X350<48)
  1338. {
  1339. Thing_Remove(196);
  1340. BOX_currentitem=random(0,DEF_COUNT_BOXITEMS);
  1341. SpawnSpotForced(BOX_items[BOX_currentitem],BOX_weaponstid,196,0);
  1342. X350+=1;
  1343. delay(4);
  1344. }
  1345. X350=0;
  1346. BOX_active=2;
  1347. while(BOX_itemtaken==0 && X350<(35*6))
  1348. {
  1349. X350+=1;
  1350. delay(1);
  1351. }
  1352. BOX_active=1;
  1353. BOX_itemtaken=0;
  1354. BOX_currentitem=0;
  1355. Thing_Remove(196);
  1356. Floor_RaiseByValue(26,8,12);
  1357. Ceiling_RaiseByValue(26,8,12);
  1358. delay(35);
  1359. BOX_active=0;
  1360. }
  1361. if(BOX_active==2)
  1362. {
  1363. if(BOX_activator==ActivatorTID())
  1364. {
  1365. ActivatorSound("game/PURCHASE",127);
  1366. ACS_ExecuteAlways(502,0,10,0,0);
  1367. BOX_itemtaken=1;
  1368. if(CheckInventory(BOX_items[BOX_currentitem])) {GiveInventory(BOX_items[BOX_currentitem],1);}
  1369. else
  1370. {
  1371. if(CheckInventory("WeaponsInInventory")<2)
  1372. {
  1373. GiveInventory(BOX_items[BOX_currentitem],1);
  1374. GiveInventory("WeaponsInInventory",1);
  1375. SetWeapon(BOX_items[BOX_currentitem]);
  1376. }
  1377. else
  1378. {
  1379. TakeInventory(ACS_ExecuteWithResult(450,0,0,0),1);
  1380. GiveInventory(BOX_items[BOX_currentitem],1);
  1381. SetWeapon(BOX_items[BOX_currentitem]);
  1382. }
  1383. }
  1384. }
  1385. }
  1386. }
  1387.  
  1388. function void DrawPlayerName(int tid, int range, int playerid, int id)
  1389. {
  1390. int dist, ang, vang, pitch, x, y;
  1391. int HUDX = 1024;
  1392. int HUDY = 768;
  1393. int offset = 0;
  1394. SetFont("BIGFONT");
  1395. offset = 0.1;
  1396. sethudsize(HUDX, HUDY, 1);
  1397. x = getactorx(tid) - getactorx(0);
  1398. y = getactory(tid) - getactory(0);
  1399. vang = vectorangle(x,y);
  1400. ang = (vang - GetActorAngle(0) + 1.0) % 1.0;
  1401. if(((vang+0.125)%0.5) > 0.25) dist = fixeddiv(y, sin(vang));
  1402. else dist = fixeddiv(x, cos(vang));
  1403. if ((ang < 0.2 || ang > 0.8) && dist < range)
  1404. {
  1405. pitch = vectorangle(dist, getactorz(tid) - (getactorz(0) + 41.0));
  1406. pitch = (pitch + GetActorPitch(0) + 1.0) % 1.0;
  1407. x = HUDX/2 - ((HUDX/2) * sin(ang) / cos(ang));
  1408. y = HUDY/2 - ((HUDX/2) * sin(pitch) / cos(pitch));
  1409. hudmessage(n:playerid; HUDMSG_PLAIN, id, CR_UNTRANSLATED, (x<<16)+0.1, (y<<16)+offset, 0);
  1410. }
  1411. else
  1412. hudmessage(s:" "; HUDMSG_PLAIN, id, CR_UNTRANSLATED, 0, 0, 0);
  1413. }
  1414. function int fdistance (int tid1, int tid2)
  1415. {
  1416. int len;
  1417. int y = getactory(tid1) - getactory(tid2);
  1418. int x = getactorx(tid1) - getactorx(tid2);
  1419. int z = getactorz(tid1) - getactorz(tid2);
  1420. int ang = vectorangle(x,y);
  1421. if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(y, sin(ang));
  1422. else len = fixeddiv(x, cos(ang));
  1423. ang = vectorangle(len, z);
  1424. if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(z, sin(ang));
  1425. else len = fixeddiv(len, cos(ang));
  1426. return len;
  1427. }
  1428.  
  1429. SCRIPT 450 (void)
  1430. {
  1431. if(CheckWeapon("Colt45")) {SetResultValue("Colt45");}
  1432. else if(CheckWeapon("357Magnum")) {SetResultValue("357Magnum");}
  1433. else if(CheckWeapon("M1A1Carbine")) {SetResultValue("M1A1Carbine");}
  1434. else if(CheckWeapon("M1Garand")) {SetResultValue("M1Garand");}
  1435. else if(CheckWeapon("Kar98k")) {SetResultValue("Kar98k");}
  1436. else if(CheckWeapon("Springfield")) {SetResultValue("Springfield");}
  1437. else if(CheckWeapon("Thompson")) {SetResultValue("Thompson");}
  1438. else if(CheckWeapon("MP40")) {SetResultValue("MP40");}
  1439. else if(CheckWeapon("STG-44")) {SetResultValue("STG-44");}
  1440. else if(CheckWeapon("TrenchGun")) {SetResultValue("TrenchGun");}
  1441. else if(CheckWeapon("DoubleBarrel")) {SetResultValue("DoubleBarrel");}
  1442. else if(CheckWeapon("SawnOffShotgun")) {SetResultValue("SawnOffShotgun");}
  1443. else if(CheckWeapon("BAR")) {SetResultValue("BAR");}
  1444. else if(CheckWeapon("BrowningM1919")) {SetResultValue("BrowningM1919");}
  1445. else if(CheckWeapon("Panzerschreck")) {SetResultValue("Panzerschreck");}
  1446. else if(CheckWeapon("M2Flamethrower")) {SetResultValue("M2Flamethrower");}
  1447. else if(CheckWeapon("FG42")) {SetResultValue("FG42");}
  1448. else if(CheckWeapon("Gewehr43")) {SetResultValue("Gewehr43");}
  1449. else if(CheckWeapon("PPSh41")) {SetResultValue("PPSh41");}
  1450. else if(CheckWeapon("DP-28")) {SetResultValue("DP-28");}
  1451. else if(CheckWeapon("MG42")) {SetResultValue("MG42");}
  1452. else if(CheckWeapon("Dualcolt45s")) {SetResultValue("Dualcolt45s");}
  1453. else if(CheckWeapon("Luger")) {SetResultValue("Luger");}
  1454. else if(Checkweapon("Thundergun")) {SetResultValue("Thundergun");}
  1455. else if(Checkweapon("Nailgun")) {SetResultValue("Nailgun");}
  1456. else if(Checkweapon("Raygun")) {SetResultValue("Raygun");}
  1457. else if(Checkweapon("Glock18")) {SetResultValue("Glock18");}
  1458. else if(checkweapon("Sterlingl2a3")) {setResultValue("Sterlingl2a3");}
  1459. else if(Checkweapon("Nambu")) {SetResultValue("Nambu");}
  1460. else if(Checkweapon("SpringfieldScoped")) {SetResultValue("SpringfieldScoped");}
  1461. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement