Classes:Health

From ZDoom Wiki

Jump to: navigation, search
Health
Actor type Internal Game
DoomEd Number None Class Name Health

Classes: InventoryHealth

 →CrystalVial
 →HealthBonus
 →Medikit
 →MegasphereHealth
 →Soulsphere
 →Stimpack

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. Health is never used directly. This class is only used as a base class for predefined items (like Doom's Stim pack 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.

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
  }
}

DECORATE definition

Actor Health : Inventory native
{
  Inventory.Amount 1
  Inventory.MaxAmount 0
  Inventory.PickupSound "misc/health_pkup"
}
Personal tools