UFO: Alien Invasion
|
Character (soldier, alien) related campaign functions. More...
Go to the source code of this file.
Data Structures | |
struct | updateCharacter_t |
Functions | |
int | CHAR_GetMaxExperiencePerMission (const abilityskills_t skill) |
Determines the maximum amount of XP per skill that can be gained from any one mission. More... | |
void | CHAR_UpdateSkills (character_t *chr) |
Updates the character skills after a mission. More... | |
void | CHAR_UpdateData (linkedList_t *updateCharacters) |
Transforms the battlescape values to the character. More... | |
void | CHAR_ParseData (dbuffer *msg, linkedList_t **updateCharacters) |
Parses the character data which was send by G_MatchSendResults using G_SendCharacterData. More... | |
static bool | CHAR_ShouldUpdateSoldierRank (const rank_t *rank, const character_t *chr) |
Checks whether a soldier should be promoted. More... | |
void | CHAR_UpdateStats (const base_t *base, const aircraft_t *aircraft) |
Update employees stats after mission. More... | |
void | CHAR_InitStartup (void) |
Campaign initialization actions for the character module. More... | |
void | CHAR_Shutdown (void) |
Campaign closing actions for the character module. More... | |
Character (soldier, alien) related campaign functions.
Definition in file cp_character.cpp.
int CHAR_GetMaxExperiencePerMission | ( | const abilityskills_t | skill | ) |
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 51 of file cp_character.cpp.
References ABILITY_ACCURACY, ABILITY_MIND, ABILITY_POWER, ABILITY_SPEED, cgi, ERR_DROP, SKILL_ASSAULT, SKILL_CLOSE, SKILL_EVADING, SKILL_EXPLOSIVE, SKILL_HEAVY, SKILL_NUM_TYPES, SKILL_PILOTING, SKILL_SNIPER, and SKILL_TARGETING.
Referenced by AM_UpdateSurivorsAfterBattle(), and CHAR_UpdateData().
Campaign initialization actions for the character module.
Definition at line 285 of file cp_character.cpp.
References cgi.
Referenced by CP_InitStartup().
void CHAR_ParseData | ( | dbuffer * | msg, |
linkedList_t ** | updateCharacters | ||
) |
Parses the character data which was send by G_MatchSendResults using G_SendCharacterData.
[in] | msg | The network buffer message. If this is nullptr the character is updated, if this is not nullptr the data is stored in a temp buffer because the player can choose to retry the mission and we have to catch this situation to not update the character data in this case. |
updateCharacters | A LinkedList where to store the character data. One listitem per character. |
Definition at line 147 of file cp_character.cpp.
References chrScoreGlobal_s::assignedMissions, BODYPART_MAXTYPE, cgi, updateCharacter_t::chrscore, ERR_DROP, chrScoreGlobal_s::experience, updateCharacter_t::HP, i, KILLED_NUM_TYPES, chrScoreGlobal_s::kills, LIST_Add(), updateCharacter_t::morale, OBJZERO, SKILL_NUM_TYPES, updateCharacter_t::STUN, chrScoreGlobal_s::stuns, woundInfo_s::treatmentLevel, updateCharacter_t::ucn, and updateCharacter_t::wounds.
Referenced by GAME_CP_Results().
|
static |
Checks whether a soldier should be promoted.
[in] | rank | The rank to check for |
[in] | chr | The character to check a potential promotion for |
Definition at line 183 of file cp_character.cpp.
References ABILITY_MIND, EMPL_SOLDIER, KILLED_CIVILIANS, KILLED_ENEMIES, KILLED_TEAM, rank_s::killedEnemies, rank_s::killedOthers, chrScoreGlobal_s::kills, rank_s::mind, character_s::score, chrScoreGlobal_s::skills, and rank_s::type.
Referenced by CHAR_UpdateStats().
Campaign closing actions for the character module.
Definition at line 295 of file cp_character.cpp.
References cgi.
Referenced by CP_Shutdown().
void CHAR_UpdateData | ( | linkedList_t * | updateCharacters | ) |
Transforms the battlescape values to the character.
Definition at line 102 of file cp_character.cpp.
References ABILITY_POWER, chrScoreGlobal_s::assignedMissions, cgi, CHAR_GetMaxExperiencePerMission(), CHAR_UpdateSkills(), Employee::chr, DEBUG_CLIENT, E_GetEmployeeFromChrUCN(), chrScoreGlobal_s::experience, character_s::HP, i, chrScoreGlobal_s::kills, LIST_Foreach, character_s::maxHP, character_s::morale, character_s::name, character_s::score, SKILL_NUM_TYPES, character_s::STUN, chrScoreGlobal_s::stuns, woundInfo_s::treatmentLevel, and character_s::wounds.
Referenced by CP_MissionEnd().
void CHAR_UpdateSkills | ( | character_t * | chr | ) |
Updates the character skills after a mission.
[in,out] | chr | Pointer to the character that should get the skills updated. |
Definition at line 88 of file cp_character.cpp.
References chrScoreGlobal_s::experience, i, chrScoreGlobal_s::initialSkills, MAX_MAXHP, MAX_SKILL, character_s::maxHP, character_s::score, SKILL_NUM_TYPES, and chrScoreGlobal_s::skills.
Referenced by AM_UpdateSurivorsAfterBattle(), and CHAR_UpdateData().
void CHAR_UpdateStats | ( | const base_t * | base, |
const aircraft_t * | aircraft | ||
) |
Update employees stats after mission.
[in] | base | The base where the team lives. |
[in] | aircraft | The aircraft used for the mission. |
Definition at line 209 of file cp_character.cpp.
References _, AIR_IsEmployeeInAircraft(), chrScoreGlobal_s::assignedMissions, ccs, cgi, CHAR_ShouldUpdateSoldierRank(), CL_GetRankByIdx(), Com_sprintf(), cp_messageBuffer, DEBUG_CLIENT, E_Foreach, EMPL_SOLDIER, aircraft_s::homebase, character_s::HP, MS_AddNewMessage(), MSG_PROMOTION, rank_s::name, character_s::name, ccs_s::numRanks, chrScoreGlobal_s::rank, and character_s::score.
Referenced by CP_MissionEnd().