2017-01-15 09:37:54 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2016-11-30 12:36:13 +00:00
|
|
|
class ScoreItem : Inventory
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
Height 10;
|
|
|
|
+COUNTITEM
|
|
|
|
Inventory.Amount 1;
|
|
|
|
+Inventory.ALWAYSPICKUP
|
|
|
|
}
|
|
|
|
|
|
|
|
override bool TryPickup (in out Actor toucher)
|
|
|
|
{
|
|
|
|
toucher.Score += Amount;
|
|
|
|
GoAwayAndDie();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-15 09:37:54 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2017-01-18 14:17:12 +00:00
|
|
|
class Key : Inventory
|
2016-11-30 12:36:13 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DONTGIB; // Don't disappear due to a crusher
|
|
|
|
Inventory.InterHubAmount 0;
|
|
|
|
Inventory.PickupSound "misc/k_pkup";
|
|
|
|
}
|
2018-12-01 13:01:03 +00:00
|
|
|
|
2022-12-23 17:22:13 +00:00
|
|
|
static native clearscope bool IsLockDefined(int locknum);
|
2022-12-23 15:36:59 +00:00
|
|
|
static native clearscope Color GetMapColorForLock(int locknum);
|
|
|
|
static native clearscope Color GetMapColorForKey(Key key);
|
2018-12-01 13:01:03 +00:00
|
|
|
static native clearscope int GetKeyTypeCount();
|
|
|
|
static native clearscope class<Key> GetKeyType(int index);
|
2017-01-15 09:37:54 +00:00
|
|
|
|
|
|
|
override bool HandlePickup (Inventory item)
|
|
|
|
{
|
|
|
|
// In single player, you can pick up an infinite number of keys
|
|
|
|
// even though you can only hold one of each.
|
|
|
|
if (multiplayer)
|
|
|
|
{
|
|
|
|
return Super.HandlePickup (item);
|
|
|
|
}
|
|
|
|
if (GetClass() == item.GetClass())
|
|
|
|
{
|
|
|
|
item.bPickupGood = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
override bool ShouldStay ()
|
|
|
|
{
|
|
|
|
return !!multiplayer;
|
|
|
|
}
|
2016-11-30 12:36:13 +00:00
|
|
|
}
|
|
|
|
|
2017-01-15 09:37:54 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// AMapRevealer
|
|
|
|
//
|
|
|
|
// A MapRevealer reveals the whole map for the player who picks it up.
|
|
|
|
// The MapRevealer doesn't actually go in your inventory. Instead, it sets
|
|
|
|
// a flag on the level.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2016-11-30 12:36:13 +00:00
|
|
|
class MapRevealer : Inventory
|
|
|
|
{
|
|
|
|
override bool TryPickup (in out Actor toucher)
|
|
|
|
{
|
|
|
|
level.allmap = true;
|
|
|
|
GoAwayAndDie ();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-15 09:37:54 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2017-01-15 17:16:36 +00:00
|
|
|
class PuzzleItem : Inventory
|
2016-11-30 12:36:13 +00:00
|
|
|
{
|
2017-02-27 23:45:16 +00:00
|
|
|
meta int PuzzleItemNumber;
|
|
|
|
meta String PuzzFailMessage;
|
2022-06-12 11:03:14 +00:00
|
|
|
meta Sound PuzzFailSound;
|
2017-01-15 17:16:36 +00:00
|
|
|
|
|
|
|
property Number: PuzzleItemNumber;
|
|
|
|
property FailMessage: PuzzFailMessage;
|
2022-06-12 11:03:14 +00:00
|
|
|
property FailSound: PuzzFailSound;
|
2016-11-30 12:36:13 +00:00
|
|
|
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+NOGRAVITY
|
|
|
|
+INVENTORY.INVBAR
|
|
|
|
Inventory.DefMaxAmount;
|
|
|
|
Inventory.UseSound "PuzzleSuccess";
|
|
|
|
Inventory.PickupSound "misc/i_pkup";
|
2017-01-15 17:16:36 +00:00
|
|
|
PuzzleItem.FailMessage("$TXT_USEPUZZLEFAILED");
|
2022-06-12 11:03:14 +00:00
|
|
|
PuzzleItem.FailSound "*puzzfail";
|
2016-11-30 12:36:13 +00:00
|
|
|
}
|
2017-01-15 09:37:54 +00:00
|
|
|
|
|
|
|
override bool HandlePickup (Inventory item)
|
|
|
|
{
|
|
|
|
// Can't carry more than 1 of each puzzle item in coop netplay
|
|
|
|
if (multiplayer && !deathmatch && item.GetClass() == GetClass())
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return Super.HandlePickup (item);
|
|
|
|
}
|
|
|
|
|
|
|
|
override bool Use (bool pickup)
|
|
|
|
{
|
|
|
|
if (Owner == NULL) return false;
|
|
|
|
if (Owner.UsePuzzleItem (PuzzleItemNumber))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// [RH] Always play the sound if the use fails.
|
2022-06-12 11:03:14 +00:00
|
|
|
Owner.A_StartSound (PuzzFailSound, CHAN_VOICE);
|
2019-01-31 02:29:25 +00:00
|
|
|
if (Owner.CheckLocalView())
|
2017-01-15 09:37:54 +00:00
|
|
|
{
|
2019-03-11 21:44:28 +00:00
|
|
|
Console.MidPrint (null, PuzzFailMessage, true);
|
2017-01-15 09:37:54 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-12-02 17:43:38 +00:00
|
|
|
override void UseAll(Actor user)
|
|
|
|
{
|
|
|
|
}
|
2017-01-15 09:37:54 +00:00
|
|
|
|
|
|
|
override bool ShouldStay ()
|
|
|
|
{
|
|
|
|
return !!multiplayer;
|
|
|
|
}
|
|
|
|
|
2016-11-30 12:36:13 +00:00
|
|
|
}
|
|
|
|
|