UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_cgame_callbacks.cpp
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22*/
23
24#include "../../cl_shared.h"
25#include "../../input/cl_keys.h"
26#include "../../ui/ui_dataids.h"
27#include "cp_cgame_callbacks.h"
28#include "cp_campaign.h"
29#include "cp_character.h"
30#include "cp_missions.h"
31#include "cp_mission_triggers.h"
32#include "cp_team.h"
33#include "cp_geoscape.h"
36#include "cp_save_callbacks.h"
37#include "cp_base_callbacks.h"
38
40
46static void GAME_CP_Results_f (void)
47{
49 battleParam_t* bp = &ccs.battleParameters;
50
51 if (!mission)
52 return;
53
54 if (cgi->Cmd_Argc() < 2) {
55 cgi->Com_Printf("Usage: %s <won:true|false> [retry:true|false]\n", cgi->Cmd_Argv(0));
56 return;
57 }
58
59 /* check for retry */
60 if (cgi->Cmd_Argc() >= 3 && cgi->Com_ParseBoolean(cgi->Cmd_Argv(2))) {
61 if (bp->retriable) {
62 /* don't collect things and update stats --- we retry the mission */
64 return;
65 } else {
66 cgi->Com_Printf("Battle cannot be retried!\n");
67 }
68 }
69
70 CP_MissionEnd(ccs.curCampaign, mission, bp, cgi->Com_ParseBoolean(cgi->Cmd_Argv(1)));
71}
72
77static inline const char* CP_ToDifficultyName (const int difficulty)
78{
79 switch (difficulty) {
80 case -4:
81 return _("Chicken-hearted");
82 case -3:
83 return _("Very Easy");
84 case -2:
85 case -1:
86 return _("Easy");
87 case 0:
88 return _("Normal");
89 case 1:
90 case 2:
91 return _("Hard");
92 case 3:
93 return _("Very Hard");
94 case 4:
95 return _("Insane");
96 default:
97 cgi->Com_Error(ERR_DROP, "Unknown difficulty id %i", difficulty);
98 }
99}
100
104static void GAME_CP_GetCampaigns_f (void)
105{
106 cgi->UI_ExecuteConfunc("ui_clear_campaigns");
107 for (int i = 0; i < ccs.numCampaigns; i++) {
108 const campaign_t* c = &ccs.campaigns[i];
109 if (c->visible)
110 cgi->UI_ExecuteConfunc("ui_add_campaign %s \"%s\" \"%s\"", c->id, c->name, c->defaultCampaign ? "default" : "");
111 }
112}
113
114#define MAXCAMPAIGNTEXT 4096
120{
121 const char* racetype;
122 const campaign_t* campaign;
123
124 if (cgi->Cmd_Argc() < 2 || Q_streq(cgi->Cmd_Argv(1), "")) {
125 if (ccs.numCampaigns > 0)
126 campaign = &ccs.campaigns[0];
127 else
128 campaign = nullptr;
129 } else {
130 campaign = CP_GetCampaign(cgi->Cmd_Argv(1));
131 }
132
133 if (!campaign) {
134 cgi->Com_Printf("Invalid Campaign id: %s\n", cgi->Cmd_Argv(1));
135 return;
136 }
137
138 if (campaign->team == TEAM_PHALANX)
139 racetype = _("Human");
140 else
141 racetype = _("Aliens");
142
143 const char* text = cgi->CL_Translate(campaign->text);
144 Com_sprintf(campaignDesc, sizeof(campaignDesc), _("%s\n\nRace: %s\nRecruits: %i %s, %i %s, %i %s, %i %s\n"
145 "Credits: %ic\nDifficulty: %s\n"
146 "Min. happiness of nations: %i %%\n"
147 "Max. allowed debts: %ic\n"
148 "%s\n"), _(campaign->name), racetype,
149 campaign->soldiers, ngettext("soldier", "soldiers", campaign->soldiers),
150 campaign->scientists, ngettext("scientist", "scientists", campaign->scientists),
151 campaign->workers, ngettext("worker", "workers", campaign->workers),
152 campaign->pilots, ngettext("pilot", "pilots", campaign->pilots),
153 campaign->credits, CP_ToDifficultyName(campaign->difficulty),
154 (int)(round(campaign->minhappiness * 100.0f)), campaign->negativeCreditsUntilLost,
155 text);
156 cgi->UI_RegisterText(TEXT_STANDARD, campaignDesc);
157}
158
164static void GAME_CP_Start_f (void)
165{
166 campaign_t* campaign;
167
168 campaign = CP_GetCampaign(cgi->Cmd_Argv(1));
169 if (!campaign) {
170 cgi->Com_Printf("Invalid Campaign id: %s\n", cgi->Cmd_Argv(1));
171 return;
172 }
173
174 if (CP_IsRunning()) {
175 cgi->Cmd_ExecuteString("game_exit");
176 cgi->Cmd_ExecuteString("game_setmode campaign");
177 }
178 CP_CampaignInit(campaign, false);
179
180 /* Intro sentences */
181 cgi->Cbuf_AddText("seq_start intro\n");
182}
183
184static inline void AL_AddAlienTypeToAircraftCargo_ (void* data, const teamDef_t* teamDef, int amount, bool dead)
185{
186 AL_AddAlienTypeToAircraftCargo((aircraft_t*) data, teamDef, amount, dead);
187}
188
201void GAME_CP_Results (dbuffer* msg, int winner, int* numSpawned, int* numAlive, int numKilled[][MAX_TEAMS], int numStunned[][MAX_TEAMS], bool nextmap)
202{
203 int ownSurvived, ownKilled, ownStunned;
204 int aliensSurvived, aliensKilled, aliensStunned;
205 int civiliansSurvived, civiliansKilled, civiliansStunned;
206 const int currentTeam = cgi->GAME_GetCurrentTeam();
207 const bool won = (winner == currentTeam);
208 const bool draw = (winner == -1 || winner == 0);
210 battleParam_t* bp = &ccs.battleParameters;
211
212 CHAR_ParseData(msg, &ccs.updateCharacters);
213
214 ownSurvived = ownKilled = ownStunned = 0;
215 aliensSurvived = aliensKilled = aliensStunned = 0;
216 civiliansSurvived = civiliansKilled = civiliansStunned = 0;
217
218 for (int i = 0; i <= MAX_TEAMS; i++) {
219 if (i == currentTeam)
220 ownSurvived = numAlive[i];
221 else if (i == TEAM_CIVILIAN)
222 civiliansSurvived = numAlive[i];
223 else if (i < MAX_TEAMS)
224 aliensSurvived += numAlive[i];
225 for (int j = 0; j < MAX_TEAMS; j++)
226 if (j == currentTeam) {
227 ownKilled += numKilled[i][j];
228 ownStunned += numStunned[i][j]++;
229 } else if (j == TEAM_CIVILIAN) {
230 civiliansKilled += numKilled[i][j];
231 civiliansStunned += numStunned[i][j]++;
232 } else {
233 aliensKilled += numKilled[i][j];
234 aliensStunned += numStunned[i][j]++;
235 }
236 }
237 /* if we won, our stunned are alive */
238 if (won) {
239 ownSurvived += ownStunned;
240 ownStunned = 0;
241 } else {
242 /* if we lost, they revive stunned */
243 aliensStunned = 0;
244 }
245
246 /* we won, and we're not the dirty aliens */
247 if (won)
248 civiliansSurvived += civiliansStunned;
249 else
250 civiliansKilled += civiliansStunned;
251
252 /* Collect items from the battlefield. */
253 AII_CollectingItems(aircraft, won);
254 if (won)
255 /* Collect aliens from the battlefield. */
256 cgi->CollectAliens(aircraft, AL_AddAlienTypeToAircraftCargo_);
257
258 ccs.aliensKilled += aliensKilled;
259
260 missionResults_t* results = &(bp->mission->missionResults);
261 results->mission = bp->mission;
262
263 if (nextmap) {
264 assert(won || draw);
265 results->aliensKilled += aliensKilled;
266 results->aliensStunned += aliensStunned;
267 results->aliensSurvived += aliensSurvived;
268 results->ownKilled += ownKilled - numKilled[currentTeam][currentTeam] - numKilled[TEAM_CIVILIAN][currentTeam];
269 results->ownStunned += ownStunned;
270 results->ownKilledFriendlyFire += numKilled[currentTeam][currentTeam] + numKilled[TEAM_CIVILIAN][currentTeam];
271 results->ownSurvived += ownSurvived;
272 results->civiliansKilled += civiliansKilled;
273 results->civiliansKilledFriendlyFire += numKilled[currentTeam][TEAM_CIVILIAN] + numKilled[TEAM_CIVILIAN][TEAM_CIVILIAN];
274 results->civiliansSurvived += civiliansSurvived;
275 return;
276 }
277
278 /* won mission cannot be retried */
279 if (won)
280 bp->retriable = false;
281
282 if (won)
283 results->state = WON;
284 else if (draw)
285 results->state = DRAW;
286 else
287 results->state = LOST;
288 results->aliensKilled = aliensKilled;
289 results->aliensStunned = aliensStunned;
290 results->aliensSurvived = aliensSurvived;
291 results->ownKilled = ownKilled - numKilled[currentTeam][currentTeam] - numKilled[TEAM_CIVILIAN][currentTeam];
292 results->ownStunned = ownStunned;
293 results->ownKilledFriendlyFire = numKilled[currentTeam][currentTeam] + numKilled[TEAM_CIVILIAN][currentTeam];
294 results->ownSurvived = ownSurvived;
295 results->civiliansKilled = civiliansKilled;
296 results->civiliansKilledFriendlyFire = numKilled[currentTeam][TEAM_CIVILIAN] + numKilled[TEAM_CIVILIAN][TEAM_CIVILIAN];
297 results->civiliansSurvived = civiliansSurvived;
298
299 MIS_InitResultScreen(results);
300 if (ccs.missionResultCallback) {
301 ccs.missionResultCallback(results);
302 }
303
304 cgi->UI_InitStack("geoscape", "campaign_main");
305
306 if (won)
307 cgi->UI_PushWindow("won");
308 else if (draw)
309 cgi->UI_PushWindow("draw");
310 else
311 cgi->UI_PushWindow("lost");
312
313 if (bp->retriable)
314 cgi->UI_ExecuteConfunc("enable_retry");
315
316 cgi->CL_Disconnect();
317 cgi->SV_Shutdown("Mission end", false);
318}
319
321{
323 if (!aircraft)
324 return false;
325
326 /* convert aircraft team to character list */
327 LIST_Foreach(aircraft->acTeam, Employee, employee) {
328 cgi->LIST_AddPointer(chrList, (void*)&employee->chr);
329 }
330
331 /* clean temp inventory */
333
334 return true;
335}
336
338{
339 const technology_t* tech = RS_GetTechForItem(od);
340 return RS_IsResearched_ptr(tech);
341}
342
348bool GAME_CP_TeamIsKnown (const teamDef_t* teamDef)
349{
350 if (!CHRSH_IsTeamDefAlien(teamDef))
351 return true;
352
353 if (!ccs.teamDefTechs[teamDef->idx])
354 cgi->Com_Error(ERR_DROP, "Could not find tech for teamdef '%s'", teamDef->id);
355
356 return RS_IsResearched_ptr(ccs.teamDefTechs[teamDef->idx]);
357}
358
364{
365 Employee* employee = E_GetEmployeeFromChrUCN(cgi->Cvar_GetInteger("mn_ucn"));
366 if (employee)
367 return &employee->chr;
368 return nullptr;
369}
370
371void GAME_CP_Drop (void)
372{
374 cgi->UI_InitStack("geoscape", "campaign_main");
375
376 cgi->SV_Shutdown("Mission end", false);
377 cgi->CL_Disconnect();
378}
379
380void GAME_CP_Frame (float secondsSinceLastFrame)
381{
382 if (!CP_IsRunning())
383 return;
384
385 if (!CP_OnGeoscape())
386 return;
387
388 /* advance time */
389 CP_CampaignRun(ccs.curCampaign, secondsSinceLastFrame);
390}
391
398void GAME_CP_DrawBaseLayoutTooltip (int baseIdx, int x, int y)
399{
400 const base_t* base = B_GetFoundedBaseByIDX(baseIdx);
401 if (base == nullptr)
402 return;
403 cgi->UI_DrawTooltip(base->name, x, y, 250);
404}
405
406void GAME_CP_DrawBaseLayout (int baseIdx, int x1, int y1, int totalMarge, int w, int h, int padding, const vec4_t bgcolor, const vec4_t color)
407{
408 const base_t* base = B_GetBaseByIDX(baseIdx);
409 if (base == nullptr)
410 return;
411 int y = y1 + padding;
412 for (int row = 0; row < BASE_SIZE; row++) {
413 int x = x1 + padding;
414 for (int col = 0; col < BASE_SIZE; col++) {
415 if (B_IsTileBlocked(base, col, row)) {
416 cgi->UI_DrawFill(x, y, w, h, bgcolor);
417 } else if (B_GetBuildingAt(base, col, row) != nullptr) {
418 /* maybe destroyed in the meantime */
419 if (base->founded)
420 cgi->UI_DrawFill(x, y, w, h, color);
421 }
422 x += w + padding;
423 }
424 y += h + padding;
425 }
426}
427
428const char* GAME_CP_GetTeamDef (void)
429{
430 const int team = ccs.curCampaign->team;
431 return cgi->Com_ValueToStr(&team, V_TEAM, 0);
432}
433
434void GAME_CP_InitMissionBriefing (const char** title, linkedList_t** victoryConditionsMsgIDs, linkedList_t** missionBriefingMsgIDs)
435{
436 const battleParam_t* bp = &ccs.battleParameters;
437 const mission_t* mission = bp->mission;
438 const mapDef_t* md = mission->mapDef;
439 if (Q_strvalid(md->victoryCondition)) {
440 cgi->LIST_AddString(victoryConditionsMsgIDs, md->victoryCondition);
441 }
442 if (mission->crashed) {
443 cgi->LIST_AddString(missionBriefingMsgIDs, "*msgid:mission_briefing_crashsite");
444 }
445 if (Q_strvalid(md->missionBriefing)) {
446 cgi->LIST_AddString(missionBriefingMsgIDs, md->missionBriefing);
447 }
448 if (Q_strvalid(md->description)) {
449 *title = _(md->description);
450 }
451}
452
459{
460 const int teamSize = cgi->LIST_Count(team);
461
462 cgi->NET_WriteByte(msg, clc_initactorstates);
463 cgi->NET_WriteByte(msg, teamSize);
464
465 LIST_Foreach(team, character_t, chr) {
466 cgi->NET_WriteShort(msg, chr->ucn);
467 cgi->NET_WriteShort(msg, chr->state);
468 cgi->NET_WriteShort(msg, chr->RFmode.getHand());
469 cgi->NET_WriteShort(msg, chr->RFmode.getFmIdx());
470 cgi->NET_WriteShort(msg, chr->RFmode.getWeapon() != nullptr ? chr->RFmode.getWeapon()->idx : NONE);
471 }
472}
473
475{
476 return &ccs.eMission;
477}
478
480{
481 /* Display rank if the character has one. */
482 if (chr->score.rank >= 0) {
483 const rank_t* rank = CL_GetRankByIdx(chr->score.rank);
484 cgi->Cvar_Set("mn_chrrank", _("Rank: %s"), _(rank->name));
485 cgi->Cvar_Set("mn_chrrank_img", "%s", rank->image);
486 cgi->Cvar_Set("mn_chrrankprefix", "%s ", _(rank->shortname));
487 } else {
488 cgi->Cvar_Set("mn_chrrank_img", "");
489 cgi->Cvar_Set("mn_chrrank", "");
490 cgi->Cvar_Set("mn_chrrankprefix", "");
491 }
492
493 cgi->Cvar_Set("mn_chrmis", "%i", chr->score.assignedMissions);
494 cgi->Cvar_Set("mn_chrkillalien", "%i", chr->score.kills[KILLED_ENEMIES]);
495 cgi->Cvar_Set("mn_chrkillcivilian", "%i", chr->score.kills[KILLED_CIVILIANS]);
496 cgi->Cvar_Set("mn_chrkillteam", "%i", chr->score.kills[KILLED_TEAM]);
497}
498
499const char* GAME_CP_GetItemModel (const char* string)
500{
501 const aircraft_t* aircraft = AIR_GetAircraftSilent(string);
502 if (aircraft) {
503 assert(aircraft->tech);
504 return aircraft->tech->mdl;
505 } else {
506 const technology_t* tech = RS_GetTechByProvided(string);
507 if (tech)
508 return tech->mdl;
509 return nullptr;
510 }
511}
512
513static const cmdList_t cgameCallbacks[] = {
514 {"cp_results", GAME_CP_Results_f, "Parses and shows the game results"},
515 {"cp_getdescription", GAME_CP_CampaignDescription_f, nullptr},
516 {"cp_getcampaigns", GAME_CP_GetCampaigns_f, "Fill the campaign list with available campaigns"},
517 {"cp_start", GAME_CP_Start_f, "Start the new campaign"},
518 {nullptr, nullptr, nullptr}
519};
520
522{
523#ifndef HARD_LINKED_CGAME
524 INVSH_InitCSI(cgi->csi);
525#endif
526 cgi->Cmd_TableAddList(cgameCallbacks);
527
529
530 /* cvars might have been changed by other gametypes */
531 cgi->Cvar_ForceSet("sv_maxclients", "1");
532 cgi->Cvar_ForceSet("sv_ai", "1");
533
534 /* reset campaign data */
537
539}
540
542{
544 cgi->Cmd_TableRemoveList(cgameCallbacks);
545
546 CP_Shutdown();
547
549
550 cgi->SV_Shutdown("Quitting server.", false);
551}
bool CHRSH_IsTeamDefAlien(const teamDef_t *const td)
Check if a team definition is alien.
@ KILLED_TEAM
Definition chr_shared.h:30
@ KILLED_ENEMIES
Definition chr_shared.h:28
@ KILLED_CIVILIANS
Definition chr_shared.h:29
HUD related routines.
Header file for keyboard handler.
Share stuff between the different cgame implementations.
#define _(String)
Definition cl_shared.h:44
character_t chr
@ clc_initactorstates
Definition common.h:178
#define ERR_DROP
Definition common.h:211
void AII_CollectingItems(aircraft_t *aircraft, int won)
Collect items from the battlefield.
const aircraft_t * AIR_GetAircraftSilent(const char *name)
Searches the global array of aircraft types for a given aircraft.
bool AL_AddAlienTypeToAircraftCargo(aircraft_t *aircraft, const teamDef_t *teamDef, int amount, bool dead)
Adds an alientype to an aircraft cargo.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
Definition cp_base.cpp:326
base_t * B_GetBaseByIDX(int baseIdx)
Array bound check for the base index. Will also return unfounded bases as long as the index is in the...
Definition cp_base.cpp:313
#define B_IsTileBlocked(base, x, y)
Definition cp_base.h:164
#define BASE_SIZE
Definition cp_base.h:38
#define B_GetBuildingAt(base, x, y)
Definition cp_base.h:165
Header file for menu related console command callbacks.
void CP_ResetCampaignData(void)
Will clear most of the parsed singleplayer data.
void CP_Shutdown(void)
Campaign closing actions.
bool CP_OnGeoscape(void)
Returns if we are currently on the Geoscape.
bool CP_IsRunning(void)
Checks whether a campaign mode game is running.
void CP_CampaignRun(campaign_t *campaign, float secondsSinceLastFrame)
Called every frame when we are in geoscape view.
void CP_InitStartup(void)
void CP_StartSelectedMission(void)
Starts a selected mission.
void CP_CampaignInit(campaign_t *campaign, bool load)
Called at new game and load game.
campaign_t * CP_GetCampaign(const char *name)
Returns the campaign pointer from global campaign array.
ccs_t ccs
Header file for single player campaign control.
const cgame_import_t * cgi
void CP_ParseCampaignData(void)
Read the data for campaigns.
Definition cp_parse.cpp:641
static void GAME_CP_GetCampaigns_f(void)
Fill the campaign list with available campaigns.
void GAME_CP_DrawBaseLayout(int baseIdx, int x1, int y1, int totalMarge, int w, int h, int padding, const vec4_t bgcolor, const vec4_t color)
static void GAME_CP_CampaignDescription_f(void)
Script function to show description of the selected a campaign.
void GAME_CP_CharacterCvars(const character_t *chr)
const char * GAME_CP_GetTeamDef(void)
void GAME_CP_InitStartup(void)
void GAME_CP_Drop(void)
character_t * GAME_CP_GetSelectedChr(void)
Returns the currently selected character.
equipDef_t * GAME_CP_GetEquipmentDefinition(void)
static void GAME_CP_Results_f(void)
static void GAME_CP_Start_f(void)
Starts a new single-player game.
void GAME_CP_Shutdown(void)
static const cmdList_t cgameCallbacks[]
#define MAXCAMPAIGNTEXT
const char * GAME_CP_GetItemModel(const char *string)
void GAME_CP_InitMissionBriefing(const char **title, linkedList_t **victoryConditionsMsgIDs, linkedList_t **missionBriefingMsgIDs)
void GAME_CP_Frame(float secondsSinceLastFrame)
static char campaignDesc[MAXCAMPAIGNTEXT]
void GAME_CP_Results(dbuffer *msg, int winner, int *numSpawned, int *numAlive, int numKilled[][MAX_TEAMS], int numStunned[][MAX_TEAMS], bool nextmap)
After a mission was finished this function is called.
static const char * CP_ToDifficultyName(const int difficulty)
Translate the difficulty int to a translated string.
bool GAME_CP_Spawn(linkedList_t **chrList)
bool GAME_CP_TeamIsKnown(const teamDef_t *teamDef)
Checks whether the team is known at this stage already.
static void AL_AddAlienTypeToAircraftCargo_(void *data, const teamDef_t *teamDef, int amount, bool dead)
void GAME_CP_InitializeBattlescape(dbuffer *msg, const linkedList_t *team)
Changes some actor states for a campaign game.
void GAME_CP_DrawBaseLayoutTooltip(int baseIdx, int x, int y)
Draws basename as tooltip for baselayout widget.
bool GAME_CP_ItemIsUseable(const objDef_t *od)
void CHAR_ParseData(dbuffer *msg, linkedList_t **updateCharacters)
Parses the character data which was send by G_MatchSendResults using G_SendCharacterData.
Header file for character (soldier, alien) related campaign functions.
Employee * E_GetEmployeeFromChrUCN(int uniqueCharacterNumber)
Searches all employee for the ucn (character id).
Header for Geoscape management.
#define GEO_GetMissionAircraft()
Definition cp_geoscape.h:60
#define GEO_GetSelectedMission()
Definition cp_geoscape.h:59
void MIS_InitResultScreen(const missionResults_t *results)
Updates mission result menu text with appropriate values.
header file UI callbacks for missions.
Campaign mission triggers.
void CP_MissionEnd(const campaign_t *campaign, mission_t *mission, const battleParam_t *battleParameters, bool won)
Closing actions after fighting a battle.
Campaign missions headers.
@ LOST
Definition cp_missions.h:57
@ WON
Definition cp_missions.h:57
@ DRAW
Definition cp_missions.h:57
rank_t * CL_GetRankByIdx(const int index)
Returns a rank at an index.
Definition cp_rank.cpp:50
technology_t * RS_GetTechForItem(const objDef_t *item)
Returns technology entry for an item.
bool RS_IsResearched_ptr(const technology_t *tech)
Checks whether an item is already researched.
technology_t * RS_GetTechByProvided(const char *idProvided)
returns a pointer to the item tech (as listed in "provides")
void SAV_InitCallbacks(void)
Register UI callbacks for the savegame-subsystem.
void SAV_ShutdownCallbacks(void)
UnregisterUI callbacks for the savegame-subsystem.
Header file for Savegame UI callbacks.
void CP_CleanTempInventory(base_t *base)
Clears all containers that are temp containers (see script definition).
Definition cp_team.cpp:273
Team management for the campaign gametype headers.
#define MAX_TEAMS
Definition defines.h:98
#define NONE
Definition defines.h:68
#define ngettext(x, y, cnt)
Definition g_local.h:40
void INVSH_InitCSI(const csi_t *import)
Initializes client server shared data pointer. This works because the client and the server are both ...
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
Definition list.h:41
#define TEAM_PHALANX
Definition q_shared.h:62
#define TEAM_CIVILIAN
Definition q_shared.h:61
QGL_EXTERN GLsizei const GLvoid * data
Definition r_gl.h:89
QGL_EXTERN GLint i
Definition r_gl.h:113
@ V_TEAM
Definition scripts.h:70
#define Q_strvalid(string)
Definition shared.h:141
#define Q_streq(a, b)
Definition shared.h:136
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
Definition shared.cpp:494
An aircraft with all it's data.
struct base_s * homebase
linkedList_t * acTeam
struct technology_s * tech
A base with all it's data.
Definition cp_base.h:84
bool founded
Definition cp_base.h:90
char name[MAX_VAR]
Definition cp_base.h:86
struct mission_s * mission
char text[MAX_VAR]
bool defaultCampaign
char name[MAX_VAR]
signed int difficulty
float minhappiness
int negativeCreditsUntilLost
char id[MAX_VAR]
Describes a character with all its attributes.
Definition chr_shared.h:388
chrScoreGlobal_t score
Definition chr_shared.h:406
int kills[KILLED_NUM_TYPES]
Definition chr_shared.h:126
char * victoryCondition
Definition q_shared.h:467
char * missionBriefing
Definition q_shared.h:469
char * description
Definition q_shared.h:466
mission definition
Definition cp_missions.h:86
mapDef_t * mapDef
Definition cp_missions.h:89
Structure with mission info needed to create results summary at menu won.
Definition cp_missions.h:61
int civiliansKilledFriendlyFire
Definition cp_missions.h:78
const struct mission_s * mission
Definition cp_missions.h:62
missionState_t state
Definition cp_missions.h:63
Defines all attributes of objects used in the inventory.
Definition inv_shared.h:264
Describes a rank that a recruit can gain.
Definition cp_rank.h:29
const char * name
Definition cp_rank.h:31
const char * image
Definition cp_rank.h:33
const char * shortname
Definition cp_rank.h:32
char id[MAX_VAR]
Definition chr_shared.h:309
This is the technology parsed from research.ufo.
vec_t vec4_t[4]
Definition ufotypes.h:40
@ TEXT_STANDARD
Definition ui_dataids.h:30