Damage Impact
Posted: Fri Oct 29, 2021 8:19 am
Another minimalist suggestion... This isn't realistic (unless Hollywood is accurate or one considers lower gravity off-Earth) but creates an opposite partial thrust based on damage, angle of attack, and mass (a monster can be punched out of the way or blown halfway across a room):
The arbitrary 0.5 multiplier seems to work.
It does look a bit silly with infighters skating about. I haven't extensively tested this to see if a player would get stuck in a map from being pushed around by attacks. I suppose that is possible.
Code: Select all
class di_EventHandler : EventHandler
{
override
void WorldThingDamaged(WorldEvent e)
{
if (e.thing)
{
e.thing.Thrust(e.damage * 0.5 * (100 / e.thing.mass), e.damageangle);
}
}
}
It does look a bit silly with infighters skating about. I haven't extensively tested this to see if a player would get stuck in a map from being pushed around by attacks. I suppose that is possible.