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

  1. #
  2. # Droids Cog Script
  3. #
  4. # 00_t_inventory.cog
  5. #
  6. #    bin 27    gear, this number can be changed.  Right now, it's Doug's large gear bin number.
  7. # Desc:  
  8. #     
  9. #
  10. # 03/09/98    [JP]         Created  
  11. #
  12. # <C> 1998 LucasLearningLimited.  All Rights Reserved--------------------------------------------------------------------------------
  13.  
  14. symbols
  15.  
  16. message        pulse
  17. message        blocked
  18. message        startup
  19. message        used
  20. message        taken
  21. message        entered
  22.  
  23. template       bigtemplate
  24. template       smalltemplate
  25.  
  26. sector         attachbig
  27. sector         attachsmall
  28.  
  29. sector         left   linkid=4
  30. sector         right
  31.  
  32. thing          ghostbig     linkid=5
  33. thing          ghostsmall   linkid=6
  34.  
  35. int            bin=27
  36. int            bin2=25
  37. int            part_id=0                     local
  38. int            big_spindle_i       linkid=5  local
  39. int            small_spindle_i     linkid=6  local
  40. int            xrotate                       local
  41.  
  42. sound          gearon=swt9gearon.wav  local
  43. sound          gearoff=swtt9gearoff.wav local
  44. sound          turnfree=mcht9motfree.wav local
  45. sound          turnwithgear=mcht9motstrss.wav local
  46. end
  47.  
  48.  
  49.  
  50.  
  51. ##code section
  52. code
  53.  
  54. startup:
  55.      sleep(5);
  56.      print("is this on?");
  57.      //player=getlocalplayerthing();
  58.      xrotate=0;
  59.      return;
  60.      
  61. used:
  62.      print("used");
  63.      printint (dwGetActivateBin());
  64.      if (xrotate == 0)
  65.           {
  66.           if (getinv(getlocalplayerthing(), dwGetActivatebin()) > 0)
  67.                {
  68.                     printint (getthingsector(getlocalplayerthing()));
  69.                     if (getthingsector(getlocalplayerthing()) == left)
  70.                          {
  71.                          print("big attached in left");
  72.                          call handle_big;
  73.                          }
  74.                }
  75.             }   
  76.      return;
  77.  
  78. taken:
  79.      print("taken");
  80.      if (GetSenderId()==4);
  81.           {    
  82.                if (getthingsector(getlocalplayerthing()) ==left)
  83.                     {
  84.                     if (big_spindle_i != 0);
  85.                          {
  86.                          ChangeInv(getlocalplayerthing(), big_spindle_i, 1);
  87.                          destroything(big_spindle_i);
  88.                          big_spindle =0;
  89.                          call update_bins;
  90.                          }
  91.                          
  92.                     }
  93.                     
  94.           }
  95.           
  96.      return;
  97.      
  98. update_bins:
  99.      print("update_bins");
  100.      if (getinv(getlocalplayerthing(), bin) > 0) SetInvAvailable(getlocalplayerthing(), bin, 1);
  101.      else SetInvAvailable(getlocalplayerthing(), bin, 0);
  102.      playsoundlocal(gearoff, 1, 0, 0);
  103.      return;
  104.      
  105. handle_big:
  106.      print("handlebig");
  107.      if (big_spindle==0)
  108.           {
  109.           
  110.           if (dwGetActivateBin() = bin)
  111.                {
  112.                big_spindle = dwGetActivateBin();
  113.                print ("big gear on!");
  114.                big_spindle_i = creatething (bigtemplate, ghostbig);
  115.                capturething(big_spindle_i);
  116.                ChangeInv(getlocalplayerthing(), big_spindle, -1);
  117.                playsoundlocal(gearon, 1, 0, 0);
  118.                }
  119.                
  120.           }
  121.           
  122.      return;
  123.      
  124. end
  125.                          
  126.           
  127.  
  128.  
  129.  
  130.  
  131.           
  132.