Seven Towers: UCC Reference

USECODE INTRINSICS

int UI_apply_damage(int base, int hits, int type, object obj)

Causes random damage of a given type to the desired object, subject to armor.

Parameters

baseThe 'strength' of the attack; only one third of this value (rounded down) is used to deal damage. This parameter is ignored depending on damage type; specifically, damage of LIGHTNING_DAMAGE type ignores this parameter.
hitsThe 'weapon points' of the attack. If this parameter is equal to 127 or more, this intrinsic will ignore all armor and deal a fixed 127 points of damage of the specified type, ignoring the 'base' parameter.
typeThe type of the damage. If the target is immune to this damage type, he will take no damage from this intrinsic; conversely, a monster vulnerable to this type of damage takes doubled damage. Armor-granted immunities also protect the target from the effects of this intrinsic. If the damage type is LIGHTNING_DAMAGE, ETHEREAL_DAMAGE or SONIC_DAMAGE, this intrinsic will ignore armor.
objThe object to be damaged.

The type of the damage is a numerical value that describes what kind of damage should be caused. It can be one of the following values:

NORMAL_DAMAGE = 0Normal damage.
FIRE_DAMAGE = 1Damage from heat sources.
MAGIC_DAMAGE = 2Damage from a magical source.
LIGHTNING_DAMAGE = 3Damage from electrical sources such as lightning. Extremely painful, even a single point of damage causes the screen to flash a red color. This damage ignores all armor and does not depend on the attacker's strength.
POISON_DAMAGE = 3Damage from poison. Extremely painful, even a single point of damage causes the screen to flash a red color. This damage ignores all armor and does not depend on the attacker's strength.
STARVATION_DAMAGE = 3Damage from starvation. Extremely painful, even a single point of damage causes the screen to flash a red color. This damage ignores all armor and does not depend on the attacker's strength.
FREEZING_DAMAGE = 3Damage from frostbite. Extremely painful, even a single point of damage causes the screen to flash a red color. This damage ignores all armor and does not depend on the attacker's strength.
ETHEREAL_DAMAGE = 4Special magical damage, basically magic damage not blocked by normal magic resistance or armor.
SONIC_DAMAGE = 5Sound-based damage. This damage type ignores armor.

The damage is calculated from a series of generated random numbers. It proceeds along the following steps:

Return

Returns true if any damage is caused on a valid target, false otherwise.

Related intrinsics

See also