home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 52 / ClassicFond52.iso / GAMES / DROIDW.RAR / DWCD.GOB / mission_cog_03_env_ctrlrm.cog < prev    next >
Encoding:
Text File  |  1998-11-04  |  1.5 KB  |  81 lines

  1. # DroidWorks
  2. # 03_env_ctrlrm.cog
  3. #
  4. #
  5. # Battery is in inventory bin 16
  6. # Power is in inventory bin 20
  7. #
  8. # Script handles random enviroment object for the gear level. It also handles 
  9. # the pick-up for right now, although I might change that later on. 
  10. #
  11. # Set the inv_number to what bin you want it added to.
  12. # Set amount var to how many things you have attached.
  13. #  
  14. # [01/16/98] DGS    Created
  15. # [01/26/98] DGS    Added code to make it random
  16. #
  17.  
  18. symbols
  19.  
  20. thing    thing0
  21. thing    thing1
  22. thing    thing2
  23.  
  24.  
  25. message    taken
  26. message    startup
  27. message pulse
  28.  
  29. int    amount=0
  30. flex    set=0.0
  31. int    inv_number=0
  32. int    act_thing
  33.  
  34.  
  35. end
  36.  
  37. # ========================================================================================
  38.  
  39. code
  40. startup:
  41.     set = (rand()*amount);
  42.     if (set < 1)
  43.         {
  44.                 print("Rand: 0");
  45.         // Keep thing 0
  46.         act_thing = thing0;
  47.         destroything(thing1);
  48.                 destroything(thing2);
  49.         }
  50.     else if ( set < 2)
  51.         {
  52.                 print("Rand: 2");
  53.         // keep thing 1
  54.                 destroything(thing0);
  55.                 act_thing = thing1;
  56.         destroything(thing2);
  57.         }
  58.         else if ( set < 3)
  59.         {
  60.                 print("Rand: 3");
  61.         // Keep thing 2
  62.                 destroything(thing0);
  63.                 destroything(thing1);
  64.                 act_thing = thing2;
  65.         }
  66.     return;
  67.  
  68. pulse:
  69.        call startup;
  70.        printflex(set);
  71.        return;
  72.  
  73. taken:
  74.         SetInvAvailable(getlocalplayerthing(), inv_number, 1);
  75.     ChangeInv(getlocalplayerthing(), inv_number, 1);
  76.     destroything(act_thing);
  77.     return;
  78.  
  79. end
  80.