]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_domination.qc
Merge branch 'master' into Mario/vaporizer_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_domination.qc
index 8e4d929beefed58d4163d6c5b5c119c6e4f9fc78..7b392a0663af09b0b65be533388aee3cb211b083 100644 (file)
@@ -1,3 +1,8 @@
+#include "gamemode_domination.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
 void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later
 {
        if(autocvar_sv_eventlog)
@@ -19,7 +24,6 @@ void dompoint_captured ()
 {
        entity head;
        float old_delay, old_team, real_team;
-       string msg = "dom-neut";
 
        // now that the delay has expired, switch to the latest team to lay claim to this point
        head = self.owner;
@@ -75,15 +79,16 @@ void dompoint_captured ()
        self.delay = old_delay;
        self.team = old_team;
 
+       entity msg = WP_DomNeut;
        switch(self.team)
        {
-               case NUM_TEAM_1: msg = "dom-red"; break;
-               case NUM_TEAM_2: msg = "dom-blue"; break;
-               case NUM_TEAM_3: msg = "dom-yellow"; break;
-               case NUM_TEAM_4: msg = "dom-pink"; break;
+               case NUM_TEAM_1: msg = WP_DomRed; break;
+               case NUM_TEAM_2: msg = WP_DomBlue; break;
+               case NUM_TEAM_3: msg = WP_DomYellow; break;
+               case NUM_TEAM_4: msg = WP_DomPink; break;
        }
 
-       WaypointSprite_UpdateSprites(self.sprite, msg, "", "");
+       WaypointSprite_UpdateSprites(self.sprite, msg, WP_Null, WP_Null);
 
        total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
        for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )
@@ -221,7 +226,7 @@ void dompointtouch()
        if(head == world)
                return;
 
-       WaypointSprite_UpdateSprites(self.sprite, "dom-neut", "", "");
+       WaypointSprite_UpdateSprites(self.sprite, WP_DomNeut, WP_Null, WP_Null);
        WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');
        WaypointSprite_Ping(self.sprite);
 
@@ -287,7 +292,7 @@ void dom_controlpoint_setup()
        droptofloor();
 
        waypoint_spawnforitem(self);
-       WaypointSprite_SpawnFixed("dom-neut", self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT, '0 1 1');
+       WaypointSprite_SpawnFixed(WP_DomNeut, self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT);
 }
 
 float total_controlpoints, redowned, blueowned, yellowowned, pinkowned;
@@ -422,19 +427,19 @@ MUTATOR_HOOKFUNCTION(dom_PlayerSpawn)
                self.player_blocked = 1;
        else
                self.player_blocked = 0;
-       return FALSE;
+       return false;
 }
 
 MUTATOR_HOOKFUNCTION(dom_ClientConnect)
 {
        set_dom_state(self);
-       return FALSE;
+       return false;
 }
 
 MUTATOR_HOOKFUNCTION(dom_BotRoles)
 {
        self.havocbot_role = havocbot_role_dom;
-       return TRUE;
+       return true;
 }
 
 /*QUAKED spawnfunc_dom_controlpoint (0 .5 .8) (-16 -16 -24) (16 16 32)
@@ -513,7 +518,7 @@ void ScoreRules_dom(float teams)
 {
        if(domination_roundbased)
        {
-               ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
+               ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
                ScoreInfo_SetLabel_TeamScore  (ST_DOM_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
                ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
                ScoreRules_basics_end();
@@ -526,7 +531,7 @@ void ScoreRules_dom(float teams)
                        sp_domticks = SFL_SORT_PRIO_PRIMARY;
                else
                        sp_score = SFL_SORT_PRIO_PRIMARY;
-               ScoreRules_basics(teams, sp_score, sp_score, TRUE);
+               ScoreRules_basics(teams, sp_score, sp_score, true);
                ScoreInfo_SetLabel_TeamScore  (ST_DOM_TICKS,    "ticks",     sp_domticks);
                ScoreInfo_SetLabel_PlayerScore(SP_DOM_TICKS,    "ticks",     sp_domticks);
                ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES,    "takes",     0);
@@ -592,11 +597,11 @@ void dom_DelayedInit() // Do this check with a delay so we can wait for teams to
        // if no teams are found, spawn defaults
        if(find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
        {
-               print("No ""dom_team"" entities found on this map, creating them anyway.\n");
+               LOG_INFO("No ""dom_team"" entities found on this map, creating them anyway.\n");
                domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4);
                dom_spawnteams(domination_teams);
        }
-       
+
        CheckAllowedTeams(world);
        domination_teams = ((c4>=0) ? 4 : (c3>=0) ? 3 : 2);
 
@@ -647,7 +652,7 @@ MUTATOR_DEFINITION(gamemode_domination)
 
        MUTATOR_ONREMOVE
        {
-               print("This is a game type and it cannot be removed at runtime.");
+               LOG_INFO("This is a game type and it cannot be removed at runtime.");
                return -1;
        }