UFO: Alien Invasion
inv_shared.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2022 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 struct csi_s;
29 
31 typedef short humanAircraftType_t;
32 #define DROPSHIP_MAX 8
33 #define INTERCEPTOR_MAX 12
34 #define AIRCRAFTTYPE_MAX (DROPSHIP_MAX + INTERCEPTOR_MAX)
35 
36 /* this is the absolute max for now */
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
45 
46 typedef int32_t containerIndex_t;
47 #define CID_RIGHT 0
48 #define CID_LEFT 1
49 #define CID_IMPLANT 2
50 #define CID_HEADGEAR 3
51 #define CID_BACKPACK 4
52 #define CID_BELT 5
53 #define CID_HOLSTER 6
54 #define CID_ARMOUR 7
55 #define CID_FLOOR 8
56 #define CID_EQUIP 9
57 #define CID_MAX 10
58 
59 inline bool isValidContId(const containerIndex_t id)
60 {
61  return (id >= 0 && id < CID_MAX);
62 }
63 
65 typedef enum {
76 
77 typedef int32_t weaponFireDefIndex_t;
78 typedef int32_t fireDefIndex_t;
79 
80 typedef enum {
87 
88 typedef struct itemEffect_s {
89  bool isPermanent;
90  int duration;
91  int period;
93  /* all in percent */
94  float accuracy;
95  float TUs;
96  float power;
97  float mind;
98  float morale;
99 } itemEffect_t;
100 
101 typedef struct implantDef_s {
102  const char* id;
103  int idx;
104  const struct objDef_s* item;
107 } implantDef_t;
108 
110 typedef struct fireDef_s {
111  const char* name;
112  const char* projectile;
113  const char* impact;
114  const char* impactSound;
115  const char* hitBody;
116  const char* hitBodySound;
117  const char* fireSound;
118  const char* bounceSound;
123  /* These values are created in Com_ParseItem and Com_AddObjectLinks.
124  * They are used for self-referencing the firedef. */
125  const struct objDef_s* obj;
134 
135  bool soundOnce;
136  bool gravity;
137  bool launched;
138  bool rolled;
139  bool reaction;
140  bool irgoggles;
143  float speed;
147  int delay;
149  int bounce;
150  float bounceFac;
151  float crouch;
152  float range;
153  int shots;
154  int ammo;
157  int time;
161  float splrad;
163  int rounds;
165  void getShotOrigin (const vec3_t from, const vec3_t dir, bool crouching, vec3_t shotOrigin) const;
166 } fireDef_t;
167 
176 #define SHAPE_SMALL_MAX_WIDTH 8
177 #define SHAPE_SMALL_MAX_HEIGHT 4
178 
188 #define SHAPE_BIG_MAX_HEIGHT 16
189 
190 #define SHAPE_BIG_MAX_WIDTH 32
191 
197 typedef enum {
198  /* weapons */
203  /* misc */
207  /* Crew */
209 
210  /* ammos */
217 
225 typedef enum {
239 
246 typedef struct craftitem_s {
248  float stats[AIR_STATS_MAX];
249  float weaponDamage;
250  float weaponSpeed;
251  float weaponDelay;
253  bool bullets;
254  bool beam;
256 } craftItem;
257 
258 #define MAX_DAMAGETYPES 64
259 
264 typedef struct objDef_s {
265  /* Common */
266  int idx;
267  const char* name;
268  const char* id;
269  const char* model;
270  const char* image;
271  const char* type;
272  const char* armourPath;
273  uint32_t shape;
275  float scale;
277  bool weapon;
280  bool headgear;
281  bool thrown;
282  bool implant;
284  bool isVirtual;
285  bool isPrimary;
287  bool isHeavy;
288  bool isMisc;
289  bool isUGVitem;
290  bool isDummy;
291 
292  /* Weapon specific. */
293  int ammo;
296  int _reload;
297  const char* reloadSound;
299  bool oneshot;
301  bool deplete;
304  int useable;
307  const struct objDef_s* ammos[MAX_AMMOS_PER_OBJDEF];
308  int numAmmos;
310  /* Firemodes (per weapon). */
311  const struct objDef_s* weapons[MAX_WEAPONS_PER_OBJDEF];
321  /* Armour specific */
322  short protection[MAX_DAMAGETYPES];
323  short ratings[MAX_DAMAGETYPES];
326  byte sx, sy;
329  /**** @todo move into campaign only structure ****/
330  /* Aircraft specific */
332  int price;
334  int size;
335  int weight;
336  bool notOnMarket;
339  uint32_t getShapeRotated () const;
340  bool isCraftItem () const;
341  bool isBaseDefenceItem () const;
342  bool isLoadableInWeapon (const objDef_s* weapon) const;
343  inline bool isAmmo () const {
344  return Q_streq(this->type, "ammo");
345  }
346  inline bool isArmour () const {
347  return Q_streq(this->type, "armour");
348  }
349  inline int getReloadTime () const {
350  return _reload;
351  }
352  inline bool isReloadable () const {
353  return getReloadTime() > 0;
354  }
355 
356 } objDef_t;
357 
361 enum {
363  INV_FITS = 1,
366 };
367 
368 #define MAX_INVDEFS 16
369 
371 typedef struct invDef_s {
372  char name[MAX_VAR];
375  bool single;
376  bool armour;
377  bool implant;
378  bool headgear;
379  bool all;
380  bool unique;
381  bool temp;
383  bool scroll;
384  uint32_t shape[SHAPE_BIG_MAX_HEIGHT];
385  int in, out;
387  bool isArmourDef () const;
388  bool isFloorDef () const;
389  bool isRightDef () const;
390  bool isLeftDef () const;
391  bool isEquipDef () const;
392 } invDef_t;
393 
394 #define MAX_CONTAINERS MAX_INVDEFS
395 
402 class Item {
406  int _x, _y;
409  int _amount;
410  int _ammoLeft;
411 public:
412  int rotated;
417  /*==================
418  * ctors
419  *==================*/
420  Item ();
421  Item (const objDef_t* _itemDef, const objDef_t* ammo = nullptr, int ammoLeft = 0);
422 
423  /*==================
424  * setters
425  *==================*/
426  inline void setNext (Item* nx) {
427  _next = nx;
428  }
429  inline void setX (const int val) {
430  _x = val;
431  }
432  inline void setY (const int val) {
433  _y = val;
434  }
435  inline void setAmmoDef (const objDef_t* od) {
436  _ammoDef = od;
437  }
438  inline void setAmount (int value) {
439  _amount = value;
440  }
441  inline void setAmmoLeft (int value) {
442  _ammoLeft = value;
443  }
444  inline void setDef(const objDef_t* objDef) {
445  _itemDef = objDef;
446  }
447 
448  /*==================
449  * getters
450  *==================*/
451  inline Item* getNext () const {
452  return _next;
453  }
454  inline int getX () const {
455  return _x;
456  }
457  inline int getY () const {
458  return _y;
459  }
460  inline const objDef_t* ammoDef (void) const {
461  return _ammoDef;
462  }
463  inline int getAmount () const {
464  return _amount;
465  }
466  inline int getAmmoLeft () const {
467  return _ammoLeft;
468  }
469  inline const objDef_t* def (void) const {
470  return _itemDef;
471  }
472 
473  /*==================
474  * checkers
475  *==================*/
476  inline bool isHeldTwoHanded() const {
477  return _itemDef->holdTwoHanded;
478  }
479  inline bool isReloadable() const {
480  return _itemDef->getReloadTime() > 0;
481  }
483  inline bool mustReload() const {
484  return isReloadable() && getAmmoLeft() <= 0;
485  }
486  inline bool isWeapon() const {
487  return _itemDef->weapon;
488  }
489  inline bool isArmour() const {
490  return _itemDef->isArmour();
491  }
492  bool isSameAs (const Item* const other) const;
493 
494  /*==================
495  * manipulators
496  *==================*/
497  inline void addAmount (int value) {
498  _amount += value;
499  }
500 
501 
502  int getWeight() const;
503  void getFirstShapePosition(int* const x, int* const y) const;
504  const objDef_t* getReactionFireWeaponType() const;
505  const fireDef_t* getFiredefs() const;
506  int getNumFiredefs() const;
507  const fireDef_t* getSlowestFireDef() const;
508  const fireDef_t* getFastestFireDef() const;
509 };
510 
512 {
513  const invDef_t* _def; /* container attributes (invDef_t) */
514 public:
515  int id;
516  Item* _invList; /* start of the list of items */
517 
518  Container();
519  const invDef_t* def () const;
520  Item* getNextItem (const Item* prev) const;
521  int countItems () const;
522 };
523 
525 class Inventory {
526 protected:
528 
530  const Container* _getNextCont (const Container* prev) const;
531 
532 public:
533  Inventory ();
534  virtual ~Inventory() {}
535  void init ();
536 
537  inline const Container& getContainer (const containerIndex_t idx) const {
538  return _containers[idx];
539  }
540 
546  inline Item* getContainer2 (const containerIndex_t idx) const {
547  return getContainer(idx)._invList;
548  }
549 
550  inline void setContainer (const containerIndex_t idx, Item* cont) {
551  _containers[idx]._invList = cont;
552  }
553 
554  inline void resetContainer (const containerIndex_t idx) {
555  _containers[idx]._invList = nullptr;
556  }
557  inline void resetTempContainers () {
558  const Container* cont = nullptr;
559  while ((cont = getNextCont(cont, true))) {
560  /* CID_FLOOR and CID_EQUIP are temp */
561  if (cont->def()->temp)
562  resetContainer(cont->id);
563  }
564  }
565 
572  inline bool containsItem (const containerIndex_t contId, const Item* const item) const {
573  return findInContainer(contId, item) ? true : false;
574  }
575 
576  Item* getArmour () const;
577  Item* getHeadgear() const;
579  Item* getRightHandContainer() const;
581  Item* getLeftHandContainer () const;
583  Item* getHolsterContainer() const;
585  Item* getEquipContainer () const;
586  Item* getImplantContainer () const;
588  Item* getFloorContainer() const;
589  void setFloorContainer(Item* cont);
590 
591  void findSpace (const invDef_t* container, const Item* item, int* const px, int* const py, const Item* ignoredItem) const;
592  Item* findInContainer (const containerIndex_t contId, const Item* const item) const;
593  Item* getItemAtPos (const invDef_t* container, const int x, const int y) const;
594  int getWeight () const;
595  int canHoldItem (const invDef_t* container, const objDef_t* od, const int x, const int y, const Item* ignoredItem) const;
596  bool canHoldItemWeight (containerIndex_t from, containerIndex_t to, const Item& item, int maxWeight) const;
597  bool holdsReactionFireWeapon () const;
599  const Container* getNextCont (const Container* prev, bool inclTemp = false) const;
600  int countItems () const;
601 };
602 
603 #define MAX_EQUIPDEFS 64
604 
605 typedef struct equipDef_s {
606  char id[MAX_VAR];
607  const char* name;
608  int numItems[MAX_OBJDEFS];
609  byte numItemsLoose[MAX_OBJDEFS];
610  int numAircraft[AIRCRAFTTYPE_MAX];
614  void addClip(const Item* item);
615 } equipDef_t;
616 
617 /* Maximum number of alien teams per alien group */
618 #define MAX_TEAMS_PER_MISSION MAX_TEAMDEFS
619 
620 typedef struct damageType_s {
621  char id[MAX_VAR];
622  bool showInMenu;
623 } damageType_t;
624 
626 typedef enum {
630 
632 } actorHands_t;
633 
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
636 
637 
638 /* ================================ */
639 /* INVENTORY MANAGEMENT FUNCTIONS */
640 /* ================================ */
641 
642 void INVSH_InitCSI(const struct csi_s* import) __attribute__((nonnull));
643 
644 const objDef_t* INVSH_GetItemByID(const char* id);
645 const objDef_t* INVSH_GetItemByIDX(int index);
646 const objDef_t* INVSH_GetItemByIDSilent(const char* id);
647 
649 const implantDef_t* INVSH_GetImplantByID(const char* id);
650 const implantDef_t* INVSH_GetImplantByIDSilent(const char* id);
651 
652 const invDef_t* INVSH_GetInventoryDefinitionByID(const char* id);
653 
654 #define THIS_FIREMODE(fm, HAND, fdIdx) ((fm)->getHand() == (HAND) && (fm)->getFmIdx() == (fdIdx))
655 
656 /* =============================== */
657 /* FIREMODE MANAGEMENT FUNCTIONS */
658 /* =============================== */
659 
660 const fireDef_t* FIRESH_GetFiredef(const objDef_t* obj, const weaponFireDefIndex_t weapFdsIdx, const fireDefIndex_t 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);
663 bool INVSH_CheckShape(const uint32_t* shape, const int x, const int y);
664 int INVSH_ShapeSize(const uint32_t shape);
int numAmmos
Definition: inv_shared.h:308
const char * impactSound
Definition: inv_shared.h:114
Item * getFloorContainer() const
Definition: inv_shared.cpp:975
const char * hitBodySound
Definition: inv_shared.h:116
craftItem craftitem
Definition: inv_shared.h:331
float impactAttenuation
Definition: inv_shared.h:121
const char * name
Definition: inv_shared.h:267
#define SHAPE_BIG_MAX_HEIGHT
defines the max height of an inventory container
Definition: inv_shared.h:188
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
Definition: inv_shared.cpp:266
inventory_action_t
Possible inventory actions for moving items between containers.
Definition: inv_shared.h:65
int minInterest
Definition: inv_shared.h:611
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/...
Definition: inv_shared.cpp:402
int _ammoLeft
Definition: inv_shared.h:410
const objDef_t * _itemDef
Definition: inv_shared.h:403
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.
Definition: inv_shared.cpp:844
float scale
Definition: inv_shared.h:275
Item()
Item constructor with all default values.
Definition: inv_shared.cpp:497
const implantDef_t * INVSH_GetImplantForObjDef(const objDef_t *od)
Definition: inv_shared.cpp:291
void setAmmoLeft(int value)
Definition: inv_shared.h:441
const fireDef_t * getFastestFireDef() const
Definition: inv_shared.cpp:624
bool soundOnce
Definition: inv_shared.h:135
const invDef_t * def() const
Definition: inv_shared.cpp:667
Defines all attributes of objects used in the inventory.
Definition: inv_shared.h:264
Item * getNextItem(const Item *prev) const
Definition: inv_shared.cpp:671
int _y
Definition: inv_shared.h:406
Item * getHolsterContainer() const
Definition: inv_shared.cpp:970
const char * image
Definition: inv_shared.h:270
short humanAircraftType_t
Definition: inv_shared.h:28
bool isArmour() const
Definition: inv_shared.h:346
bool single
Definition: inv_shared.h:375
bool implant
Definition: inv_shared.h:377
void resetContainer(const containerIndex_t idx)
Definition: inv_shared.h:554
int _x
Definition: inv_shared.h:406
float power
Definition: inv_shared.h:96
float morale
Definition: inv_shared.h:98
itemEffect_t * activeEffect
Definition: inv_shared.h:131
bool scroll
Definition: inv_shared.h:383
bool unique
Definition: inv_shared.h:380
const objDef_t * ammoDef(void) const
Definition: inv_shared.h:460
bool armour
Definition: inv_shared.h:376
effectStages_t
Definition: inv_shared.h:80
void setY(const int val)
Definition: inv_shared.h:432
int maxInterest
Definition: inv_shared.h:612
bool reaction
Definition: inv_shared.h:139
aircraftParams_t
Aircraft parameters.
Definition: inv_shared.h:225
bool mustReload() const
Definition: inv_shared.h:483
const char * armourPath
Definition: inv_shared.h:272
int installationTime
Definition: inv_shared.h:105
bool containsItem(const containerIndex_t contId, const Item *const item) const
Searches if there is a specific item already in the inventory&container.
Definition: inv_shared.h:572
int getReloadTime() const
Definition: inv_shared.h:349
bool showInMenu
Definition: inv_shared.h:622
bool isMisc
Definition: inv_shared.h:288
bool isWeapon() const
Definition: inv_shared.h:486
const Container & getContainer(const containerIndex_t idx) const
Definition: inv_shared.h:537
float accuracy
Definition: inv_shared.h:94
containerIndex_t id
Definition: inv_shared.h:373
bool isPrimary
Definition: inv_shared.h:285
bool isVirtual
Definition: inv_shared.h:284
Item * findInContainer(const containerIndex_t contId, const Item *const item) const
Searches a specific item in the inventory&container.
float speed
Definition: inv_shared.h:143
void setDef(const objDef_t *objDef)
Definition: inv_shared.h:444
void resetTempContainers()
Definition: inv_shared.h:557
float weaponDelay
Definition: inv_shared.h:251
bool headgear
Definition: inv_shared.h:280
#define __attribute__(x)
Definition: cxx.h:37
bool deplete
Definition: inv_shared.h:301
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.
Definition: inv_shared.cpp:385
vec3_t center
Definition: inv_shared.h:276
const char * fireSound
Definition: inv_shared.h:117
const invDef_t * INVSH_GetInventoryDefinitionByID(const char *id)
Definition: inv_shared.cpp:340
bool canHoldItemWeight(containerIndex_t from, containerIndex_t to, const Item &item, int maxWeight) const
Check that adding an item to the inventory won&#39;t exceed the max permitted weight. ...
Definition: inv_shared.cpp:919
this is a fire definition for our weapons/ammo
Definition: inv_shared.h:110
const char * id
Definition: inv_shared.h:268
Item * getEquipContainer() const
Definition: inv_shared.cpp:980
void getFirstShapePosition(int *const x, int *const y) const
Calculates the first "true" bit in the shape and returns its position in the item.
Definition: inv_shared.cpp:557
virtual ~Inventory()
Definition: inv_shared.h:534
int throughWall
Definition: inv_shared.h:142
char animationIndex
Definition: inv_shared.h:327
int size
Definition: inv_shared.h:334
Item * getContainer2(const containerIndex_t idx) const
Definition: inv_shared.h:546
bool isSameAs(const Item *const other) const
Check if the (physical) information of 2 items is exactly the same.
Definition: inv_shared.cpp:536
itemEffect_t * strengthenEffect
Definition: inv_shared.h:283
const struct objDef_s * item
Definition: inv_shared.h:104
item instance data, with linked list capability
Definition: inv_shared.h:402
byte dmgweight
Definition: inv_shared.h:141
const char * hitBody
Definition: inv_shared.h:115
inventory definition with all its containers
Definition: inv_shared.h:525
const char * model
Definition: inv_shared.h:269
#define MAX_DAMAGETYPES
Definition: inv_shared.h:258
#define MAX_CONTAINERS
Definition: inv_shared.h:394
const objDef_t * _ammoDef
Definition: inv_shared.h:404
bool isSecondary
Definition: inv_shared.h:286
vec2_t damage
Definition: inv_shared.h:158
void setNext(Item *nx)
Definition: inv_shared.h:426
int weaponSkill
Definition: inv_shared.h:162
float weaponSpeed
Definition: inv_shared.h:250
bool temp
Definition: inv_shared.h:381
bool weapon
Definition: inv_shared.h:277
#define MAX_VAR
Definition: shared.h:36
const char * name
Definition: inv_shared.h:607
Item * getNext() const
Definition: inv_shared.h:451
int getWeight() const
Return the weight of an item.
Definition: inv_shared.cpp:522
byte sy
Definition: inv_shared.h:326
#define MAX_OBJDEFS
Definition: inv_shared.h:37
itemEffect_t * deactiveEffect
Definition: inv_shared.h:132
void addAmount(int value)
Definition: inv_shared.h:497
int INVSH_ShapeSize(const uint32_t shape)
Counts the used bits in a shape (item shape).
Definition: inv_shared.cpp:435
float delayBetweenShots
Definition: inv_shared.h:155
bool all
Definition: inv_shared.h:379
int _amount
Definition: inv_shared.h:409
#define MAX_WEAPONS_PER_OBJDEF
Definition: inv_shared.h:40
int32_t fireDefIndex_t
Definition: inv_shared.h:78
#define MAX_FIREDEFS_PER_WEAPON
Definition: inv_shared.h:42
Aircraft items.
Definition: inv_shared.h:246
#define AIRCRAFTTYPE_MAX
Definition: inv_shared.h:34
actorHands_t
Definition: inv_shared.h:626
const char * reloadSound
Definition: inv_shared.h:297
bool isAmmo() const
Definition: inv_shared.h:343
float reloadAttenuation
Definition: inv_shared.h:298
bool implant
Definition: inv_shared.h:282
int getAmount() const
Definition: inv_shared.h:463
bool gravity
Definition: inv_shared.h:136
int numWeapons
Definition: inv_shared.h:317
vec2_t spread
Definition: inv_shared.h:146
byte dmgtype
Definition: inv_shared.h:325
itemEffect_t * overdoseEffect
Definition: inv_shared.h:133
bool isReloadable() const
Definition: inv_shared.h:352
bool headgear
Definition: inv_shared.h:378
const fireDef_t * getSlowestFireDef() const
Get the firedef that uses the most TU for this item.
Definition: inv_shared.cpp:610
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.
Definition: inv_shared.cpp:414
Item * _invList
Definition: inv_shared.h:516
inventory definition for our menus
Definition: inv_shared.h:371
bool isDummy
Definition: inv_shared.h:290
bool isHeldTwoHanded() const
Definition: inv_shared.h:476
int productionCost
Definition: inv_shared.h:333
void init()
Definition: inv_shared.cpp:703
bool launched
Definition: inv_shared.h:137
QGL_EXTERN GLuint index
Definition: r_gl.h:110
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn&#39;t found.
Definition: inv_shared.cpp:282
int countItems() const
Count the number of items in the Container.
Definition: inv_shared.cpp:681
int32_t weaponFireDefIndex_t
Definition: inv_shared.h:77
bool thrown
Definition: inv_shared.h:281
int price
Definition: inv_shared.h:332
float crouch
Definition: inv_shared.h:151
bool holdTwoHanded
Definition: inv_shared.h:278
int32_t containerIndex_t
Definition: inv_shared.h:46
Container _containers[MAX_CONTAINERS]
Definition: inv_shared.h:527
bool isHeavy
Definition: inv_shared.h:287
int _reload
Definition: inv_shared.h:296
Item * getHeadgear() const
Definition: inv_shared.cpp:965
bool oneshot
Definition: inv_shared.h:299
vec2_t spldmg
Definition: inv_shared.h:160
const Container * _getNextCont(const Container *prev) const
Definition: inv_shared.cpp:710
int bounce
Definition: inv_shared.h:149
const char * projectile
Definition: inv_shared.h:112
bool fireTwoHanded
Definition: inv_shared.h:279
int canHoldItem(const invDef_t *container, const objDef_t *od, const int x, const int y, const Item *ignoredItem) const
Definition: inv_shared.cpp:761
weaponFireDefIndex_t weapFdsIdx
Definition: inv_shared.h:126
bool rolled
Definition: inv_shared.h:138
#define MAX_AMMOS_PER_OBJDEF
Definition: inv_shared.h:41
float bounceFac
Definition: inv_shared.h:150
Item * getImplantContainer() const
Definition: inv_shared.cpp:985
aircraftItemType_t type
Definition: inv_shared.h:247
uint32_t shape
Definition: inv_shared.h:273
const implantDef_t * INVSH_GetImplantByID(const char *id)
Returns the implant that belongs to the given id or nullptr if it wasn&#39;t found.
Definition: inv_shared.cpp:326
int getNumFiredefs() const
Definition: inv_shared.cpp:597
aircraftItemType_t
All different types of craft items.
Definition: inv_shared.h:197
int rounds
Definition: inv_shared.h:163
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
int countItems() const
Count the number of items in the inventory (without temp containers)
Definition: inv_shared.cpp:741
void setAmmoDef(const objDef_t *od)
Definition: inv_shared.h:435
const char * id
Definition: inv_shared.h:102
void INVSH_InitCSI(const struct csi_s *import) __attribute__((nonnull))
void setX(const int val)
Definition: inv_shared.h:429
#define CID_MAX
Definition: inv_shared.h:57
void setFloorContainer(Item *cont)
Definition: inv_shared.cpp:950
const fireDef_t * getFiredefs() const
Returns the firedefinitions for a given weapon/ammo.
Definition: inv_shared.cpp:576
const objDef_t * getReactionFireWeaponType() const
Checks whether this item is a reaction fire enabled weapon.
Definition: inv_shared.cpp:649
bool isPermanent
Definition: inv_shared.h:89
float weaponDamage
Definition: inv_shared.h:249
bool isReloadable() const
Definition: inv_shared.h:479
int getWeight() const
Get the weight of the items in the given inventory (excluding those in temp containers).
Definition: inv_shared.cpp:937
int getX() const
Definition: inv_shared.h:454
int installationTime
Definition: inv_shared.h:252
float mind
Definition: inv_shared.h:97
Item * _next
Definition: inv_shared.h:405
vec_t vec3_t[3]
Definition: ufotypes.h:39
const char * impact
Definition: inv_shared.h:113
Item * getRightHandContainer() const
Definition: inv_shared.cpp:955
vec_t vec2_t[2]
Definition: ufotypes.h:38
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.
Definition: inv_shared.cpp:876
float splrad
Definition: inv_shared.h:161
float range
Definition: inv_shared.h:152
int getY() const
Definition: inv_shared.h:457
const char * name
Definition: inv_shared.h:111
void setAmount(int value)
Definition: inv_shared.h:438
const struct objDef_s * obj
Definition: inv_shared.h:125
const char * type
Definition: inv_shared.h:271
vec2_t shotOrg
Definition: inv_shared.h:145
bool notOnMarket
Definition: inv_shared.h:336
bool isValidContId(const containerIndex_t id)
Definition: inv_shared.h:59
fireDefIndex_t fdIdx
Definition: inv_shared.h:130
float fireAttenuation
Definition: inv_shared.h:120
int weight
Definition: inv_shared.h:335
const invDef_t * _def
Definition: inv_shared.h:513
int rotated
Definition: inv_shared.h:412
int useable
Definition: inv_shared.h:304
#define Q_streq(a, b)
Definition: shared.h:136
bool isArmour() const
Definition: inv_shared.h:489
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
Definition: inv_shared.cpp:722
int ammo
Definition: inv_shared.h:293
const implantDef_t * INVSH_GetImplantByIDSilent(const char *id)
Returns the implant that belongs to the given id or nullptr if it wasn&#39;t found.
Definition: inv_shared.cpp:307
Item * getLeftHandContainer() const
Definition: inv_shared.cpp:960
Item * getArmour() const
Definition: inv_shared.cpp:990
const objDef_t * def(void) const
Definition: inv_shared.h:469
const char * bounceSound
Definition: inv_shared.h:118
uint8_t byte
Definition: ufotypes.h:34
const objDef_t * INVSH_GetItemByIDSilent(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn&#39;t found.
Definition: inv_shared.cpp:249
bool beam
Definition: inv_shared.h:254
void setContainer(const containerIndex_t idx, Item *cont)
Definition: inv_shared.h:550
int getAmmoLeft() const
Definition: inv_shared.h:466
bool irgoggles
Definition: inv_shared.h:140
bool holdsReactionFireWeapon() const
Checks if there is a weapon in the hands that can be used for reaction fire.
bool bullets
Definition: inv_shared.h:253
bool isUGVitem
Definition: inv_shared.h:289
vec_t vec4_t[4]
Definition: ufotypes.h:40
vec4_t beamColor
Definition: inv_shared.h:255