home *** CD-ROM | disk | FTP | other *** search
- # DroidWorks
- # b0_env_battery.cog
- #
- # Randomizer cog for the Gear level.
- #
- #
- #
- # Script handles random enviroment object for the maze.
- # taken from env_pulley
- #
- #
- # [01/16/98] DGS Created
- # [01/26/98] DGS Added code to make it random
- # [01/30/98] DGS Took from env_gear.cog and added extra things
- # [02/04/98] DGS Took from b0_enf_pulley.
- # [03/30/98] DGS Took from Maze_rand and converted it to Gears.
-
-
- symbols
-
- sector Shuffle_s
- thing thing1
- thing thing2
- thing thing3
-
- message startup
- message pulse
- message entered
-
- int amount=3 local
- int inv_number=0
- flex set=0.0
- int enter=0 local
-
- end
-
- # ========================================================================================
-
- code
- startup:
- setpulse(0.2);
- return;
-
- pulse:
- set = (rand()*amount);
- //printflex(set);
- return;
-
- entered:
- if (enter == 0)
- {
- print("Mode:");
- printint(thing1);
- printint(thing2);
- printint(thing3);
- enter = 1;
- setpulse(0);
- call destroy;
- }
- return;
-
- destroy:
- if (set < 1)
- {
- act_thing = thing1;
- if (thing2 != 0) destroything(thing2);
- if (thing3 != 0) destroything(thing3);
- }
- else if ( set < 2)
- {
- if (thing1 != 0) destroything(thing1);
- act_thing = thing2;
- if (thing3 != 0) destroything(thing3);
- }
- else if ( set < 3)
- {
- if (thing1 != 0) destroything(thing1);
- if (thing2 != 0) destroything(thing2);
- act_thing = thing3;
- }
-
- return;
- taken:
- SetInvAvailable(getlocalplayerthing(), inv_number, 1);
- ChangeInv(getlocalplayerthing(), inv_number, 1);
- destroything(act_thing);
- return;
-
- end
-
-