UFO: Alien Invasion
|
UFO recovery and storing callback functions. More...
#include "../../cl_shared.h"
#include "../../ui/ui_dataids.h"
#include "cp_campaign.h"
#include "cp_ufo.h"
#include "cp_uforecovery.h"
#include "cp_uforecovery_callbacks.h"
#include "cp_geoscape.h"
#include "cp_time.h"
Go to the source code of this file.
Macros | |
#define | HAPPINESS_UFO_SALE_GAIN 0.02 |
#define | HAPPINESS_UFO_SALE_LOSS 0.005 |
Functions | |
static void | UR_DialogInitStore_f (void) |
Function to initialize list of storage locations for recovered UFO. More... | |
static void | UR_DialogStartStore_f (void) |
Function to start UFO recovery process. More... | |
static void | UR_DialogInitSell_f (void) |
Function to initialize list to sell recovered UFO to desired nation. More... | |
static void | UR_DialogStartSell_f (void) |
Function to start UFO selling process. More... | |
const char * | US_StoredUFOStatus (const storedUFO_t *ufo) |
Returns string representation of the stored UFO's status. More... | |
static void | US_SelectStoredUfo_f (void) |
Send Stored UFO data to the UI. More... | |
static void | US_DestroyStoredUFO_f (void) |
Destroys a stored UFO. More... | |
static void | US_FillUFOTransfer_f (void) |
Fills UFO Yard UI with transfer destinations. More... | |
static void | US_FillUFOTransferUFOs_f (void) |
Send Stored UFOs of the destination UFO Yard. More... | |
static void | US_TransferUFO_f (void) |
Callback to start the transfer of a stored UFO. More... | |
void | UR_InitCallbacks (void) |
void | UR_ShutdownCallbacks (void) |
Variables | |
static const cmdList_t | ufoRecoveryCallbacks [] |
UFO recovery and storing callback functions.
Definition in file cp_uforecovery_callbacks.cpp.
#define HAPPINESS_UFO_SALE_GAIN 0.02 |
Definition at line 36 of file cp_uforecovery_callbacks.cpp.
Referenced by UR_DialogStartSell_f().
#define HAPPINESS_UFO_SALE_LOSS 0.005 |
Definition at line 37 of file cp_uforecovery_callbacks.cpp.
Referenced by UR_DialogStartSell_f().
Function to initialize list to sell recovered UFO to desired nation.
Definition at line 108 of file cp_uforecovery_callbacks.cpp.
References _, AIR_GetAircraft(), cgi, cgame_import_s::Cmd_Argv(), f, frand(), nationInfo_s::happiness, int(), NAT_Foreach, NAT_GetCurrentMonthInfo(), NAT_GetHappinessString(), aircraft_s::price, and nationInfo_s::xviInfection.
Function to initialize list of storage locations for recovered UFO.
Definition at line 44 of file cp_uforecovery_callbacks.cpp.
References cgi, capacities_s::cur, INS_Foreach, and capacities_s::max.
Function to start UFO selling process.
Definition at line 143 of file cp_uforecovery_callbacks.cpp.
References _, ccs, cgi, cgame_import_s::Cmd_Argv(), Com_sprintf(), cp_messageBuffer, CP_UpdateCredits(), ccs_s::credits, ccs_s::curCampaign, HAPPINESS_UFO_SALE_GAIN, HAPPINESS_UFO_SALE_LOSS, campaign_s::minhappiness, MS_AddNewMessage(), nation_s::name, NAT_Foreach, NAT_GetNationByID(), and NAT_SetHappiness().
Function to start UFO recovery process.
Definition at line 64 of file cp_uforecovery_callbacks.cpp.
References _, AIR_GetAircraftSilent(), AIR_IsUFO, ccs, cgi, cgame_import_s::Cmd_Argv(), Com_sprintf(), cp_messageBuffer, capacities_s::cur, ccs_s::date, date_s::day, f, INS_GetByIDX(), int(), lengthof, capacities_s::max, MS_AddNewMessage(), installation_s::name, RECOVERY_DELAY, UFO_GetName(), installation_s::ufoCapacity, and US_StoreUFO().
Definition at line 357 of file cp_uforecovery_callbacks.cpp.
References cgi.
Referenced by UR_InitStartup().
Definition at line 362 of file cp_uforecovery_callbacks.cpp.
References cgi.
Referenced by UR_Shutdown().
Destroys a stored UFO.
Definition at line 241 of file cp_uforecovery_callbacks.cpp.
References _, cgi, cgame_import_s::Cmd_Argv(), Com_sprintf(), DEBUG_CLIENT, storedUFO_s::idx, installation_s::idx, storedUFO_s::installation, US_GetStoredUFOByIDX(), and US_RemoveStoredUFO().
Fills UFO Yard UI with transfer destinations.
Definition at line 271 of file cp_uforecovery_callbacks.cpp.
References _, cgi, cgame_import_s::Cmd_Argv(), DEBUG_CLIENT, GEO_GetNation(), INS_ForeachOfType, storedUFO_s::installation, INSTALLATION_UFOYARD, nation_s::name, and US_GetStoredUFOByIDX().
Send Stored UFOs of the destination UFO Yard.
Definition at line 298 of file cp_uforecovery_callbacks.cpp.
References cgi, cgame_import_s::Cmd_Argv(), DEBUG_CLIENT, installation_s::idx, INS_GetByIDX(), and US_Foreach.
Send Stored UFO data to the UI.
Definition at line 213 of file cp_uforecovery_callbacks.cpp.
References storedUFO_s::arrive, ccs, cgi, cgame_import_s::Cmd_Argv(), storedUFO_s::condition, CP_SecondConvert(), ccs_s::date, Date_DateToSeconds(), Date_Substract(), storedUFO_s::idx, storedUFO_s::installation, aircraft_s::model, installation_s::name, Q_streq, components_s::time, UFO_GetName(), storedUFO_s::ufoTemplate, US_GetStoredUFOByIDX(), and US_StoredUFOStatus().
const char* US_StoredUFOStatus | ( | const storedUFO_t * | ufo | ) |
Returns string representation of the stored UFO's status.
Definition at line 191 of file cp_uforecovery_callbacks.cpp.
References storedUFO_s::disassembly, storedUFO_s::status, SUFO_RECOVERED, SUFO_STORED, and SUFO_TRANSFERED.
Referenced by INS_FillUFOYardData_f(), and US_SelectStoredUfo_f().
Callback to start the transfer of a stored UFO.
Definition at line 322 of file cp_uforecovery_callbacks.cpp.
References cgi, cgame_import_s::Cmd_Argv(), INS_GetByIDX(), US_GetStoredUFOByIDX(), and US_TransferUFO().
|
static |
Definition at line 344 of file cp_uforecovery_callbacks.cpp.