CheckArmorType

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


Actor

bool CheckArmorType(name Type, int amount = 1)

Usage

Checks to see if the Actor has a certain amount of the provided armor type.

Parameters

  • Name Type
The name of the armor class to check for.
  • int amount
Default is 1. The minimum amount of armor needed.

Return value

Returns true if the Actor has the correct armor type with at least the amount provided.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.


ZScript definition

Note: The ZScript definition below is for reference and may be different in the current version of GZDoom.The most up-to-date version of this code can be found on GZDoom GitHub.
bool CheckArmorType(name Type, int amount = 1)
{
    let myarmor = BasicArmor(FindInventory("BasicArmor"));
    return myarmor != null && myarmor.ArmorType == type && myarmor.Amount >= amount;
}