X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fmutators%2Fmutator%2Fgamemode_assault.qh;h=ea714e6a23ba4528f38b6e189386a69215dd6603;hb=bcfb2c28a83d43a76cdc18de1f00b4d191da55e5;hp=8fd40748543bbcdf5a708845720791f6e6ac5f37;hpb=dd4c1682cc714ad06f353d96659e82edf76a175e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qh b/qcsrc/server/mutators/mutator/gamemode_assault.qh index 8fd407485..ea714e6a2 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qh +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qh @@ -2,33 +2,20 @@ #include "../gamemode.qh" -void assault_ScoreRules(); +const int ST_ASSAULT_OBJECTIVES = 1; REGISTER_MUTATOR(as, false) { - ActivateTeamplay(); - have_team_spawns = -1; // request team spawns - + MUTATOR_STATIC(); MUTATOR_ONADD { - if (time > 1) // game loads at time 1 - error("This is a game type and it cannot be added at runtime."); - assault_ScoreRules(); - } - - MUTATOR_ONROLLBACK_OR_REMOVE - { - // we actually cannot roll back assault_Initialize here - // BUT: we don't need to! If this gets called, adding always - // succeeds. - } - - MUTATOR_ONREMOVE - { - LOG_INFO("This is a game type and it cannot be removed at runtime."); - return -1; + GameRules_teams(true); + int teams = BITS(2); // always red vs blue + GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, { + field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY); + field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY); + }); } - return 0; } @@ -44,9 +31,6 @@ const int HAVOCBOT_AST_ROLE_OFFENSE = 4; .int havocbot_role_flags; .float havocbot_attack_time; -.void(entity this) havocbot_role; -.void(entity this) havocbot_previous_role; - void(entity this) havocbot_role_ast_defense; void(entity this) havocbot_role_ast_offense; @@ -55,8 +39,5 @@ void(entity bot) havocbot_ast_reset_role; void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items; void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers; -// scoreboard stuff -const float ST_ASSAULT_OBJECTIVES = 1; - // predefined spawnfuncs void target_objective_decrease_activate(entity this);