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

  1. # DroidWorks
  2. # b0_env_pulley.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 pulley. 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. # [01/30/98] DGS    Took from env_gear.cog and added extra things
  17. #
  18.  
  19. symbols
  20.  
  21. thing    thing0a
  22. thing    thing0b
  23. thing    thing1a
  24. thing    thing1b
  25. thing    thing2a
  26. thing    thing2b
  27. thing    thing3a
  28. thing    thing3b
  29. thing    thing4a
  30. thing    thing4b
  31. cog     jawa_cog
  32.  
  33. message    taken
  34. message    startup
  35. message pulse
  36.  
  37. int    amount=0
  38. flex    set=0.0
  39. int    inv_number=0
  40. int    act_thinga     local
  41. int    act_thingb     local
  42.  
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48. startup:
  49.     set = (rand()*amount);
  50.     if (set < 1)
  51.         {
  52.                 print("Rand: 0");
  53.         // Keep thing 0
  54.         act_thinga = thing0a;
  55.                 act_thingb = thing0b;
  56.  
  57.         destroything(thing1a);
  58.         destroything(thing1b);
  59.         
  60.         destroything(thing2a);
  61.         destroything(thing2b);
  62.                 
  63.         destroything(thing3a);
  64.         destroything(thing3b);
  65.                 
  66.         destroything(thing4a);
  67.         destroything(thing4b);
  68.         }
  69.     else if ( set < 2)
  70.         {
  71.                 print("Rand: 2");
  72.         // keep thing 1
  73.                 destroything(thing0a);
  74.         destroything(thing0b);
  75.         
  76.         act_thinga = thing1a;
  77.                 act_thingb = thing1b;
  78.         
  79.         destroything(thing2a);
  80.         destroything(thing2b);
  81.                 
  82.         destroything(thing3a);
  83.         destroything(thing3b);
  84.                 
  85.         destroything(thing4a);
  86.         destroything(thing4b);
  87.         }
  88.         else if ( set < 3)
  89.         {
  90.                 print("Rand: 3");
  91.         // Keep thing 2
  92.                 destroything(thing0a);
  93.         destroything(thing0b);
  94.         
  95.         destroything(thing1a);
  96.         destroything(thing1b);
  97.         
  98.         act_thinga = thing2a;
  99.                 act_thingb = thing2b;
  100.                 
  101.         destroything(thing3a);
  102.         destroything(thing3b);
  103.                 
  104.         destroything(thing4a);
  105.         destroything(thing4b);
  106.         }
  107.         else if ( set < 4)
  108.         {
  109.                 print("Rand: 4");
  110.         // Keep thing 3
  111.                 destroything(thing0a);
  112.         destroything(thing0b);
  113.         
  114.         destroything(thing1a);
  115.         destroything(thing1b);
  116.         
  117.         destroything(thing2a);
  118.         destroything(thing2b);
  119.         
  120.         act_thinga = thing3a;
  121.                 act_thingb = thing3b;
  122.                 
  123.         destroything(thing4a);
  124.         destroything(thing4b);
  125.         }
  126.         else if ( set < 5)
  127.         {
  128.                 print("Rand: 5");
  129.         // Keep thing 4
  130.                 destroything(thing0a);
  131.         destroything(thing0b);
  132.         
  133.         destroything(thing1a);
  134.         destroything(thing1b);
  135.         
  136.         destroything(thing2a);
  137.         destroything(thing2b);
  138.                 
  139.         destroything(thing3a);
  140.         destroything(thing3b);
  141.         
  142.         act_thinga = thing4a;
  143.                 act_thingb = thing4b;
  144.         }
  145.     return;
  146.  
  147. pulse:
  148.        call startup;
  149.        printflex(set);
  150.        return;
  151.  
  152. taken:
  153.      print("matt tateishi");
  154.     SetInvAvailable(getlocalplayerthing(), inv_number, 1);
  155.     dwflashinventory();
  156.     dwPlayCammySpeech(10000, "t3ca006.wav", 10, 3);
  157.     print("You found a pulley!");
  158.     ChangeInv(getlocalplayerthing(), inv_number, 1);
  159.     destroything(act_thinga);
  160.     destroything(act_thingb);
  161.     sendmessage(jawa_cog,user2);
  162.     return;
  163.  
  164. end
  165.