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 * getFloorContainer() const
const char * hitBodySound
#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 * _itemDef
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()
Item constructor with all default values.
const implantDef_t * INVSH_GetImplantForObjDef(const objDef_t *od)
void setAmmoLeft(int value)
const fireDef_t * getFastestFireDef() const
const invDef_t * def() const
Defines all attributes of objects used in the inventory.
Item * getNextItem(const Item *prev) const
Item * getHolsterContainer() const
short humanAircraftType_t
void resetContainer(const containerIndex_t idx)
itemEffect_t * activeEffect
const objDef_t * ammoDef(void) const
aircraftParams_t
Aircraft parameters.
bool containsItem(const containerIndex_t contId, const Item *const item) const
Searches if there is a specific item already in the inventory&container.
int getReloadTime() const
const Container & getContainer(const containerIndex_t idx) const
Item * findInContainer(const containerIndex_t contId, const Item *const item) const
Searches a specific item in the inventory&container.
void setDef(const objDef_t *objDef)
void resetTempContainers()
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)
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. ...
this is a fire definition for our weapons/ammo
Item * getEquipContainer() const
void getFirstShapePosition(int *const x, int *const y) const
Calculates the first "true" bit in the shape and returns its position in the item.
Item * getContainer2(const containerIndex_t idx) const
bool isSameAs(const Item *const other) const
Check if the (physical) information of 2 items is exactly the same.
itemEffect_t * strengthenEffect
const struct objDef_s * item
item instance data, with linked list capability
inventory definition with all its containers
const objDef_t * _ammoDef
int getWeight() const
Return the weight of an item.
itemEffect_t * deactiveEffect
void addAmount(int value)
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
itemEffect_t * overdoseEffect
bool isReloadable() const
const fireDef_t * getSlowestFireDef() const
Get the firedef that uses the most TU for this item.
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.
inventory definition for our menus
bool isHeldTwoHanded() const
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
int countItems() const
Count the number of items in the Container.
int32_t weaponFireDefIndex_t
Container _containers[MAX_CONTAINERS]
Item * getHeadgear() const
const Container * _getNextCont(const Container *prev) const
int canHoldItem(const invDef_t *container, const objDef_t *od, const int x, const int y, const Item *ignoredItem) const
weaponFireDefIndex_t weapFdsIdx
#define MAX_AMMOS_PER_OBJDEF
Item * getImplantContainer() const
const implantDef_t * INVSH_GetImplantByID(const char *id)
Returns the implant that belongs to the given id or nullptr if it wasn't found.
int getNumFiredefs() const
aircraftItemType_t
All different types of craft items.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
int countItems() const
Count the number of items in the inventory (without temp containers)
void setAmmoDef(const objDef_t *od)
void INVSH_InitCSI(const struct csi_s *import) __attribute__((nonnull))
void setFloorContainer(Item *cont)
const fireDef_t * getFiredefs() const
Returns the firedefinitions for a given weapon/ammo.
const objDef_t * getReactionFireWeaponType() const
Checks whether this item is a reaction fire enabled weapon.
bool isReloadable() const
int getWeight() const
Get the weight of the items in the given inventory (excluding those in temp containers).
Item * getRightHandContainer() const
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 setAmount(int value)
const struct objDef_s * obj
bool isValidContId(const containerIndex_t id)
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
const implantDef_t * INVSH_GetImplantByIDSilent(const char *id)
Returns the implant that belongs to the given id or nullptr if it wasn't found.
Item * getLeftHandContainer() const
const objDef_t * def(void) const
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 setContainer(const containerIndex_t idx, Item *cont)
bool holdsReactionFireWeapon() const
Checks if there is a weapon in the hands that can be used for reaction fire.