home *** CD-ROM | disk | FTP | other *** search
- #standard type crate generation cog.
- symbols
- message startup
- message pulse
-
- surface unit1a
- surface unit1b
- surface unit1c
- surface unit1d
- surface unit1e
- surface unit1f
-
- surface unit2a
- surface unit2b
- surface unit2c
- surface unit2d
- surface unit2e
-
- sector targetsector
-
- thing magtram
- thing crate0
- thing crate1
-
- cog tramcog
- end
-
- ## Code Section
- code
- startup:
- player=getlocalplayerthing();
- randx=rand();
- setadjoinflags(unit1a, 2);
- setadjoinflags(unit1b, 2);
- setadjoinflags(unit1c, 2);
- setadjoinflags(unit1d, 2);
- setadjoinflags(unit1e, 2);
- setadjoinflags(unit1f, 2);
-
- setadjoinflags(unit2a, 2);
- setadjoinflags(unit2b, 2);
- setadjoinflags(unit2c, 2);
- setadjoinflags(unit2d, 2);
- setadjoinflags(unit2e, 2);
-
- setfacegeomode(unit1a, 0);
- setfacegeomode(unit1b, 0);
- setfacegeomode(unit1c, 0);
- setfacegeomode(unit1d, 0);
- setfacegeomode(unit1e, 0);
- setfacegeomode(unit1f, 0);
-
- setfacegeomode(unit2a, 0);
- setfacegeomode(unit2b, 0);
- setfacegeomode(unit2c, 0);
- setfacegeomode(unit2d, 0);
- setfacegeomode(unit2e, 0);
- // if (rand()>.5) call setup1;
- // else call setup2;
- // call setup2;
- // setpulse(1);
- return;
-
-
- setup1:
- print("clearup1 called");
- clearadjoinflags(unit1a, 2);
- clearadjoinflags(unit1b, 2);
- clearadjoinflags(unit1c, 2);
- clearadjoinflags(unit1d, 2);
- clearadjoinflags(unit1e, 2);
- clearadjoinflags(unit1f, 2);
-
- setfacegeomode(unit1a, 4);
- setfacegeomode(unit1b, 4);
- setfacegeomode(unit1c, 4);
- setfacegeomode(unit1d, 4);
- setfacegeomode(unit1e, 4);
- setfacegeomode(unit1f, 4);
-
- return;
-
- setup2:
- print("clearup2 called");
- clearadjoinflags(unit2a, 2);
- clearadjoinflags(unit2b, 2);
- clearadjoinflags(unit2c, 2);
- clearadjoinflags(unit2d, 2);
- clearadjoinflags(unit2e, 2);
-
- setfacegeomode(unit2a, 4);
- setfacegeomode(unit2b, 4);
- setfacegeomode(unit2c, 4);
- setfacegeomode(unit2d, 4);
- setfacegeomode(unit2e, 4);
- return;
-
- pulse:
- if ((getdifficulty()==1)||(getdifficulty==2)) {
- if ((getthingsector(crate1)==targetsector)||(getthingsector(crate2)==targetsector)) {
- print("here comes the tram!");
- sendmessage(tramcog, user0);
- }
- else print("nope.");
- }
-
- return;
-
-
-
- end
-
-
-
-
-
-
-
-
-
-
-