X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fmutator%2Fgamemode_domination.qc;h=be38553c9588bcd4ba1bfd79042432f79aebd583;hp=abcae5ada5dffb2db2381386b8a9d0a23627d5b4;hb=0ef42fd969f0608f8dbf4086f569ad34ac0271d5;hpb=393022c0e9b00481e68d1db786e96e4ffb7f37e0 diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index abcae5ada..be38553c9 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -64,7 +64,7 @@ void dompoint_captured(entity this) Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time); if(this.enemy.playerid == this.enemy_playerid) - PlayerScore_Add(this.enemy, SP_DOM_TAKES, 1); + GameRules_scoring_add(this.enemy, DOM_TAKES, 1); else this.enemy = NULL; @@ -124,7 +124,7 @@ void dompoint_captured(entity this) this.captime = time; - FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(set_dom_state(it))); + FOREACH_CLIENT(IS_REAL_CLIENT(it), { set_dom_state(it); }); } void AnimateDomPoint(entity this) @@ -153,7 +153,7 @@ void dompointthink(entity this) // give points - if (gameover || this.delay > time || time < game_starttime) // game has ended, don't keep giving points + if (game_stopped || this.delay > time || time < game_starttime) // game has ended, don't keep giving points return; if(autocvar_g_domination_point_rate) @@ -176,8 +176,8 @@ void dompointthink(entity this) // give credit to the individual player, if he is still there if (this.enemy.playerid == this.enemy_playerid) { - PlayerScore_Add(this.enemy, SP_SCORE, fragamt); - PlayerScore_Add(this.enemy, SP_DOM_TICKS, fragamt); + GameRules_scoring_add(this.enemy, SCORE, fragamt); + GameRules_scoring_add(this.enemy, DOM_TICKS, fragamt); } else this.enemy = NULL; @@ -342,6 +342,8 @@ float Domination_CheckWinner() { Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER); Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER); + + game_stopped = true; round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit); return 1; } @@ -365,6 +367,7 @@ float Domination_CheckWinner() Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED); } + game_stopped = true; round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit); return 1; @@ -377,7 +380,7 @@ float Domination_CheckPlayers() void Domination_RoundStart() { - FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.player_blocked = false)); + FOREACH_CLIENT(IS_PLAYER(it), { it.player_blocked = false; }); } //go to best items, or control points you don't own @@ -406,12 +409,12 @@ void havocbot_role_dom(entity this) havocbot_goalrating_controlpoints(this, 10000, this.origin, 15000); havocbot_goalrating_items(this, 8000, this.origin, 8000); //havocbot_goalrating_enemyplayers(this, 3000, this.origin, 2000); - //havocbot_goalrating_waypoints(1, this.origin, 1000); + havocbot_goalrating_waypoints(this, 1, this.origin, 3000); navigation_goalrating_end(this); } } -MUTATOR_HOOKFUNCTION(dom, GetTeamCount) +MUTATOR_HOOKFUNCTION(dom, CheckAllowedTeams) { // fallback? M_ARGV(0, float) = domination_teams; @@ -442,13 +445,13 @@ MUTATOR_HOOKFUNCTION(dom, GetTeamCount) MUTATOR_HOOKFUNCTION(dom, reset_map_players) { total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0; - FOREACH_CLIENT(IS_PLAYER(it), LAMBDA( + FOREACH_CLIENT(IS_PLAYER(it), { PutClientInServer(it); if(domination_roundbased) it.player_blocked = 1; if(IS_REAL_CLIENT(it)) set_dom_state(it); - )); + }); return true; } @@ -556,10 +559,10 @@ void ScoreRules_dom(int teams) { if(domination_roundbased) { - 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(); + GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, { + field_team(ST_DOM_CAPS, "caps", SFL_SORT_PRIO_PRIMARY); + field(SP_DOM_TAKES, "takes", 0); + }); } else { @@ -569,11 +572,11 @@ void ScoreRules_dom(int teams) sp_domticks = SFL_SORT_PRIO_PRIMARY; else sp_score = SFL_SORT_PRIO_PRIMARY; - 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); - ScoreRules_basics_end(); + GameRules_scoring(teams, sp_score, sp_score, { + field_team(ST_DOM_TICKS, "ticks", sp_domticks); + field(SP_DOM_TICKS, "ticks", sp_domticks); + field(SP_DOM_TAKES, "takes", 0); + }); } } @@ -631,7 +634,10 @@ void dom_DelayedInit(entity this) // Do this check with a delay so we can wait f if(find(NULL, classname, "dom_team") == NULL || autocvar_g_domination_teams_override >= 2) { LOG_TRACE("No \"dom_team\" entities found on this map, creating them anyway."); - domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4); + domination_teams = autocvar_g_domination_teams_override; + if (domination_teams < 2) + domination_teams = autocvar_g_domination_default_teams; + domination_teams = bound(2, domination_teams, 4); dom_spawnteams(domination_teams); }