home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 24 / PCGamer24_23Demos.iso / Vigilance / vigilance.exe / data1.cab / Assets / scripts / endtimed.e < prev    next >
Text File  |  1998-09-21  |  2KB  |  113 lines

  1.  
  2. int Initialize(string dummy)
  3. {
  4.     global int gState;
  5.     global real gStartTime;
  6.     global real gEndTime ;
  7.     global string gNextLevel;
  8.         global string gSameLevel;
  9.     global int gStartSound = 45;
  10.     global int gProgressSound = 36;
  11.     global int gEndSound = 45;
  12.     Reset("dummy");
  13. }
  14.  
  15. int Reset(string dummy)
  16. {
  17.     gState = 0;
  18.     gEndTime = -1.0;
  19.     SetCollidableProperties(thisObject,0,0);
  20.     SetStyle(thisObject,1);
  21.     IgnoreCollision(thisObject);
  22.     wakeupTime = -1.0;
  23.     gStartTime = GetTime(thisObject);
  24. }
  25.  
  26. int startsound(string soundname)
  27. {
  28.     gStartSound = GetSoundIndex(soundname);
  29.  
  30. }
  31.  
  32. int endsound(string soundname)
  33. {
  34.     gEndSound = GetSoundIndex(soundname);
  35.  
  36. }
  37.  
  38. int progresssound(string soundname)
  39. {
  40.     gProgressSound = GetSoundIndex(soundname);
  41.  
  42. }
  43.  
  44. int nextlevel(string level)
  45. {
  46.     gNextLevel = level;
  47. }
  48.  
  49. int maxtime(string str) {
  50.     print("hello - maxtime");
  51.     real time = GetTime(thisObject);
  52.     gEndTime = Str2Real(str);;
  53.     wakeupTime = time + gEndTime;
  54. }
  55.  
  56. int setendtime(string str)
  57. {
  58.     real time = GetTime(thisObject);
  59.     gEndTime = Str2Real(str);;
  60.     wakeupTime = time + gEndTime;
  61. }
  62.  
  63. int MyEndGame(string cmd,string level)
  64. {
  65.     EndGame(thisObject,cmd,level);
  66.     PlaySound(thisObject,gStartSound);
  67. }
  68.  
  69. int Colliders(int size) 
  70.     if (gState == 1)
  71.                 MyEndGame("intermission",gNextLevel); 
  72.     else
  73.                 MyEndGame("intermission",gNextLevel);
  74.     
  75.     IgnoreCollision(thisObject);
  76. }
  77.  
  78. int Collidants(int size) 
  79.     if (gState == 1)
  80.                 MyEndGame("intermission",gNextLevel); 
  81.     else
  82.                 MyEndGame("intermission",gNextLevel);
  83.     IgnoreCollision(thisObject);
  84. }
  85.  
  86. int TimedEvent(int input)
  87. {
  88.     if (gState == 1)
  89.                 MyEndGame("intermission",gNextLevel); 
  90.     else
  91.                 MyEndGame("intermission",gSameLevel); 
  92.     wakeupTime = -1.0;
  93.     
  94. }
  95.  
  96. int start(string msg)
  97. {
  98.     if (gState == 0)
  99.     {
  100.         if (StringCompare(msg,"success") == 0)
  101.         {
  102.             gState = 1;
  103.         }
  104.         else if (StringCompare(msg,"failure") == 0)
  105.         {
  106.             gState = 2;
  107.                         MyEndGame("intermission",gSameLevel);
  108.         }
  109.     }
  110. }
  111.