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

  1. # DroidWorks
  2. # b0_env_gear.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. end
  35.  
  36. # ========================================================================================
  37.  
  38. code
  39. startup:
  40.     set = (rand()*amount);
  41.     if (set < 1)
  42.         {
  43.                 print("Rand: 0");
  44.         // Keep thing 0
  45.         act_thing = thing0;
  46.         destroything(thing1);
  47.                 destroything(thing2);
  48.         }
  49.     else if ( set < 2)
  50.         {
  51.                 print("Rand: 2");
  52.         // keep thing 1
  53.                 destroything(thing0);
  54.                 act_thing = thing1;
  55.         destroything(thing2);
  56.         }
  57.         else if ( set < 3)
  58.         {
  59.                 print("Rand: 3");
  60.         // Keep thing 2
  61.                 destroything(thing0);
  62.                 destroything(thing1);
  63.                 act_thing = thing2;
  64.         }
  65.     return;
  66.  
  67. pulse:
  68.        call startup;
  69.        printflex(set);
  70.        return;
  71.  
  72. taken:
  73.         SetInvAvailable(getlocalplayerthing(), inv_number, 1);
  74.     ChangeInv(getlocalplayerthing(), inv_number, 1);
  75.     destroything(act_thing);
  76.     return;
  77.  
  78. end
  79.