DoDamage

Category: Objects / Status
Since engine version: 1.0 OC

Description

Adjusts the damage value of an object. If a change is made, the callback 'Damage' is made in the target object.

Syntax

void DoDamage(int change, int damage_type, int caused_by);

Parameters

change:
Change of damage value (positive or negative).
damage_type:
[opt] Damage cause specification which is to be passed to Fx*Damage callbacks of effects (see effect documentation). Default is FX_Call_DmgScript.
caused_by:
[opt] Number of the player who has caused the damage.

Example

FindObject(Find_Func("IsTree"))->DoDamage(500);
Fells a tree if it's not yet down.
See also: GetDamage
Sven2, 2001-11