|
|
@ -24,6 +24,7 @@ |
|
|
|
#include "util.h" |
|
|
|
#include "util.h" |
|
|
|
#include "cbase.h" |
|
|
|
#include "cbase.h" |
|
|
|
#include "player.h" |
|
|
|
#include "player.h" |
|
|
|
|
|
|
|
#include "game.h" |
|
|
|
#include "gamerules.h" |
|
|
|
#include "gamerules.h" |
|
|
|
#include "hltv.h" |
|
|
|
#include "hltv.h" |
|
|
|
|
|
|
|
|
|
|
@ -101,6 +102,8 @@ void CBasePlayer::UpdateStatusBar() |
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) |
|
|
|
int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
float flTake; |
|
|
|
|
|
|
|
|
|
|
|
if ( (pev->takedamage == DAMAGE_NO) || (IsAlive() == FALSE) ) |
|
|
|
if ( (pev->takedamage == DAMAGE_NO) || (IsAlive() == FALSE) ) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
@ -150,6 +153,12 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl |
|
|
|
// Teamplay 2 you can still hurt teammates
|
|
|
|
// Teamplay 2 you can still hurt teammates
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( instagib.value ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
flTake = 900.0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
// check for quad damage powerup on the attacker
|
|
|
|
// check for quad damage powerup on the attacker
|
|
|
|
if (pAttacker->IsPlayer()) |
|
|
|
if (pAttacker->IsPlayer()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -182,7 +191,8 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl |
|
|
|
m_iQuakeItems &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); |
|
|
|
m_iQuakeItems &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); |
|
|
|
} |
|
|
|
} |
|
|
|
pev->armorvalue -= flSave; |
|
|
|
pev->armorvalue -= flSave; |
|
|
|
float flTake = ceil(flDamage - flSave); |
|
|
|
flTake = ceil(flDamage - flSave); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// add to the damage total for clients, which will be sent as a single message at the end of the frame
|
|
|
|
// add to the damage total for clients, which will be sent as a single message at the end of the frame
|
|
|
|
pev->dmg_take = pev->dmg_take + flTake; |
|
|
|
pev->dmg_take = pev->dmg_take + flTake; |
|
|
@ -203,7 +213,6 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl |
|
|
|
// this global is still used for glass and other non-monster killables, along with decals.
|
|
|
|
// this global is still used for glass and other non-monster killables, along with decals.
|
|
|
|
g_vecAttackDir = vecTemp.Normalize(); |
|
|
|
g_vecAttackDir = vecTemp.Normalize(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// figure momentum add
|
|
|
|
// figure momentum add
|
|
|
|
if ( (pevInflictor) && (pev->movetype == MOVETYPE_WALK) && !( FBitSet (bitsDamageType, DMG_BURN) ) && !( FBitSet (bitsDamageType, DMG_ACID) ) ) |
|
|
|
if ( (pevInflictor) && (pev->movetype == MOVETYPE_WALK) && !( FBitSet (bitsDamageType, DMG_BURN) ) && !( FBitSet (bitsDamageType, DMG_ACID) ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|