home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # POW_BACTA.COG
- #
- # POWERUP Script - Bacta tank
- #
- # [YB & CYW]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
-
-
- symbols
-
- thing powerup local
- thing player local
- int bin=15 local
- sound pickupsnd=BactaPu1.wav local
- flex amount local
-
- message activate
- message touched
- message taken
- //message respawn
-
- end
-
- # ========================================================================================
-
- code
-
- activate:
- player = getlocalplayerthing();
- amount = GetInv(player, bin);
-
- print("touched");
- if (amount < GetInvMax(player, bin))
- {
- print("touched2");
- powerup = GetSenderRef();
- // TakeItem(powerup, player);
- destroything(powerup);
- }
-
- Return;
-
- # ........................................................................................
-
- taken:
- player = GetSourceRef();
- powerup = GetSenderRef();
-
- // Print("Bacta Tank");
- jkPrintUNIString(player, bin);
-
- // Do effects.
- PlaySoundThing(pickupsnd, powerup, 1.0, -1, -1, 0);
- AddDynamicTint(player, 0.0, 0.0, 0.2);
-
- // Increment powerup amount.
- ChangeInv(player, bin, 1.0);
- SetInvAvailable(player, bin, 1);
-
- Return;
-
- # ........................................................................................
-
- respawn:
- powerup = GetSenderRef();
- PlaySoundThing(respawnsnd, powerup, 0.6, 5.0, 10.0, 0);
-
- Return;
-
- end
-
-