Classes:Health


Classes: InventoryHealth
CrystalVial
HealthBonus
Medikit
MegasphereHealth
Soulsphere
Stimpack

Note: Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
  1. You do not need to copy that actor, since it is already defined.
  2. In fact, it's not just useless, it's actually harmful as it can cause problems.
  3. If you want to modify it, or use a modified version, using inheritance is the way to go.
  4. The actor definitions here are put on the wiki for reference purpose only. Learn from them, don't copy them.
  5. There is only one exception: if what you want is changing Ammo capacity, you need to create a new type from Ammo.
Health
Actor type Internal Game
DoomEd Number None Class Name Health

A Health item adds a certain amount to the player's health points. Items of this type are always effective when picked up. They cannot be placed in the inventory; to have health items in inventory, use HealthPickup. Health is never used directly. This class is only used as a base class for predefined items (like Doom's Stimpack or for items defined in DECORATE.


Using in DECORATE

Health items support all the basic Inventory properties. However, they use a few of them differently:

  • Inventory.Amount value
Sets the amount of health this item gives when picked up.
  • Inventory.MaxAmount value
Sets the maximum amount of health you can get with this item. If this is greater than 0, the maximum health points gain is added to this to determine the final maximum amount.

In addition they define one new property:

  • Health.LowMessage value, message
When pickupper's health is lower than value, the pickup message is set to message.

Examples:

ACTOR Whiskey : Health 10715
{
  Inventory.PickupMessage "You drank some booze."
  Inventory.Amount 5
  Inventory.MaxAmount 200
  +COUNTITEM
  States
  {
  Spawn:
    RWHI A -1
    Stop
  }
}
ACTOR DogFood : Health 10575
{
  Inventory.PickupMessage "Ate some dog food. Woof!"
  Inventory.PickupSound "dog/sight"
  Inventory.Amount 4
  Inventory.MaxAmount 200
  +COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  States
  {
  Spawn:
    AWI1 A -1
    Stop
  }
}

COUNTITEM flag means that counts toward item percentage.

DECORATE definition

ACTOR Health : Inventory native
{
  Inventory.Amount 1
  Inventory.MaxAmount 0
  Inventory.PickupSound "misc/health_pkup"
}
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.