Advertisement
ijontichy

<stdin>

Dec 18th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.92 KB | None | 0 0
  1. #include "zcommon.acs"
  2. #library "fadein"
  3.  
  4. int ScoutCounter[32][3];
  5. int engyBuildings[4][2] = {{"SentryGun1", "engy/buildsentry"}, {"Dispenser1", "engy/builddispenser"}, {"TeleEntrance1", "engy/buildteleenter"}, {"TeleExit1", "engy/buildteleexit"}};
  6. int Level2Buildings[4] = {"SentryGun2", "Dispenser2", "TeleEntrance2", "TeleExit2"};
  7. int Level3Buildings[4] = {"SentryGun3", "Dispenser3", "TeleEntrance3", "TeleExit3"};
  8. int SpawnChoice[4][2] = {{"SpawnSentry2", "SpawnSentry3"}, {"SpawnDispenser2", "SpawnDispenser3"}, {"SpawnTI2", "SpawnTI3"}, {"SpawnTO2", "SpawnTO3"}};
  9. int buildingCost[4] = {130, 100, 125, 125};
  10.  
  11. script 948 (void)
  12. {
  13. switch(Random(1,4))
  14. {
  15. case 1:
  16. MorphActor(0, "ShadowPlayerRail", "", 2147483647, 0, "NoMorphFog", "NoMorphFog");
  17. break;
  18.  
  19. case 2:
  20. MorphActor(0, "ShadowPlayerQuadshot", 0, 2147483647, 0, "NoMorphFog", "NoMorphFog");
  21. break;
  22.  
  23. case 3:
  24. MorphActor(0, "ShadowPlayerRocket", 0, 2147483647, 0, "NoMorphFog", "NoMorphFog");
  25. break;
  26.  
  27. case 4:
  28. MorphActor(0, "ShadowPlayerPlasma", 0, 2147483647, 0, "NoMorphFog", "NoMorphFog");
  29. break;
  30. }
  31. Print(s:"Stealthed");
  32. }
  33.  
  34. script 949 (void)
  35. {
  36. UnMorphActor(0, 0);
  37. Print(s:"Unstealthed");
  38. }
  39.  
  40. script 749 (int red, int green, int blue)
  41. {
  42. FadeRange(red, green, blue, 0.6, red, green, blue, 0.6, 4.0);
  43. Delay(140);
  44. FadeRange(red, green, blue, 0.6, red, green, blue, 0.0, 4.0);
  45. }
  46.  
  47. function void giveBonk(void)
  48. {
  49. ScoutCounter[PlayerNumber()][2] -= 1;
  50. if ((CheckInventory("Bonk! Atomic Punch") == 0) && (ScoutCounter[PlayerNumber()][2] == 0))
  51. {
  52. GiveInventory("Bonk! Atomic Punch", 1);
  53. GiveInventory("Crit-A-Cola", 1);
  54. GiveInventory("YouHaveBonk", 1);
  55. ActivatorSound("scout/recharged", 127);
  56. }
  57. }
  58.  
  59. function void giveBall(void)
  60. {
  61. ScoutCounter[PlayerNumber()][1] -= 1;
  62. if ((CheckInventory("ScoutBallAmmo") == 0) && (ScoutCounter[PlayerNumber()][1] == 0))
  63. {
  64. GiveInventory("ScoutBallAmmo", 1);
  65. GiveInventory("YouHaveBall", 1);
  66. ActivatorSound("scout/recharged", 127);
  67. }
  68. }
  69.  
  70. script 748 (int teststring) net
  71. {
  72. if (teststring == 733137331)
  73. {
  74. GiveInventory("Scout's Bottomless Clip", 1);
  75. }
  76. else if ((teststring == 733173313) && (CheckInventory("Mini-Base Spawner") == 1))
  77. {
  78. GiveInventory("Hax Base Spawner", 1);
  79. }
  80. }
  81.  
  82. script 747 (int ballTime, int bonkTime, int doublejump)
  83. {
  84. Thing_ChangeTID(0, PlayerNumber()+747);
  85.  
  86. if (doubleJump == 1)
  87. {
  88. if (GetActorZ(PlayerNumber()+747) - GetActorFloorZ(PlayerNumber()+747) <= 10.0)
  89. {
  90. ScoutCounter[PlayerNumber()][0] = 0;
  91. }
  92. else if (ScoutCounter[PlayerNumber()][0] == 1)
  93. {
  94. if ((CheckInventory("PowerHighJump") == 1) || (CheckInventory("RuneHighJump") == 1))
  95. {
  96. ThrustThingZ(0, 100, 0, 0);
  97. }
  98. else
  99. {
  100. ThrustThingZ(0, 50, 0, 0);
  101. }
  102.  
  103. if (GetActorZ(PlayerNumber()+747) - GetActorFloorZ(PlayerNumber()+747) >= 160.0)
  104. {
  105. ActivatorSound("scout/djump", 127);
  106. }
  107. }
  108. ScoutCounter[PlayerNumber()][0] += 1;
  109. }
  110.  
  111. if ((ballTime == -1) && (bonkTime == -1))
  112. {
  113. ScoutCounter[PlayerNumber()][1] = 1;
  114. ScoutCounter[PlayerNumber()][2] = 1;
  115. giveBall();
  116. giveBonk();
  117. CancelFade();
  118. }
  119. else if ((ballTime > 0) || (bonkTime > 0))
  120. {
  121. if (ballTime <= 0)
  122. {
  123. ScoutCounter[PlayerNumber()][2] += 1;
  124. Delay(bonkTime);
  125. giveBonk();
  126.  
  127. }
  128. else if (bonkTime <= 0)
  129. {
  130. ScoutCounter[PlayerNumber()][1] += 1;
  131. Delay(ballTime);
  132. giveBall();
  133. }
  134. else
  135. {
  136. if (ballTime <= bonkTime)
  137. {
  138. ScoutCounter[PlayerNumber()][1] += 1;
  139. ScoutCounter[PlayerNumber()][2] += 1;
  140. Delay(ballTime);
  141. giveBall();
  142. Delay(bonkTime - ballTime);
  143. giveBonk();
  144. }
  145. else
  146. {
  147. ScoutCounter[PlayerNumber()][1] += 1;
  148. ScoutCounter[PlayerNumber()][2] += 1;
  149. Delay(bonkTime);
  150. giveBonk();
  151. Delay(ballTime - bonkTime);
  152. giveBall();
  153. }
  154. }
  155. }
  156. }
  157.  
  158. script 746 (void)
  159. {
  160. int newtid = (PlayerNumber()*5)+1747;
  161. int buildOption = CheckInventory("BuildToolCounter");
  162. int buildingtid = newtid+buildOption;
  163. Thing_ChangeTID(0, newtid);
  164. Print(i:buildingtid);
  165. if (ClassifyActor(buildingtid))
  166. {
  167. Thing_Destroy(buildingtid);
  168. }
  169. else if (CheckInventory("EngyMetal")+1 > buildingCost[buildOption-1])
  170. {
  171. int buildingSpawnX = GetActorX(newtid)+(64*cos(GetActorAngle(newtid)));
  172. int buildingSpawnY = GetActorY(newtid)+(64*sin(GetActorAngle(newtid)));
  173. int buildingSpawnZ = GetActorZ(newtid)+16;
  174.  
  175. Spawn(engyBuildings[buildOption-1][0], buildingSpawnX, buildingSpawnY, buildingSpawnZ, buildingtid, 256-(GetActorAngle(newtid) >> 8));
  176. SetThingSpecial(buildingtid, 226, 744, 0, buildingtid, buildOption);
  177. if (ClassifyActor(buildingtid))
  178. {
  179. Thing_SetTranslation(buildingtid, -1);
  180. ActivatorSound(engyBuildings[buildOption-1][1], 127);
  181. TakeInventory("EngyMetal", buildingCost[buildOption-1]);
  182. }
  183. }
  184. else
  185. {
  186. print(s:"Insufficient metal - you need ", i:buildingCost[buildOption-1] - CheckInventory("EngyMetal"), s:" metal");
  187. }
  188. }
  189.  
  190. script 745 (int doWhat, int myTid, int level)
  191. {
  192. if (doWhat == 1)
  193. {
  194. if (level == 1)
  195. {
  196. Spawn("DispenserPawn1", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid), myTid, 0);
  197. }
  198. if (level == 2)
  199. {
  200. Spawn("DispenserPawn2", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid), myTid, 0);
  201. Spawn("DispenserPawn2", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid), myTid, 128);
  202. }
  203. if (level == 3)
  204. {
  205. Spawn("DispenserPawn3", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid), myTid, 0);
  206. Spawn("DispenserPawn3", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid), myTid, 64);
  207. Spawn("DispenserPawn3", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid), myTid, 128);
  208. Spawn("DispenserPawn3", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid), myTid, 192);
  209. }
  210. }
  211. if (doWhat == 2)
  212. {
  213. Spawn("TeleEntrance", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid)+48, myTid, GetActorAngle(myTid) >> 8);
  214. }
  215. if (doWhat == 3)
  216. {
  217. Spawn("TeleExit", GetActorX(myTid), GetActorY(myTid), GetActorZ(myTid)+48, myTid, GetActorAngle(myTid) >> 8);
  218. }
  219. }
  220.  
  221. script 744 (int buildingTid, int whichBuilding)
  222. {
  223. if (CheckInventory("EngyMetal") < 200)
  224. {
  225. Print(s:"You're ", i:200-CheckInventory("EngyMetal"), s:" metal short");
  226. terminate;
  227. }
  228. TakeInventory("EngyMetal", 200);
  229. if ((whichBuilding == 1) || (whichBuilding == 2)) /* it'll expand to all of them soon enough */
  230. {
  231. GiveActorInventory(buildingTid, "UpgradeBuilding", 1);
  232. Thing_Destroy(buildingTid);
  233. }
  234. }
  235.  
  236. script 743 (int buildingTid, int level, int buildingChoice)
  237. {
  238. int buildingSpawnAngle = GetActorAngle(buildingTid) >> 8;
  239. if (level == 2)
  240. {
  241. SpawnSpotForced("TeleportFog", buildingTid, 0, buildingSpawnAngle);
  242. SpawnSpotForced(Level2Buildings[buildingChoice-1], buildingTid, buildingTid, buildingSpawnAngle);
  243. }
  244. if (level == 3)
  245. {
  246. SpawnSpotForced("TeleportFog", buildingTid, 0, buildingSpawnAngle);
  247. SpawnSpotForced(Level3Buildings[buildingChoice-1], buildingTid, buildingTid, buildingSpawnAngle);
  248. }
  249.  
  250. SetThingSpecial(buildingTid, 226, 744, 0, buildingtid, buildingChoice);
  251. Thing_SetTranslation(buildingtid, -1);
  252. Delay(1);
  253. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement