X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fassault%2Fsv_assault.qc;h=e9fb0a48dea9b2988e4bf22135d457b143a65d22;hb=f79d3329e933bd6d5539d2065467772d85c36079;hp=9a9a654de9c928d3ae5112a69c8308ebaaab4016;hpb=9ce1079a850c81a5f14a150f6a19cad2f51f6032;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc index 9a9a654de..e9fb0a48d 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc +++ b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc @@ -1,20 +1,16 @@ #include "sv_assault.qh" +#include #include +#include +#include +#include +#include +#include .entity sprite; #define AS_ROUND_DELAY 5 -IntrusiveList g_assault_destructibles; -IntrusiveList g_assault_objectivedecreasers; -IntrusiveList g_assault_objectives; -STATIC_INIT(g_assault) -{ - g_assault_destructibles = IL_NEW(); - g_assault_objectivedecreasers = IL_NEW(); - g_assault_objectives = IL_NEW(); -} - // random functions void assault_objective_use(entity this, entity actor, entity trigger) { @@ -123,7 +119,6 @@ void target_objective_decrease_activate(entity this) spr = WaypointSprite_SpawnFixed(WP_AssaultDefend, 0.5 * (it.absmin + it.absmax), it, assault_sprite, RADARICON_OBJECTIVE); spr.assault_decreaser = this; spr.waypointsprite_visible_for_player = assault_decreaser_sprite_visible; - spr.classname = "sprite_waypoint"; WaypointSprite_UpdateRule(spr, assault_attacker_team, SPRITERULE_TEAMPLAY); if(it.classname == "func_assault_destructible") { @@ -196,8 +191,6 @@ void assault_wall_think(entity this) // reset objectives, toggle spawnpoints, reset triggers, ... void assault_new_round(entity this) { - //bprint("ASSAULT: new round\n"); - // up round counter this.winning = this.winning + 1; @@ -217,7 +210,8 @@ void assault_new_round(entity this) // reset the level with a countdown cvar_set("timelimit", ftos(ceil(time - AS_ROUND_DELAY - game_starttime) / 60)); - ReadyRestart_force(); // sets game_starttime + bprint("Starting second round...\n"); + ReadyRestart_force(true); // sets game_starttime } entity as_round; @@ -256,12 +250,12 @@ int WinningCondition_Assault() { if(ent.winning) // round end has been triggered by attacking team { - bprint("Assault: round completed.\n"); + bprint(Team_ColoredFullName(assault_attacker_team), " destroyed the objective in ", process_time(2, ceil(time - game_starttime)), "\n"); SetWinners(team, assault_attacker_team); TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0)); - if(ent.cnt == 1 || autocvar_g_campaign) // this was the second round + if(ent.cnt == 1 || autocvar_g_campaign) // this was the second round or the only round in campaign { status = WINNING_YES; } @@ -306,7 +300,6 @@ spawnfunc(target_objective) { if (!g_assault) { delete(this); return; } - this.classname = "target_objective"; IL_PUSH(g_assault_objectives, this); this.use = assault_objective_use; this.reset = assault_objective_reset; @@ -318,7 +311,6 @@ spawnfunc(target_objective_decrease) { if (!g_assault) { delete(this); return; } - this.classname = "target_objective_decrease"; IL_PUSH(g_assault_objectivedecreasers, this); if(!this.dmg) @@ -354,7 +346,6 @@ spawnfunc(func_assault_destructible) if (!g_assault) { delete(this); return; } this.spawnflags = 3; - this.classname = "func_assault_destructible"; this.event_heal = destructible_heal; IL_PUSH(g_assault_destructibles, this); @@ -363,14 +354,13 @@ spawnfunc(func_assault_destructible) else this.team = NUM_TEAM_1; - spawnfunc_func_breakable(this); + func_breakable_setup(this); } spawnfunc(func_assault_wall) { if (!g_assault) { delete(this); return; } - this.classname = "func_assault_wall"; this.mdl = this.model; _setmodel(this, this.mdl); this.solid = SOLID_BSP; @@ -384,7 +374,6 @@ spawnfunc(target_assault_roundend) if (!g_assault) { delete(this); return; } this.winning = 0; // round not yet won by attackers - this.classname = "target_assault_roundend"; this.use = target_assault_roundend_use; this.cnt = 0; // first round this.reset = target_assault_roundend_reset; @@ -395,7 +384,6 @@ spawnfunc(target_assault_roundstart) if (!g_assault) { delete(this); return; } assault_attacker_team = NUM_TEAM_1; - this.classname = "target_assault_roundstart"; this.use = assault_roundstart_use; this.reset2 = assault_roundstart_use_this; InitializeEntity(this, assault_roundstart_use_this, INITPRIO_FINDTARGET); @@ -642,5 +630,8 @@ MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn) MUTATOR_HOOKFUNCTION(as, ReadyRestart_Deny) { // readyrestart not supported (yet) + // it's supported only in campaign mode (single round mode), since campaign requires it + if (autocvar_g_campaign) + return false; return true; }