home *** CD-ROM | disk | FTP | other *** search
- symbols
- message user0
- message user1
- message user2
- message user3
- message user4
- message user5
- message user6
- message startup
- message entered
- message activate
- message arrived
- message pulse
- message timer
-
- sector crosector linkid=1
- sector lamesector linkid=2
-
- thing light1
- thing light2
- thing light3
-
- thing xlight1
- thing xlight2
- thing xlight3
- thing xlight4
- thing xlight5
- thing xlight6
- thing xlight7
- thing xlight8
-
- thing mirror
-
- cog fittotalkcog
- cog ADarrivescog
-
- flex xcount=0.67
-
- cog goalscog
-
- surface mirrorswitch linkid=3
- surface led_ones nolink
- surface led_tens nolink
-
- sound poweronwav=nrg02poweron.wav
- sound poweroffwav=nrg02poweroff.wav
- sound clicksound
- end
-
- code
- startup:
- poweron=0;
- ct=0;
- ct2=0;
- x1genon=0;
- x2genon=0;
- x3genon=0;
- setthinglight(light1, 0, 0.0);
- setthinglight(light2, 0, 0.0);
- setthinglight(light3, 0, 0.0);
- setpulse(5);
- rotatepivot(mirror, 1, 1);
- settimerEX(3, 1, 0, 0);
- direction=1;
- mircount=0;
- genbreak=0;
- pleasework=0;
- md_power=35;
- call displayweight;
- return;
-
- pulse:
- if ( (x1genon==1)&&(x2genon==1)&&(x3genon==1) ) xcount=1.0;
-
- if ( (x1genon==1)&&(x2genon==1)&&(x3genon==0) ) xcount=0.67;
- if ( (x1genon==1)&&(x2genon==0)&&(x3genon==1) ) xcount=0.67;
- if ( (x1genon==1)&&(x2genon==0)&&(x3genon==1) ) xcount=0.67;
-
- if ( (x1genon==1)&&(x2genon==0)&&(x3genon==0) ) xcount=0.33;
- if ( (x1genon==0)&&(x2genon==1)&&(x3genon==0) ) xcount=0.33;
- if ( (x1genon==0)&&(x2genon==0)&&(x3genon==1) ) xcount=0.33;
-
- rand1=rand();
- rand2=rand();
- rand3=rand();
- rand4=rand();
- rand5=rand();
- rand6=rand();
- rand7=rand();
- rand8=rand();
-
- hightime=xcount*2.5;
-
- if (rand1<xcount) setthinglight(xlight1, hightime, 2);
- else setthinglight(xlight1, .33, 2);
-
- if (rand2<xcount) setthinglight(xlight2, hightime, 2);
- else setthinglight(xlight2, .33, 2);
-
- if (rand3<xcount) setthinglight(xlight3, hightime, 2);
- else setthinglight(xlight3, .33, 2);
-
- if (rand4<xcount) setthinglight(xlight4, hightime, 2);
- else setthinglight(xlight4, .33, 2);
-
- if (rand5<xcount) setthinglight(xlight5, hightime, 2);
- else setthinglight(xlight5, .33, 2);
-
- if (rand6<xcount) setthinglight(xlight6, hightime, 2);
- else setthinglight(xlight6, .33, 2);
-
- if (rand7<xcount) setthinglight(xlight7, hightime, 2);
- else setthinglight(xlight7, .33, 2);
-
- if (rand8<xcount) setthinglight(xlight8, hightime, 2);
- else setthinglight(xlight8, .33, 2);
-
- return;
-
- entered:
- if (getsenderid()==1) call xGenCheck;
- return;
-
- user0:
- x1genon=1;
- print("generator one LINED UP");
- if (miron==1) setthinglight(light1, 1.5, 3.0);
- call xGenCheck;
- // else call ctext2;
- return;
-
- user1:
- x1genon=0;
- setthinglight(light1, 0.0, 3.0);
- call xGenCheck;
- return;
-
- user2:
- x2genon=1;
- print("generator two ONLINE");
- setthinglight(light2, 1.5, 3.0);
- call xGenCheck;
- return;
-
- user3:
- x2genon=0;
- setthinglight(light2, 0.0, 3.0);
- call xGenCheck;
- return;
-
- user4:
- x3genon=1;
- print("generator three ONLINE");
- setthinglight(light3, 1.5, 3.0);
- call xGenCheck;
- return;
-
- user5:
- x3genon=0;
- setthinglight(light3, 0.0, 3.0);
- call xGenCheck;
- return;
-
- user6:
- genbreak=1;
- return;
-
- timer:
- if (getsenderid()==1) {
- if (mircount<6) {
- rotatepivot(mirror, 1, 1);
- settimerEX(3, 1, 0, 0);
- }
- }
- else if (getsenderid()==2) {
- md_power=md_power+inc;
- if (md_power < 35) md_power = 35;
- else if (md_power>65) md_power=65;
- else if (md_power == c_dest) print("reached c_dest");
- else SetTimerEX(0.02,2,0,0);
- call displayweight;
- }
- return;
-
- displayweight:
- playsoundpos(clicksound, getsurfacecenter(led_tens), 0.3, -1, -1, 0);
- SetWallCel(led_ones, md_power % 10);
- SetWallCel(led_tens, (md_power / 10) % 10);
- SetWallCel(led_hund, (md_power / 100) % 10);
- return;
-
- #--------------------------------------------------------------------------
- arrived:
- setwallcel(mirrorswitch,0);
- mircount=mircount+1;
- print("mircount is");
- printint(mircount);
- miron=0;
- if (mircount%12==0) {
- direction=1;
- jumptoframe(mirror, 0, getthingsector(mirror));
- print("jump!");
- }
- else if ((mircount-6)%12==0) direction=-1;
- else if ( ((mircount-8)%12==0)||((mircount-4)%12==0) ) {
- if (x1genon==1) setthinglight(light1, 1.5, 3.0);
- miron=1;
- print("that's it!");
- }
- else setthinglight(light1, 0.0, 3.0);
- call xGenCheck;
- return;
-
- activate:
- print("activate");
- if (getsenderid()==3) {
- if (getwallcel(mirrorswitch)==1) return;
- setwallcel(mirrorswitch, 1);
-
- if (direction==1) {
- print("moving downward");
- rotatepivot(mirror, 1, 1);
- inc=-1;
- c_dest=md_power-5;
- }
- else if (direction==-1) {
- print("moving upward");
- rotatepivot(mirror, 1, -1);
- inc=1;
- c_dest=md_power+5;
- }
-
-
- SetTimerEX(0.02,2,0,0);
- }
- return;
-
- displayweight:
- SetWallCel(led_ones, md_power % 10);
- SetWallCel(led_tens, (md_power / 10) % 10);
- return;
-
-
-
- #--------------------------------------------------------------------------
-
- xGenCheck:
- if ( (x3genon==1)&&(x2genon==1)&&(x1genon==1)&&(miron==1) ) {
- print("GENERATORS ONLINE");
- playsoundlocal(poweronwav, 1.0, 0.0, 0);
- poweron=1;
- if (genbreak==0) {
- sendmessage(fittotalkcog, user3);
- call ctext1;
- }
- else if ((genbreak==1)&&(pleasework==0)) {
- sendmessage(ADarrivescog, user0);
- pleasework=1;
- }
- }
- else {
- print("GENERATORS OFFLINE");
- sendmessage(fittotalkcog, user2);
- if (poweron==1) {
- playsoundlocal(poweroffwav, 1.0, 0.0, 0);
- poweron=0;
- }
- }
- return;
-
- ctext1:
- if (ct==0) {
- dwplaycammyspeech(16006, "m2ca006.wav", 20, 2);
- // sendmessage(goalscog, user0);
- ct=1;
- }
- return;
-
- ctext2:
- if (ct2==0) {
- dwplaycammyspeech(16016, "m2ca016.wav", 20, 2);
- ct2=1;
- }
- return;
-
- end
-
-
-
-
-
-
-
-
-
-
-