mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
b0f3121bec
- moved health items to their own file. - scriptified ScoreItem and MapRevealer whose entire functionality was a small TryPickup method. - fixed: bit fields in global variables were not correctly written. This should conclude the inventory cleanup. It is now possible again to find things in there.
87 lines
1.4 KiB
Text
87 lines
1.4 KiB
Text
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;
|
|
}
|
|
}
|
|
|
|
class Health : Inventory native
|
|
{
|
|
native int PrevHealth;
|
|
|
|
Default
|
|
{
|
|
Inventory.Amount 1;
|
|
Inventory.MaxAmount 0;
|
|
Inventory.PickupSound "misc/health_pkup";
|
|
}
|
|
}
|
|
|
|
class HealthPickup : Inventory native
|
|
{
|
|
native int autousemode;
|
|
|
|
Default
|
|
{
|
|
Inventory.DefMaxAmount;
|
|
+INVENTORY.INVBAR
|
|
}
|
|
}
|
|
|
|
class Key : Inventory native
|
|
{
|
|
native uint8 KeyNumber;
|
|
|
|
Default
|
|
{
|
|
+DONTGIB; // Don't disappear due to a crusher
|
|
Inventory.InterHubAmount 0;
|
|
Inventory.PickupSound "misc/k_pkup";
|
|
}
|
|
}
|
|
|
|
class MapRevealer : Inventory
|
|
{
|
|
//===========================================================================
|
|
//
|
|
// AMapRevealer :: TryPickup
|
|
//
|
|
// 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.
|
|
//
|
|
//===========================================================================
|
|
|
|
override bool TryPickup (in out Actor toucher)
|
|
{
|
|
level.allmap = true;
|
|
GoAwayAndDie ();
|
|
return true;
|
|
}
|
|
}
|
|
|
|
class PuzzleItem : Inventory native
|
|
{
|
|
native int PuzzleItemNumber;
|
|
|
|
Default
|
|
{
|
|
+NOGRAVITY
|
|
+INVENTORY.INVBAR
|
|
Inventory.DefMaxAmount;
|
|
Inventory.UseSound "PuzzleSuccess";
|
|
Inventory.PickupSound "misc/i_pkup";
|
|
}
|
|
}
|
|
|