Advertisement
Chronos_Ouroboros

ACZ

Feb 18th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. /* ---------------------------------------------------- */
  2. // All
  3. script "FDNightvision" Enter // Nightvision system
  4. {
  5. // Not needed or desired in TitleMaps.
  6. If (GameType() == Game_Title_Map) Terminate;
  7. // FDNightvisionOn is used to turn on nightvision,
  8. // NVBattery is the nightvision battery
  9. int pln = PlayerNumber();
  10. int FDNVTics = 0; // tic counter, used for taking battery and other tic related things
  11.  
  12. while (TRUE)
  13. {
  14. if (FDNVTics == 52 && checkInventory("NightvisionUpgrade") == 0) // if the tic counter is on tic 52(or whatever number is used on the comparison)...
  15. {
  16. FDNVTics = 0; // reset counter
  17. }
  18. else if (FDNVTics == 70 && checkInventory("NightvisionUpgrade") == 1)
  19. {
  20. FDNVTics = 0; // reset counter
  21. }
  22. else if (FDNVTics == 87 && checkInventory("NightvisionUpgrade") == 2)
  23. {
  24. FDNVTics = 0; // reset counter
  25. }
  26. if (checkInventory("FDNightvisionOn") != 0 && checkInventory("NVBattery") != 0) // if nightvision is on and there's usable battery...
  27. {
  28. GiveInventory("PowerNightvision",1); // turn on nightvision
  29. if (FDNVTics == 0) // if FDNVTics is zero...
  30. {
  31. TakeInventory("NVBattery",1); // take one battery point
  32. }
  33. }
  34. else if (checkInventory("FDNightvisionOn") != 0 && checkInventory("NVBattery") == 0) // if nightvision is on and there's no usable battery
  35. {
  36. TakeInventory("PowerNightvision",1); // take PowerNightvision
  37. TakeInventory("FDNightvisionOn",1); // take FDNightvisionOn
  38. ActivatorSound("Nightvision/Off", 127); // play turning off sound
  39. }
  40. else if (checkInventory("FDNightvisionOn") == 0) // if nightvision is off, turn off nightvision and take FDNightvisionON
  41. {
  42. TakeInventory("PowerNightvision",1); // take PowerNightvision
  43. TakeInventory("FDNightvisionOn",1); // take FDNightvisionOn
  44. }
  45. Delay(1);
  46. if (checkInventory("FDNightvisionOn") != 0) { FDNVTics++; } // if nightvision on, add one tic
  47. }
  48. }
  49. /* ---------------------------------------------------- */
  50.  
  51. /* ---------------------------------------------------- */
  52. // Chronos
  53. /* ---------------------------------------------------- */
  54.  
  55. /* ---------------------------------------------------- */
  56. // Nero
  57. /* ---------------------------------------------------- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement