]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Replace 'sv' into 'surv' to avoid possible future confusions Mario/survival
authorLegendaryGuard <rootuser999@gmail.com>
Mon, 10 Apr 2023 21:22:42 +0000 (23:22 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Mon, 10 Apr 2023 21:22:42 +0000 (23:22 +0200)
gamemodes-client.cfg
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/survival/cl_survival.qc
qcsrc/common/gamemodes/gamemode/survival/survival.qh
qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc
qcsrc/common/gamemodes/gamemode/survival/sv_survival.qh
qcsrc/common/scores.qh

index 6960fe2dc84beaf025705027edf6aa1fee37b641..c0562cfb84c127562e669bc268efd274e1e0fc2c 100644 (file)
@@ -34,7 +34,7 @@ alias cl_hook_gamestart_inv
 alias cl_hook_gamestart_duel
 alias cl_hook_gamestart_mayhem
 alias cl_hook_gamestart_tmayhem
-alias cl_hook_gamestart_sv
+alias cl_hook_gamestart_surv
 alias cl_hook_gameend
 alias cl_hook_shutdown
 alias cl_hook_activeweapon
index 2d4d8a396a3f834b37dc5a46039f83ce97a95a42..23c97924e96188edfe2822fac7fc0f242eda58d7 100644 (file)
@@ -31,7 +31,7 @@ alias sv_hook_gamestart_inv
 alias sv_hook_gamestart_duel
 alias sv_hook_gamestart_mayhem
 alias sv_hook_gamestart_tmayhem
-alias sv_hook_gamestart_sv
+alias sv_hook_gamestart_surv
 // there is currently no hook for when the match is restarted
 // see sv_hook_readyrestart for previous uses of this hook
 //alias sv_hook_gamerestart
@@ -63,7 +63,7 @@ alias sv_vote_gametype_hook_tdm
 alias sv_vote_gametype_hook_duel
 alias sv_vote_gametype_hook_mayhem
 alias sv_vote_gametype_hook_tmayhem
-alias sv_vote_gametype_hook_sv
+alias sv_vote_gametype_hook_surv
 
 // Example preset to allow 1v1ctf to be used for the gametype voting screen.
 // Aliases can have max 31 chars so the gametype can have max 9 chars.
@@ -228,13 +228,13 @@ set g_tmayhem_respawn_delay_large_count 0
 set g_tmayhem_respawn_delay_max 0
 set g_tmayhem_respawn_waves 0
 set g_tmayhem_weapon_stay 0
-set g_sv_respawn_delay_small 0
-set g_sv_respawn_delay_small_count 0
-set g_sv_respawn_delay_large 0
-set g_sv_respawn_delay_large_count 0
-set g_sv_respawn_delay_max 0
-set g_sv_respawn_waves 0
-set g_sv_weapon_stay 0
+set g_surv_respawn_delay_small 0
+set g_surv_respawn_delay_small_count 0
+set g_surv_respawn_delay_large 0
+set g_surv_respawn_delay_large_count 0
+set g_surv_respawn_delay_max 0
+set g_surv_respawn_waves 0
+set g_surv_weapon_stay 0
 
 
 // =========
index 285d48ea287cc98309ab9fda33af2d7fa5e36f4a..02d0907abccf0a40b28a6c388455fd962cd8f2ad 100644 (file)
@@ -11,13 +11,13 @@ void HUD_Mod_Survival(vector pos, vector mySize)
        string player_text = "";
        vector player_color = '1 1 1';
        //string player_icon = "";
-       if(mystatus == SV_STATUS_HUNTER)
+       if(mystatus == SURV_STATUS_HUNTER)
        {
                player_text = _("Hunter");
                player_color = '1 0 0';
                //player_icon = "player_red";
        }
-       else if(mystatus == SV_STATUS_PREY)
+       else if(mystatus == SURV_STATUS_PREY)
        {
                player_text = _("Survivor");
                player_color = '0 1 0';
@@ -32,9 +32,9 @@ void HUD_Mod_Survival(vector pos, vector mySize)
        drawstring_aspect(pos, player_text, vec2(mySize.x, mySize.y), player_color, panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
-REGISTER_MUTATOR(cl_sv, true);
+REGISTER_MUTATOR(cl_surv, true);
 
-MUTATOR_HOOKFUNCTION(cl_sv, ForcePlayercolors_Skip, CBC_ORDER_LAST)
+MUTATOR_HOOKFUNCTION(cl_surv, ForcePlayercolors_Skip, CBC_ORDER_LAST)
 {
        if(!ISGAMETYPE(SURVIVAL))
                return false;
@@ -44,15 +44,15 @@ MUTATOR_HOOKFUNCTION(cl_sv, ForcePlayercolors_Skip, CBC_ORDER_LAST)
        int surv_status = ((e) ? e.survival_status : 0);
        int mystatus = entcs_receiver(player_localnum).survival_status;
 
-       int plcolor = SV_COLOR_PREY; // default to survivor
-       if((mystatus == SV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SV_STATUS_HUNTER)
-               plcolor = SV_COLOR_HUNTER;
+       int plcolor = SURV_COLOR_PREY; // default to survivor
+       if((mystatus == SURV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SURV_STATUS_HUNTER)
+               plcolor = SURV_COLOR_HUNTER;
 
        player.colormap = 1024 + plcolor;
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(cl_sv, DrawScoreboard_Force)
+MUTATOR_HOOKFUNCTION(cl_surv, DrawScoreboard_Force)
 {
        // show the scoreboard when the round ends, so players can see who the hunter was
        return STAT(GAME_STOPPED);
index 4b52ed200d33c06dcaa682b3f90332813d10e350..baddfb5c26ec7cacddc4e1748f9bd57ecfebf783 100644 (file)
@@ -9,7 +9,7 @@ void HUD_Mod_Survival(vector pos, vector mySize);
 CLASS(Survival, Gametype)
     INIT(Survival)
     {
-        this.gametype_init(this, _("Survival"),"sv","g_survival",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=12",_("Identify and eliminate all the hunters before all your allies are gone"));
+        this.gametype_init(this, _("Survival"), "surv", "g_survival", GAMETYPE_FLAG_USEPOINTS, "", "timelimit=20 pointlimit=12", _("Identify and eliminate all the hunters before all your allies are gone"));
     }
     METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
     {
@@ -34,10 +34,10 @@ REGISTER_GAMETYPE(SURVIVAL, NEW(Survival));
 #ifdef GAMEQC
 // shared state signalling the player's survival status
 .int survival_status;
-const int SV_STATUS_PREY = 1;
-const int SV_STATUS_HUNTER = 2;
+const int SURV_STATUS_PREY = 1;
+const int SURV_STATUS_HUNTER = 2;
 
 // hardcoded player colors for survival
-const int SV_COLOR_PREY = 51; // green
-const int SV_COLOR_HUNTER = 68; // red
+const int SURV_COLOR_PREY = 51; // green
+const int SURV_COLOR_HUNTER = 68; // red
 #endif
index 85e40e8175f9f3ef912530e204b203cd03c73f05..6414686e0bcc67638503f6aaeda15ecb9e67754b 100644 (file)
@@ -20,12 +20,12 @@ void Surv_UpdateScores(bool timed_out)
                // player survived the round
                if(IS_PLAYER(it) && !IS_DEAD(it))
                {
-                       if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SV_STATUS_PREY)
+                       if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SURV_STATUS_PREY)
                                GameRules_scoring_add(it, SCORE, 1); // reward survivors who make it to the end of the round time limit
-                       if(it.survival_status == SV_STATUS_PREY)
-                               GameRules_scoring_add(it, SV_SURVIVALS, 1);
-                       else if(it.survival_status == SV_STATUS_HUNTER)
-                               GameRules_scoring_add(it, SV_HUNTS, 1);
+                       if(it.survival_status == SURV_STATUS_PREY)
+                               GameRules_scoring_add(it, SURV_SURVIVALS, 1);
+                       else if(it.survival_status == SURV_STATUS_HUNTER)
+                               GameRules_scoring_add(it, SURV_HUNTS, 1);
                }
        });
 }
@@ -54,9 +54,9 @@ float Surv_CheckWinner()
        int survivor_count = 0, hunter_count = 0;
        FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
        {
-               if(it.survival_status == SV_STATUS_PREY)
+               if(it.survival_status == SURV_STATUS_PREY)
                        survivor_count++;
-               else if(it.survival_status == SV_STATUS_HUNTER)
+               else if(it.survival_status == SURV_STATUS_HUNTER)
                        hunter_count++;
        });
        if(survivor_count > 0 && hunter_count > 0)
@@ -104,7 +104,7 @@ void Surv_RoundStart()
                if(IS_PLAYER(it) && !IS_DEAD(it))
                {
                        ++playercount;
-                       it.survival_status = SV_STATUS_PREY;
+                       it.survival_status = SURV_STATUS_PREY;
                }
                else
                        it.survival_status = 0; // this is mostly a safety check; if a client manages to somehow maintain a survival status, clear it before the round starts!
@@ -117,14 +117,14 @@ void Surv_RoundStart()
                if(total_hunters >= hunter_count)
                        break;
                total_hunters++;
-               it.survival_status = SV_STATUS_HUNTER;
+               it.survival_status = SURV_STATUS_HUNTER;
        });
 
        FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
        {
-               if(it.survival_status == SV_STATUS_PREY)
+               if(it.survival_status == SURV_STATUS_PREY)
                        Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_SURVIVOR);
-               else if(it.survival_status == SV_STATUS_HUNTER)
+               else if(it.survival_status == SURV_STATUS_HUNTER)
                        Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_HUNTER);
        });
 }
@@ -173,8 +173,8 @@ bool surv_isEliminated(entity e)
 void surv_Initialize() // run at the start of a match, initiates game mode
 {
        GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
-               field(SP_SV_SURVIVALS, "survivals", 0);
-               field(SP_SV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY);
+               field(SP_SURV_SURVIVALS, "survivals", 0);
+               field(SP_SURV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY);
        });
 
        allowed_to_spawn = true;
@@ -188,7 +188,7 @@ void surv_Initialize() // run at the start of a match, initiates game mode
 // Hook Functions
 // ==============
 
-MUTATOR_HOOKFUNCTION(sv, ClientObituary)
+MUTATOR_HOOKFUNCTION(surv, ClientObituary)
 {
        // in survival, announcing a frag would tell everyone who the hunter is
        entity frag_attacker = M_ARGV(1, entity);
@@ -203,11 +203,11 @@ MUTATOR_HOOKFUNCTION(sv, ClientObituary)
                        GiveFrags(frag_attacker, frag_target, ((autocvar_g_survival_punish_teamkill) ? -1 : -2), frag_deathtype, wep_ent.weaponentity_fld);
        }
 
-       if(frag_attacker.survival_status == SV_STATUS_HUNTER)
+       if(frag_attacker.survival_status == SURV_STATUS_HUNTER)
                M_ARGV(5, bool) = true; // anonymous attacker
 }
 
-MUTATOR_HOOKFUNCTION(sv, PlayerPreThink)
+MUTATOR_HOOKFUNCTION(surv, PlayerPreThink)
 {
        entity player = M_ARGV(0, entity);
 
@@ -215,14 +215,14 @@ MUTATOR_HOOKFUNCTION(sv, PlayerPreThink)
        {
                // update the scoreboard colour display to out the real killer at the end of the round
                // running this every frame to avoid cheats
-               int plcolor = SV_COLOR_PREY;
-               if(player.survival_status == SV_STATUS_HUNTER && game_stopped)
-                       plcolor = SV_COLOR_HUNTER;
+               int plcolor = SURV_COLOR_PREY;
+               if(player.survival_status == SURV_STATUS_HUNTER && game_stopped)
+                       plcolor = SURV_COLOR_HUNTER;
                setcolor(player, plcolor);
        }
 }
 
-MUTATOR_HOOKFUNCTION(sv, PlayerSpawn)
+MUTATOR_HOOKFUNCTION(surv, PlayerSpawn)
 {
        entity player = M_ARGV(0, entity);
 
@@ -233,7 +233,7 @@ MUTATOR_HOOKFUNCTION(sv, PlayerSpawn)
                eliminatedPlayers.SendFlags |= 1;
 }
 
-MUTATOR_HOOKFUNCTION(sv, ForbidSpawn)
+MUTATOR_HOOKFUNCTION(surv, ForbidSpawn)
 {
        entity player = M_ARGV(0, entity);
 
@@ -245,7 +245,7 @@ MUTATOR_HOOKFUNCTION(sv, ForbidSpawn)
        return false;
 }
 
-MUTATOR_HOOKFUNCTION(sv, PutClientInServer)
+MUTATOR_HOOKFUNCTION(surv, PutClientInServer)
 {
        entity player = M_ARGV(0, entity);
 
@@ -260,7 +260,7 @@ MUTATOR_HOOKFUNCTION(sv, PutClientInServer)
        }
 }
 
-MUTATOR_HOOKFUNCTION(sv, reset_map_players)
+MUTATOR_HOOKFUNCTION(surv, reset_map_players)
 {
        FOREACH_CLIENT(true, {
                CS(it).killcount = 0;
@@ -276,7 +276,7 @@ MUTATOR_HOOKFUNCTION(sv, reset_map_players)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(sv, reset_map_global)
+MUTATOR_HOOKFUNCTION(surv, reset_map_global)
 {
        allowed_to_spawn = true;
        return true;
@@ -307,7 +307,7 @@ void surv_LastPlayerForTeam_Notify(entity this)
        }
 }
 
-MUTATOR_HOOKFUNCTION(sv, PlayerDies)
+MUTATOR_HOOKFUNCTION(surv, PlayerDies)
 {
        entity frag_attacker = M_ARGV(1, entity);
        entity frag_target = M_ARGV(2, entity);
@@ -335,7 +335,7 @@ MUTATOR_HOOKFUNCTION(sv, PlayerDies)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(sv, ClientDisconnect)
+MUTATOR_HOOKFUNCTION(surv, ClientDisconnect)
 {
        entity player = M_ARGV(0, entity);
 
@@ -344,7 +344,7 @@ MUTATOR_HOOKFUNCTION(sv, ClientDisconnect)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(sv, MakePlayerObserver)
+MUTATOR_HOOKFUNCTION(surv, MakePlayerObserver)
 {
        entity player = M_ARGV(0, entity);
        bool is_forced = M_ARGV(1, bool);
@@ -368,13 +368,13 @@ MUTATOR_HOOKFUNCTION(sv, MakePlayerObserver)
        return true;  // prevent team reset
 }
 
-MUTATOR_HOOKFUNCTION(sv, Scores_CountFragsRemaining)
+MUTATOR_HOOKFUNCTION(surv, Scores_CountFragsRemaining)
 {
        // announce remaining frags?
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(sv, GiveFragsForKill, CBC_ORDER_FIRST)
+MUTATOR_HOOKFUNCTION(surv, GiveFragsForKill, CBC_ORDER_FIRST)
 {
        entity frag_attacker = M_ARGV(0, entity);
        if(!warmup_stage && round_handler_IsActive() && round_handler_IsRoundStarted())
@@ -383,20 +383,20 @@ MUTATOR_HOOKFUNCTION(sv, GiveFragsForKill, CBC_ORDER_FIRST)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(sv, AddPlayerScore)
+MUTATOR_HOOKFUNCTION(surv, AddPlayerScore)
 {
        entity scorefield = M_ARGV(0, entity);
        if(scorefield == SP_KILLS || scorefield == SP_DEATHS || scorefield == SP_SUICIDES || scorefield == SP_DMG || scorefield == SP_DMGTAKEN)
                M_ARGV(1, float) = 0; // don't report that the player has killed or been killed, that would out them as a hunter!
 }
 
-MUTATOR_HOOKFUNCTION(sv, CalculateRespawnTime)
+MUTATOR_HOOKFUNCTION(surv, CalculateRespawnTime)
 {
        // no respawn calculations needed, player is forced to spectate anyway
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(sv, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(surv, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
 {
        FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                if (IS_PLAYER(it) || INGAME_JOINED(it))
@@ -406,7 +406,7 @@ MUTATOR_HOOKFUNCTION(sv, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(sv, ClientCommand_Spectate)
+MUTATOR_HOOKFUNCTION(surv, ClientCommand_Spectate)
 {
        entity player = M_ARGV(0, entity);
 
@@ -421,7 +421,7 @@ MUTATOR_HOOKFUNCTION(sv, ClientCommand_Spectate)
        return MUT_SPECCMD_CONTINUE;
 }
 
-MUTATOR_HOOKFUNCTION(sv, BotShouldAttack)
+MUTATOR_HOOKFUNCTION(surv, BotShouldAttack)
 {
        entity bot = M_ARGV(0, entity);
        entity targ = M_ARGV(1, entity);
index 822cfd0ebfffc2642fd7f2276b6d8ed50c31de4c..129410a5af77345887bad7d769d740c8b136f44b 100644 (file)
@@ -4,7 +4,7 @@
 #include <common/scores.qh>
 void surv_Initialize();
 
-REGISTER_MUTATOR(sv, false)
+REGISTER_MUTATOR(surv, false)
 {
     MUTATOR_STATIC();
        MUTATOR_ONADD
index 805a022a7c16fc0db492796eedb5146dbe37e2db..18a74c1bfe9f2ba1a9f6d527134285c5fe390d98 100644 (file)
@@ -60,8 +60,8 @@ REGISTER_SP(NEXBALL_FAULTS);
 REGISTER_SP(ONS_CAPS);
 REGISTER_SP(ONS_TAKES);
 
-REGISTER_SP(SV_SURVIVALS);
-REGISTER_SP(SV_HUNTS);
+REGISTER_SP(SURV_SURVIVALS);
+REGISTER_SP(SURV_HUNTS);
 
 REGISTER_SP(SCORE);
 REGISTER_SP(KILLS);