From d3626948e489fa4714314c2d318778a4b62ec513 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Jan 2017 09:42:49 +0100 Subject: [PATCH] - removed duplicate health definitions. --- wadsrc/static/zscript/inventory/inv_misc.txt | 125 ------------------- 1 file changed, 125 deletions(-) diff --git a/wadsrc/static/zscript/inventory/inv_misc.txt b/wadsrc/static/zscript/inventory/inv_misc.txt index 3aa1a4df5..fbc6d1322 100644 --- a/wadsrc/static/zscript/inventory/inv_misc.txt +++ b/wadsrc/static/zscript/inventory/inv_misc.txt @@ -16,131 +16,6 @@ class ScoreItem : Inventory } } -class Health : Inventory native -{ - native int PrevHealth; - native meta int LowHealth; - native meta String LowHealthMessage; - - Default - { - Inventory.Amount 1; - Inventory.MaxAmount 0; - Inventory.PickupSound "misc/health_pkup"; - } - - //=========================================================================== - // - // AHealth :: PickupMessage - // - //=========================================================================== - override String PickupMessage () - { - if (PrevHealth < LowHealth) - { - String message = LowHealthMessage; - - if (message.Length() != 0) - { - return message; - } - } - return Super.PickupMessage(); - } - - //=========================================================================== - // - // TryPickup - // - //=========================================================================== - - override bool TryPickup (in out Actor other) - { - PrevHealth = other.player != NULL ? other.player.health : other.health; - - // P_GiveBody adds one new feature, applied only if it is possible to pick up negative health: - // Negative values are treated as positive percentages, ie Amount -100 means 100% health, ignoring max amount. - if (other.GiveBody(Amount, MaxAmount)) - { - GoAwayAndDie(); - return true; - } - return false; - } - - -} - -class HealthPickup : Inventory native -{ - native int autousemode; - - Default - { - Inventory.DefMaxAmount; - +INVENTORY.INVBAR - } - - //=========================================================================== - // - // CreateCopy - // - //=========================================================================== - - override Inventory CreateCopy (Actor other) - { - Inventory copy = Super.CreateCopy (other); - copy.health = health; - return copy; - } - - //=========================================================================== - // - // CreateTossable - // - //=========================================================================== - - override Inventory CreateTossable () - { - Inventory copy = Super.CreateTossable (); - if (copy != NULL) - { - copy.health = health; - } - return copy; - } - - //=========================================================================== - // - // HandlePickup - // - //=========================================================================== - - override bool HandlePickup (Inventory item) - { - // HealthPickups that are the same type but have different health amounts - // do not count as the same item. - if (item.health == health) - { - return Super.HandlePickup (item); - } - return false; - } - - //=========================================================================== - // - // Use - // - //=========================================================================== - - override bool Use (bool pickup) - { - return Owner.GiveBody (health, 0); - } - - -} - class Key : Inventory native { native uint8 KeyNumber;