reduce lightning strength if an object is struck

This prevents lightning to be an infinite path of destruction.
install-platforms
Maikel de Vries 2017-07-10 19:13:58 +02:00
parent 2d0a178b87
commit 57c0aacbfa
1 changed files with 7 additions and 0 deletions

View File

@ -88,6 +88,13 @@ protected func FxLightningMoveTimer(object target, effect fx, int time)
Punch(obj, damage);
else
obj->DoDamage(damage, FX_Call_DmgScript, GetController());
// Reduce strength of the lightning if an object is struck.
strength -= damage;
if (strength <= 0)
{
RemoveObject();
return FX_OK;
}
}
}