30 #include "../shared/parse.h"
74 UI_Popup(
_(
"Warning"),
_(
"This soldier can not carry anything else."));
79 const int moved =
cls.
i.
moveInInventory(inv, fromContainer, fItem, toContainer, toX, toY,
nullptr, uponItem);
105 x += weaponList->
getX();
106 y += weaponList->
getY();
122 return INV_MoveItem(inv, destContainer, x, y, srcContainer, ic,
nullptr);
139 if (container && inv) {
145 if (moved || weapon->
def() == weapon->
ammoDef()) {
159 static void INV_InventoryList_f (
void)
172 Com_Printf(
"... usable for weapon (if type is ammo):\n");
206 Com_Printf(
"INV_EquipmentDefSanityCheck: Equipment Def '%s' has a total probability for primary weapons greater than 100\n", ed->
id);
218 Com_Printf(
"INV_EquipmentDefSanityCheck: Equipment Def '%s' has a total probability for secondary weapons greater than 100\n", ed->
id);
230 Com_Printf(
"INV_EquipmentDefSanityCheck: Equipment Def '%s' has a total probability for armours greater than 100\n", ed->
id);
259 Sys_Error(
"INV_GetFilterFromItem: unknown filter category for item '%s'", obj->
id);
273 switch (filterType) {
339 Com_Printf(
"INV_ItemMatchesFilter: Unknown filter type for items: %i\n", filterType);
359 if (itemType ==
nullptr)
366 if (itemType == ic->def())
403 if (filterTypeID[0] ==
'\0')
407 const char* fileTypeName = filterTypeNames[
i];
408 if (fileTypeName &&
Q_streq(fileTypeName, filterTypeID))
422 return filterTypeNames[
id];
428 Cmd_AddCommand(
"debug_listinventory", INV_InventoryList_f,
"Print the current inventory to the game console");
#define SHAPE_BIG_MAX_HEIGHT
defines the max height of an inventory container
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
void Sys_Error(const char *error,...)
void setAmmoLeft(int value)
itemFilterTypes_t INV_GetFilterTypeID(const char *filterTypeID)
Searches for a filter type name (as used in console functions) and returns the matching itemFilterTyp...
bool isCraftItem() const
Checks whether a given item is an aircraftitem item.
bool INV_ItemMatchesFilter(const objDef_t *obj, const itemFilterTypes_t filterType)
Checks if the given object/item matched the given filter type.
Item * getContainer2(const containerIndex_t idx) const
static char const *const filterTypeNames[]
inventory_action_t moveInInventory(Inventory *const inv, const invDef_t *from, Item *item, const invDef_t *to, int tx, int ty, int *TU, Item **icp)
Conditions for moving items between containers.
itemFilterTypes_t
A list of filter types in the market and production view.
Shared game type headers.
const objDef_t * def(void) const
equipDef_t eds[MAX_EQUIPDEFS]
void Com_Printf(const char *const fmt,...)
Header file for inventory handling and Equipment menu.
bool isReloadable() const
const struct objDef_s * ammos[MAX_AMMOS_PER_OBJDEF]
Defines all attributes of objects used in the inventory.
const equipDef_t * INV_GetEquipmentDefinitionByID(const char *name)
Gets equipment definition by id.
int GAME_GetChrMaxLoad(const character_t *chr)
Returns the max weight the given character can carry.
void Com_Error(int code, const char *fmt,...)
item instance data, with linked list capability
void getFirstShapePosition(int *const x, int *const y) const
Calculates the first "true" bit in the shape and returns its position in the item.
inventory definition with all its containers
static bool INV_EquipmentDefSanityCheck(void)
Make sure equipment definitions used to generate teams are proper.
#define SHAPE_BIG_MAX_WIDTH
32 bit mask
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
bool INV_MoveItem(Inventory *inv, const invDef_t *toContainer, int toX, int toY, const invDef_t *fromContainer, Item *fItem, Item **uponItem)
Move item between containers.
character_t * GAME_GetSelectedChr(void)
Returns the currently selected character.
bool canHoldItemWeight(containerIndex_t from, containerIndex_t to, const Item &item, int maxWeight) const
Check that adding an item to the inventory won't exceed the max permitted weight. ...
Item * addToInventory(Inventory *const inv, const Item *const item, const invDef_t *container, int x, int y, int amount) __attribute__((warn_unused_result))
Add an item to a specified container in a given inventory.
void INV_InitStartup(void)
int numItems[MAX_OBJDEFS]
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void setAmmoDef(const objDef_t *od)
Item * getItemAtPos(const invDef_t *container, const int x, const int y) const
Searches if there is an item at location (x,y) in a container.
const objDef_t * ammoDef(void) const
inventory definition for our menus
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
Primary header for client.
itemFilterTypes_t INV_GetFilterFromItem(const objDef_t *obj)
void INV_InitCallbacks(void)
CASSERT(lengthof(filterTypeNames)==MAX_FILTERTYPES)
bool INV_LoadWeapon(const Item *weaponList, Inventory *inv, const invDef_t *srcContainer, const invDef_t *destContainer)
Load a weapon with ammo.
Item * INV_SearchInInventoryWithFilter(const Inventory *const inv, const invDef_t *container, const objDef_t *itemType, const itemFilterTypes_t filterType)
Searches if there is an item at location (x/y) in a scrollable container. You can also provide an ite...
const char * INV_GetFilterType(itemFilterTypes_t id)
bool INV_UnloadWeapon(Item *weapon, Inventory *inv, const invDef_t *container)
Unload a weapon and put the ammo in a container.
const struct objDef_s * weapons[MAX_WEAPONS_PER_OBJDEF]