Match related functions. More...
#include "g_local.h"
#include "g_ai.h"
Go to the source code of this file.
Functions | |
static int | G_GetEarnedExperience (abilityskills_t skill, character_t *chr) |
Determines the amount of XP earned by a given soldier for a given skill, based on the soldier's performance in the last mission. | |
static int | G_CharacterGetMaxExperiencePerMission (const abilityskills_t skill) |
Determines the maximum amount of XP per skill that can be gained from any one mission. | |
static void | G_UpdateCharacterSkills (character_t *chr) |
Updates character skills after a mission. | |
void | G_MatchEndTrigger (int team, int timeGap) |
Triggers the end of the game. Will be executed in the next server (or game) frame. | |
static void | G_SendCharacterData (const edict_t *ent) |
Sends character stats like assigned missions and kills back to client. | |
static void | G_MatchSendResults (int team) |
Handles the end of a match. | |
qboolean | G_MatchDoEnd (void) |
Checks whether a match is over. | |
void | G_MatchEndCheck (void) |
Checks whether there are still actors to fight with left. If non are the match end will be triggered. | |
qboolean | G_MatchIsRunning (void) |
Checks whether the game is running (active team and no intermission time). |
Match related functions.
Definition in file g_match.c.
static int G_CharacterGetMaxExperiencePerMission | ( | const abilityskills_t | skill | ) | [static] |
Determines the maximum amount of XP per skill that can be gained from any one mission.
[in] | skill | The skill for which to fetch the maximum amount of XP. |
Definition at line 96 of file g_match.c.
References ABILITY_ACCURACY, ABILITY_MIND, ABILITY_POWER, ABILITY_SPEED, gi, SKILL_ASSAULT, SKILL_CLOSE, SKILL_EXPLOSIVE, SKILL_HEAVY, SKILL_NUM_TYPES, and SKILL_SNIPER.
Referenced by G_UpdateCharacterSkills().
static int G_GetEarnedExperience | ( | abilityskills_t | skill, | |
character_t * | chr | |||
) | [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] | chr | Pointer to the character you want to get the earned experience for |
Definition at line 36 of file g_match.c.
References ABILITY_ACCURACY, ABILITY_MIND, ABILITY_POWER, ABILITY_SPEED, chrScoreMission_s::firedSplashTUs, chrScoreMission_s::firedTUs, chrScoreMission_s::hits, chrScoreMission_s::hitsSplash, i, KILLED_ENEMIES, chrScoreMission_s::kills, chrScoreMission_s::movedCrouched, chrScoreMission_s::movedNormal, character_s::scoreMission, SKILL_ASSAULT, SKILL_CLOSE, SKILL_EXPLOSIVE, SKILL_HEAVY, SKILL_NUM_TYPES, and SKILL_SNIPER.
Referenced by G_UpdateCharacterSkills().
qboolean G_MatchDoEnd | ( | void | ) |
Checks whether a match is over.
true
if this match is over, false
otherwise Definition at line 306 of file g_match.c.
References G_MatchSendResults(), G_PrintStats(), level_locals_t::intermissionTime, level, qfalse, qtrue, level_locals_t::time, va(), and level_locals_t::winningTeam.
Referenced by G_RunFrame().
void G_MatchEndCheck | ( | void | ) |
Checks whether there are still actors to fight with left. If non are the match end will be triggered.
Definition at line 325 of file g_match.c.
References level_locals_t::activeTeam, G_EdictsGetNextLivingActorOfTeam(), G_IsStunned, G_MatchEndTrigger(), i, level_locals_t::intermissionTime, level, MAX_TEAMS, level_locals_t::numplayers, and TEAM_ALIEN.
Referenced by G_ClientDisconnect(), and G_ClientShoot().
void G_MatchEndTrigger | ( | int | team, | |
int | timeGap | |||
) |
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 169 of file g_match.c.
References level_locals_t::intermissionTime, level, level_locals_t::time, and level_locals_t::winningTeam.
Referenced by G_MatchEndCheck(), G_MissionThink(), and SVCmd_Win_f().
qboolean G_MatchIsRunning | ( | void | ) |
Checks whether the game is running (active team and no intermission time).
Definition at line 366 of file g_match.c.
References level_locals_t::activeTeam, level_locals_t::intermissionTime, level, qfalse, and TEAM_NO_ACTIVE.
Referenced by Door_Use(), G_ClientEndRound(), G_ClientUserinfoChanged(), G_GetStartingTeam(), G_MissionThink(), G_PhysicsRun(), G_ReactionFireCanBeEnabled(), and G_RunFrame().
static void G_MatchSendResults | ( | int | team | ) | [static] |
Handles the end of a match.
[in] | team | The winning team number |
Definition at line 215 of file g_match.c.
References AIL_Cleanup(), edict_s::chr, Com_sprintf(), level_locals_t::day, EV_RESULTS, G_ActorDieOrStun(), G_ActorIsInRescueZone(), G_AppearPerishEvent(), G_EdictsGetNextActor(), G_EdictsGetNextInUse(), G_EdictsGetNextLivingActor(), G_IsActor, G_IsAI, G_SendCharacterData(), G_SendInventory(), G_TeamToPM(), G_UpdateCharacterSkills(), G_VisToPM(), gi, edict_s::HP, i, level, MAX_TEAMS, MAX_VAR, level_locals_t::nextmap, level_locals_t::num_alive, level_locals_t::num_kills, level_locals_t::num_spawned, level_locals_t::num_stuns, PM_ALL, qtrue, edict_s::team, TEAM_ALIEN, and edict_s::visflags.
Referenced by G_MatchDoEnd().
static void G_SendCharacterData | ( | const edict_t * | ent | ) | [static] |
Sends character stats like assigned missions and kills back to client.
[in] | ent | The edict to send the data for |
Scores
Definition at line 184 of file g_match.c.
References chrScoreGlobal_s::assignedMissions, edict_s::chr, chrScoreGlobal_s::experience, gi, edict_s::HP, KILLED_NUM_TYPES, chrScoreGlobal_s::kills, edict_s::morale, character_s::score, SKILL_NUM_TYPES, chrScoreGlobal_s::skills, edict_s::STUN, chrScoreGlobal_s::stuns, and character_s::ucn.
Referenced by G_MatchSendResults().
static void G_UpdateCharacterSkills | ( | character_t * | chr | ) | [static] |
Updates character skills after a mission.
[in,out] | chr | Pointer to the character that should get the skills updated |
< We need to get sure that index for health-experience is correct.
Definition at line 131 of file g_match.c.
References chrScoreGlobal_s::experience, G_CharacterGetMaxExperiencePerMission(), G_GetEarnedExperience(), G_PrintStats(), i, chrScoreGlobal_s::initialSkills, int(), character_s::maxHP, character_s::name, teamDef_s::race, RACE_ROBOT, character_s::score, SKILL_NUM_TYPES, chrScoreGlobal_s::skills, character_s::teamDef, and va().
Referenced by G_MatchSendResults().