seta notification_INFO_WEAPON_VAPORIZER_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_WEAPON_VORTEX_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
-// MSG_CENTER notifications (count = 230):
+// MSG_CENTER notifications (count = 231):
seta notification_CENTER_ALONE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_ATTACKING "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_DEFENDING "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ASSAULT_OBJ_DESTROYED "1" "0 = off, 1 = centerprint"
seta notification_CENTER_CAMPCHECK "1" "0 = off, 1 = centerprint"
seta notification_CENTER_COINTOSS "1" "0 = off, 1 = centerprint"
seta notification_CENTER_COUNTDOWN_BEGIN "1" "0 = off, 1 = centerprint"
seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
-// Notification counts (total = 820): MSG_ANNCE = 89, MSG_INFO = 320, MSG_CENTER = 230, MSG_MULTI = 153, MSG_CHOICE = 28
+// Notification counts (total = 821): MSG_ANNCE = 89, MSG_INFO = 320, MSG_CENTER = 231, MSG_MULTI = 153, MSG_CHOICE = 28
float uid2name_dialog;
-float gameover_time;
+float intermission_time;
.bool csqcmodel_isdead; // used by shownames and miscfunctions (entcs_IsDead) to know when a player is dead
}
vector timer_color;
- if(gameover_time || minutesLeft >= 5 || warmup_stage || timelimit == 0)
+ if(intermission_time || minutesLeft >= 5 || warmup_stage || timelimit == 0)
timer_color = '1 1 1'; //white
else if(minutesLeft >= 1)
timer_color = '1 1 0'; //yellow
else
timer_color = '1 0 0'; //red
- if (gameover_time) {
- timer = seconds_tostring(max(0, floor(gameover_time - STAT(GAMESTARTTIME))));
+ if (intermission_time) {
+ timer = seconds_tostring(max(0, floor(intermission_time - STAT(GAMESTARTTIME))));
} else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) {
if (time < STAT(GAMESTARTTIME))
timer = seconds_tostring(0); //while restart is still active, show 00:00
{
if(autocvar_cl_orthoview)
return false;
- if(intermission)
+ if(STAT(GAMEOVER) || intermission)
return true;
if(this.viewloc)
return true;
{
float f, i, j;
vector v;
- if(!scoreboard_active && !camera_active && intermission != 2 &&
+ if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAMEOVER) &&
spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) &&
!HUD_MinigameMenu_IsOpened() )
{
if(!postinit)
PostInit();
- if(intermission && !gameover_time)
- gameover_time = time;
+ if(intermission && !intermission_time)
+ intermission_time = time;
if(intermission && !isdemo() && !(calledhooks & HOOK_END))
{
{
entity player = M_ARGV(0, entity);
- if(!intermission_running)
+ if(!gameover)
if(!IS_DEAD(player))
if(IS_PLAYER(player))
NIX_GiveCurrentWeapon(player);
MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
{
- if(intermission_running || gameover)
+ if(gameover)
return;
entity player = M_ARGV(0, entity);
MSG_CENTER_NOTIF(ASSAULT_ATTACKING, 1, 0, 0, "", CPID_ASSAULT_ROLE, "0 0", _("^BGYou are attacking!"), "")
MSG_CENTER_NOTIF(ASSAULT_DEFENDING, 1, 0, 0, "", CPID_ASSAULT_ROLE, "0 0", _("^BGYou are defending!"), "")
+ MSG_CENTER_NOTIF(ASSAULT_OBJ_DESTROYED, 1, 0, 1, "f1time", CPID_ASSAULT_ROLE, "0 0", _("^BGObjective destroyed in ^F4%s^BG!"), "")
MSG_CENTER_NOTIF(COUNTDOWN_BEGIN, 1, 0, 0, "", CPID_ROUND, "2 0", _("^F4Begin!"), "")
MSG_CENTER_NOTIF(COUNTDOWN_GAMESTART, 1, 0, 1, "", CPID_ROUND, "1 f1", _("^F4Game starts in ^COUNT"), "")
#ifdef SVQC
SPECTATE_COPYFIELD(_STAT(WEAPON_NEXTTHINK))
float W_WeaponRateFactor(entity this);
+float gameover;
#endif
REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this))
-
+REGISTER_STAT(GAMEOVER, int, gameover)
REGISTER_STAT(GAMESTARTTIME, float)
REGISTER_STAT(STRENGTH_FINISHED, float)
REGISTER_STAT(INVINCIBLE_FINISHED, float)
entity vehic = this.vehicle;
return = true;
- if(intermission_running)
+ if(gameover)
{
vehic.solid = SOLID_NOT;
vehic.takedamage = DAMAGE_NO;
entity vehic = this.vehicle;
return = true;
- if(intermission_running)
+ if(gameover)
{
vehic.solid = SOLID_NOT;
vehic.takedamage = DAMAGE_NO;
entity vehic = this.vehicle;
return = true;
- if(intermission_running)
+ if(gameover)
{
vehic.solid = SOLID_NOT;
vehic.takedamage = DAMAGE_NO;
entity vehic = this.vehicle;
return = true;
- if(intermission_running)
+ if(gameover)
{
vehic.solid = SOLID_NOT;
vehic.takedamage = DAMAGE_NO;
void bot_serverframe()
{
- if (intermission_running)
+ if (gameover)
return;
if (time < 2)
if (this.killcount != FRAGS_SPECTATOR)
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname);
- if(!intermission_running)
- if(autocvar_g_chat_nospectators == 1 || (!(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2))
+ if(!gameover)
+ if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2))
Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
if(this.just_joined == false) {
if (IS_PLAYER(this)) {
CheckRules_Player(this);
- if (intermission_running) {
- IntermissionThink(this);
+ if (gameover || intermission_running) {
+ if(intermission_running)
+ IntermissionThink(this);
return;
}
this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
}
- else if (gameover) {
- if (intermission_running) IntermissionThink(this);
+ else if (gameover || intermission_running) {
+ if(intermission_running)
+ IntermissionThink(this);
return;
}
else if (IS_OBSERVER(this)) {
CheatFrame(this);
//CheckPlayerJump();
+ if (gameover)
+ {
+ this.solid = SOLID_NOT;
+ this.takedamage = DAMAGE_NO;
+ set_movetype(this, MOVETYPE_NONE);
+ }
if (IS_PLAYER(this)) {
DrownPlayer(this);
CheckRules_Player(this);
UpdateChatBubble(this);
if (this.impulse) ImpulseCommands(this);
- if (intermission_running) return; // intermission or finale
+ if (gameover)
+ {
+ CSQCMODEL_AUTOUPDATE(this);
+ return;
+ }
GetPressedKeys(this);
}
void ReadyRestart()
{
// no assault support yet...
- if (g_assault | gameover | intermission_running | race_completing) localcmd("restart\n");
+ if (g_assault || gameover || race_completing) localcmd("restart\n");
else localcmd("\nsv_hook_gamerestart\n");
// Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
void weapon_defaultspawnfunc(entity this, Weapon e);
-float gameover;
float intermission_running;
float intermission_exittime;
float alreadychangedlevel;
error("Owner lost the hook!\n");
return;
}
- if(LostMovetypeFollow(this) || intermission_running || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade"))
+ if(LostMovetypeFollow(this) || gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade"))
{
RemoveGrapplingHook(this.realowner);
return;
void IntermissionThink(entity this)
{
FixIntermissionClient(this);
- CSQCMODEL_AUTOUPDATE(this); // PlayerPostThink returns before calling this during intermission, so run it here
float server_screenshot = (autocvar_sv_autoscreenshot && this.cvar_cl_autoscreenshot);
float client_screenshot = (this.cvar_cl_autoscreenshot == 2);
e.autoscreenshot = time + 0.8; // used for autoscreenshot
e.health = -2342;
// first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
- e.solid = SOLID_NOT;
- set_movetype(e, MOVETYPE_NONE);
- e.takedamage = DAMAGE_NO;
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
intermission_running = 1;
-// enforce a wait time before allowing changelevel
+ // enforce a wait time before allowing changelevel
if(player_count > 0)
intermission_exittime = time + autocvar_sv_mapchange_delay;
else
SetDefaultAlpha();
- if (gameover) // someone else quit the game already
+ if (intermission_running) // someone else quit the game already
{
if(player_count == 0) // Nobody there? Then let's go to the next map
MapVote_Start();
string playername(entity p)
{
string t;
- if (teamplay && !intermission_running && IS_PLAYER(p))
+ if (teamplay && !gameover && IS_PLAYER(p))
{
t = Team_ColorCode(p.team);
return strcat(t, strdecolorize(p.netname));
#include "gamemode_assault.qh"
.entity sprite;
+#define AS_ROUND_DELAY 5
// random functions
void assault_objective_use(entity this, entity actor, entity trigger)
});
// reset the level with a countdown
- cvar_set("timelimit", ftos(ceil(time - game_starttime) / 60));
+ cvar_set("timelimit", ftos(ceil(time - AS_ROUND_DELAY - game_starttime) / 60));
ReadyRestart_force(); // sets game_starttime
}
+entity as_round;
+.entity ent_winning;
+void as_round_think()
+{
+ gameover = false;
+ assault_new_round(as_round.ent_winning);
+ delete(as_round);
+ as_round = NULL;
+}
+
// Assault winning condition: If the attackers triggered a round end (by fulfilling all objectives)
// they win. Otherwise the defending team wins once the timelimit passes.
int WinningCondition_Assault()
{
+ if(as_round)
+ return WINNING_NO;
+
WinningConditionHelper(NULL); // set worldstatus
int status = WINNING_NO;
{
if(ent.winning) // round end has been triggered by attacking team
{
- bprint("ASSAULT: round completed...\n");
+ bprint("Assault: round completed.\n");
SetWinners(team, assault_attacker_team);
TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
}
else
{
- assault_new_round(ent);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ASSAULT_OBJ_DESTROYED, ceil(time - game_starttime));
+ as_round = new(as_round);
+ as_round.think = as_round_think;
+ as_round.ent_winning = ent;
+ as_round.nextthink = time + AS_ROUND_DELAY;
+ gameover = true;
+
+ // make sure timelimit isn't hit while the game is blocked
+ if(autocvar_timelimit > 0)
+ if(time + AS_ROUND_DELAY >= game_starttime + autocvar_timelimit * 60)
+ cvar_set("timelimit", ftos(autocvar_timelimit + AS_ROUND_DELAY / 60));
}
}
}
void kh_WaitForPlayers();
void kh_Controller_Think(entity this) // called a lot
{
- if(intermission_running)
+ if(gameover)
return;
if(this.cnt > 0)
{
void kh_Scores_Event(entity player, entity key, string what, float frags_player, float frags_owner) // update the score when a key is captured
{
string s;
- if(intermission_running)
+ if(gameover)
return;
if(frags_player)
void kh_Key_Touch(entity this, entity toucher) // runs many, many times when a key has been dropped and can be picked up
{
- if(intermission_running)
+ if(gameover)
return;
if(this.owner) // already carried
void kh_Key_Think(entity this) // runs all the time
{
- if(intermission_running)
+ if(gameover)
return;
if(this.owner)
teamsay = false;
}
- if(intermission_running)
+ if(gameover)
teamsay = false;
if (!source) {
if (!privatesay && source && !IS_PLAYER(source))
{
- if (!intermission_running)
- if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover)))
- teamsay = -1; // spectators
+ if (!gameover)
+ if (teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
+ teamsay = -1; // spectators
}
if(flood)
}
if (gameover)
+ gameover = false;
+
+ if (intermission_running)
{
round_handler_Reset(0);
round_handler_Remove();
// schedule a new round
this.wait = true;
this.nextthink = time + this.delay;
+ gameover = true;
}
else
{
void CL_Weaponentity_Think(entity this)
{
this.nextthink = time;
- if (intermission_running) this.frame = this.anim_idle.x;
+ if (gameover) this.frame = this.anim_idle.x;
.entity weaponentity = this.weaponentity_fld;
if (this.owner.(weaponentity) != this)
{