Page 1 of 1

Damage Impact

PostPosted: Fri Oct 29, 2021 8:19 am
by Hey Doomer
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):

Code: Select allExpand view
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);
   }
  }
}


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.

Re: Damage Impact

PostPosted: Fri Dec 03, 2021 7:32 pm
by WARCHILD_89
hint: when getting hit by a rocket, the actor always gets blown to the east, no matter from which side he gets hit.

Re: Damage Impact

PostPosted: Sun Dec 05, 2021 3:56 pm
by Hey Doomer
WARCHILD_89 wrote:hint: when getting hit by a rocket, the actor always gets blown to the east, no matter from which side he gets hit.


Hmm. I wonder, is that a bug? Not sure.