Header for research related stuff. More...
Go to the source code of this file.
Data Structures | |
struct | requirement_s |
struct | requirements_s |
struct | markResearched_s |
struct | techMail_s |
available mails for a tech - mail and mail_pre in script files More... | |
struct | descriptions_s |
struct | technology_s |
This is the technology parsed from research.ufo. More... | |
Defines | |
#define | MAX_RESEARCHDISPLAY 22 |
#define | MAX_RESEARCHLIST 32 |
#define | MAX_TECHNOLOGIES 256 |
#define | MAX_TECHLINKS 16 |
#define | MAX_DESCRIPTIONS 8 |
#define | TECH_INVALID -1 |
#define | ANTIMATTER_TECH_ID "antimatter" |
Typedefs | |
typedef enum researchStatus_s | researchStatus_t |
The status of a research (per tech). | |
typedef enum researchType_s | researchType_t |
Types of research topics. | |
typedef enum requirementType_s | requirementType_t |
typedef struct requirement_s | requirement_t |
typedef struct requirements_s | requirements_t |
typedef struct markResearched_s | markResearched_t |
typedef struct techMail_s | techMail_t |
available mails for a tech - mail and mail_pre in script files | |
typedef struct descriptions_s | descriptions_t |
typedef struct technology_s | technology_t |
This is the technology parsed from research.ufo. | |
Enumerations | |
enum | researchStatus_s { RS_NONE, RS_RUNNING, RS_PAUSED, RS_FINISH } |
The status of a research (per tech). More... | |
enum | researchType_s { RS_TECH, RS_WEAPON, RS_ARMOUR, RS_CRAFT, RS_CRAFTITEM, RS_BUILDING, RS_ALIEN, RS_UGV, RS_NEWS, RS_LOGIC } |
Types of research topics. More... | |
enum | requirementType_s { RS_LINK_TECH, RS_LINK_TECH_NOT, RS_LINK_ITEM, RS_LINK_ALIEN, RS_LINK_ALIEN_DEAD, RS_LINK_ALIEN_GLOBAL, RS_LINK_UFO, RS_LINK_ANTIMATTER, MAX_RS_LINKTYPES } |
enum | techMailType_t { TECHMAIL_PRE, TECHMAIL_RESEARCHED, TECHMAIL_MAX } |
Types for tech mail definitions - see tech->mail[]. More... | |
enum | mailSentType_t { MAILSENT_NONE, MAILSENT_PROPOSAL, MAILSENT_FINISHED, MAILSENT_MAX } |
Functions | |
void | RS_InitStartup (void) |
This is more or less the initial Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal. | |
void | RS_ResetTechs (void) |
This is called everytime RS_ParseTechnologies is called - to prevent cyclic hash tables. | |
void | RS_ResearchRun (void) |
Checks the research status. | |
void | RS_ParseTechnologies (const char *name, const char **text) |
Parses one "tech" entry in the research.ufo file and writes it into the next free entry in technologies (technology_t). | |
qboolean | RS_IsResearched_idx (int techIdx) |
Checks if the technology (tech-index) has been researched. | |
qboolean | RS_IsResearched_ptr (const technology_t *tech) |
Checks whether an item is already researched. | |
int | RS_Collected_ (const technology_t *tech) |
technology_t * | RS_GetTechForItem (const objDef_t *item) |
void | RS_AddObjectTechs (void) |
void | RS_RequiredLinksAssign (void) |
Assign Link pointers to all required techs/items/etc... | |
void | RS_InitTree (qboolean load) |
Gets all needed names/file-paths/etc... for each technology entry. Should be executed after the parsing of _all_ the ufo files and e.g. the research tree/inventory/etc... are initialised. | |
const char * | RS_GetDescription (descriptions_t *desc) |
returns the currently used description for a technology. | |
void | RS_MarkCollected (technology_t *tech) __attribute__((nonnull)) |
Marks a give technology as collected. | |
void | RS_MarkResearchable (qboolean init, const struct base_s *base) |
qboolean | RS_MarkStoryLineEventResearched (const char *techID) |
void | RS_ResearchFinish (technology_t *tech) |
Sets a technology status to researched and updates the date. | |
void | RS_StopResearch (technology_t *tech) |
Stops a research (Removes scientists from it). | |
void | RS_MarkOneResearchable (technology_t *tech) |
Marks one tech as researchable. | |
void | RS_AssignScientist (technology_t *tech, struct base_s *base, struct employee_s *employee) |
Assigns scientist to the selected research-project. | |
void | RS_RemoveScientist (technology_t *tech, struct employee_s *employee) |
Remove a scientist from a technology. | |
void | RS_RemoveFiredScientist (struct base_s *base, struct employee_s *employee) |
Remove one scientist from research project if needed. | |
void | RS_RemoveScientistsExceedingCapacity (struct base_s *base) |
Remove all exceeding scientist. | |
technology_t * | RS_GetTechByID (const char *id) |
return a pointer to the technology identified by given id string | |
technology_t * | RS_GetTechByProvided (const char *idProvided) |
returns a pointer to the item tech (as listed in "provides") | |
technology_t * | RS_GetTechByIDX (int tech_idx) |
Returns the technology pointer for a tech index. You can use this instead of "&ccs.technologies[techIdx]" to avoid having to check valid indices. | |
technology_t * | RS_GetTechWithMostScientists (const struct base_s *base) |
Searches for the technology that has the most scientists assigned in a given base. | |
int | RS_GetTechIdxByName (const char *name) |
Returns the index (idx) of a "tech" entry given it's name. | |
int | RS_CountScientistsInBase (const struct base_s *base) |
qboolean | RS_ScriptSanityCheck (void) |
Checks the parsed tech data for errors. | |
void | UP_AircraftDescription (const technology_t *t) |
Prints the UFOpaedia description for aircraft. | |
void | UP_UGVDescription (const struct ugv_s *ugvType) |
qboolean | RS_RequirementsMet (const requirements_t *requiredAND, const requirements_t *requiredOR, const struct base_s *base) |
Header for research related stuff.
Definition in file cp_research.h.
#define ANTIMATTER_TECH_ID "antimatter" |
Definition at line 37 of file cp_research.h.
Referenced by AIR_Refuel(), B_AntimatterInBase(), B_ItemIsStoredInBaseStorage(), B_ManageAntimatter(), B_UpdateAntimatterCap(), PR_DisassembleItem(), TR_CargoListSelect_f(), TR_CheckItem(), TR_EmptyTransferCargo(), TR_TransferList_Scroll_f(), TR_TransferListClear_f(), TR_TransferListSelect_f(), and TR_TransferSelect().
#define MAX_DESCRIPTIONS 8 |
Maximum number of descriptions (per tech and description-type).
Definition at line 33 of file cp_research.h.
Referenced by RS_ParseTechnologies().
#define MAX_RESEARCHDISPLAY 22 |
Number of the available string (in the list) in the research menu
Definition at line 29 of file cp_research.h.
Referenced by RS_InitGUI().
#define MAX_RESEARCHLIST 32 |
Definition at line 30 of file cp_research.h.
#define MAX_TECHLINKS 16 |
Maximum number of requirements in a technology (i.e in requireAND and requireOR).
Definition at line 32 of file cp_research.h.
Referenced by RS_ParseTechnologies().
#define MAX_TECHNOLOGIES 256 |
Maximum number of technologies overall.
Definition at line 31 of file cp_research.h.
Referenced by AII_GetCraftitemTechsByType(), RS_IsValidTechIndex(), and RS_ParseTechnologies().
#define TECH_INVALID -1 |
The value for an "undef" tech-index.
Definition at line 35 of file cp_research.h.
Referenced by RS_GetTechIdxByName(), and RS_IsValidTechIndex().
typedef struct descriptions_s descriptions_t |
typedef struct markResearched_s markResearched_t |
typedef struct requirement_s requirement_t |
typedef struct requirements_s requirements_t |
typedef enum requirementType_s requirementType_t |
typedef enum researchStatus_s researchStatus_t |
The status of a research (per tech).
typedef enum researchType_s researchType_t |
Types of research topics.
typedef struct techMail_s techMail_t |
available mails for a tech - mail and mail_pre in script files
typedef struct technology_s technology_t |
This is the technology parsed from research.ufo.
enum mailSentType_t |
MAILSENT_NONE |
No mail sent yet. |
MAILSENT_PROPOSAL |
Mail for research proposal already send. |
MAILSENT_FINISHED |
Mail for finsihed research snet (and maybe the previous as well). |
MAILSENT_MAX |
Definition at line 124 of file cp_research.h.
enum requirementType_s |
RS_LINK_TECH | |
RS_LINK_TECH_NOT | |
RS_LINK_ITEM | |
RS_LINK_ALIEN | |
RS_LINK_ALIEN_DEAD | |
RS_LINK_ALIEN_GLOBAL | |
RS_LINK_UFO | |
RS_LINK_ANTIMATTER | |
MAX_RS_LINKTYPES |
Definition at line 61 of file cp_research.h.
enum researchStatus_s |
The status of a research (per tech).
Definition at line 40 of file cp_research.h.
enum researchType_s |
Types of research topics.
RS_TECH | |
RS_WEAPON | |
RS_ARMOUR | |
RS_CRAFT | |
RS_CRAFTITEM | |
RS_BUILDING | |
RS_ALIEN | |
RS_UGV | |
RS_NEWS | |
RS_LOGIC |
Definition at line 48 of file cp_research.h.
enum techMailType_t |
Types for tech mail definitions - see tech->mail[].
TECHMAIL_PRE |
this is a mail_pre (proposal) definition |
TECHMAIL_RESEARCHED |
this is the mail definition (after research was completed) |
TECHMAIL_MAX |
Definition at line 101 of file cp_research.h.
void RS_AddObjectTechs | ( | void | ) |
void RS_AssignScientist | ( | technology_t * | tech, | |
base_t * | base, | |||
employee_t * | employee | |||
) |
Assigns scientist to the selected research-project.
[in] | tech | What technology you want to assign the scientist to. |
[in] | base | Pointer to base where the research is ongoing. |
[in] | employee | Pointer to the scientist to assign. It can be NULL! That means "any". |
Definition at line 680 of file cp_research.c.
References _, B_GetBuildingInBaseByType(), B_LAB, technology_s::base, employee_s::building, CAP_LABSPACE, base_s::capacities, Com_DPrintf(), Com_Error(), Com_Printf(), cap_maxcur_s::cur, DEBUG_CLIENT, E_GetUnassignedEmployee(), EMPL_SCIENTIST, ERR_DROP, technology_s::id, employee_s::idx, technology_s::idx, cap_maxcur_s::max, base_s::name, technology_s::name, qtrue, RS_RUNNING, technology_s::scientists, technology_s::statusResearch, technology_s::statusResearchable, employee_s::type, and UI_Popup().
Referenced by RS_AssignScientist_f(), RS_ChangeScientist_f(), RS_MaxOutResearch(), and RS_RemoveFiredScientist().
int RS_Collected_ | ( | const technology_t * | tech | ) |
Definition at line 1638 of file cp_research.c.
References Com_DPrintf(), DEBUG_CLIENT, and technology_s::statusCollected.
Referenced by UP_AircraftDescription(), UP_Article(), UP_TechGetsDisplayed(), and UP_UGVDescription().
int RS_CountScientistsInBase | ( | const struct base_s * | base | ) |
const char* RS_GetDescription | ( | descriptions_t * | desc | ) |
returns the currently used description for a technology.
[in] | desc | A list of possible descriptions (with tech-links that decide which one is the correct one) |
< Stored used description
Definition at line 292 of file cp_research.c.
References i, descriptions_s::numDescriptions, RS_GetTechByID(), RS_IsResearched_ptr(), descriptions_s::tech, descriptions_s::text, and descriptions_s::usedDescription.
Referenced by RS_MarkOneResearchable(), RS_ResearchFinish(), and UP_Article().
technology_t* RS_GetTechByID | ( | const char * | id | ) |
return a pointer to the technology identified by given id string
[in] | id | Unique identifier of the tech as defined in the research.ufo file (e.g. "tech xxxx"). |
Definition at line 1667 of file cp_research.c.
References Com_HashKey(), Com_Printf(), hash(), technology_s::hashNext, technology_s::id, Q_strcasecmp, and TECH_HASH_SIZE.
Referenced by AIM_AutoEquipAircraft(), AIR_ParseAircraft(), AL_AddAliens(), B_ScriptSanityCheck(), BDEF_BaseDefenceMenuUpdate_f(), CL_ReadSinglePlayerData(), CP_AddTechAsResearchable_f(), CP_GetEventsByID(), CP_XVIInit(), MS_LoadXML(), RS_AssignTechLinks(), RS_GetDescription(), RS_LoadXML(), RS_MarkStoryLineEventResearched(), RS_RequiredLinksAssign(), TR_TransferAlienAfterMissionStart(), and UP_FindEntry_f().
technology_t* RS_GetTechByIDX | ( | int | techIdx | ) |
Returns the technology pointer for a tech index. You can use this instead of "&ccs.technologies[techIdx]" to avoid having to check valid indices.
[in] | techIdx | Index in the global ccs.technologies[] array. |
Definition at line 1653 of file cp_research.c.
References ccs, RS_IsValidTechIndex(), and ccs_s::technologies.
Referenced by BaseSummary_Init(), CL_ParseResearchableCampaignStates(), CL_ParseResearchedCampaignItems(), RS_GetTechWithMostScientists(), RS_InitGUIData(), RS_MarkResearchable(), RS_RequiredLinksAssign(), RS_ResearchRun(), and RS_SaveXML().
technology_t* RS_GetTechByProvided | ( | const char * | idProvided | ) |
returns a pointer to the item tech (as listed in "provides")
[in] | idProvided | Unique identifier of the object the tech is providing |
Definition at line 1689 of file cp_research.c.
References Com_DPrintf(), Com_HashKey(), DEBUG_CLIENT, hash(), technology_s::hashProvidedNext, technology_s::provides, Q_strcasecmp, and TECH_HASH_SIZE.
Referenced by AII_LoadOneSlotXML(), AIRFIGHT_LoadXML(), B_ParseBuildings(), BS_BuyType(), BS_MarketInfoClick_f(), GAME_CP_DisplayItemInfo(), RS_InitTree(), UFO_GetTechnologyFromType(), and UP_UGVDescription().
technology_t* RS_GetTechForItem | ( | const objDef_t * | item | ) |
Definition at line 489 of file cp_research.c.
References ccs, Com_Error(), ERR_DROP, objDef_s::id, objDef_s::idx, lengthof, and ccs_s::objDefTechs.
Referenced by AII_AutoAddAmmo(), AII_CarriedItems(), AII_GetCraftitemTechsByType(), AIM_AircraftEquipMenuUpdate(), AIM_DrawAircraftSlots(), B_SellOrAddItems(), BDEF_AddSlotToSlotList(), BS_Autosell_f(), BS_InitMarket(), CL_CampaignRunMarket(), CP_AddItemAsCollected_f(), GAME_CP_GetModelForItem(), GAME_CP_ItemIsUseable(), PR_DecreaseProduction(), PR_DisassembleItem(), PR_IncreaseProduction(), PR_ItemIsProduceable(), PR_ItemProductionInfo(), PR_ProductionFrame(), PR_ProductionIncrease_f(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_QueueDelete(), PR_QueueNew(), PR_UpdateProductionList(), UP_AircraftItemDescription(), UP_DrawAssociatedAmmo(), and UP_ResearchedLinkClick_f().
int RS_GetTechIdxByName | ( | const char * | name | ) |
Returns the index (idx) of a "tech" entry given it's name.
[in] | name | the name of the tech |
Definition at line 1744 of file cp_research.c.
References Com_HashKey(), Com_Printf(), hash(), technology_s::hashNext, technology_s::id, technology_s::idx, Q_strcasecmp, TECH_HASH_SIZE, and TECH_INVALID.
technology_t* RS_GetTechWithMostScientists | ( | const struct base_s * | base | ) |
Searches for the technology that has the most scientists assigned in a given base.
[in] | base | In what base the tech should be researched. |
Definition at line 1716 of file cp_research.c.
References technology_s::base, ccs, ccs_s::numTechnologies, RS_GetTechByIDX(), RS_RUNNING, technology_s::scientists, and technology_s::statusResearch.
Referenced by RS_RemoveFiredScientist(), and RS_RemoveScientistsExceedingCapacity().
void RS_InitStartup | ( | void | ) |
This is more or less the initial Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal.
Definition at line 1123 of file cp_research.c.
References Cmd_AddCommand().
Referenced by CP_InitStartup().
void RS_InitTree | ( | qboolean | load | ) |
Gets all needed names/file-paths/etc... for each technology entry. Should be executed after the parsing of _all_ the ufo files and e.g. the research tree/inventory/etc... are initialised.
[in] | load | qtrue if we are loading a game, qfalse otherwise |
Add a function to reset ALL research-stati to RS_NONE; -> to be called after start of a new game.
Enhance ammo model display (see comment in code).
Definition at line 509 of file cp_research.c.
References AIR_GetNextFromBase(), ccs_s::aircraftTemplates, B_GetFoundedBaseByIDX(), ccs_s::buildingTemplates, byte, markResearched_s::campaign, ccs, Com_DPrintf(), Com_Error(), Com_Printf(), cp_campaignPool, csi, ccs_s::curCampaign, DEBUG_CLIENT, ERR_DROP, ERR_FATAL, i, aircraft_s::id, building_s::id, technology_s::id, objDef_s::id, objDef_s::idx, building_s::image, objDef_s::image, technology_s::image, INVSH_GetItemByIDX(), technology_s::mail, markResearched_s::markOnly, technology_s::markResearched, technology_s::mdl, Mem_PoolStrDup, aircraft_s::model, objDef_s::model, aircraft_s::name, building_s::name, objDef_s::name, technology_s::name, ccs_s::numAircraftTemplates, ccs_s::numBases, ccs_s::numBuildingTemplates, markResearched_s::numDefinitions, csi_s::numODs, ccs_s::numTechnologies, ccs_s::objDefTechs, csi_s::ods, technology_s::provides, qfalse, qtrue, technology_s::requireAND, technology_s::requireOR, campaign_s::researched, RS_ALIEN, RS_ARMOUR, RS_AssignTechLinks(), RS_BUILDING, RS_CRAFT, RS_CRAFTITEM, RS_GetTechByProvided(), RS_LOGIC, RS_NEWS, RS_ResearchFinish(), RS_TECH, RS_UGV, RS_WEAPON, techMail_s::subject, aircraft_s::tech, TECHMAIL_MAX, ccs_s::technologies, techMail_s::to, and technology_s::type.
Referenced by CP_CampaignInit().
qboolean RS_IsResearched_idx | ( | int | techIdx | ) |
Checks if the technology (tech-index) has been researched.
[in] | techIdx | index of the technology. |
Definition at line 1611 of file cp_research.c.
References ccs, qfalse, qtrue, RS_FINISH, RS_IsValidTechIndex(), technology_s::statusResearch, and ccs_s::technologies.
qboolean RS_IsResearched_ptr | ( | const technology_t * | tech | ) |
Checks whether an item is already researched.
Definition at line 1627 of file cp_research.c.
References qfalse, qtrue, RS_FINISH, and technology_s::statusResearch.
Referenced by AC_OpenUFOpedia_f(), AC_ResearchAlien_f(), AC_UpdateMenu(), AIM_CheckTechnologyIntoSlot(), AIM_CrafttypeFilter(), AIM_SelectableCraftItem(), AL_AddAliens(), B_BuildingInit(), B_SellOrAddItems(), BaseSummary_Init(), BDEF_BaseDefenceMenuUpdate_f(), BS_Autosell_f(), BS_BuyType(), BS_InitMarket(), CL_CampaignRunMarket(), CP_IsXVIResearched(), GAME_CP_ItemIsUseable(), GAME_CP_TeamIsKnown(), MAP_DrawMapMarkers(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_RequirementsMet(), PR_UpdateProductionList(), RS_GetDescription(), RS_MarkStoryLineEventResearched(), RS_RequirementsMet(), TR_TransferAlienAfterMissionStart(), UFO_AircraftToIDOnGeoscape(), UP_AircraftDescription(), UP_AircraftItemDescription(), UP_Article(), UP_GetUnreadMails(), UP_TechGetsDisplayed(), and UP_UGVDescription().
void RS_MarkCollected | ( | technology_t * | tech | ) |
Marks a give technology as collected.
[in] | tech | The technology pointer to mark collected |
Definition at line 328 of file cp_research.c.
References _, ccs, Com_sprintf(), cp_messageBuffer, ccs_s::date, date_s::day, technology_s::mailSent, MAILSENT_FINISHED, MAILSENT_PROPOSAL, MSG_RESEARCH_PROPOSAL, MSO_CheckAddNewMessage(), technology_s::name, NT_RESEARCH_PROPOSED, technology_s::preResearchedDate, qfalse, qtrue, RS_FINISH, technology_s::statusCollected, technology_s::statusResearch, and technology_s::time.
Referenced by AII_CarriedItems(), AL_AddAliens(), B_SellOrAddItems(), CP_AddItemAsCollected_f(), PR_DisassembleItem(), UR_ProcessActive(), and US_StoreUFO().
void RS_MarkOneResearchable | ( | technology_t * | tech | ) |
Marks one tech as researchable.
tech | The technology to be marked. |
At this point we define what research proposal description is used when displayed. (i.e. "usedDescription" is set here). That's because this is the first the player will see anything from the tech and any later changes may make the content (proposal) of the tech inconsistent for the player.
Definition at line 113 of file cp_research.c.
References _, ccs, Com_DPrintf(), Com_sprintf(), cp_messageBuffer, ccs_s::date, date_s::day, DEBUG_CLIENT, technology_s::id, technology_s::mailSent, MAILSENT_FINISHED, MAILSENT_PROPOSAL, MSG_RESEARCH_PROPOSAL, MSO_CheckAddNewMessage(), technology_s::name, NT_RESEARCH_PROPOSED, technology_s::preDescription, technology_s::preResearchedDate, qfalse, qtrue, RS_GetDescription(), technology_s::statusResearchable, and technology_s::time.
Referenced by CL_ParseResearchableCampaignStates(), CP_AddTechAsResearchable_f(), RS_MarkResearchable(), and RS_ResearchStart_f().
qboolean RS_MarkStoryLineEventResearched | ( | const char * | techID | ) |
Pick a random base to research a story line event tech
techID | The event technology script id to research |
Definition at line 821 of file cp_research.c.
References B_GetFoundedBaseByIDX(), ccs, ccs_s::numBases, qfalse, qtrue, RS_GetTechByID(), RS_IsResearched_ptr(), and RS_MarkResearched().
Referenced by CP_CheckCampaignEvents(), and CP_SpawnAlienBaseMission().
void RS_ParseTechnologies | ( | const char * | name, | |
const char ** | text | |||
) |
Parses one "tech" entry in the research.ufo file and writes it into the next free entry in technologies (technology_t).
[in] | name | Unique id of a technology_t. This is parsed from "tech xxx" -> id=xxx |
[in] | text | the whole following text that is part of the "tech" item definition in research.ufo. |
< Remove first char (i.e. we assume it's the "_")
Definition at line 1187 of file cp_research.c.
References _, requirement_s::amount, ccs, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Error(), Com_HashKey(), Com_Parse(), Com_Printf(), cp_campaignPool, DEBUG_CLIENT, technology_s::description, ERR_DROP, pediaChapter_s::first, hash(), technology_s::hashNext, technology_s::hashProvidedNext, pediaChapter_s::id, requirement_s::id, technology_s::id, technology_s::idx, pediaChapter_s::last, requirements_s::links, LIST_AddPointer(), LIST_AddString(), technology_s::mail, MAX_DESCRIPTIONS, MAX_TECHLINKS, MAX_TECHNOLOGIES, Mem_PoolStrDup, Mem_PoolStrDupTo, techMail_s::model, ccs_s::numChapters, descriptions_s::numDescriptions, requirements_s::numLinks, technology_s::numTechMails, ccs_s::numTechnologies, value_s::ofs, technology_s::overallTime, technology_s::preDescription, technology_s::provides, qfalse, technology_s::requireAND, technology_s::requireForProduction, technology_s::requireOR, RS_ALIEN, RS_ARMOUR, RS_BUILDING, RS_CRAFT, RS_CRAFTITEM, RS_LINK_ALIEN, RS_LINK_ALIEN_DEAD, RS_LINK_ALIEN_GLOBAL, RS_LINK_ANTIMATTER, RS_LINK_ITEM, RS_LINK_TECH, RS_LINK_TECH_NOT, RS_LINK_UFO, RS_LOGIC, RS_NEWS, RS_NONE, RS_TECH, RS_UGV, RS_WEAPON, value_s::size, technology_s::statusResearch, technology_s::statusResearchable, value_s::string, descriptions_s::tech, TECH_HASH_SIZE, TECHMAIL_MAX, TECHMAIL_PRE, TECHMAIL_RESEARCHED, ccs_s::technologies, descriptions_s::text, technology_s::time, value_s::type, requirement_s::type, technology_s::type, technology_s::upChapter, ccs_s::upChapters, technology_s::upNext, technology_s::upPrev, descriptions_s::usedDescription, V_CLIENT_HUNK_STRING, V_NULL, and V_TRANSLATION_STRING.
Referenced by CL_ParseScriptFirst().
void RS_RemoveFiredScientist | ( | base_t * | base, | |
employee_t * | employee | |||
) |
Remove one scientist from research project if needed.
[in] | base | Pointer to base where a scientist should be removed. |
[in] | employee | Pointer to the employee that is fired. |
Definition at line 782 of file cp_research.c.
References E_GetUnassignedEmployee(), EMPL_SCIENTIST, RS_AssignScientist(), RS_GetTechWithMostScientists(), and RS_RemoveScientist().
Referenced by E_RemoveEmployeeFromBuildingOrAircraft().
void RS_RemoveScientist | ( | technology_t * | tech, | |
employee_t * | employee | |||
) |
Remove a scientist from a technology.
[in] | tech | The technology you want to remove the scientist from. |
[in] | employee | Employee you want to remove (NULL if you don't care which one should be removed). |
Definition at line 741 of file cp_research.c.
References technology_s::base, employee_s::building, CAP_LABSPACE, base_s::capacities, Com_Error(), cap_maxcur_s::cur, E_GetAssignedEmployee(), EMPL_SCIENTIST, ERR_DROP, RS_PAUSED, technology_s::scientists, and technology_s::statusResearch.
Referenced by RS_ChangeScientist_f(), RS_RemoveFiredScientist(), RS_RemoveScientist_f(), RS_RemoveScientistsExceedingCapacity(), RS_ResearchFinish(), RS_ResearchRun(), and RS_StopResearch().
void RS_RemoveScientistsExceedingCapacity | ( | base_t * | base | ) |
Remove all exceeding scientist.
[in] | base | Pointer to base where a scientist should be removed. |
Definition at line 1782 of file cp_research.c.
References CAP_LABSPACE, base_s::capacities, cap_maxcur_s::cur, cap_maxcur_s::max, RS_CountScientistsInBase(), RS_GetTechWithMostScientists(), and RS_RemoveScientist().
Referenced by B_BuildingOnDestroy_f().
void RS_RequiredLinksAssign | ( | void | ) |
Assign Link pointers to all required techs/items/etc...
< Use this so we do not change the original redirectedTechs pointer.
Definition at line 455 of file cp_research.c.
References ccs, linkedList_s::data, i, LIST_Delete(), linkedList_s::next, requirements_s::numLinks, ccs_s::numTechnologies, technology_s::redirect, technology_s::requireAND, technology_s::requireForProduction, technology_s::requireOR, RS_AssignTechLinks(), RS_GetTechByID(), and RS_GetTechByIDX().
Referenced by CL_ReadSinglePlayerData().
qboolean RS_RequirementsMet | ( | const requirements_t * | requiredAND, | |
const requirements_t * | requiredOR, | |||
const struct base_s * | base | |||
) |
void RS_ResearchFinish | ( | technology_t * | tech | ) |
Sets a technology status to researched and updates the date.
[in] | tech | The technology that was researched. |
At this point we define what research-report description is used when displayed. (i.e. "usedDescription" is set here). That's because this is the first the player will see the research result and any later changes may make the content inconsistent for the player.
Definition at line 59 of file cp_research.c.
References _, ccs, Cmd_ExecuteString(), Com_sprintf(), cp_messageBuffer, ccs_s::date, technology_s::description, technology_s::finishedResearchEvent, technology_s::mailSent, MAILSENT_FINISHED, MSG_RESEARCH_FINISHED, MSO_CheckAddNewMessage(), technology_s::name, NT_RESEARCH_COMPLETED, technology_s::preDescription, technology_s::preResearchedDate, qfalse, qtrue, technology_s::researchedDate, RS_FINISH, RS_GetDescription(), RS_LOGIC, RS_PushNewsWhenResearchedFinished(), RS_RemoveScientist(), technology_s::scientists, technology_s::statusResearch, technology_s::statusResearchable, technology_s::type, and descriptions_s::usedDescription.
Referenced by RS_InitTree(), RS_MarkResearchable(), and RS_MarkResearched().
void RS_ResearchRun | ( | void | ) |
Checks the research status.
< If there are scientitsts there _has_ to be a base.
rudolfo: please verify; I changed from RS_InitGuiData to RS_MarkResearchable
Definition at line 843 of file cp_research.c.
References _, technology_s::base, ccs, Com_sprintf(), cp_messageBuffer, i, base_s::idx, MAX_BASES, MSG_RESEARCH_HALTED, MSO_CheckAddNewMessage(), base_s::name, technology_s::name, NT_RESEARCH_HALTED, ccs_s::numTechnologies, qfalse, technology_s::requireAND, technology_s::requireOR, RS_GetTechByIDX(), RS_MarkResearchable(), RS_MarkResearched(), RS_PAUSED, RS_RemoveScientist(), RS_RequirementsMet(), RS_ResearchAllowed(), RS_RUNNING, technology_s::scientists, technology_s::statusResearch, and technology_s::time.
Referenced by CL_CampaignRun().
void RS_ResetTechs | ( | void | ) |
This is called everytime RS_ParseTechnologies is called - to prevent cyclic hash tables.
Definition at line 1137 of file cp_research.c.
References LIST_Delete().
Referenced by CL_ResetSinglePlayerData().
qboolean RS_ScriptSanityCheck | ( | void | ) |
Checks the parsed tech data for errors.
Definition at line 1931 of file cp_research.c.
References ccs, Com_Printf(), technology_s::description, error(), technology_s::id, technology_s::name, ccs_s::numTechnologies, technology_s::produceTime, technology_s::provides, qfalse, qtrue, RS_ALIEN, RS_BUILDING, RS_LOGIC, RS_NEWS, RS_TECH, ccs_s::technologies, descriptions_s::text, and technology_s::type.
void RS_StopResearch | ( | technology_t * | tech | ) |
Stops a research (Removes scientists from it).
[in] | tech | The technology that is being researched. |
Definition at line 99 of file cp_research.c.
References RS_PAUSED, RS_RemoveScientist(), technology_s::scientists, and technology_s::statusResearch.
Referenced by RS_ResearchStop_f(), and US_RemoveStoredUFO().
void UP_AircraftDescription | ( | const technology_t * | tech | ) |
Prints the UFOpaedia description for aircraft.
Definition at line 323 of file cp_ufopedia.c.
References _, AIR_GetAircraft(), AIR_GetOperationRange(), AIR_IsUFO, AIR_STATS_ACCURACY, AIR_STATS_FUELSIZE, AIR_STATS_MAX, AIR_STATS_MAXSPEED, AIR_STATS_SPEED, CL_AircraftMenuStatsValues(), CL_AircraftSizeToName(), CL_AircraftStatToName(), Com_sprintf(), Cvar_Set(), i, INV_ItemDescription(), aircraft_s::maxTeamSize, technology_s::provides, Q_strcat(), RS_Collected_(), RS_IsResearched_ptr(), aircraft_s::size, aircraft_s::stats, TEXT_ITEMDESCRIPTION, UI_RegisterText(), UP_DisplayTechTree(), upBuffer, and va().
Referenced by BS_MarketAircraftDescription(), and UP_Article().
void UP_UGVDescription | ( | const struct ugv_s * | ugvType | ) |
Referenced by BS_BuyItem_f(), BS_BuyType(), BS_MarketClick_f(), BS_SellItem_f(), and UP_Article().