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

  1. # DroidWorks
  2. # 03_ctrl_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. message        user3
  13. message        activate
  14. message        startup
  15. message        timer
  16. message        pulse
  17.  
  18. cog             ctrl_cog
  19. cog            endfarmer
  20. surface        button
  21.  
  22. thing          light0
  23. sector         sector1
  24. sector         sector2
  25. sector         sector3
  26. sector         sector4
  27.  
  28. sound          accomplish=00tAccomplish.wav local
  29. sound          power=NRG02PowerOn.wav local
  30. sound          broke=swt00twghtmax.wav local          
  31.  
  32. end
  33.  
  34. # ========================================================================================
  35.  
  36. code
  37.  
  38. startup:
  39.      player=getlocalplayerthing();
  40.      print("ctrlactivate");
  41.      underwater=0;
  42.      //global0=0;
  43.      //AttachThingToThing(wrench_long, gear);
  44.      setwallcel(button, 2);
  45.      setpulse(0.7);
  46.      return;
  47.    
  48. # =========================================================
  49. user3:
  50.      //user3 gets called when player hits reset switch, see ctrlswitch co
  51.      //sendmesasge
  52.      print("user3");
  53.      underwater=1;
  54.      return;
  55.      
  56. activate:
  57.           print("ctrl activate");
  58.           //if (GetSenderId() == 7)      // pressing reset button underwater
  59.           //{
  60.           if (underwater == 0)    // water is not drained yet
  61.                {
  62.                print ("resetswitchbroke");
  63.                //PlaySoundLocal(reset_switch_broke, 1, 0, 0);
  64.                dwplaycammyspeech(16031, "M3CA027.wav", 5, 2); //reset don't work under h20
  65.                playsoundlocal(broke, 1, 0, 0);
  66.                }
  67.           
  68.            if (underwater == 1)   // power comes on
  69.                {
  70.                print("powers on");
  71.                //PlaySoundLocal(power_on, 1, 0, 0);
  72.                setpulse(0);
  73.                SetWallCel(button, 1);  // reset button changes color
  74.                setthinglight(light0, brightness, 1.5);  //  turns these lights on
  75.              //setthinglight(light1, brightness, 2.0);
  76.              //setthinglight(light2, brightness, 1.0);
  77.              //setthinglight(light3, brightness, 3.0);
  78.                dwplaycammyspeech(16036, "M3CA032.wav", 5, 2); //you did it!
  79.                dwfreezeplayer();
  80.                playsoundlocal(power, 1, 0, 0);
  81.                settimer(8);
  82.                sendmessage(endfarmer, user1);
  83.                print("user1 sent");
  84.                SetSectorLight(sector1, 0.9, 1);
  85.                SetSectorLight(sector2, 0.9, 1.5);
  86.                SetSectorLight(sector3, 0.9, 0.7);
  87.                SetSectorLight(sector4, 0.9, 1.2);
  88.          }
  89.           
  90.           
  91.      //}         
  92.      return;
  93.  
  94. //timer:
  95.         //setInv(player, 4, 1);
  96.         //playsoundthing(accomplish, player, 1.0, -1, -1, 0);
  97. pulse:
  98.      curcel=getwallcel(button);
  99.      setwallcel(button, 2-curcel);
  100.      
  101.      return;
  102.  
  103. end
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. startup:
  129.      setwallcel(button, 0);
  130.      return;
  131.  
  132. activate:
  133.     // send message to 03_Tanks_cog telling it the switch has been hit.
  134.         sendmessage(tanks2_cog, user0);
  135.         setwallcel(button, 1);
  136.         print("foo2");
  137.         settimer(1); 
  138.     return;
  139.  
  140. timer:
  141.           setwallcel(button, 0);
  142.           return;
  143. end
  144.