mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- removed duplicate health definitions.
This commit is contained in:
parent
87617b588a
commit
d3626948e4
1 changed files with 0 additions and 125 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue