From 8f5fc5bc352ffa8470b1c63e814a61ae6977b0b6 Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Mon, 12 Jul 2021 20:49:19 +0200 Subject: [PATCH] Remove attackertext mutator (developed by z411), already added in SMB modpack --- qcsrc/common/mutators/mutator/_mod.inc | 1 - qcsrc/common/mutators/mutator/_mod.qh | 1 - .../mutators/mutator/attackertext/_mod.inc | 8 --- .../mutators/mutator/attackertext/_mod.qh | 11 ---- .../mutator/attackertext/attackertext.qc | 3 - .../mutator/attackertext/attackertext.qh | 4 -- .../mutator/attackertext/cl_attackertext.qc | 61 ------------------- .../mutator/attackertext/cl_attackertext.qh | 4 -- .../mutator/attackertext/sv_attackertext.qc | 34 ----------- .../mutator/attackertext/sv_attackertext.qh | 1 - 10 files changed, 128 deletions(-) delete mode 100644 qcsrc/common/mutators/mutator/attackertext/_mod.inc delete mode 100644 qcsrc/common/mutators/mutator/attackertext/_mod.qh delete mode 100644 qcsrc/common/mutators/mutator/attackertext/attackertext.qc delete mode 100644 qcsrc/common/mutators/mutator/attackertext/attackertext.qh delete mode 100644 qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qc delete mode 100644 qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qh delete mode 100644 qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qc delete mode 100644 qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qh diff --git a/qcsrc/common/mutators/mutator/_mod.inc b/qcsrc/common/mutators/mutator/_mod.inc index 57e591d48..c463c429f 100644 --- a/qcsrc/common/mutators/mutator/_mod.inc +++ b/qcsrc/common/mutators/mutator/_mod.inc @@ -1,6 +1,5 @@ // generated file; do not modify -#include #include #include #include diff --git a/qcsrc/common/mutators/mutator/_mod.qh b/qcsrc/common/mutators/mutator/_mod.qh index 5128166ec..3b4eba7cb 100644 --- a/qcsrc/common/mutators/mutator/_mod.qh +++ b/qcsrc/common/mutators/mutator/_mod.qh @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/common/mutators/mutator/attackertext/_mod.inc b/qcsrc/common/mutators/mutator/attackertext/_mod.inc deleted file mode 100644 index 52b56df94..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/_mod.inc +++ /dev/null @@ -1,8 +0,0 @@ -// generated file; do not modify -#include -#ifdef CSQC - #include -#endif -#ifdef SVQC - #include -#endif diff --git a/qcsrc/common/mutators/mutator/attackertext/_mod.qh b/qcsrc/common/mutators/mutator/attackertext/_mod.qh deleted file mode 100644 index e712e37c9..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/_mod.qh +++ /dev/null @@ -1,11 +0,0 @@ -// generated file; do not modify -#include -#ifdef CSQC - #include -#endif -#ifdef SVQC - #include -#endif -#ifdef MENUQC - #include -#endif diff --git a/qcsrc/common/mutators/mutator/attackertext/attackertext.qc b/qcsrc/common/mutators/mutator/attackertext/attackertext.qc deleted file mode 100644 index dafd533c7..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/attackertext.qc +++ /dev/null @@ -1,3 +0,0 @@ -#include "attackertext.qh" - -REGISTER_NET_TEMP(attackertext) diff --git a/qcsrc/common/mutators/mutator/attackertext/attackertext.qh b/qcsrc/common/mutators/mutator/attackertext/attackertext.qh deleted file mode 100644 index 96d63a7af..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/attackertext.qh +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -const int ATFLAG_SAMETEAM = BIT(0); - diff --git a/qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qc b/qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qc deleted file mode 100644 index e191cf20d..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qc +++ /dev/null @@ -1,61 +0,0 @@ -#include "cl_attackertext.qh" - -AUTOCVAR_SAVE(cl_attackertext, bool, true, "Draw damage dealt where you hit the enemy"); -AUTOCVAR_SAVE(cl_attackertext_friendlyfire, bool, false, "Show for friendlyfire"); -AUTOCVAR_SAVE(cl_attackertext_time, float, 3, "Time to show"); -AUTOCVAR_SAVE(cl_attackertext_fadetime, float, 2, "Time to fade"); -AUTOCVAR_SAVE(cl_attackertext_decolorize, int, 1, "1 = decolorize names when teamplay, 2 = decolorize always"); - -REGISTER_MUTATOR(attackertext, true); - -MUTATOR_HOOKFUNCTION(attackertext, DrawInfoMessages) -{ - if (autocvar_cl_attackertext == 0) return false; - - float fade_start = max(0, autocvar_cl_attackertext_time); - float fade_time = max(0, autocvar_cl_attackertext_fadetime); - - if (last_attack_time && last_attack_time > time - fade_start - fade_time) { - vector pos = M_ARGV(0, vector); - vector mySize = M_ARGV(1, vector); - vector fontsize = '0.3 0.3 0' * mySize.y; - int img_curr_group = M_ARGV(2, int); - - float alpha_ = 0; - - if (last_attack_time + fade_start > time) - alpha_ = panel_fg_alpha; - else if (fade_time != 0) - alpha_ = panel_fg_alpha - bound(0, (time - last_attack_time - fade_start) * (1 / fade_time), 1); - else - return true; - - pos = InfoMessages_drawstring(last_attack_name, pos, mySize, alpha_, fontsize); - img_curr_group = -1; - - return true; - } - - return false; -} - - -NET_HANDLE(attackertext, bool isNew) -{ - int server_entity_index = ReadByte(); - int flags = ReadByte(); - bool friendlyfire = flags & ATFLAG_SAMETEAM; - - return = true; - - if (autocvar_cl_attackertext == 0) return; - if (friendlyfire && autocvar_cl_attackertext_friendlyfire == 0) return; - - string s = entcs_GetName(server_entity_index - 1); - if ((autocvar_cl_attackertext_decolorize == 1 && teamplay) || autocvar_cl_attackertext_decolorize == 2) - s = playername(s, entcs_GetTeam(server_entity_index - 1), true); - - last_attack_time = time; - strfree(last_attack_name); - strcpy(last_attack_name, s); -} diff --git a/qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qh b/qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qh deleted file mode 100644 index c2c6d6e47..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/cl_attackertext.qh +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -float last_attack_time; -string last_attack_name; \ No newline at end of file diff --git a/qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qc b/qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qc deleted file mode 100644 index 2a2556d7c..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qc +++ /dev/null @@ -1,34 +0,0 @@ -#include "sv_attackertext.qh" - -AUTOCVAR(sv_attackertext, int, 1, "0: disabled, 1: visible"); - -REGISTER_MUTATOR(attackertext, true); - -#define SV_ATTACKERTEXT_DISABLED() (autocvar_sv_attackertext <= 0) -#define SV_ATTACKERTEXT_ENABLED() (autocvar_sv_attackertext >= 1) - -void attackertext_Send(entity to, entity attacker, int sf) -{ - if(IS_REAL_CLIENT(to)) { - msg_entity = to; - WriteHeader(MSG_ONE, attackertext); - WriteByte(MSG_ONE, etof(attacker)); - WriteByte(MSG_ONE, sf); - } -} - -MUTATOR_HOOKFUNCTION(attackertext, PlayerDamaged) { - if (SV_ATTACKERTEXT_DISABLED()) return; - - entity attacker = M_ARGV(0, entity); - entity hit = M_ARGV(1, entity); - - if (hit == attacker) return; - if (!IS_PLAYER(attacker)) return; - - int sf = 0; - if (SAME_TEAM(hit, attacker)) sf |= ATFLAG_SAMETEAM; - - attackertext_Send(hit, attacker, sf); - FOREACH_CLIENT(IS_SPEC(it) && it.(enemy) == hit, { attackertext_Send(it, attacker, sf); }); -} diff --git a/qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qh b/qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qh deleted file mode 100644 index 6f70f09be..000000000 --- a/qcsrc/common/mutators/mutator/attackertext/sv_attackertext.qh +++ /dev/null @@ -1 +0,0 @@ -#pragma once -- 2.39.2