35#define BS_GetMarket() (&ccs.eMarket)
116 if (aircraft->
price == -1)
178 if (aircraft->
tpl != aircraft) {
240 cgi->Com_Error(
ERR_DROP,
"BS_BuyAircraft: No base given.");
241 if (!aircraftTemplate)
242 cgi->Com_Error(
ERR_DROP,
"BS_BuyAircraft: No aircraft template given.");
249 if (
ccs.credits < price)
313 cgi->Com_Error(
ERR_DROP,
"BS_BuyUGV: Called on nullptr UGV!");
315 cgi->Com_Error(
ERR_DROP,
"BS_BuyUGV: Called on nullptr base!");
318 cgi->Com_Error(
ERR_DROP,
"BS_BuyItem_f: Could not get weapon '%s' for ugv/tank '%s'.", ugv->
weapon, ugv->
id);
360 cgi->Com_Error(
ERR_DROP,
"BS_BuyItem_f: Could not get wepaon '%s' for ugv/tank '%s'.", ugv->
weapon, ugv->
id);
385 cgi->Com_Error(
ERR_DROP,
"BS_BuyItem: Called on nullptr objDef!");
387 cgi->Com_Error(
ERR_DROP,
"BS_BuyItem: Called on nullptr base!");
417 cgi->Com_Error(
ERR_DROP,
"BS_SellItem: Called on nullptr objDef!");
450 for (
i = 0;
i <
cgi->csi->numODs;
i++) {
462 const int maxAircraft =
cgi->Com_GetHumanAircraftIdsNum();
463 for (
i = 0;
i < maxAircraft;
i++) {
497 cgi->Com_Printf(
"BS_LoadXML: Could not find item '%s'\n", s);
531 for (
i = 0;
i <
cgi->csi->numODs;
i++) {
545 cgi->Com_Printf(
"BS_InitMarket: Could not add item %s to the market - not marked as researched in campaign %s\n",
546 od->
id, campaign->
id);
550 const int maxAircraft =
cgi->Com_GetHumanAircraftIdsNum();
551 for (
i = 0;
i < maxAircraft;
i++) {
566 cgi->Com_Printf(
"BS_InitMarket: Could not add aircraft %s to the market - not marked as researched in campaign %s\n",
567 aircraft->
id, campaign->
id);
582 const float TYPICAL_TIME = 10.f;
583 const int RESEARCH_LIMIT_DELAY = 30;
590 for (
i = 0;
i <
cgi->csi->numODs;
i++) {
593 int asymptoticNumber;
602 asymptoticNumber = 0;
619 const int maxAircraft =
cgi->Com_GetHumanAircraftIdsNum();
620 for (
i = 0;
i < maxAircraft;
i++) {
622 const char* aircraftID =
cgi->Com_DropShipTypeToShortName(
type);
625 int asymptoticNumber;
634 asymptoticNumber = 0;
DateTime class definition.
Share stuff between the different cgame implementations.
int getDateAsDays() const
Return the date part of the DateTime as days.
const struct ugv_s * getUGV() const
bool unhire()
Fires an employee.
void AIR_DeleteAircraft(aircraft_t *aircraft)
Removes an aircraft from its base and the game.
aircraft_t * AIR_NewAircraft(base_t *base, const aircraft_t *aircraftTemplate)
Places a new aircraft in the given base.
int AIR_GetTeamSize(const aircraft_t *aircraft)
Counts the number of soldiers in given aircraft.
const aircraft_t * AIR_GetAircraft(const char *name)
Searches the global array of aircraft types for a given aircraft.
bool AIR_IsAircraftInBase(const aircraft_t *aircraft)
Checks whether given aircraft is in its homebase.
#define AIR_IsUFO(aircraft)
int B_ItemInBase(const objDef_t *item, const base_t *base)
Check if the item has been collected (i.e it is in the storage) in the given base.
int B_AddToStorage(base_t *base, const objDef_t *obj, int amount)
Add/remove items to/from the storage.
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t buildingType)
Get the status associated to a building.
#define B_IsUnderAttack(base)
void CP_UpdateCredits(int credits)
Sets credits and update mn_credits cvar.
Header file for single player campaign control.
const cgame_import_t * cgi
int CAP_GetFreeCapacity(const base_t *base, baseCapacities_t capacityType)
Returns the free capacity of a type.
int E_CountUnhiredRobotsByType(const ugv_t *ugvType)
Counts all available Robots/UGVs that are for sale.
bool E_HireRobot(base_t *base, const ugv_t *ugvType)
Hires the first free employee of that type.
bool BS_LoadXML(xmlNode_t *parent)
Load callback for savegames.
static void BS_AddAircraftToMarket(const aircraft_t *aircraft, int amount)
Internal function to add aircraft to the market.
int BS_GetItemBuyingPrice(const objDef_t *od)
Get the price for an item that you want to buy on the market.
int BS_GetAircraftOnMarket(const aircraft_t *aircraft)
Get the number of aircraft of the given type on the market.
int BS_GetItemSellingPrice(const objDef_t *od)
Get the price for an item that you want to sell on the market.
bool BS_AircraftIsOnMarket(const aircraft_t *aircraft)
Checks whether a given aircraft should appear on the market.
static void BS_RemoveAircraftFromMarket(const aircraft_t *aircraft, int amount)
Internal function to remove aircraft from the market.
int BS_GetItemOnMarket(const objDef_t *od)
Get the number of items of the given type on the market.
int BS_GetAircraftSellingPrice(const aircraft_t *aircraft)
Get the price for an aircraft that you want to sell on the market.
bool BS_SellUGV(Employee *robot)
Sells the given UGV with all the equipment.
bool BS_BuyUGV(const ugv_t *ugv, base_t *base)
Buys the given UGV.
void BS_AddItemToMarket(const objDef_t *od, int amount)
Internal function to add items to the market.
static void BS_ProcessCraftItemSale(const objDef_t *craftitem, const int numItems)
Update storage, the market, and the player's credits.
bool BS_SellAircraft(aircraft_t *aircraft)
Sells the given aircraft with all the equipment.
void BS_InitMarket(const campaign_t *campaign)
sets market prices at start of the game
int BS_GetAircraftBuyingPrice(const aircraft_t *aircraft)
Get the price for an aircraft that you want to buy on the market.
static void BS_RemoveItemFromMarket(const objDef_t *od, int amount)
Internal function to remove items from the market.
bool BS_SellItem(const objDef_t *od, base_t *base, int count)
Sells items from the market.
bool BS_SaveXML(xmlNode_t *parent)
Save callback for savegames.
bool BS_BuyItem(const objDef_t *od, base_t *base, int count)
Buys items from the market.
bool BS_IsOnMarket(const objDef_t *item)
Check if an item is on market.
void CP_CampaignRunMarket(campaign_t *campaign)
make number of items change every day.
bool BS_BuyAircraft(const aircraft_t *aircraftTemplate, base_t *base)
Buys an aircraft.
bool BS_BuySellAllowed(const base_t *base)
Returns true if you can buy or sell equipment.
Header for single player market stuff.
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.
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
short humanAircraftType_t
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
QGL_EXTERN GLint GLenum type
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
XML tag constants for savegame.
#define SAVE_MARKET_AIRCRAFT
#define SAVE_MARKET_MARKET
#define SAVE_MARKET_AUTOSELL
An aircraft with all it's data.
aircraftSlot_t weapons[MAX_AIRCRAFTSLOT]
aircraftSlot_t electronics[MAX_AIRCRAFTSLOT]
struct technology_s * tech
A base with all it's data.
const equipDef_t * asymptoticMarketDef
const equipDef_t * marketDef
int numItems[MAX_OBJDEFS]
int numAircraft[AIRCRAFTTYPE_MAX]
int numItems[MAX_OBJDEFS]
int bidAircraft[AIRCRAFTTYPE_MAX]
int numAircraft[AIRCRAFTTYPE_MAX]
int askAircraft[AIRCRAFTTYPE_MAX]
bool autosell[MAX_OBJDEFS]
int askItems[MAX_OBJDEFS]
double currentEvolutionAircraft[AIRCRAFTTYPE_MAX]
double currentEvolutionItems[MAX_OBJDEFS]
int bidItems[MAX_OBJDEFS]
Defines all attributes of objects used in the inventory.
This is the technology parsed from research.ufo.
class DateTime researchedDate
Defines a type of UGV/Robot.