83 cgi->Com_Error(
ERR_DROP,
"G_GetMaxExperiencePerMission: invalid skill type");
96 static_cast<int>(pow(
static_cast<float>(chr->
score.
experience[
i]) / 10, 0.6f)));
112 cgi->Com_Printf(
"Warning: Could not get character with ucn: %i.\n", c->ucn);
117 const bool fullHP = c->
HP >= chr->
maxHP;
128 const int gainedXP = std::min(maxXP, c->chrscore.experience[
i] - chr->
score.
experience[
i]);
130 cgi->Com_DPrintf(
DEBUG_CLIENT,
"CP_UpdateCharacterData: Soldier %s earned %d experience points in skill #%d (total experience: %d)\n",
137 chr->
HP = (fullHP ? chr->
maxHP : std::min(c->HP, chr->
maxHP));
153 const int num =
cgi->NET_ReadByte(msg);
156 cgi->Com_Error(
ERR_DROP,
"CP_ParseCharacterData: invalid character number found in stream (%i)\n", num);
158 for (
int i = 0;
i < num;
i++) {
160 c.
ucn =
cgi->NET_ReadShort(msg);
161 c.
HP =
cgi->NET_ReadShort(msg);
162 c.
STUN =
cgi->NET_ReadByte(msg);
218 if (!employee->isHiredInBase(aircraft->
homebase))
233 if (
ccs.numRanks < 2)
236 for (
int j =
ccs.numRanks - 1; j > chr->
score.
rank; j--) {
258static void CHAR_DebugChangeStats_f (
void)
260 if (
cgi->Cmd_Argc() < 2) {
261 cgi->Com_Printf(
"Usage: %s <baseIDX>\n",
cgi->Cmd_Argv(0));
266 cgi->Com_Printf(
"Invalid base idx\n");
271 if (!employee->isHiredInBase(base))
291 cgi->Cmd_AddCommand(
"debug_statsupdate", CHAR_DebugChangeStats_f,
"Debug function to increase the kills and test the ranks");
301 cgi->Cmd_RemoveCommand(
"debug_statsupdate");
CGAME_HARD_LINKED_FUNCTIONS linkedList_t * LIST_Add(linkedList_t **listDest, void const *data, size_t length)
Share stuff between the different cgame implementations.
const aircraft_t * AIR_IsEmployeeInAircraft(const Employee *employee, const aircraft_t *aircraft)
Tells you if an employee is assigned to an aircraft.
base_t * B_GetBaseByIDX(int baseIdx)
Array bound check for the base index. Will also return unfounded bases as long as the index is in the...
Header file for single player campaign control.
const cgame_import_t * cgi
int CHAR_GetMaxExperiencePerMission(const abilityskills_t skill)
Determines the maximum amount of XP per skill that can be gained from any one mission.
void CHAR_InitStartup(void)
Campaign initialization actions for the character module.
void CHAR_UpdateData(linkedList_t *updateCharacters)
Transforms the battlescape values to the character.
void CHAR_ParseData(dbuffer *msg, linkedList_t **updateCharacters)
Parses the character data which was send by G_MatchSendResults using G_SendCharacterData.
void CHAR_Shutdown(void)
Campaign closing actions for the character module.
void CHAR_UpdateSkills(character_t *chr)
Updates the character skills after a mission.
static bool CHAR_ShouldUpdateSoldierRank(const rank_t *rank, const character_t *chr)
Checks whether a soldier should be promoted.
void CHAR_UpdateStats(const base_t *base, const aircraft_t *aircraft)
Update employees stats after mission.
Header file for character (soldier, alien) related campaign functions.
Employee * E_GetEmployeeFromChrUCN(int uniqueCharacterNumber)
Searches all employee for the ucn (character id).
#define E_Foreach(employeeType, var)
uiMessageListNodeMessage_t * MS_AddNewMessage(const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup, bool playSound)
Adds a new message to message stack.
char cp_messageBuffer[MAX_MESSAGE_TEXT]
rank_t * CL_GetRankByIdx(const int index)
Returns a rank at an index.
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
An aircraft with all it's data.
A base with all it's data.
aircraft_t * aircraftCurrent
Describes a character with all its attributes.
Structure of all stats collected for an actor over time.
int initialSkills[SKILL_NUM_TYPES+1]
int stuns[KILLED_NUM_TYPES]
int kills[KILLED_NUM_TYPES]
int skills[SKILL_NUM_TYPES]
int experience[SKILL_NUM_TYPES+1]
Describes a rank that a recruit can gain.
chrScoreGlobal_t chrscore
int treatmentLevel[BODYPART_MAXTYPE]