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

  1. #standard type crate generation cog.
  2. symbols
  3. message        startup
  4. message        activate
  5. message        arrived
  6. message        timer
  7. thing          incline1            nolink
  8. thing          incline2            nolink   
  9. thing          incline3            nolink  
  10. thing          incline4            nolink       
  11. thing          alternatecam
  12. surface        switch1             linkid=5
  13. surface        switch2             linkid=6
  14. surface        switch3             linkid=7
  15. surface        switch4             linkid=8 
  16.  
  17. sound          fulcrumstart=mcht4InclStrt.wav
  18. sound          fulcrumloop=mcht4incllp.wav
  19. sound          fulcrumstop=mcht4inclstp.wav
  20.  
  21. sound          switchsound=swt00ltswch1.wav   
  22.  
  23. template       template12
  24. template       template123
  25. template       template1234
  26. thing          ghost12
  27. thing          ghost123
  28. thing          ghost1234
  29. thing          fakeincline1        linkid=1
  30. thing          fakeincline2        linkid=2
  31. thing          fakeincline3        linkid=3
  32. thing          fakeincline4        linkid=4
  33. thing          truealternatecam
  34. thing          ThatCrate           nolink
  35. thing          CTDest24
  36. thing          CTDest3
  37. thing          ThatOtherCrate      nolink
  38. thing          TOCDest24
  39. thing          TOCDest3
  40. int            XCheck1=0              local
  41. int            XCheck2=0           local
  42. end
  43.  
  44. ## Code Section
  45. code                  
  46. startup:
  47.      ca5=0;
  48.      hasmoved=0;
  49.      player=getlocalplayerthing();
  50.      setwallcel(switch1, 1);
  51.      setwallcel(switch2, 1);
  52.      setwallcel(switch3, 1);
  53.      setwallcel(switch4, 1);
  54.      return;
  55.  
  56. activate:
  57.      print("activate");
  58.      printint(getsenderid());
  59.      cratepos=getthingpos(ThatCrate);
  60.      crateY=VectorY(cratepos);
  61.      crateX=VectorX(cratepos);
  62.      cratepos2=getthingpos(ThatOtherCrate);
  63.      crateY2=VectorY(cratepos2);     
  64.      crateX2=VectorX(cratepos2);
  65.  
  66.      if ( (getsenderid()==5)&&(getwallcel(switch1)==1) ) { 
  67.           playsoundpos(switchsound, getsurfacecenter(switch1), 1.0, -1, -1, 0);
  68.           setwallcel(switch1, 2);     
  69.           settimerEX(0.5, 1, 0, 0);
  70.           dwfreezeplayer();
  71.           movetoframe(incline1, 1, 5);
  72.           movetoframe(fakeincline1, 1, 5);
  73.           playsoundlocal(fulcrumstart,  1.0, 0.0, 0);
  74.           sleep(0.17);
  75.           floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);          
  76.           if (getdifficulty()==0) dwPlayCammySpeech(16005, "t4ca005.wav", 20, 2); 
  77.      }
  78.      else if ( (getsenderid()==6)&&(getwallcel(switch2)==1) ) { 
  79.           playsoundpos(switchsound, getsurfacecenter(switch2), 1.0, -1, -1, 0);
  80.           setwallcel(switch2, 2);     
  81.           settimerEX(0.5, 2, 0, 0);
  82.           dwfreezeplayer();
  83.           destroything(incline2);
  84.           movetoframe(fakeincline2, 1, 5);
  85.           playsoundlocal(fulcrumstart,  1.0, 0.0, 0);
  86.           sleep(0.17);
  87.           floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);          
  88.           if (getdifficulty()==0) dwPlayCammySpeech(16006, "t4ca006.wav", 20, 2);                                            
  89.           if ( (crateY>15.95)&&(crateY<16.63)&&(crateX>7.88)&&(crateX<8.65) ) teleportthing(thatcrate, CTDest24);                                           
  90.           if ( (crateY2>15.95)&&(crateY2<16.63)&&(crateX2>7.88)&&(crateX2<8.65) ) teleportthing(thatothercrate, TOCDest24);                                           
  91.      }
  92.      else if ( (getsenderid()==7)&&(getwallcel(switch3)==1) ) { 
  93.           playsoundpos(switchsound, getsurfacecenter(switch3), 1.0, -1, -1, 0);
  94.           setwallcel(switch3, 2);     
  95.           settimerEX(0.5, 3, 0, 0);
  96.           dwfreezeplayer();
  97.           destroything(incline3);
  98.           movetoframe(fakeincline3, 1, 5);
  99.           playsoundlocal(fulcrumstart,  1.0, 0.0, 0);
  100.           sleep(0.17);
  101.           floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);          
  102.           if (getdifficulty()==0) dwPlayCammySpeech(16007, "t4ca007.wav", 10, 2);                                                                          
  103.           if ( (crateY>15.95)&&(crateY<16.63)&&(crateX>7.31)&&(crateX<8.28) ) teleportthing(thatcrate, CTDest3);
  104.           if ( (crateY2>15.95)&&(crateY2<16.63)&&(crateX2>7.31)&&(crateX2<8.28) ) teleportthing(thatOthercrate, TOCDest3);                                                    
  105.                                            
  106.      }
  107.      else if ( (getsenderid()==8)&&(getwallcel(switch4)==1) ) { 
  108.           playsoundpos(switchsound, getsurfacecenter(switch4), 1.0, -1, -1, 0);
  109.           setwallcel(switch4, 2);     
  110.           settimerEX(0.5, 4, 0, 0);
  111.           dwfreezeplayer();
  112.           destroything(incline4);
  113.           movetoframe(fakeincline4, 1, 5);
  114.           playsoundlocal(fulcrumstart,  1.0, 0.0, 0);
  115.           sleep(0.17);
  116.           floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);          
  117.           if (getdifficulty()==0) dwPlayCammySpeech(16008, "t4ca008.wav", 10, 2);                     
  118.           if ( (crateY>15.95)&&(crateY<16.63)&&(crateX>6.54)&&(crateX<7.89) ) teleportthing(thatcrate, CTDest24);
  119.           if ( (crateY2>15.95)&&(crateY2<16.63)&&(crateX2>6.54)&&(crateX2<7.89) ) teleportthing(thatOthercrate, TOCDest24);                                           
  120.      }
  121.      return;
  122.      
  123. timer:    
  124.      if (getsenderid()==1) SetCameraFocii(2, incline1, truealternatecam);
  125.      else if (getsenderid()==2) SetCameraFocii(2, fakeincline2, alternatecam);
  126.      else if (getsenderid()==3) SetCameraFocii(2, fakeincline3, alternatecam);
  127.      else if (getsenderid()==4) SetCameraFocii(2, fakeincline4, alternatecam);
  128.      SetCurrentCamera(2);
  129.      return;
  130.      
  131. arrived:
  132.      if (getsenderid()==1) {
  133.           setwallcel(switch1, 0);
  134.           stopsound(floop, 0.75);
  135.           playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
  136.           sleep(0.5);
  137.           SetCurrentCamera(7);
  138.           dwunfreezeplayer();
  139.      }
  140.      else if (getsenderid()==2) {
  141.           setwallcel(switch2, 0);
  142.           stopsound(floop, 0.75);
  143.           playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
  144.           sleep(0.5);
  145.           SetCurrentCamera(7);
  146.           dwunfreezeplayer();
  147.           destroything(incline1);
  148.           incline12=creatething(template12, ghost12);
  149.      }
  150.      else if (getsenderid()==3) {
  151.           setwallcel(switch3, 0);
  152.           stopsound(floop, 0.75);
  153.           playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
  154.           sleep(0.5);
  155.           SetCurrentCamera(7);
  156.           dwunfreezeplayer();
  157.           destroything(incline12);
  158.           incline123=creatething(template123, ghost123);
  159.      }
  160.      else if (getsenderid()==4) {
  161.           setwallcel(switch4, 0);
  162.           stopsound(floop, 0.75);
  163.           playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
  164.           SetCurrentCamera(7);
  165.           dwunfreezeplayer();
  166.           destroything(incline123);
  167.           incline1234=creatething(template1234, ghost1234);          
  168.      }
  169.      return;
  170.  
  171. end
  172.      
  173.      
  174.      
  175.     
  176.  
  177.      
  178.      
  179.      
  180.      
  181.  
  182.