home *** CD-ROM | disk | FTP | other *** search
- # DroidWorks
- # 03_env_tanks.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
- # [01/29/98] JP Modified to work in the Moisture Farm Level
-
- 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
-
- sound pickup=Nrginventory.wav local
-
- 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;
- }
- player=getlocalplayerthing();
- //armstrength=dwgetarmstrength( getlocalplayerthing() );
- return;
-
- pulse:
- call startup;
- printflex(set);
- return;
-
- taken:
- //if (armstrength>8) {
- if (dwGetArmStrength() > 8) {
- SetInvAvailable(getlocalplayerthing(), inv_number, 1);
- ChangeInv(getlocalplayerthing(), inv_number, 1);
- destroything(act_thing);
- playsoundlocal(pickup, 1, 0, 0);
- dwflashinventory();
- }
- else {
- print("you're not strong enough to pick that up!");
- dwplaycammyspeech(16044, "m2ca022.wav", 20, 2); //droid ain't strong enough
- }
- return;
-
- end
-