home *** CD-ROM | disk | FTP | other *** search
- # DroidWorks
- # b0_env_gear.cog
- #
- #
- #
- # Battery is in inventory bin 16
- # Power is in inventory bin 20
- #
- # Script handles random enviroment object for the gear level. It also handles
- # the pick-up for right now, although I might change that later on.
- #
- # Set the inv_number to what bin you want it added to.
- # Set amount var to how many things you have attached.
- #
- # [01/16/98] DGS Created
- # [01/26/98] DGS Added code to make it random
- #
-
- symbols
-
- thing thing0
- thing thing1
- thing thing2
-
-
- message taken
- message startup
- message pulse
-
- int amount=0
- flex set=0.0
- int inv_number=0
- int act_thing
-
- end
-
- # ========================================================================================
-
- code
- startup:
- set = (rand()*amount);
- if (set < 1)
- {
- print("Rand: 0");
- // Keep thing 0
- act_thing = thing0;
- destroything(thing1);
- destroything(thing2);
- }
- else if ( set < 2)
- {
- print("Rand: 2");
- // keep thing 1
- destroything(thing0);
- act_thing = thing1;
- destroything(thing2);
- }
- else if ( set < 3)
- {
- print("Rand: 3");
- // Keep thing 2
- destroything(thing0);
- destroything(thing1);
- act_thing = thing2;
- }
- return;
-
- pulse:
- call startup;
- printflex(set);
- return;
-
- taken:
- SetInvAvailable(getlocalplayerthing(), inv_number, 1);
- ChangeInv(getlocalplayerthing(), inv_number, 1);
- destroything(act_thing);
- return;
-
- end
-