105 unsigned int totalGainedXP = 0;
111 totalGainedXP += gainedXP;
127 bool foundNextMap =
false;
128 Edict* ent =
nullptr;
139 const int realTimeGap = timeGap > 0 ?
level.time + timeGap : 1;
140 level.winningTeam = team;
141 level.intermissionTime = realTimeGap;
160 gi.WriteShort(actor->
HP);
186 Edict* attacker =
nullptr;
187 Actor* actor =
nullptr;
192 else if (actor->
getTeam() == team)
212 gi.WriteByte(nextmap);
221 gi.WriteByte(
level.num_kills[
i][j]);
225 gi.WriteByte(
level.num_stuns[
i][j]);
256 if (
level.intermissionTime > 0.0f &&
level.time >
level.intermissionTime) {
263 if (
level.mapEndCommand !=
nullptr) {
264 gi.AddCommandString(
"%s\n",
level.mapEndCommand);
267 level.intermissionTime = 0.0f;
268 level.winningTeam = 0;
282 if (
level.intermissionTime > 0.0f)
285 if (!
level.numplayers) {
294 Actor* actor =
nullptr;
308 if (activeTeams < 2) {
322 if (
level.intermissionTime > 0.0f)
#define ABILITY_NUM_TYPES
bool isInRescueZone() const
Checks whether the given actor is currently standing in a rescue zone.
void(* think)(Edict *self)
bool G_ActorDieOrStun(Actor *actor, Edict *attacker)
Reports and handles death or stun of an actor. If the HP of an actor is zero the actor will die,...
Artificial Intelligence functions.
void AIL_Cleanup(void)
Closes the LUA AI.
Actor * G_EdictsGetNextLivingActorOfTeam(Actor *lastEnt, const int team)
Iterate through the living actor entities of the given team.
Edict * G_EdictsGetTriggerNextMaps(Edict *lastEnt)
Iterator through all the trigger_nextmap edicts.
Actor * G_EdictsGetNextActor(Actor *lastEnt)
Iterate through the actor entities (even the dead!).
Actor * G_EdictsGetNextLivingActor(Actor *lastEnt)
Iterate through the living actor entities.
functions to handle the storage and lifecycle of all edicts in the game module.
void G_EventAdd(playermask_t playerMask, int eType, int entnum)
Local definitions for game module.
static int G_GetEarnedExperience(abilityskills_t skill, Edict *ent)
Determines the amount of XP earned by a given soldier for a given skill, based on the soldier's perfo...
static void G_MatchSendResults(int team, bool nextmap)
Handles the end of a match.
void G_MatchEndTrigger(int team, int timeGap)
Triggers the end of the game. Will be executed in the next server (or game) frame.
bool G_MatchIsRunning(void)
Checks whether the game is running (active team and no intermission time).
void G_MatchEndCheck(void)
Checks whether there are still actors to fight with left. If none are the match end will be triggered...
static void G_UpdateCharacterExperience(Edict *ent)
Updates character experience after a mission.
bool G_MatchDoEnd(void)
Checks whether a match is over.
static void G_SendCharacterData(const Actor *actor)
Sends character stats like assigned missions and kills back to client.
void Think_NextMapTrigger(Edict *self)
Register this think function once you would like to end the match This think function will register t...
void G_PrintStats(const char *format,...)
Prints stats to game console and stats log file.
Misc utility functions for game module.
void G_VisMakeEverythingVisible(void)
Make everything visible to anyone who can't already see it.
#define GET_ENCUMBRANCE_PENALTY(weight, max)
Describes a character with all its attributes.
const teamDef_t * teamDef
chrScoreMission_t * scoreMission
int stuns[KILLED_NUM_TYPES]
int kills[KILLED_NUM_TYPES]
int skills[SKILL_NUM_TYPES]
int experience[SKILL_NUM_TYPES+1]
int hitsSplash[SKILL_NUM_TYPES][KILLED_NUM_TYPES]
int hits[SKILL_NUM_TYPES][KILLED_NUM_TYPES]
int kills[KILLED_NUM_TYPES]
int woundLevel[BODYPART_MAXTYPE]
int treatmentLevel[BODYPART_MAXTYPE]