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

  1. # DroidWorks
  2. # 03_tanks_activate.cog
  3. #
  4. # This cog sends a message to 03_tanks.cog when the motor's been activated. 
  5. #
  6. #
  7. # [01/20/98] DGS    Created
  8. # {01/29/98] JP     Modified to be used in the Moisture Farm Level.
  9. #
  10. symbols
  11.  
  12. cog             tanks2_cog
  13. surface        button
  14. message        activate
  15. message        startup
  16. message        timer
  17. message        user2 //from tanks_activate.cog
  18. message        user6 //from tanks2 "access denied"
  19. message        pulse
  20.  
  21. sound          sw2=swt00drswtch.wav local
  22. sound          no2=swt00twghtmax.wav local
  23.  
  24. cog            cammyvoicecog
  25.  
  26. end
  27.  
  28. # ========================================================================================
  29.  
  30. code
  31. startup:
  32.      print("start me up");
  33.      setwallcel(button, 0); //button is inoperational.
  34.      buttonworks=0;  //button don't works
  35.      return;
  36.  
  37. activate:
  38.     // send message to 03_Tanks_cog telling it the switch has been hit.
  39.         if (buttonworks == 0)
  40.           {
  41.           print("notyet");
  42.           //play wav.
  43.           dwplaycammyspeech(16043, "m3ca036.wav", 5, 2); //can't use yet
  44.           playsoundlocal(no2, 1, 0, 0);
  45.           }
  46.         
  47.         else if (buttonworks == 1)
  48.           {    
  49.           sendmessage(tanks2_cog, user0);
  50.           setwallcel(button, 2);
  51.           playsoundlocal(sw2, 1, 0, 0);
  52.           print("foo2");
  53.           settimer(1);
  54.           }
  55.           
  56.         else if (buttonworks == 2)
  57.           {
  58.           setwallcel(button, 0);
  59.           }
  60.            
  61.      return;
  62.  
  63. user2:
  64.     // from tanks_activate.cog 
  65.     // tank2 is now operational, after tank 1 is done
  66.     setwallcel(button, 1);
  67.     print("foo2setup");
  68.     buttonworks=1;
  69.     setpulse(0.7);
  70.     return;
  71.     
  72. user6:
  73.      //from tanks2, "switch access denied" right?
  74.      sleep(5);
  75.      setwallcel(button, 0);
  76.      buttonworks=2;    //was 0, 2 means it no longer works, after its solved.
  77.      setpulse(0);
  78.      sendmessage(cammyvoicecog, user1);
  79.      return;    
  80.     
  81.    
  82. timer:
  83.      if (buttonworks == 0)
  84.           {
  85.           setwallcel(button, 0);
  86.           }
  87.           
  88.      else if (buttonworks == 1)
  89.           {
  90.           setwallcel(button, 1);
  91.           }
  92.      
  93.      else if (buttonworks == 2)
  94.           {
  95.           setwallcel(button, 0);
  96.           }
  97.                     
  98.      return;
  99.      
  100. pulse:
  101.      curcel=getwallcel(button);   //the blinkin' thing
  102.      setwallcel(button, 1-curcel);
  103.      return;
  104.      
  105. end
  106.