#include "mutators/mutators_include.qh"
#include "race.qh"
#include "scores.qh"
-#include "secret.qh"
#include "teamplay.qh"
-#include "waypointsprites.qh"
#include "weapons/weaponstats.qh"
#include "../common/buffs.qh"
#include "../common/constants.qh"
#include "../common/deathtypes.qh"
+#include "../common/effects.qh"
#include "../common/mapinfo.qh"
#include "../common/monsters/all.qh"
#include "../common/monsters/sv_monsters.qh"
+#include "../common/vehicles/all.qh"
#include "../common/notifications.qh"
#include "../common/playerstats.qh"
#include "../common/stats.qh"
BADCVAR("pausable");
BADCVAR("sv_allow_fullbright");
BADCVAR("sv_checkforpacketsduringsleep");
- BADCVAR("sv_fraginfo");
BADCVAR("sv_timeout");
BADPREFIX("sv_timeout_");
BADPREFIX("crypto_");
BADPREFIX("prvm_");
BADPREFIX("skill_");
BADPREFIX("sv_cullentities_");
- BADPREFIX("sv_fraginfo_");
BADPREFIX("sv_maxidle_");
BADPREFIX("sv_vote_");
BADPREFIX("timelimit_");
self.classname = "worldspawn"; // safeguard against various stuff ;)
// needs to be done so early because of the constants they create
- CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
- CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
- CALL_ACCUMULATED_FUNCTION(RegisterItems);
- CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+ static_init();
+ CALL_ACCUMULATED_FUNCTION(RegisterTurrets);
CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
- CALL_ACCUMULATED_FUNCTION(RegisterBuffs);
+ CALL_ACCUMULATED_FUNCTION(RegisterEffects);
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
void ClientInit_Spawn();
void WeaponStats_Init();
void WeaponStats_Shutdown();
+void Physics_AddStats();
void spawnfunc_worldspawn (void)
{
float fd, l, j, n;
server_is_dedicated = (stof(cvar_defstring("is_dedicated")) ? true : false);
// needs to be done so early because of the constants they create
- CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
- CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
- CALL_ACCUMULATED_FUNCTION(RegisterItems);
- CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+ static_init();
+ CALL_ACCUMULATED_FUNCTION(RegisterTurrets);
CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
- CALL_ACCUMULATED_FUNCTION(RegisterBuffs);
+ CALL_ACCUMULATED_FUNCTION(RegisterEffects);
ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s));
s = ":gameinfo:mutators:LIST";
- ret_string = s;
- MUTATOR_CALLHOOK(BuildMutatorsString);
+ MUTATOR_CALLHOOK(BuildMutatorsString, s);
s = ret_string;
// simple, probably not good in the mutator system
WeaponStats_Init();
WepSet_AddStat();
+ WepSet_AddStat_InMap();
addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon);
addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon);
addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);
addstat(STAT_FROZEN, AS_INT, frozen);
addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, revive_progress);
- // g_movementspeed hack
- addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
- addstat(STAT_MOVEVARS_MAXSPEED, AS_FLOAT, stat_sv_maxspeed);
- addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
- addstat(STAT_MOVEVARS_AIRSTRAFEACCEL_QW, AS_FLOAT, stat_sv_airstrafeaccel_qw);
+ // physics
+ Physics_AddStats();
// new properties
addstat(STAT_MOVEVARS_JUMPVELOCITY, AS_FLOAT, stat_sv_jumpvelocity);
head.winning = 0;
}
-// Onslaught winning condition:
-// game terminates if only one team has a working generator (or none)
-float WinningCondition_Onslaught()
-{
- entity head;
- float t1, t2, t3, t4;
-
- WinningConditionHelper(); // set worldstatus
-
- if(warmup_stage)
- return WINNING_NO;
-
- // first check if the game has ended
- t1 = t2 = t3 = t4 = 0;
- head = find(world, classname, "onslaught_generator");
- while (head)
- {
- if (head.health > 0)
- {
- if (head.team == NUM_TEAM_1) t1 = 1;
- if (head.team == NUM_TEAM_2) t2 = 1;
- if (head.team == NUM_TEAM_3) t3 = 1;
- if (head.team == NUM_TEAM_4) t4 = 1;
- }
- head = find(head, classname, "onslaught_generator");
- }
- if (t1 + t2 + t3 + t4 < 2)
- {
- // game over, only one team remains (or none)
- ClearWinners();
- if (t1) SetWinners(team, NUM_TEAM_1);
- if (t2) SetWinners(team, NUM_TEAM_2);
- if (t3) SetWinners(team, NUM_TEAM_3);
- if (t4) SetWinners(team, NUM_TEAM_4);
- dprint("Have a winner, ending game.\n");
- return WINNING_YES;
- }
-
- // Two or more teams remain
- return WINNING_NO;
-}
-
// 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.
void assault_new_round();
return;
}
- if(g_onslaught)
- timelimit = 0; // ONS has its own overtime rule
-
float wantovertime;
wantovertime = 0;
{
checkrules_status = WinningCondition_LMS();
}
- else if (g_onslaught)
- {
- checkrules_status = WinningCondition_Onslaught(); // TODO remove this?
- }
else
{
checkrules_status = WinningCondition_Scores(fraglimit, leadlimit);