3 AUTOCVAR(sv_damagetext,
int, 2,
"<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage");
7 #define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0) 8 #define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1) 9 #define SV_DAMAGETEXT_PLAYERS() (autocvar_sv_damagetext >= 2) 10 #define SV_DAMAGETEXT_ALL() (autocvar_sv_damagetext >= 3) 34 WriteHeader(MSG_ENTITY, damagetext);
36 WriteInt24_t(MSG_ENTITY, deathtype);
43 else WriteShort(MSG_ENTITY, health * DAMAGETEXT_PRECISION_MULTIPLIER);
46 if (flags &
DTFLAG_BIG_ARMOR) WriteInt24_t(MSG_ENTITY, armor * DAMAGETEXT_PRECISION_MULTIPLIER);
47 else WriteShort(MSG_ENTITY, armor * DAMAGETEXT_PRECISION_MULTIPLIER);
51 if (flags &
DTFLAG_BIG_POTENTIAL) WriteInt24_t(MSG_ENTITY, potential_damage * DAMAGETEXT_PRECISION_MULTIPLIER);
52 else WriteShort(MSG_ENTITY, potential_damage * DAMAGETEXT_PRECISION_MULTIPLIER);
62 float armor =
M_ARGV(3,
float);
63 int deathtype =
M_ARGV(5,
int);
64 float potential_damage =
M_ARGV(6,
float);
66 if(deathtype == DEATH_FIRE.m_id || deathtype == DEATH_BUFF.m_id)
return;
77 net_text.realowner = attacker;
79 net_text.dent_net_flags =
flags;
80 net_text.dent_net_deathtype = deathtype;
81 net_text.dent_net_health =
health;
82 net_text.dent_net_armor = armor;
83 net_text.dent_net_potential = potential_damage;
86 net_text.nextthink = (
time > 10) ? (
time + 0.5) : 10;
const int DTFLAG_NO_POTENTIAL
const int DTFLAG_NO_ARMOR
#define DAMAGETEXT_PRECISION_MULTIPLIER
#define DEATH_WEAPONOF(t)
const int DTFLAG_BIG_POTENTIAL
REGISTER_MUTATOR(damagetext, true)
MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged)
#define SV_DAMAGETEXT_PLAYERS()
#define DAMAGETEXT_SHORT_LIMIT
#define SV_DAMAGETEXT_ALL()
const int DTFLAG_SAMETEAM
AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage")
#define new_pure(class)
purely logical entities (.origin doesn't work)
const int DTFLAG_BIG_HEALTH
#define SV_DAMAGETEXT_SPECTATORS_ONLY()
ERASEABLE float almost_equals_eps(float a, float b, float times_eps)
const int DTFLAG_BIG_ARMOR
#define SV_DAMAGETEXT_DISABLED()
bool write_damagetext(entity this, entity client, int sf)