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

  1. # Jedi Knight Cog Script
  2. #
  3. # CC_Mirror.cog
  4. #
  5. # Generic Mirror control Script
  6. #
  7. # 03/17/98 DGS Created
  8. #
  9. #Desc:
  10. # cog designed to keep the doors from being able to be cut.
  11. # (C) 1998 Lucas Learning Limited All Rights Reserved
  12. # ========================================================================================
  13.  
  14. symbols
  15. message           cut
  16. message            arrived
  17. message            startup            
  18. message          timer
  19. message            activated
  20. message            entered
  21.  
  22. ## ========================= Things
  23. thing            door_o    linkid=1
  24. thing            spike_o    linkid=2
  25. thing            anchor_g
  26. thing            door_g
  27. thing            cut_g
  28.  
  29. sound            cut_snd=FLY01CutRope.WAV        local
  30. sound            crash_snd=CRA01DoorFall.WAV     local
  31.  
  32. sector            sayline_sector
  33. surface            tramblock1            linkid=2
  34. surface            tramblock2            linkid=2
  35. surface            tramblock3            linkid=2
  36. surface            tramblock4            linkid=2
  37. int                l_color=0        local
  38. flex            l_size=0.005    local
  39. thing            rope1_i=0        local
  40. thing            rope2_i=0        local
  41. int                mtext=0            local
  42. int                cut=0            local
  43. int                sayline=0        local
  44. end
  45.  
  46. # ========================================================================================
  47.                     
  48. code
  49. entered:
  50.     if (sayline == 0)
  51.         {
  52.         dwPlayCammySpeech(16108, "m1ca011.wav", 10, 0);
  53.         sayline = 1;
  54.         }
  55.     return;
  56.  
  57. startup:
  58.     cut = 0;
  59.     attachthingtothing(door_g,door_o);
  60.     rope1_i  = addbeam(anchor_g,    cut_g,    147,    l_size);
  61.     rope2_i  = addbeam(cut_g,        door_g,    147,    l_size);
  62.         clearadjoinflags(tramblock1, 2);
  63.         clearadjoinflags(tramblock2, 2);
  64.         clearadjoinflags(tramblock3, 2);
  65.         clearadjoinflags(tramblock4, 2);
  66.     
  67.     return;
  68.  
  69. cut:
  70.     print("cut");
  71.     printint(cut);
  72.     //sleep(1);
  73.     if (cut == 0)
  74.         {
  75.         if (getsenderid() == 2)        //if the player is trying to cut the rope
  76.             {
  77.              setadjoinflags(tramblock1, 2);
  78.              setadjoinflags(tramblock2, 2);
  79.              setadjoinflags(tramblock3, 2);
  80.              setadjoinflags(tramblock4, 2);
  81.             // cut the rope.......
  82.             garbage = playsoundlocal(cut_snd,1.0,0.0,0);
  83.             removelaser(rope1_i);
  84.             movetoframe(cut_g,1,10);
  85.             rotatepivot(door_o,1,0.5);
  86.             cut=1;
  87.             }
  88.         else
  89.             {
  90.             print("suckerfool");
  91.             dwPlayCammySpeech(12501, "M1ca039.wav", 10, 0);
  92.             }
  93.         }
  94.     return;
  95.  
  96. arrived:
  97.     if (getsenderid()== 1) 
  98.         {
  99.         removelaser(rope2_i); 
  100.         garbage = playsoundlocal(crash_snd,1.0,0.0,0);
  101.         }
  102.     return;
  103.  
  104. activated:
  105.     if ((getsenderid() == 1) && (cut == 0))
  106.         {
  107.         print("It's not going to open");
  108.         dwPlayCammySpeech(12500, "M1ca038.wav", 10, 0);
  109.         }
  110.     return;
  111. timer:
  112.     If (mtext == dwGetMissionText())  
  113.         {
  114.         //notneeded anymore        print("DWcleared");
  115.         }
  116.     return;
  117.     
  118. end
  119.  
  120.