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

  1. symbols
  2. message        startup
  3. message        taken
  4. message        used
  5. message        pulse
  6. message        activate
  7. message        arrived
  8. message        user0
  9.  
  10. thing          elevator       linkid=3
  11. thing          ghostdeliver   mask=0x100
  12. thing          ghostpickup    mask=0x100
  13. thing          PMN            linkid=5
  14. thing          PMN2           local          
  15.  
  16. sector         ds1
  17. sector         ds2
  18.  
  19. template       phrikT
  20.  
  21. surface        conveyor       nolink
  22. surface        conveyorA      nolink
  23. surface        conveyor2      nolink
  24. surface        conveyor2a     nolink
  25. surface        conveyor2b     nolink
  26. surface        xtracon        nolink
  27.  
  28. vector         conVector
  29. vector         conVector2
  30.  
  31. cog            fittocog
  32. cog            animcog
  33. int            okaytopickup=1 local
  34. sound          takesound=NRG00MgntSck.wav    local
  35. end
  36.  
  37.  
  38.  
  39. code
  40.  
  41. user0:
  42.      sendmessage(animcog, user0);
  43.      Mcount=0;
  44.      slidewall(conveyor, conVector, 3);  
  45.      slidewall(conveyorA, conVector, 3); 
  46.      slidewall(conveyor2, conVector2, 3);
  47.      slidewall(conveyor2a, conVector2, 3);
  48.      slidewall(conveyor2b, conVector2, 3);
  49.      slidewall(xtracon, convector, 3);
  50.      player=getlocalplayerthing();
  51.      call createPMN;
  52.      okaytopickup=1;
  53.      return;
  54.      
  55. used:     
  56.      print("used");
  57. //     print("activate bin=");
  58. //     printint(dwGetActivateBin());
  59.      if (getsenderid()==3) {
  60.           if ( (getinv(player, dwGetActivateBin() ) >0)&&(dwgetactivatebin()==32) ) {
  61.                okaytopickup=0;
  62.                PMN2=creatething(PhrikT, ghostdeliver);
  63.                capturething(PMN2);
  64.                changeInv(player, 32, -1);
  65.                SetInvAvailable(player, 32, 0);
  66.                setpulse(1);
  67.                sleep(0.5);
  68.                movetoframe(elevator, 1, 1);
  69.                movetoframe(PMN2, 1, 1);
  70.                Mcount=Mcount+1;
  71.                 if (Mcount==3) {
  72.                     sendmessage(Fittocog, user5);
  73.                     dwplaycammyspeech(16018, "m2ca018.wav", 20, 2);
  74.                }
  75.                else if (Mcount==1) {
  76.                     dwplaycammyspeech(16017, "m2ca017.wav", 20, 2);
  77.                }         
  78.           }    
  79.      }
  80.      return;          
  81.      
  82.  
  83.  
  84. taken:
  85.      print("trying to take");
  86.      if (getsenderid()==3) return;
  87.      if (okaytopickup==0) return;
  88.      if (dwGetArmStrength() > 6) {    
  89.           if (Mcount==0) dwplaycammyspeech(16021, "m2ca021.wav", 20, 2);
  90.           else playsoundlocal(takesound, 1.0, 0.0, -1);
  91.           print("taken");
  92.           dwFlashInventory(); 
  93.           destroything(PMN);
  94.           SetInvAvailable(player, 32, 1);
  95.           changeInv(player, 32, 1);
  96.      }  
  97.    else {
  98.           print("you're not strong enough to pick that up!");  
  99.           dwplaycammyspeech(16022, "m2ca022.wav", 20, 2); 
  100.      }      
  101.      return;     
  102.  
  103. createPMN:
  104.      PMN=creatething(PhrikT, ghostpickup);
  105.      capturething(PMN);
  106.      movetoframe(PMN, 2, 3);
  107.      setpulse(1);
  108.      return;
  109.      
  110. arrived:
  111.      if (getcurframe(PMN)==2) movetoframe(PMN, 3, 30);
  112.      return;
  113.      
  114.      
  115. pulse:
  116.      if (getthingsector(PMN)==ds1) {
  117.           print("destroying original PMN");
  118.           destroything(PMN);
  119.           call createPMN;    
  120.      }
  121.      else if (getthingsector(PMN2)==ds2) {
  122.           destroything(PMN2);
  123.           movetoframe(elevator, 0, 20);
  124.           if (Mcount==3) setpulse(0);
  125.           else call createPMN;
  126.           okaytopickup=1;
  127.      }
  128.      return;
  129.  
  130. end
  131.