3AUTOCVAR(sv_damagetext,
int, 2,
"\\\"0\\\" = disable damage text, \\\"1\\\" = show damage text to spectators, \\\"2\\\" = also to the attacker, \\\"3\\\" = show damage text to all players");
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)
67 float armor =
M_ARGV(3,
float);
68 int deathtype =
M_ARGV(5,
int);
69 float potential_damage =
M_ARGV(6,
float);
70 if (potential_damage == 0)
75 static entity net_text_prev;
76 static float net_damagetext_prev_time;
78 bool multiple = (net_damagetext_prev_time ==
time && net_text_prev && !wasfreed(net_text_prev)
79 && net_text_prev.realowner == attacker && net_text_prev.enemy == hit
80 && net_text_prev.dent_net_deathtype == deathtype);
86 health += net_text_prev.dent_net_health;
87 armor += net_text_prev.dent_net_armor;
88 potential_damage += net_text_prev.dent_net_potential;
101 net_text_prev.dent_net_flags =
flags;
102 net_text_prev.dent_net_health =
health;
103 net_text_prev.dent_net_armor = armor;
104 net_text_prev.dent_net_potential = potential_damage;
109 int attacker_id =
etof(attacker) - 1;
112 if (!(hit.dent_attackers[idx] &
BIT(bit)))
115 hit.dent_attackers[idx] |=
BIT(bit);
121 net_text.realowner = attacker;
122 net_text.enemy = hit;
123 net_text.dent_net_flags =
flags;
124 net_text.dent_net_deathtype = deathtype;
125 net_text.dent_net_health =
health;
126 net_text.dent_net_armor = armor;
127 net_text.dent_net_potential = potential_damage;
129 net_text_prev = net_text;
130 net_damagetext_prev_time =
time;
133 net_text.nextthink = (
time > 10) ? (
time + 0.5) : 10;
141 int player_id =
etof(player) - 1;
146 it.dent_attackers[idx] &=
~BIT(bit);
154 player.dent_attackers[i] = 0;
#define MUTATOR_IS_ENABLED(this)
#define REGISTER_MUTATOR(...)
#define MUTATOR_HOOKFUNCTION(...)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int DTFLAG_BIG_HEALTH
const int DTFLAG_NO_POTENTIAL
const int DTFLAG_STOP_ACCUMULATION
const int DTFLAG_BIG_ARMOR
const int DTFLAG_SAMETEAM
const int DTFLAG_BIG_POTENTIAL
#define DAMAGETEXT_SHORT_LIMIT
#define DAMAGETEXT_PRECISION_MULTIPLIER
const int DTFLAG_NO_ARMOR
#define DEATH_WEAPONOF(t)
void SUB_Remove(entity this)
Remove entity.
#define WriteHeader(to, id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
ERASEABLE float almost_equals_eps(float a, float b, float times_eps)
#define new_pure(class)
purely logical entities (not linked to the area grid)
float health
Legacy fields for the resources. To be removed.
#define SV_DAMAGETEXT_DISABLED()
#define SV_DAMAGETEXT_PLAYERS()
bool write_damagetext(entity this, entity client, int sf)
#define SV_DAMAGETEXT_ALL()
const int DENT_ATTACKERS_SIZE
int dent_attackers[DENT_ATTACKERS_SIZE]
#define SV_DAMAGETEXT_SPECTATORS_ONLY()
#define FOREACH_CLIENT(cond, body)