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

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