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

  1. # DrowWorks Cog Script
  2. #    
  3. # SY_MagTram A
  4. #
  5. # First attempt at MagTram cog
  6. #
  7. # Desc:
  8. #    
  9. #
  10. #
  11. # [01/18/97] DGS Created From Matt's TreadRX script.
  12. # [03/03/98] DGS Modified to work with sector thrusts. It got totally re-written. (Del-Fi Lost Treasures)
  13. symbols
  14. ## ====================== Messages
  15. message    startup
  16. message    timer
  17. message   activated
  18.  
  19. surface   button0  linkid=1
  20. vector    up
  21. sector      goingup
  22.  
  23. sound     magnet=AMB00MgntLp2.wav  local
  24. sound     switch=swt00drswtch.wav  local
  25.  
  26. int       show_once1=1   local
  27. int       show_once2=1   local
  28. int       show_once3=1   local
  29. int       show_once4=1   local
  30.  
  31. thing     emagnet    
  32. sound     up=NRG00MgntSck.wav local
  33. sound     attach=NRG00MgntAttch.wav local
  34.  
  35. surface   a1        nolink
  36. surface   a2        nolink
  37. surface   a3        nolink
  38. surface   a4        nolink
  39.  
  40. end
  41.  
  42. # ========================================================================================
  43.  
  44. code
  45.  
  46. startup:
  47.      setwallcel(button0, 2);
  48.      player=getlocalplayerthing();
  49.      return;
  50.      
  51. activated:
  52.     //playsoundlocal(switch, 1, 0, 0);
  53.      if (getsenderid() ==1)
  54.          {     
  55.           if (getthingsector(getlocalplayerthing()) == goingup)
  56.                {                                                  
  57.               playsoundlocal(switch, 1, 0, 0);
  58.                if (dwCheckDroidCaps(16))
  59.                     {
  60.                  print("magnetic!");
  61.                     Setwallcel(button0, 1);
  62.                  call adjoinon;
  63.                     SetSectorThrust(goingup, up, 8);
  64.                     playsoundlocal(attach, 1, 0, 0);
  65.                     magneti=Playsoundthing(magnet, emagnet, 1.0, -1, -1, 0x1);
  66.                     dwdisablejump();
  67.                     settimer(4);
  68.                     randx=rand();
  69.                     if (randx> 0.6)
  70.                          {
  71.                          if (show_once1 < 2)                                        
  72.                               {
  73.                               dwplaycammyspeech(16015, "TGCA018.wav", 4, 2);  //great globes of att...
  74.                                    if (show_once1 == 1) show_once1 = 2;
  75.                            }
  76.                          }     
  77.                                                   
  78.                     else 
  79.                          {
  80.                          if (show_once2 < 2)
  81.                               {
  82.                               dwplaycammyspeech(16410, "TGCA054.wav", 4, 2);
  83.                                    if (show_once2 == 1) show_once2 = 2;
  84.                               }                                       
  85.                          }                                                       
  86.                     }
  87.                     
  88.                else if (!dwCheckDroidCaps(16))
  89.                     {
  90.                     print("notmagnetic");
  91.                     randx=rand();
  92.                     settimer(7);
  93.                     Setwallcel(button0, 2);
  94.                     if (randx>0.5)
  95.                          {
  96.                          if (show_once3 < 2)
  97.                               {
  98.                               dwplaycammyspeech(16016, "TGCA019.wav", 4, 2);  //looks like it ain't magnetic
  99.                                    if (show_once3 == 1) show_once3 = 2;
  100.                               }
  101.                          }     
  102.                                                   
  103.                     else
  104.                          {
  105.                          if (show_once4 < 2)
  106.                               {
  107.                               dwplaycammyspeech(16420, "TGCA055.wav", 4, 2);
  108.                                    if (show_once4 == 1) show_once4 = 2;     
  109.                               }
  110.                          }              
  111.                  }
  112.                                
  113.           }
  114.      } 
  115.           
  116.       return;
  117.  
  118. timer:
  119.      SetSectorThrust(goingup, up, 0);
  120.      dwenablejump();
  121.      call adjoinoff;
  122.      Setwallcel(button0, 2); 
  123.      stopsound(magneti, 0.5);
  124.      return;
  125.  
  126. adjoinon:
  127.      print("adjoinon");
  128.      clearadjoinflags(a1, 2);
  129.      clearadjoinflags(a2, 2);
  130.      clearadjoinflags(a3, 2);
  131.      clearadjoinflags(a4, 2);
  132.      return;
  133.      
  134. adjoinoff:
  135.      print("adjoinoff");
  136.      setadjoinflags(a1, 2);
  137.      setadjoinflags(a2, 2);
  138.      setadjoinflags(a3, 2);
  139.      setadjoinflags(a4, 2);
  140.      return;
  141.      
  142.  
  143. end
  144.  
  145.  
  146.