32 #define DROPSHIP_MAX 8 33 #define INTERCEPTOR_MAX 12 34 #define AIRCRAFTTYPE_MAX (DROPSHIP_MAX + INTERCEPTOR_MAX) 37 #define MAX_OBJDEFS 144 38 #define MAX_IMPLANTS 16 39 #define MAX_MAPDEFS 256 40 #define MAX_WEAPONS_PER_OBJDEF 4 41 #define MAX_AMMOS_PER_OBJDEF 4 42 #define MAX_FIREDEFS_PER_WEAPON 8 43 #define WEAPON_BALANCE 0.5f 44 #define SKILL_BALANCE 1.0f 50 #define CID_HEADGEAR 3 51 #define CID_BACKPACK 4 61 return (
id >= 0 &&
id <
CID_MAX);
88 typedef struct itemEffect_s {
101 typedef struct implantDef_s {
110 typedef struct fireDef_s {
125 const struct objDef_s*
obj;
165 void getShotOrigin (
const vec3_t from,
const vec3_t dir,
bool crouching,
vec3_t shotOrigin)
const;
176 #define SHAPE_SMALL_MAX_WIDTH 8 177 #define SHAPE_SMALL_MAX_HEIGHT 4 188 #define SHAPE_BIG_MAX_HEIGHT 16 190 #define SHAPE_BIG_MAX_WIDTH 32 246 typedef struct craftitem_s {
258 #define MAX_DAMAGETYPES 64 264 typedef struct objDef_s {
339 uint32_t getShapeRotated ()
const;
340 bool isCraftItem ()
const;
341 bool isBaseDefenceItem ()
const;
342 bool isLoadableInWeapon (
const objDef_s* weapon)
const;
344 return Q_streq(this->type,
"ammo");
347 return Q_streq(this->type,
"armour");
353 return getReloadTime() > 0;
368 #define MAX_INVDEFS 16 371 typedef struct invDef_s {
387 bool isArmourDef ()
const;
388 bool isFloorDef ()
const;
389 bool isRightDef ()
const;
390 bool isLeftDef ()
const;
391 bool isEquipDef ()
const;
394 #define MAX_CONTAINERS MAX_INVDEFS 429 inline void setX (
const int val) {
432 inline void setY (
const int val) {
591 void findSpace (
const invDef_t* container,
const Item* item,
int*
const px,
int*
const py,
const Item* ignoredItem)
const;
603 #define MAX_EQUIPDEFS 64 605 typedef struct equipDef_s {
614 void addClip(
const Item* item);
618 #define MAX_TEAMS_PER_MISSION MAX_TEAMDEFS 620 typedef struct damageType_s {
634 #define foreachhand(hand) for (int hand##__loop = 0; hand##__loop < 2; ++hand##__loop) \ 635 if (hand = (hand##__loop == 0 ? ACTOR_HAND_RIGHT : ACTOR_HAND_LEFT), false) {} else 654 #define THIS_FIREMODE(fm, HAND, fdIdx) ((fm)->getHand() == (HAND) && (fm)->getFmIdx() == (fdIdx)) 661 #define FIRESH_IsMedikit(firedef) ((firedef)->damage[0] < 0) 662 void INVSH_MergeShapes(uint32_t* shape,
const uint32_t itemShape,
const int x,
const int y);
Item * getEquipContainer() const
bool isReloadable() const
const objDef_t * def(void) const
int getNumFiredefs() const
#define SHAPE_BIG_MAX_HEIGHT
defines the max height of an inventory container
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
inventory_action_t
Possible inventory actions for moving items between containers.
void INVSH_MergeShapes(uint32_t *shape, const uint32_t itemShape, const int x, const int y)
Will merge the second shape (=itemShape) into the first one (=big container shape) on the position x/...
const objDef_t * getReactionFireWeaponType() const
Checks whether this item is a reaction fire enabled weapon.
const implantDef_t * INVSH_GetImplantForObjDef(const objDef_t *od)
Item * getLeftHandContainer() const
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. ...
void resetContainer(const containerIndex_t idx)
bool isSameAs(const Item *const other) const
Check if the (physical) information of 2 items is exactly the same.
void setFloorContainer(Item *cont)
Item * getRightHandContainer() const
Container _containers[MAX_CONTAINERS]
short humanAircraftType_t
const fireDef_t * getFiredefs() const
Returns the firedefinitions for a given weapon/ammo.
void setContainer(const containerIndex_t idx, Item *cont)
int canHoldItem(const invDef_t *container, const objDef_t *od, const int x, const int y, const Item *ignoredItem) const
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.
Item * getNextItem(const Item *prev) const
aircraftParams_t
Aircraft parameters.
Item * findInContainer(const containerIndex_t contId, const Item *const item) const
Searches a specific item in the inventory&container.
Item * getHeadgear() const
Item()
Item constructor with all default values.
const objDef_t * _ammoDef
const objDef_t * ammoDef(void) const
itemEffect_t * strengthenEffect
inventory definition for our menus
const fireDef_t * getFastestFireDef() const
const fireDef_t * FIRESH_GetFiredef(const objDef_t *obj, const weaponFireDefIndex_t weapFdsIdx, const fireDefIndex_t fdIdx)
Get the fire definitions for a given object.
const invDef_t * INVSH_GetInventoryDefinitionByID(const char *id)
itemEffect_t * activeEffect
Item * getFloorContainer() const
const Container * _getNextCont(const Container *prev) const
const invDef_t * def() const
void setAmount(int value)
itemEffect_t * overdoseEffect
void setAmmoDef(const objDef_t *od)
int INVSH_ShapeSize(const uint32_t shape)
Counts the used bits in a shape (item shape).
#define MAX_WEAPONS_PER_OBJDEF
#define MAX_FIREDEFS_PER_WEAPON
bool isHeldTwoHanded() const
Item * getImplantContainer() const
int countItems() const
Count the number of items in the inventory (without temp containers)
item instance data, with linked list capability
Item * getContainer2(const containerIndex_t idx) const
void setDef(const objDef_t *objDef)
int countItems() const
Count the number of items in the Container.
bool INVSH_CheckShape(const uint32_t *shape, const int x, const int y)
Checks the shape if there is a 1-bit on the position x/y.
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
int getWeight() const
Return the weight of an item.
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
int32_t weaponFireDefIndex_t
const struct objDef_s * item
void findSpace(const invDef_t *container, const Item *item, int *const px, int *const py, const Item *ignoredItem) const
Finds space for item in inv at container.
void getFirstShapePosition(int *const x, int *const y) const
Calculates the first "true" bit in the shape and returns its position in the item.
void addAmount(int value)
int getReloadTime() const
const char * hitBodySound
bool isReloadable() const
#define MAX_AMMOS_PER_OBJDEF
bool holdsReactionFireWeapon() const
Checks if there is a weapon in the hands that can be used for reaction fire.
weaponFireDefIndex_t weapFdsIdx
const implantDef_t * INVSH_GetImplantByID(const char *id)
Returns the implant that belongs to the given id or nullptr if it wasn't found.
aircraftItemType_t
All different types of craft items.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void INVSH_InitCSI(const struct csi_s *import) __attribute__((nonnull))
inventory definition with all its containers
const Container & getContainer(const containerIndex_t idx) const
Defines all attributes of objects used in the inventory.
int getWeight() const
Get the weight of the items in the given inventory (excluding those in temp containers).
itemEffect_t * deactiveEffect
this is a fire definition for our weapons/ammo
bool containsItem(const containerIndex_t contId, const Item *const item) const
Searches if there is a specific item already in the inventory&container.
bool isValidContId(const containerIndex_t id)
Item * getHolsterContainer() const
const objDef_t * _itemDef
const implantDef_t * INVSH_GetImplantByIDSilent(const char *id)
Returns the implant that belongs to the given id or nullptr if it wasn't found.
const fireDef_t * getSlowestFireDef() const
Get the firedef that uses the most TU for this item.
void setAmmoLeft(int value)
const struct objDef_s * obj
const objDef_t * INVSH_GetItemByIDSilent(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
void resetTempContainers()