home *** CD-ROM | disk | FTP | other *** search
- # DroidWorks
- # b0_env_pulley.cog
- #
- #
- #
- # Battery is in inventory bin 16
- # Power is in inventory bin 20
- #
- # Script handles random enviroment object for the pulley. 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/30/98] DGS Took from env_gear.cog and added extra things
- #
-
- symbols
-
- thing thing0a
- thing thing0b
- thing thing1a
- thing thing1b
- thing thing2a
- thing thing2b
- thing thing3a
- thing thing3b
- thing thing4a
- thing thing4b
- cog jawa_cog
-
- message taken
- message startup
- message pulse
-
- int amount=0
- flex set=0.0
- int inv_number=0
- int act_thinga local
- int act_thingb local
-
- end
-
- # ========================================================================================
-
- code
- startup:
- set = (rand()*amount);
- if (set < 1)
- {
- print("Rand: 0");
- // Keep thing 0
- act_thinga = thing0a;
- act_thingb = thing0b;
-
- destroything(thing1a);
- destroything(thing1b);
-
- destroything(thing2a);
- destroything(thing2b);
-
- destroything(thing3a);
- destroything(thing3b);
-
- destroything(thing4a);
- destroything(thing4b);
- }
- else if ( set < 2)
- {
- print("Rand: 2");
- // keep thing 1
- destroything(thing0a);
- destroything(thing0b);
-
- act_thinga = thing1a;
- act_thingb = thing1b;
-
- destroything(thing2a);
- destroything(thing2b);
-
- destroything(thing3a);
- destroything(thing3b);
-
- destroything(thing4a);
- destroything(thing4b);
- }
- else if ( set < 3)
- {
- print("Rand: 3");
- // Keep thing 2
- destroything(thing0a);
- destroything(thing0b);
-
- destroything(thing1a);
- destroything(thing1b);
-
- act_thinga = thing2a;
- act_thingb = thing2b;
-
- destroything(thing3a);
- destroything(thing3b);
-
- destroything(thing4a);
- destroything(thing4b);
- }
- else if ( set < 4)
- {
- print("Rand: 4");
- // Keep thing 3
- destroything(thing0a);
- destroything(thing0b);
-
- destroything(thing1a);
- destroything(thing1b);
-
- destroything(thing2a);
- destroything(thing2b);
-
- act_thinga = thing3a;
- act_thingb = thing3b;
-
- destroything(thing4a);
- destroything(thing4b);
- }
- else if ( set < 5)
- {
- print("Rand: 5");
- // Keep thing 4
- destroything(thing0a);
- destroything(thing0b);
-
- destroything(thing1a);
- destroything(thing1b);
-
- destroything(thing2a);
- destroything(thing2b);
-
- destroything(thing3a);
- destroything(thing3b);
-
- act_thinga = thing4a;
- act_thingb = thing4b;
- }
- return;
-
- pulse:
- call startup;
- printflex(set);
- return;
-
- taken:
- print("matt tateishi");
- SetInvAvailable(getlocalplayerthing(), inv_number, 1);
- dwflashinventory();
- dwPlayCammySpeech(10000, "t3ca006.wav", 10, 3);
- print("You found a pulley!");
- ChangeInv(getlocalplayerthing(), inv_number, 1);
- destroything(act_thinga);
- destroything(act_thingb);
- sendmessage(jawa_cog,user2);
- return;
-
- end
-