home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # CC_Mirror.cog
- #
- # Generic Mirror control Script
- #
- # 03/17/98 DGS Created
- #
- #Desc:
- # cog designed to keep the doors from being able to be cut.
- # (C) 1998 Lucas Learning Limited All Rights Reserved
- # ========================================================================================
-
- symbols
- message cut
- message arrived
- message startup
- message timer
- message activated
- message entered
-
- ## ========================= Things
- thing door_o linkid=1
- thing spike_o linkid=2
- thing anchor_g
- thing door_g
- thing cut_g
-
- sound cut_snd=FLY01CutRope.WAV local
- sound crash_snd=CRA01DoorFall.WAV local
-
- sector sayline_sector
- surface tramblock1 linkid=2
- surface tramblock2 linkid=2
- surface tramblock3 linkid=2
- surface tramblock4 linkid=2
- int l_color=0 local
- flex l_size=0.005 local
- thing rope1_i=0 local
- thing rope2_i=0 local
- int mtext=0 local
- int cut=0 local
- int sayline=0 local
- end
-
- # ========================================================================================
-
- code
- entered:
- if (sayline == 0)
- {
- dwPlayCammySpeech(16108, "m1ca011.wav", 10, 0);
- sayline = 1;
- }
- return;
-
- startup:
- cut = 0;
- attachthingtothing(door_g,door_o);
- rope1_i = addbeam(anchor_g, cut_g, 147, l_size);
- rope2_i = addbeam(cut_g, door_g, 147, l_size);
- clearadjoinflags(tramblock1, 2);
- clearadjoinflags(tramblock2, 2);
- clearadjoinflags(tramblock3, 2);
- clearadjoinflags(tramblock4, 2);
-
- return;
-
- cut:
- print("cut");
- printint(cut);
- //sleep(1);
- if (cut == 0)
- {
- if (getsenderid() == 2) //if the player is trying to cut the rope
- {
- setadjoinflags(tramblock1, 2);
- setadjoinflags(tramblock2, 2);
- setadjoinflags(tramblock3, 2);
- setadjoinflags(tramblock4, 2);
- // cut the rope.......
- garbage = playsoundlocal(cut_snd,1.0,0.0,0);
- removelaser(rope1_i);
- movetoframe(cut_g,1,10);
- rotatepivot(door_o,1,0.5);
- cut=1;
- }
- else
- {
- print("suckerfool");
- dwPlayCammySpeech(12501, "M1ca039.wav", 10, 0);
- }
- }
- return;
-
- arrived:
- if (getsenderid()== 1)
- {
- removelaser(rope2_i);
- garbage = playsoundlocal(crash_snd,1.0,0.0,0);
- }
- return;
-
- activated:
- if ((getsenderid() == 1) && (cut == 0))
- {
- print("It's not going to open");
- dwPlayCammySpeech(12500, "M1ca038.wav", 10, 0);
- }
- return;
- timer:
- If (mtext == dwGetMissionText())
- {
- //notneeded anymore print("DWcleared");
- }
- return;
-
- end
-
-