Go to the source code of this file.
Data Structures | |
struct | nationInfo_s |
Detailed information about the nation relationship (currently per month, but could be used elsewhere). More... | |
struct | nation_s |
Nation definition. More... | |
struct | city_s |
City definition. More... | |
Defines | |
#define | MAX_NATIONS 8 |
Typedefs | |
typedef struct nationInfo_s | nationInfo_t |
Detailed information about the nation relationship (currently per month, but could be used elsewhere). | |
typedef struct nation_s | nation_t |
Nation definition. | |
typedef struct city_s | city_t |
City definition. | |
Functions | |
nation_t * | NAT_GetNationByIDX (const int index) |
nation_t * | NAT_GetNationByID (const char *nationID) |
Return a nation-pointer by the nations id (nation_t->id) text. | |
void | NAT_UpdateHappinessForAllNations (void) |
Lower happiness of nations depending on alien activity. | |
void | NAT_SetHappiness (nation_t *nation, const float happiness) |
Updates the nation happiness. | |
int | NAT_GetFunding (const nation_t *const nation, int month) |
Get the actual funding of a nation. | |
const char * | NAT_GetHappinessString (const nation_t *nation) |
Translates the nation happiness float value to a string. | |
void | CL_ParseNations (const char *name, const char **text) |
Parse the nation data from script file. | |
void | CL_ParseCities (const char *name, const char **text) |
Parse the city data from script file. | |
qboolean | NAT_ScriptSanityCheck (void) |
Checks the parsed nations and cities for errors. | |
void | NAT_InitStartup (void) |
#define MAX_NATIONS 8 |
Definition at line 88 of file cp_nation.h.
Referenced by CL_NationStatsUpdate_f(), CL_ParseNations(), CP_UpdateNationXVIInfection(), and E_RefreshUnhiredEmployeeGlobalList().
typedef struct nationInfo_s nationInfo_t |
Detailed information about the nation relationship (currently per month, but could be used elsewhere).
void CL_ParseCities | ( | const char * | name, | |
const char ** | text | |||
) |
Parse the city data from script file.
[in] | name | ID of the found nation |
[in] | text | The text of the nation node |
Definition at line 379 of file cp_nation.c.
References byte, ccs, ccs_s::cities, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Parse(), Com_Printf(), cp_campaignPool, linkedList_s::data, DEBUG_CLIENT, city_s::id, city_s::idx, LIST_Add(), Mem_PoolStrDup, Mem_PoolStrDupTo, linkedList_s::next, ccs_s::numCities, value_s::ofs, value_s::size, value_s::string, value_s::type, V_CLIENT_HUNK_STRING, and V_TRANSLATION_STRING.
Referenced by CL_ParseScriptFirst().
void CL_ParseNations | ( | const char * | name, | |
const char ** | text | |||
) |
Parse the nation data from script file.
[in] | name | Name or ID of the found nation |
[in] | text | The text of the nation node |
Definition at line 286 of file cp_nation.c.
References ccs, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Parse(), Com_Printf(), cp_campaignPool, DEBUG_CLIENT, i, nation_s::id, nation_s::idx, nationInfo_s::inuse, MAX_NATIONS, Mem_PoolStrDup, Mem_PoolStrDupTo, ccs_s::nations, ccs_s::numNations, value_s::ofs, qtrue, value_s::size, nation_s::stats, value_s::string, value_s::type, V_CLIENT_HUNK_STRING, and V_TRANSLATION_STRING.
Referenced by CL_ParseScriptFirst().
int NAT_GetFunding | ( | const nation_t *const | nation, | |
int | month | |||
) |
Get the actual funding of a nation.
[in] | nation | Pointer to the nation |
[in] | month | idx of the month -- 0 for current month (sa nation_t) |
Definition at line 115 of file cp_nation.c.
References nationInfo_s::happiness, nation_s::maxFunding, and nation_s::stats.
Referenced by CL_NationDrawStats(), CL_NationsMaxFunding(), CL_NationStatsUpdate_f(), CL_StatsUpdate_f(), and CP_NationHandleBudget().
const char* NAT_GetHappinessString | ( | const nation_t * | nation | ) |
Translates the nation happiness float value to a string.
[in] | nation |
Definition at line 126 of file cp_nation.c.
References _, nationInfo_s::happiness, and nation_s::stats.
Referenced by CL_StatsUpdate_f(), CP_NationHandleBudget(), NAT_SetHappiness(), and UR_DialogFillNations().
nation_t* NAT_GetNationByID | ( | const char * | nationID | ) |
Return a nation-pointer by the nations id (nation_t->id) text.
[in] | nationID | nation id as defined in (nation_t->id) |
Definition at line 50 of file cp_nation.c.
References ccs, Com_Printf(), i, nation_s::id, ccs_s::nations, and ccs_s::numNations.
Referenced by E_LoadXML(), and NAT_LoadXML().
nation_t* NAT_GetNationByIDX | ( | const int | index | ) |
Definition at line 37 of file cp_nation.c.
References ccs, ccs_s::nations, and ccs_s::numNations.
Referenced by NAT_SaveXML(), UR_DialogInitSell_f(), and UR_DialogStartSell_f().
void NAT_InitStartup | ( | void | ) |
Definition at line 818 of file cp_nation.c.
References CL_NationSelect_f(), CL_NationStatsUpdate_f(), Cmd_AddCommand(), and CP_NationStatsClick_f().
Referenced by CP_InitStartup().
qboolean NAT_ScriptSanityCheck | ( | void | ) |
Checks the parsed nations and cities for errors.
Definition at line 460 of file cp_nation.c.
References ccs, ccs_s::cities, cls, Com_GetMapDefByIDX(), Com_Printf(), Com_UFOTypeToShortName(), CP_TerrorMissionAvailableUFOs(), mapDef_s::cultures, linkedList_s::data, error(), i, LIST_ContainsString(), MAP_PositionFitsTCPNTypes(), MAP_PrintParameterStringByPos(), linkedList_s::next, client_static_s::numMDs, mapDef_s::populations, city_s::pos, pos, qfalse, qtrue, REMOVE_ELEM, mapDef_s::storyRelated, mapDef_s::terrains, UFO_MAX, and mapDef_s::ufos.
void NAT_SetHappiness | ( | nation_t * | nation, | |
const float | happiness | |||
) |
Updates the nation happiness.
[in] | nation | The nation to update the happiness for |
[in] | happiness | The new happiness value to set for the given nation |
Definition at line 157 of file cp_nation.c.
References _, ccs, Com_sprintf(), cp_messageBuffer, ccs_s::curCampaign, nationInfo_s::happiness, campaign_s::minhappiness, MSG_STANDARD, MSO_CheckAddNewMessage(), nation_s::name, NAT_GetHappinessString(), NT_HAPPINESS_CHANGED, NT_HAPPINESS_MIN, NT_HAPPINESS_PLEASED, NT_NUM_NOTIFYTYPE, qfalse, and nation_s::stats.
Referenced by CL_HandleNationData(), CP_BuildBaseGovernmentLeave(), CP_ChangeNationHappiness_f(), NAT_UpdateHappinessForAllNations(), and UR_DialogStartSell_f().
void NAT_UpdateHappinessForAllNations | ( | void | ) |
Lower happiness of nations depending on alien activity.
Definition at line 76 of file cp_nation.c.
References ccs, Com_DPrintf(), linkedList_s::data, DEBUG_CLIENT, HAPPINESS_ALIEN_MISSION_LOSS, MAP_GetNation(), ccs_s::missions, NAT_SetHappiness(), linkedList_s::next, mission_s::pos, mission_s::stage, STAGE_HARVEST, STAGE_RECON_GROUND, STAGE_SPREAD_XVI, STAGE_SUBVERT_GOV, and STAGE_TERROR_MISSION.
Referenced by CL_CampaignRun().