|
UFO: Alien Invasion
|
Campaign parsing code. More...
#include "../../DateTime.h"#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. | |
| 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. | |
| static void | CP_ParseSalary (const char *name, const char **text, salary_t *s) |
| Parse the salaries from campaign definition. | |
| 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. | |
| static void | CP_ParseScriptSecond (const char *type, const char *name, const char **text) |
| Parsing only for singleplayer. | |
| 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. | |
| static bool | CP_ItemsSanityCheck (void) |
| Make sure values of items after parsing are proper. | |
| void | CP_ScriptSanityCheck (void) |
| Check the parsed script values for errors after parsing every script file. | |
| void | CP_ParseCampaignData (void) |
| Read the data for campaigns. | |
| 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. | |
Campaign parsing code.
Definition in file cp_parse.cpp.
|
static |
Definition at line 38 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, Q_streq, and type.
Referenced by CP_ParseAlienTeam().
|
static |
Make sure values of items after parsing are proper.
Definition at line 574 of file cp_parse.cpp.
References B_ItemIsStoredInBaseStorage(), BS_IsOnMarket(), cgi, i, objDef_t::id, INVSH_GetItemByIDX(), PR_ItemIsProduceable(), objDef_t::price, and objDef_t::size.
|
static |
Definition at line 79 of file cp_parse.cpp.
References alien_group_vals, ALIENCATEGORY_MAX, alienTeamGroup_t::alienChrTemplates, alienTeamCategory_t::alienTeamGroups, alienTeamGroup_t::alienTeams, alienTeamGroup_t::categoryIdx, ccs, cgi, CHRSH_GetTemplateByID(), Com_Parse(), cp_campaignPool, CP_GetAlienMissionTypeByID(), alienTeamCategory_t::equipment, ERR_DROP, i, alienTeamCategory_t::id, alienTeamGroup_t::idx, INTERESTCATEGORY_NONE, MAX_ALIEN_GROUP_PER_CATEGORY, MAX_TEAMS_PER_MISSION, alienTeamGroup_t::maxAlienCount, alienTeamGroup_t::minAlienCount, alienTeamCategory_t::missionCategories, name, linkedList_t::next, alienTeamCategory_t::numAlienTeamGroups, alienTeamGroup_t::numAlienTeams, alienTeamCategory_t::numMissionCategories, Q_streq, Q_strncpyz(), and Sys_Error().
Referenced by CP_ParseScriptFirst().
|
static |
Definition at line 378 of file cp_parse.cpp.
References salary_t::aircraftDivisor, salary_t::aircraftFactor, campaign_t::alienBaseInterest, salary_t::base, salary_t::baseUpkeep, campaign_vals, ccs, cgi, Com_Error(), Com_Parse(), campaign_t::componentRate, CP_GetCampaign(), CP_GetEventsByID(), CP_ParseSalary(), campaign_t::date, DateTime::DAYS_PER_YEAR, salary_t::debtInterest, campaign_t::difficulty, campaign_t::employeeRate, ERR_DROP, campaign_t::events, campaign_t::healingRate, i, campaign_t::id, campaign_t::idx, INITIAL_OVERALL_INTEREST, campaign_t::initialCraft, campaign_t::initialInterest, campaign_t::liquidationRate, MAX_CAMPAIGNS, MAX_EMPL, campaign_t::maxMissions, campaign_t::minMissions, name, NON_OCCURRENCE_PROBABILITY, OBJZERO, campaign_t::produceRate, Q_streq, Q_strncpyz(), salary_t::rankBonus, campaign_t::researched, campaign_t::researchRate, campaign_t::salaries, DateTime::SECONDS_PER_HOUR, campaign_t::team, TEAM_PHALANX, and campaign_t::ufoReductionRate.
Referenced by CP_ParseScriptSecond().
Read the data for campaigns.
Definition at line 641 of file cp_parse.cpp.
References campaign_t::asymptoticMarket, campaign_t::asymptoticMarketDef, ccs, cgi, CHRSH_IsTeamDefAlien(), CP_ParseScriptFirst(), CP_ParseScriptSecond(), DEBUG_CLIENT, ERR_DROP, i, teamDef_t::id, teamDef_t::idx, INS_LinkTechnologies(), campaign_t::market, campaign_t::marketDef, name, RS_GetTechByID(), RS_RequiredLinksAssign(), teamDef_t::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 255 of file cp_parse.cpp.
References ccs, cgi, Com_Parse(), DEBUG_CLIENT, i, technology_t::id, technology_t::mailSent, MAILSENT_PROPOSAL, name, Q_streq, campaign_t::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 203 of file cp_parse.cpp.
References markResearched_t::campaign, ccs, cgi, Com_Parse(), cp_campaignPool, DEBUG_CLIENT, i, technology_t::id, technology_t::mailSent, MAILSENT_FINISHED, markResearched_t::markOnly, technology_t::markResearched, name, markResearched_t::numDefinitions, Q_streq, campaign_t::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 330 of file cp_parse.cpp.
References cgi, cp_campaignPool, name, and salary_vals.
Referenced by CP_ParseCampaign().
|
static |
Parses the campaign specific data - this data can only be parsed once the campaign started.
Definition at line 561 of file cp_parse.cpp.
References CP_ParseResearchableCampaignStates(), CP_ParseResearchedCampaignItems(), name, Q_streq, and type.
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 501 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(), name, Q_streq, RS_ParseTechnologies(), type, 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 545 of file cp_parse.cpp.
References AIR_ParseAircraft(), B_ParseBaseTemplate(), B_ParseBuildings(), CP_ParseCampaign(), name, Q_streq, and type.
Referenced by CP_ParseCampaignData().
| void CP_ReadCampaignData | ( | const campaign_t * | campaign | ) |
Definition at line 692 of file cp_parse.cpp.
References ccs, cgi, CP_ParseScriptCampaignRelated(), campaign_t::date, DEBUG_CLIENT, name, and type.
Referenced by CP_CampaignInit(), and CampaignTest::SetUp().
Check the parsed script values for errors after parsing every script file.
Definition at line 623 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 68 of file cp_parse.cpp.
Referenced by CP_ParseAlienTeam().
|
static |
Definition at line 337 of file cp_parse.cpp.
Referenced by CP_ParseCampaign().
|
static |
Definition at line 302 of file cp_parse.cpp.
Referenced by CP_ParseSalary().
|
static |
Data for sanity check of parsed script data.
Definition at line 609 of file cp_parse.cpp.
Referenced by CP_ScriptSanityCheck().