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

  1. symbols
  2. message        startup
  3. message        arrived
  4. message        activate
  5.  
  6. thing          baffle1        linkid=1
  7. thing          baffle2        linkid=2
  8.  
  9. int            count1=0       local
  10. int            count2=0       local
  11.  
  12. cog            baffleMcog
  13.  
  14. sound          bafflewav=swt02baffle.wav
  15.  
  16.  
  17. end
  18.  
  19. code
  20. startup:
  21.      print("startup");
  22.      count1=0;
  23.      count2=0;
  24.      return;
  25.      
  26. arrived:
  27.      if (getsenderid()==1) {
  28.           count1=count1+1;
  29.           if (count1%12==0) jumptoframe(baffle1, 0, getthingsector(baffle1));
  30.      }
  31.      else if (getsenderid()==2) {
  32.           count2=count2+1;
  33.           if (count2%12==0) jumptoframe(baffle2, 0, getthingsector(baffle2));
  34.      }
  35.      call onlinestatus;     
  36.      return;
  37.      
  38. onlinestatus:     
  39.      if ( ((count1-3)%12==0)&&((count2-3)%12==0) ) sendmessage(baffleMcog, user2);   //generator two online 
  40.      else sendmessage(baffleMcog, user3);                   //generator two OFFLINE
  41.      return;
  42.  
  43.      
  44. activate:
  45.      if (dwGetArmStrength() < 7) {     
  46.           dwplaycammyspeech(16022, "t3ca008.wav", 20, 2);
  47.           return;    
  48.      }
  49.      if (getsenderid()==1) {
  50.           if (ismoving(baffle1)!=0) return;
  51.           else {
  52.                rotatepivot(baffle1, 1, 1);
  53.                rotatepivot(baffle2, 1, 0.9);
  54.                playsoundthing(bafflewav, baffle2, 1.0, -1, -1, 0);
  55.           }
  56.      }
  57.      else if (getsenderid()==2) {
  58.           if (ismoving(baffle2)!=0) return;
  59.           else {
  60.                rotatepivot (baffle2, 1, 1);
  61.                playsoundthing(bafflewav, baffle2, 1.0, -1, -1, 0);
  62.           }
  63.      }
  64.      
  65.      return;
  66.      
  67. end
  68.  
  69.  
  70.  
  71.