home *** CD-ROM | disk | FTP | other *** search
- # DrowWorks Cog Script
- #
- # SY_MagTram A
- #
- # First attempt at MagTram cog
- #
- # Desc:
- #
- #
- #
- # [01/18/97] DGS Created From Matt's TreadRX script.
- # [03/03/98] DGS Modified to work with sector thrusts. It got totally re-written. (Del-Fi Lost Treasures)
- symbols
- ## ====================== Messages
- message startup
- message timer
- message activated
-
- surface button0 linkid=1
- vector up
- sector goingup
-
- sound magnet=AMB00MgntLp2.wav local
- sound switch=swt00drswtch.wav local
-
- int show_once1=1 local
- int show_once2=1 local
- int show_once3=1 local
- int show_once4=1 local
-
- thing emagnet
- sound up=NRG00MgntSck.wav local
- sound attach=NRG00MgntAttch.wav local
-
- surface a1 nolink
- surface a2 nolink
- surface a3 nolink
- surface a4 nolink
-
- end
-
- # ========================================================================================
-
- code
-
- startup:
- setwallcel(button0, 2);
- player=getlocalplayerthing();
- return;
-
- activated:
- //playsoundlocal(switch, 1, 0, 0);
- if (getsenderid() ==1)
- {
- if (getthingsector(getlocalplayerthing()) == goingup)
- {
- playsoundlocal(switch, 1, 0, 0);
- if (dwCheckDroidCaps(16))
- {
- print("magnetic!");
- Setwallcel(button0, 1);
- call adjoinon;
- SetSectorThrust(goingup, up, 8);
- playsoundlocal(attach, 1, 0, 0);
- magneti=Playsoundthing(magnet, emagnet, 1.0, -1, -1, 0x1);
- dwdisablejump();
- settimer(4);
- randx=rand();
- if (randx> 0.6)
- {
- if (show_once1 < 2)
- {
- dwplaycammyspeech(16015, "TGCA018.wav", 4, 2); //great globes of att...
- if (show_once1 == 1) show_once1 = 2;
- }
- }
-
- else
- {
- if (show_once2 < 2)
- {
- dwplaycammyspeech(16410, "TGCA054.wav", 4, 2);
- if (show_once2 == 1) show_once2 = 2;
- }
- }
- }
-
- else if (!dwCheckDroidCaps(16))
- {
- print("notmagnetic");
- randx=rand();
- settimer(7);
- Setwallcel(button0, 2);
- if (randx>0.5)
- {
- if (show_once3 < 2)
- {
- dwplaycammyspeech(16016, "TGCA019.wav", 4, 2); //looks like it ain't magnetic
- if (show_once3 == 1) show_once3 = 2;
- }
- }
-
- else
- {
- if (show_once4 < 2)
- {
- dwplaycammyspeech(16420, "TGCA055.wav", 4, 2);
- if (show_once4 == 1) show_once4 = 2;
- }
- }
- }
-
- }
- }
-
- return;
-
- timer:
- SetSectorThrust(goingup, up, 0);
- dwenablejump();
- call adjoinoff;
- Setwallcel(button0, 2);
- stopsound(magneti, 0.5);
- return;
-
- adjoinon:
- print("adjoinon");
- clearadjoinflags(a1, 2);
- clearadjoinflags(a2, 2);
- clearadjoinflags(a3, 2);
- clearadjoinflags(a4, 2);
- return;
-
- adjoinoff:
- print("adjoinoff");
- setadjoinflags(a1, 2);
- setadjoinflags(a2, 2);
- setadjoinflags(a3, 2);
- setadjoinflags(a4, 2);
- return;
-
-
- end
-
-
-