The setHPScale native AI script function sets the current HP level of each bot in the current group based on a given coefficient. The maximum HP of the bot is used to calculate the HP level to be set.
setHPScale(coef: f)
setHPScale(0.8);
This example code sets the current HP level of each bot in the current group to 80% of the bot's maximum HP.
The setHPScale
function updates the current HP level of each bot in the group based on the given coefficient by sending the difference with the current HP. The HP difference is calculated using the following formula: maxHP * coef - currentHP
.
If a bot is not spawned, the function will skip that bot.
setHPLevel
: Sets the current HP level of each bot in the current group to a specified value. The value is an absolute HP level rather than a percentage of the bot's maximum HP.