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

  1. #
  2. # Droids Cog Script
  3. #
  4. # 00_corrosion.cog
  5. #
  6. # Desc: 
  7. #     When activated at the corrosion surfaces, the welder will weld it. 
  8. #     
  9. #
  10. # 1/22/98    [JP]         Created 
  11. #
  12. # <C> 1998 LucasLearningLimited.  All Rights Reserved--------------------------------------------------------------------------------
  13.  
  14.  
  15. symbols
  16.     
  17.     message    activate
  18.     message    startup
  19.      message   pulse
  20.      message   timer
  21.      message   user1
  22.      message   user2
  23.      
  24.     surface    corrosion0
  25.     
  26.      thing     light0    //dynamic lights that go on when you weld.
  27.      
  28.      sounds    welding   //welding .wav
  29.      
  30.  
  31.  
  32.     float        brightness=1.00
  33.     int        onoff=0        local        
  34.      int       bzzt=0
  35.      int       fixed=0        local
  36.      int       head_on=0      local
  37.      
  38.      cog       spark
  39.      cog       rdroid
  40.      
  41.      sound     weld=nrg03weld.wav local
  42.      sound     weldbad=nrg03weldbad.wav local     
  43.      message   welded
  44.      
  45. end
  46.  
  47. ## Code Section
  48. code
  49. startup:
  50.      player=getlocalplayerthing();
  51.     check = (getthingsector(player));
  52.     return;
  53.      
  54. user1:  
  55.      head_on = 1;
  56.      if ( fixed == 0)
  57.           {
  58.           setwallcel(corrosion0,1);
  59.           }
  60.      else
  61.          {
  62.          setwallcel(corrosion0,6);
  63.          }
  64.          return;
  65.          
  66. user2:
  67.      if (fixed == 0)
  68.           {
  69.           setwallcel(corrosion0,0);
  70.           }
  71.           
  72.      else
  73.           {
  74.           setwallcel(corrosion0, 6);
  75.           }
  76.           
  77.      head_on = 0;
  78.      return;
  79.      
  80. welded:
  81. //activate:
  82.     // if (onoff == 0)
  83.  //    if ( (dwCheckDroidCaps(256)) && (dwCheckDroidCaps(131072)) ) //droid has corrosion head & welder
  84.     
  85.      if(GetInv(player, 12)==0) return;
  86.      check=(getthingsector(player));
  87.      print("yo");
  88.     printint(getsectorflags(check));
  89.      if ( (getsectorflags(check) == 20486) || (getsectorflags(check) == 16390) )
  90.           {
  91.           print("this is underwater");
  92. //          setwallcel(corrosion0, );
  93.           dwplaycammyspeech(16011, "M3CA013.wav", 5, 2);  //corrosion don't work!
  94.           playsoundlocal(weldbad, 1, 0, 0);
  95.           settimer(10);
  96.           print("underwater");
  97.           }  
  98.     
  99.     
  100.     else if ( (getsectorflags(check) != 20486) || (getsectorflags(check) != 16390) )
  101.           {
  102.           if (getwallcel(corrosion0) == 6) 
  103.                {
  104.                setwallcel(corrosion0, 6);
  105.                //dwsetmissiontext(16012);  //you weld like a pro!
  106.                //settimer(10);
  107.                //pulse(0.1);
  108.                }
  109.      
  110.           else if ( (dwCheckDroidCaps(256)) && (dwCheckDroidCaps(131072)) )           
  111.                {          
  112.                //Turn the dyn light on
  113.                print("on!");
  114.                setwallcel(corrosion0, 2);
  115.                settimer(0.1);      
  116.               setthinglight(light0, brightness, 0.0);
  117.               setpulse(0.01);
  118.                if (light1 != 0) setthinglight(light1, brightness, 0.0);
  119.                fixed=1;
  120.                //onoff = 1;
  121.                }
  122.          else
  123.      
  124.               {
  125.               //        Turn the light off
  126.               setthinglight(light0, brightness, 0.0);
  127.               if (light1 != 0) setthinglight(light1, 0, 0.0);
  128.               //onoff = 0;
  129.               //setwallcel(corrosion0, 0);
  130.                }
  131.           }          
  132.      return;
  133.      
  134. pulse:
  135.      counter = counter + 1;
  136.      if ((counter == 2) && (head_on = 1))  //counter was 4
  137.           {
  138.           sendmessage(spark, user4);
  139.           playsoundlocal(weld, 1, 0, 0);
  140.           sendmessage(rdroid, user6);
  141.           setwallcel(corrosion0, getwallcel(corrosion0) + 1);
  142.           counter = 0;
  143.           if (getwallcel(corrosion0) == 6) 
  144.                {
  145.                setwallcel(corrosion, 6);
  146.                randx=rand();
  147.                if (randx> 0.65)
  148.                     {                    
  149.                     dwplaycammyspeech(16012, "M3CA014.wav", 5, 2);  //you weld like a pro
  150.                     //playsoundlocal(weld, 1, 0, 0);
  151.                     setpulse(0);
  152.                     //add sparks lines here...
  153.                     //sendmessage(spark, user4);
  154.                     printflex(randx);
  155.                     print("me");
  156.                     }
  157.                     
  158.                else 
  159.                     {                    
  160.                     setpulse(0);
  161.                     print("or");
  162.                     printflex(randx);
  163.                     }
  164.                               
  165.                }
  166.           }
  167.           
  168.      return;
  169. end
  170.  
  171.