Browse Source

Limit gib attacks

foolsday
mittorn 9 years ago
parent
commit
1b811d5644
  1. 29
      dlls/combat.cpp
  2. 1
      dlls/monsters.h

29
dlls/combat.cpp

@ -726,20 +726,21 @@ void CGib :: BounceGibTouch ( CBaseEntity *pOther ) @@ -726,20 +726,21 @@ void CGib :: BounceGibTouch ( CBaseEntity *pOther )
}
else
{
if ( pev->velocity.Length() > 300)
{
entvars_t *pevOwner = pev;
if( pev->owner)
pevOwner = &pev->owner->v;
if(pevOwner)
if ( m_flNextAttack < gpGlobals->time && pev->velocity.Length() > 300 )
{
float dmg = 10 + pev->velocity.Length() / 50;
TraceResult tr = UTIL_GetGlobalTrace();
ClearMultiDamage();
pOther->TraceAttack(pevOwner, dmg, gpGlobals->v_forward, &tr, DMG_CLUB);
ApplyMultiDamage(pev, pevOwner);
entvars_t *pevOwner = pev;
if( pev->owner)
pevOwner = &pev->owner->v;
if(pevOwner)
{
float dmg = 10 + pev->velocity.Length() / 50;
TraceResult tr = UTIL_GetGlobalTrace();
ClearMultiDamage();
pOther->TraceAttack(pevOwner, dmg, gpGlobals->v_forward, &tr, DMG_CLUB);
ApplyMultiDamage(pev, pevOwner);
}
m_flNextAttack = gpGlobals->time + 1.0; // debounce
}
}
if ( g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED )
{
vecSpot = pev->origin + Vector ( 0 , 0 , 8 );//move up a bit, and trace down.
@ -811,8 +812,8 @@ void CGib :: Spawn( const char *szGibModel ) @@ -811,8 +812,8 @@ void CGib :: Spawn( const char *szGibModel )
pev->nextthink = gpGlobals->time + 4;
m_lifeTime = 250;
SetThink( &WaitTillLand );
SetTouch( &BounceGibTouch );
SetThink( &CGib::WaitTillLand );
SetTouch( &CGib::BounceGibTouch );
m_material = matNone;
m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain).

1
dlls/monsters.h

@ -162,6 +162,7 @@ public: @@ -162,6 +162,7 @@ public:
return 700;
}
float m_flNextAttack;
int m_bloodColor;
int m_cBloodDecals;
int m_material;

Loading…
Cancel
Save