X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fgamemode_domination.qc;h=a6d737205c493a6f83d0e0ffdc85f1b89063a686;hp=1c2ded2dbf893984ee3936e960a5febdabb017f3;hb=20256058c4de97b81ee5aaedaa383a99010752f0;hpb=2316f8469c5be7383b5537e9425442e6678e0bf1 diff --git a/qcsrc/server/mutators/gamemode_domination.qc b/qcsrc/server/mutators/gamemode_domination.qc index 1c2ded2db..a6d737205 100644 --- a/qcsrc/server/mutators/gamemode_domination.qc +++ b/qcsrc/server/mutators/gamemode_domination.qc @@ -19,6 +19,7 @@ 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; @@ -33,7 +34,7 @@ void dompoint_captured () self.model = head.mdl; self.modelindex = head.dmg; self.skin = head.skin; - + float points, wait_time; if (autocvar_g_domination_point_amt) points = autocvar_g_domination_point_amt; @@ -57,9 +58,9 @@ void dompoint_captured () if (head.noise != "") if(self.enemy) - sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTN_NORM); + sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); else - sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTN_NORM); + sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); if (head.noise1 != "") play2all(head.noise1); @@ -75,8 +76,16 @@ void dompoint_captured () self.delay = old_delay; self.team = old_team; - WaypointSprite_UpdateSprites(self.sprite, strcat("dom-", Team_ColorName_Lower(self.goalentity.team)), "", ""); - + 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; + } + + WaypointSprite_UpdateSprites(self.sprite, msg, "", ""); + 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; ) { @@ -90,16 +99,16 @@ void dompoint_captured () wait_time = head.wait; switch(head.goalentity.team) { - case FL_TEAM_1: + case NUM_TEAM_1: pps_red += points/wait_time; break; - case FL_TEAM_2: + case NUM_TEAM_2: pps_blue += points/wait_time; break; - case FL_TEAM_3: + case NUM_TEAM_3: pps_yellow += points/wait_time; break; - case FL_TEAM_4: + case NUM_TEAM_4: pps_pink += points/wait_time; } total_pps += points/wait_time; @@ -173,7 +182,7 @@ void dompointthink() void dompointtouch() { entity head; - if (other.classname != "player") + if (!IS_PLAYER(other)) return; if (other.health < 1) return; @@ -441,12 +450,12 @@ void dom_spawnteams() { float numteams = ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override); - dom_spawnteam("Red", FL_TEAM_1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point"); - dom_spawnteam("Blue", FL_TEAM_2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point"); + dom_spawnteam("Red", NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point"); + dom_spawnteam("Blue", NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point"); if(numteams > 2) - dom_spawnteam("Yellow", FL_TEAM_3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point"); + dom_spawnteam("Yellow", NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point"); if(numteams > 3) - dom_spawnteam("Pink", FL_TEAM_4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point"); + dom_spawnteam("Pink", NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point"); dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", ""); } @@ -458,7 +467,7 @@ void dom_DelayedInit() // Do this check with a delay so we can wait for teams to print("No ""dom_team"" entities found on this map, creating them anyway.\n"); dom_spawnteams(); } - + ScoreRules_dom(); } @@ -470,13 +479,13 @@ void dom_Initialize() precache_model("models/domination/dom_pink.md3"); precache_model("models/domination/dom_unclaimed.md3"); precache_sound("domination/claim.wav"); - + addstat(STAT_DOM_TOTAL_PPS, AS_FLOAT, dom_total_pps); addstat(STAT_DOM_PPS_RED, AS_FLOAT, dom_pps_red); addstat(STAT_DOM_PPS_BLUE, AS_FLOAT, dom_pps_blue); if(c3 >= 0) addstat(STAT_DOM_PPS_YELLOW, AS_FLOAT, dom_pps_yellow); if(c4 >= 0) addstat(STAT_DOM_PPS_PINK, AS_FLOAT, dom_pps_pink); - + InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE); } @@ -484,8 +493,8 @@ void dom_Initialize() MUTATOR_DEFINITION(gamemode_domination) { MUTATOR_HOOK(ClientConnect, dom_ClientConnect, CBC_ORDER_ANY); - MUTATOR_HOOK(HavocBot_ChooseRule, dom_BotRoles, CBC_ORDER_ANY); - + MUTATOR_HOOK(HavocBot_ChooseRole, dom_BotRoles, CBC_ORDER_ANY); + MUTATOR_ONADD { if(time > 1) // game loads at time 1