UFO: Alien Invasion
|
Match related functions. More...
#include "g_match.h"
#include "g_local.h"
#include "g_actor.h"
#include "g_ai.h"
#include "g_edicts.h"
#include "g_trigger.h"
#include "g_utils.h"
#include "g_vis.h"
Go to the source code of this file.
Functions | |
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 performance in the last mission. More... | |
static void | G_UpdateCharacterExperience (Edict *ent) |
Updates character experience after a mission. More... | |
void | G_MatchEndTrigger (int team, int timeGap) |
Triggers the end of the game. Will be executed in the next server (or game) frame. More... | |
static void | G_SendCharacterData (const Actor *actor) |
Sends character stats like assigned missions and kills back to client. More... | |
static void | G_MatchSendResults (int team, bool nextmap) |
Handles the end of a match. More... | |
bool | G_MatchDoEnd (void) |
Checks whether a match is over. More... | |
void | G_MatchEndCheck (void) |
Checks whether there are still actors to fight with left. If none are the match end will be triggered. More... | |
bool | G_MatchIsRunning (void) |
Checks whether the game is running (active team and no intermission time) More... | |
Match related functions.
Definition in file g_match.cpp.
|
static |
Determines the amount of XP earned by a given soldier for a given skill, based on the soldier's performance in the last mission.
[in] | skill | The skill for which to fetch the maximum amount of XP. |
[in] | ent | Pointer to the character you want to get the earned experience for |
Definition at line 42 of file g_match.cpp.
References ABILITY_ACCURACY, ABILITY_MIND, ABILITY_NUM_TYPES, ABILITY_POWER, level_locals_s::actualRound, chrScoreMission_s::carriedWeight, Edict::chr, GET_ENCUMBRANCE_PENALTY, chrScoreMission_s::hits, chrScoreMission_s::hitsSplash, i, KILLED_ENEMIES, chrScoreMission_s::kills, level, character_s::score, character_s::scoreMission, SKILL_ASSAULT, SKILL_CLOSE, SKILL_EXPLOSIVE, SKILL_HEAVY, SKILL_NUM_TYPES, SKILL_SNIPER, chrScoreGlobal_s::skills, and WEIGHT_FACTOR.
Referenced by G_UpdateCharacterExperience().
bool G_MatchDoEnd | ( | void | ) |
Checks whether a match is over.
true
if this match is over, false
otherwise Definition at line 253 of file g_match.cpp.
References AIL_Cleanup(), G_MatchSendResults(), G_PrintStats(), gi, level_locals_s::intermissionTime, level, level_locals_s::mapEndCommand, level_locals_s::nextMapSwitch, level_locals_s::time, and level_locals_s::winningTeam.
Referenced by G_RunFrame().
Checks whether there are still actors to fight with left. If none are the match end will be triggered.
Definition at line 280 of file g_match.cpp.
References level_locals_s::activeTeam, G_EdictsGetNextLivingActorOfTeam(), G_MatchEndTrigger(), i, level_locals_s::intermissionTime, Actor::isStunned(), level, MAX_TEAMS, level_locals_s::numplayers, and TEAM_ALIEN.
Referenced by G_BleedWounds(), G_ClientDisconnect(), G_ClientMove(), and G_ClientShoot().
Triggers the end of the game. Will be executed in the next server (or game) frame.
[in] | team | The winning team |
[in] | timeGap | Second to wait before really ending the game. Useful if you want to allow a last view on the scene |
Definition at line 125 of file g_match.cpp.
References G_EdictsGetTriggerNextMaps(), Edict::getTeam(), level_locals_s::intermissionTime, level, Edict::nextthink, Edict::think, Think_NextMapTrigger(), level_locals_s::time, and level_locals_s::winningTeam.
Referenced by G_ClientEndRound(), G_MatchEndCheck(), G_MissionThink(), SVCmd_Win_f(), and Touch_NextMapTrigger().
bool G_MatchIsRunning | ( | void | ) |
Checks whether the game is running (active team and no intermission time)
true
if there is an active team for the current turn and the end of the game was not yet triggered Definition at line 320 of file g_match.cpp.
References level_locals_s::activeTeam, level_locals_s::intermissionTime, level, and TEAM_NO_ACTIVE.
Referenced by Door_Use(), G_CheckForceEndRound(), G_ClientEndRound(), G_ClientUserinfoChanged(), G_GetStartingTeam(), G_MissionThink(), G_ReactionFireCanBeEnabled(), and G_RunFrame().
Handles the end of a match.
[in] | team | The winning team number |
[in] | nextmap | Is there a follow-up map within the same match ? |
Definition at line 184 of file g_match.cpp.
References EV_RESULTS, G_ActorDieOrStun(), G_EdictsGetNextActor(), G_EdictsGetNextLivingActor(), G_EventAdd(), G_EventEnd(), G_IsAI, G_SendCharacterData(), G_UpdateCharacterExperience(), G_VisMakeEverythingVisible(), Edict::getTeam(), gi, Edict::HP, i, Actor::isInRescueZone(), level, MAX_TEAMS, level_locals_s::num_alive, level_locals_s::num_kills, level_locals_s::num_spawned, level_locals_s::num_stuns, PM_ALL, and TEAM_ALIEN.
Referenced by G_MatchDoEnd().
Sends character stats like assigned missions and kills back to client.
[in] | actor | The edict to send the data for |
Scores
Definition at line 153 of file g_match.cpp.
References chrScoreGlobal_s::assignedMissions, BODYPART_MAXTYPE, Edict::chr, chrScoreGlobal_s::experience, Edict::getStun(), gi, Edict::HP, KILLED_NUM_TYPES, chrScoreGlobal_s::kills, Edict::morale, character_s::score, SKILL_NUM_TYPES, chrScoreGlobal_s::stuns, woundInfo_s::treatmentLevel, character_s::ucn, woundInfo_s::woundLevel, and character_s::wounds.
Referenced by G_MatchSendResults().
Updates character experience after a mission.
[in,out] | ent | Pointer to the character that should get the experience updated |
Definition at line 97 of file g_match.cpp.
References ABILITY_SPEED, Edict::chr, chrScoreGlobal_s::experience, G_GetEarnedExperience(), i, teamDef_s::robot, character_s::score, SKILL_NUM_TYPES, and character_s::teamDef.
Referenced by G_MatchSendResults().