DoEnergy
Category:
Objects / Status
Since engine version:
5.1 OC
Description
Adjusts the energy value of an object. Energy signifies life energy in living beings.
Syntax
void
DoEnergy(
int
change,
bool
exact,
int
damage_type,
int
caused_by);
Parameters
change:
Change of the energy value (positive or negative) in percent of the maximum value. 100% correspond to the maximum physical value of 100,000.
exact:
[opt] If
true
, change is applied to the exact energy value.
damage_type:
[opt] Damage cause specification which is to be passed to Fx*Damage callbacks of effects (see
effect documentation
). Default is FX_Call_EngScript.
caused_by:
[opt] Number of the player who has caused the damage.
Example
GetCursor
(0)->DoEnergy(1);
Gives 1 more energy to the selected clonk.
See also:
GetEnergy
Sven2, 2001-11
Clonkonaut, 2008-04