cp_research.h File Reference

Header for research related stuff. More...

This graph shows which files directly or indirectly include this file:

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_tRS_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_tRS_GetTechByID (const char *id)
 return a pointer to the technology identified by given id string
technology_tRS_GetTechByProvided (const char *idProvided)
 returns a pointer to the item tech (as listed in "provides")
technology_tRS_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_tRS_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)

Detailed Description

Header for research related stuff.

Definition in file cp_research.h.


Define Documentation

#define ANTIMATTER_TECH_ID   "antimatter"
#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 Documentation

typedef struct requirement_s requirement_t

The status of a research (per tech).

Types of research topics.

typedef struct techMail_s techMail_t

available mails for a tech - mail and mail_pre in script files

See also:
eventMail_t
typedef struct technology_s technology_t

This is the technology parsed from research.ufo.


Enumeration Type Documentation

Enumerator:
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.

Enumerator:
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.

The status of a research (per tech).

Enumerator:
RS_NONE 
RS_RUNNING 
RS_PAUSED 
RS_FINISH 

Definition at line 40 of file cp_research.h.

Types of research topics.

Enumerator:
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.

Types for tech mail definitions - see tech->mail[].

Enumerator:
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.


Function Documentation

void RS_AddObjectTechs ( void   ) 
void RS_AssignScientist ( technology_t tech,
base_t base,
employee_t employee 
)

Assigns scientist to the selected research-project.

Note:
The lab will be automatically selected (the first one that has still free space).
Parameters:
[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".
Note:
if employee is NULL, te system selects an unassigned scientist on the selected (or tech-) base
See also:
RS_AssignScientist_f
RS_RemoveScientist

Todo:
make reassign possible with this.

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  ) 
See also:
RS_ItemCollected Call this function if you already hold a tech pointer.

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.

Parameters:
[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

Parameters:
[in] id Unique identifier of the tech as defined in the research.ufo file (e.g. "tech xxxx").
Returns:
technology_t pointer or NULL if an error occured.

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.

Parameters:
[in] techIdx Index in the global ccs.technologies[] array.
Returns:
technology_t pointer or NULL if an error occurred.

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")

Parameters:
[in] idProvided Unique identifier of the object the tech is providing
Returns:
The tech for the given object id or NULL if not found

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  ) 
int RS_GetTechIdxByName ( const char *  name  ) 

Returns the index (idx) of a "tech" entry given it's name.

Parameters:
[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.

Parameters:
[in] base In what base the tech should be researched.
See also:
E_RemoveEmployeeFromBuildingOrAircraft

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.

Parameters:
[in] load qtrue if we are loading a game, qfalse otherwise
Todo:

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).

See also:
CP_CampaignInit

Todo:
Implement me

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.

Parameters:
[in] techIdx index of the technology.
Returns:
qboolean Returns qtrue if the technology has been researched, otherwise (or on error) qfalse;
See also:
RS_IsResearched_ptr

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  ) 
void RS_MarkCollected ( technology_t tech  ) 
void RS_MarkOneResearchable ( technology_t tech  ) 

Marks one tech as researchable.

Parameters:
tech The technology to be marked.
See also:
RS_MarkCollected
RS_MarkResearchable

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.

See also:
RS_ResearchFinish

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().

void RS_MarkResearchable ( qboolean  init,
const struct base_s base 
)
qboolean RS_MarkStoryLineEventResearched ( const char *  techID  ) 

Pick a random base to research a story line event tech

Parameters:
techID The event technology script id to research
Note:
If there is no base available the tech is not marked as researched, too

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).

Parameters:
[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.
See also:
CL_ParseScriptFirst
GAME_SetMode
Note:
write into cp_campaignPool - free on every game restart and reparse

Todo:
use Com_RegisterConstInt();

< Remove first char (i.e. we assume it's the "_")

Todo:
escape "type weapon/tech/etc.." here

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.

Parameters:
[in] base Pointer to base where a scientist should be removed.
[in] employee Pointer to the employee that is fired.
Note:
used when a scientist is fired.
See also:
E_RemoveEmployeeFromBuildingOrAircraft
Note:
This function is called before the employee is actually 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.

Parameters:
[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).
See also:
RS_RemoveScientist_f
RS_AssignScientist
E_RemoveEmployeeFromBuildingOrAircraft

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.

Parameters:
[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...

Note:
This replaces the RS_InitRequirementList function (since the switch to the _OR and _AND list)

< 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.

Parameters:
[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.

See also:
RS_MarkOneResearchable

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.

Todo:
Needs to check on the exact time that elapsed since the last check of the status.
See also:
RS_MarkResearched

< If there are scientitsts there _has_ to be a base.

Todo:
Just for testing, better formular may be needed. Include employee-skill in calculation.
Todo:
CHECK THAT: very very strange

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.

Returns:
false if there are errors - true otherwise

Todo:
error++; Crafts still give errors - are there any definitions missing?

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).

Parameters:
[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  ) 
void UP_UGVDescription ( const struct ugv_s ugvType  ) 

Generated by  doxygen 1.6.2