Play short rumble when a Clonk gets hurt

qteditor^2
Lukas Werling 2016-03-22 20:12:50 +01:00
parent acc04b2398
commit a52da814fa
1 changed files with 7 additions and 0 deletions

View File

@ -109,6 +109,13 @@ protected func CatchBlow()
if (GetAction() == "Dead") return;
if (!Random(5)) PlaySoundHurt();
}
protected func OnEnergyChange(int change, int cause, int caused_by)
{
if (change < 0 && GetCursor(GetOwner()) == this)
PlayRumble(GetOwner(), Min(300 + 1000 * -change / this.MaxEnergy, 1000), 150);
return _inherited(...);
}
protected func Grab(object pTarget, bool fGrab)
{