UFO: Alien Invasion
|
Campaign parsing code. More...
#include "../../cl_shared.h"
#include "../../../shared/parse.h"
#include "cp_campaign.h"
#include "cp_rank.h"
#include "cp_parse.h"
#include "../../cl_inventory.h"
#include "cp_component.h"
Go to the source code of this file.
Data Structures | |
struct | sanity_functions_t |
struct that holds the sanity check data More... | |
Functions | |
static interestCategory_t | CP_GetAlienMissionTypeByID (const char *type) |
static void | CP_ParseAlienTeam (const char *name, const char **text) |
static void | CP_ParseResearchedCampaignItems (const campaign_t *campaign, const char *name, const char **text) |
This function parses a list of items that should be set to researched = true after campaign start. More... | |
static void | CP_ParseResearchableCampaignStates (const campaign_t *campaign, const char *name, const char **text, bool researchable) |
This function parses a list of items that should be set to researchable = true after campaign start. More... | |
static void | CP_ParseSalary (const char *name, const char **text, salary_t *s) |
Parse the salaries from campaign definition. More... | |
static void | CP_ParseCampaign (const char *name, const char **text) |
static void | CP_ParseScriptFirst (const char *type, const char *name, const char **text) |
Parsing campaign data. More... | |
static void | CP_ParseScriptSecond (const char *type, const char *name, const char **text) |
Parsing only for singleplayer. More... | |
static void | CP_ParseScriptCampaignRelated (const campaign_t *campaign, const char *type, const char *name, const char **text) |
Parses the campaign specific data - this data can only be parsed once the campaign started. More... | |
static bool | CP_ItemsSanityCheck (void) |
Make sure values of items after parsing are proper. More... | |
void | CP_ScriptSanityCheck (void) |
Check the parsed script values for errors after parsing every script file. More... | |
void | CP_ParseCampaignData (void) |
Read the data for campaigns. More... | |
void | CP_ReadCampaignData (const campaign_t *campaign) |
Variables | |
static const value_t | alien_group_vals [] |
static const value_t | salary_vals [] |
static const value_t | campaign_vals [] |
static const sanity_functions_t | sanity_functions [] |
Data for sanity check of parsed script data. More... | |
Campaign parsing code.
Definition in file cp_parse.cpp.
|
static |
Definition at line 37 of file cp_parse.cpp.
References cgi, INTERESTCATEGORY_ALIENBASE, INTERESTCATEGORY_BASE_ATTACK, INTERESTCATEGORY_BUILDING, INTERESTCATEGORY_HARVEST, INTERESTCATEGORY_INTERCEPT, INTERESTCATEGORY_NONE, INTERESTCATEGORY_RECON, INTERESTCATEGORY_RESCUE, INTERESTCATEGORY_SUPPLY, INTERESTCATEGORY_TERROR_ATTACK, INTERESTCATEGORY_UFOCARRIER, INTERESTCATEGORY_XVI, and Q_streq.
Referenced by CP_ParseAlienTeam().
|
static |
Make sure values of items after parsing are proper.
Definition at line 563 of file cp_parse.cpp.
References B_ItemIsStoredInBaseStorage(), BS_IsOnMarket(), cgi, cgame_import_s::csi, i, objDef_s::id, INVSH_GetItemByIDX(), csi_s::numODs, PR_ItemIsProduceable(), objDef_s::price, and objDef_s::size.
|
static |
Definition at line 78 of file cp_parse.cpp.
References ccs_s::alienCategories, ALIENCATEGORY_MAX, alienTeamGroup_s::alienChrTemplates, alienTeamCategory_s::alienTeamGroups, alienTeamGroup_s::alienTeams, alienTeamGroup_s::categoryIdx, ccs, cgi, CHRSH_GetTemplateByID(), cgame_import_s::Com_EParse(), cgame_import_s::Com_GetTeamDefinitionByID(), Com_Parse(), cp_campaignPool, CP_GetAlienMissionTypeByID(), alienTeamCategory_s::equipment, ERR_DROP, i, alienTeamCategory_s::id, alienTeamGroup_s::idx, INTERESTCATEGORY_NONE, MAX_ALIEN_GROUP_PER_CATEGORY, MAX_TEAMS_PER_MISSION, alienTeamGroup_s::maxAlienCount, alienTeamGroup_s::minAlienCount, alienTeamCategory_s::missionCategories, linkedList_t::next, ccs_s::numAlienCategories, alienTeamCategory_s::numAlienTeamGroups, alienTeamGroup_s::numAlienTeams, alienTeamCategory_s::numMissionCategories, Q_streq, Q_strncpyz(), and Sys_Error().
Referenced by CP_ParseScriptFirst().
|
static |
Definition at line 378 of file cp_parse.cpp.
References salary_s::aircraftDivisor, salary_s::aircraftFactor, campaign_s::alienBaseInterest, salary_s::base, salary_s::baseUpkeep, ccs_s::campaigns, ccs, cgi, cgame_import_s::Com_EParse(), Com_Parse(), campaign_s::componentRate, CP_GetCampaign(), CP_GetEventsByID(), CP_ParseSalary(), salary_s::debtInterest, campaign_s::difficulty, campaign_s::employeeRate, campaign_s::events, campaign_s::healingRate, i, campaign_s::id, campaign_s::idx, INITIAL_OVERALL_INTEREST, campaign_s::initialCraft, campaign_s::initialInterest, campaign_s::liquidationRate, MAX_CAMPAIGNS, MAX_EMPL, campaign_s::maxMissions, campaign_s::minMissions, NON_OCCURRENCE_PROBABILITY, ccs_s::numCampaigns, OBJZERO, campaign_s::produceRate, Q_streq, Q_strncpyz(), salary_s::rankBonus, campaign_s::researched, campaign_s::researchRate, campaign_s::salaries, campaign_s::team, TEAM_PHALANX, and campaign_s::ufoReductionRate.
Referenced by CP_ParseScriptSecond().
Read the data for campaigns.
Definition at line 630 of file cp_parse.cpp.
References campaign_s::asymptoticMarket, campaign_s::asymptoticMarketDef, ccs_s::campaigns, ccs, cgi, CHRSH_IsTeamDefAlien(), CP_ParseScriptFirst(), CP_ParseScriptSecond(), cgame_import_s::csi, DEBUG_CLIENT, ERR_DROP, cgame_import_s::FS_NextScriptHeader(), i, teamDef_s::id, teamDef_s::idx, INS_LinkTechnologies(), cgame_import_s::INV_GetEquipmentDefinitionByID(), campaign_s::market, campaign_s::marketDef, name, ccs_s::numBuildingTemplates, ccs_s::numCampaigns, ccs_s::numCities, ccs_s::numNations, ccs_s::numRanks, csi_s::numTeamDefs, ccs_s::numTechnologies, RS_GetTechByID(), RS_RequiredLinksAssign(), csi_s::teamDef, ccs_s::teamDefTechs, teamDef_s::tech, type, and UFO_SIZE_T.
Referenced by GAME_CP_InitStartup(), and CampaignTest::SetUp().
|
static |
This function parses a list of items that should be set to researchable = true after campaign start.
[in] | campaign | The campaign data structure |
[in] | name | Name of the techlist |
[in,out] | text | Script to parse |
[in] | researchable | Mark them researchable or not researchable |
Definition at line 254 of file cp_parse.cpp.
References ccs, cgi, cgame_import_s::Com_EParse(), Com_Parse(), DEBUG_CLIENT, i, technology_s::id, technology_s::mailSent, MAILSENT_PROPOSAL, ccs_s::numTechnologies, Q_streq, campaign_s::researched, RS_GetTechByIDX(), and RS_MarkOneResearchable().
Referenced by CP_ParseScriptCampaignRelated().
|
static |
This function parses a list of items that should be set to researched = true after campaign start.
Definition at line 202 of file cp_parse.cpp.
References markResearched_s::campaign, ccs, cgi, cgame_import_s::Com_EParse(), Com_Parse(), cp_campaignPool, DEBUG_CLIENT, i, technology_s::id, technology_s::mailSent, MAILSENT_FINISHED, markResearched_s::markOnly, technology_s::markResearched, markResearched_s::numDefinitions, ccs_s::numTechnologies, cgame_import_s::PoolStrDup(), Q_streq, campaign_s::researched, and RS_GetTechByIDX().
Referenced by CP_ParseScriptCampaignRelated().
Parse the salaries from campaign definition.
[in] | name | Name or ID of the found character skill and ability definition |
[in] | text | The text of the nation node |
[out] | s | Pointer to the campaign salaries data structure to parse into |
salary { soldier_base 3000 }
Definition at line 329 of file cp_parse.cpp.
References cgi, and cp_campaignPool.
Referenced by CP_ParseCampaign().
|
static |
Parses the campaign specific data - this data can only be parsed once the campaign started.
Definition at line 550 of file cp_parse.cpp.
References CP_ParseResearchableCampaignStates(), CP_ParseResearchedCampaignItems(), and Q_streq.
Referenced by CP_ReadCampaignData().
|
static |
Parsing campaign data.
first stage parses all the main data into their struct see CP_ParseScriptSecond for more details about parsing stages
Definition at line 490 of file cp_parse.cpp.
References AIR_ParseAircraft(), B_ParseBuildings(), CITY_Parse(), CL_ParseCampaignEvents(), CL_ParseEventMails(), CL_ParseNations(), CL_ParseRanks(), COMP_ParseComponents(), CP_ParseAlienTeam(), CP_ParseEventTrigger(), INS_ParseInstallations(), MSO_ParseMessageSettings(), Q_streq, RS_ParseTechnologies(), and UP_ParseChapter().
Referenced by CP_ParseCampaignData().
|
static |
Parsing only for singleplayer.
parsed if we are no dedicated server second stage links all the parsed data from first stage example: we need a techpointer in a building - in the second stage the buildings and the techs are already parsed - so now we can link them
Definition at line 534 of file cp_parse.cpp.
References AIR_ParseAircraft(), B_ParseBaseTemplate(), B_ParseBuildings(), CP_ParseCampaign(), and Q_streq.
Referenced by CP_ParseCampaignData().
void CP_ReadCampaignData | ( | const campaign_t * | campaign | ) |
Definition at line 681 of file cp_parse.cpp.
References ccs, cgi, CP_ParseScriptCampaignRelated(), campaign_s::date, ccs_s::date, date_s::day, DEBUG_CLIENT, cgame_import_s::FS_NextScriptHeader(), name, date_s::sec, SECONDS_PER_DAY, and type.
Referenced by CP_CampaignInit(), and CampaignTest::SetUp().
Check the parsed script values for errors after parsing every script file.
Definition at line 612 of file cp_parse.cpp.
References cgi, sanity_functions_t::check, sanity_functions_t::name, and sanity_functions.
Referenced by CP_CampaignInit().
|
static |
Definition at line 67 of file cp_parse.cpp.
|
static |
Definition at line 336 of file cp_parse.cpp.
|
static |
Definition at line 301 of file cp_parse.cpp.
|
static |
Data for sanity check of parsed script data.
Definition at line 598 of file cp_parse.cpp.
Referenced by CP_ScriptSanityCheck().