UFO: Alien Invasion
Loading...
Searching...
No Matches
inv_shared.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24*/
25
26#pragma once
27
28struct csi_s;
29
31typedef 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
46typedef 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
59inline bool isValidContId(const containerIndex_t id)
60{
61 return (id >= 0 && id < CID_MAX);
62}
63
76
77typedef int32_t weaponFireDefIndex_t;
78typedef int32_t fireDefIndex_t;
79
87
88typedef struct itemEffect_s {
91 int period;
92
93 /* all in percent */
94 float accuracy;
95 float TUs;
96 float power;
97 float mind;
98 float morale;
100
101typedef struct implantDef_s {
102 const char* id;
103 int idx;
104 const struct objDef_s* item;
108
110typedef 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;
119
122
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
136 bool gravity;
137 bool launched;
138 bool rolled;
139 bool reaction;
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;
164
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
190#define SHAPE_BIG_MAX_WIDTH 32
191
217
239
257
258#define MAX_DAMAGETYPES 64
259
264typedef 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;
274
275 float scale;
277 bool weapon;
280 bool headgear;
281 bool thrown;
282 bool implant;
288 bool isMisc;
291
292 /* Weapon specific. */
293 int ammo;
297 const char* reloadSound;
299 bool oneshot;
301 bool deplete;
303
306
307 const struct objDef_s* ammos[MAX_AMMOS_PER_OBJDEF];
309
310 /* Firemodes (per weapon). */
311 const struct objDef_s* weapons[MAX_WEAPONS_PER_OBJDEF];
319
320
321 /* Armour specific */
324
326 byte sx, sy;
328
329 /**** @todo move into campaign only structure ****/
330 /* Aircraft specific */
332 int price;
334 int size;
335 int weight;
337
338
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
361enum {
366};
367
368#define MAX_INVDEFS 16
369
371typedef 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;
385 int in, out;
386
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
402class Item {
406 int _x, _y;
411public:
415
416
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 }
482
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) */
514public:
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
526protected:
528
530 const Container* _getNextCont (const Container* prev) const;
531
532public:
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;
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
605typedef struct equipDef_s {
606 char id[MAX_VAR];
607 const char* name;
613
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
620typedef struct damageType_s {
621 char id[MAX_VAR];
624
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
642void INVSH_InitCSI(const struct csi_s* import) __attribute__((nonnull));
643
644const objDef_t* INVSH_GetItemByID(const char* id);
646const objDef_t* INVSH_GetItemByIDSilent(const char* id);
647
649const implantDef_t* INVSH_GetImplantByID(const char* id);
650const implantDef_t* INVSH_GetImplantByIDSilent(const char* id);
651
652const 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
660const 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)
662void INVSH_MergeShapes(uint32_t* shape, const uint32_t itemShape, const int x, const int y);
663bool INVSH_CheckShape(const uint32_t* shape, const int x, const int y);
664int INVSH_ShapeSize(const uint32_t shape);
int countItems() const
Count the number of items in the Container.
Item * _invList
Definition inv_shared.h:516
const invDef_t * _def
Definition inv_shared.h:513
Item * getNextItem(const Item *prev) const
const invDef_t * def() const
Item * getLeftHandContainer() const
int countItems() const
Count the number of items in the inventory (without temp containers).
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
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 * getFloorContainer() const
bool holdsReactionFireWeapon() const
Checks if there is a weapon in the hands that can be used for reaction fire.
virtual ~Inventory()
Definition inv_shared.h:534
void resetTempContainers()
Definition inv_shared.h:557
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.
Item * getRightHandContainer() const
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
Container _containers[MAX_CONTAINERS]
Definition inv_shared.h:527
Item * getEquipContainer() const
int getWeight() const
Get the weight of the items in the given inventory (excluding those in temp containers).
void setContainer(const containerIndex_t idx, Item *cont)
Definition inv_shared.h:550
Item * getHolsterContainer() const
Item * getArmour() const
Item * getImplantContainer() const
void resetContainer(const containerIndex_t idx)
Definition inv_shared.h:554
Item * getHeadgear() const
void setFloorContainer(Item *cont)
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 Container & getContainer(const containerIndex_t idx) const
Definition inv_shared.h:537
Item * getContainer2(const containerIndex_t idx) const
Definition inv_shared.h:546
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
Item * findInContainer(const containerIndex_t contId, const Item *const item) const
Searches a specific item in the inventory&container.
void init()
item instance data, with linked list capability
Definition inv_shared.h:402
bool isArmour() const
Definition inv_shared.h:489
const objDef_t * ammoDef(void) const
Definition inv_shared.h:460
int getAmmoLeft() const
Definition inv_shared.h:466
Item()
Item constructor with all default values.
int getX() const
Definition inv_shared.h:454
void setAmount(int value)
Definition inv_shared.h:438
void setAmmoDef(const objDef_t *od)
Definition inv_shared.h:435
void addAmount(int value)
Definition inv_shared.h:497
int rotated
Definition inv_shared.h:412
bool mustReload() const
Definition inv_shared.h:483
const objDef_t * _itemDef
Definition inv_shared.h:403
int getAmount() const
Definition inv_shared.h:463
int _ammoLeft
Definition inv_shared.h:410
void setDef(const objDef_t *objDef)
Definition inv_shared.h:444
int _x
Definition inv_shared.h:406
const fireDef_t * getFastestFireDef() const
const objDef_t * def(void) const
Definition inv_shared.h:469
void setY(const int val)
Definition inv_shared.h:432
const fireDef_t * getSlowestFireDef() const
Get the firedef that uses the most TU for this item.
int getY() const
Definition inv_shared.h:457
void setX(const int val)
Definition inv_shared.h:429
Item * _next
Definition inv_shared.h:405
const objDef_t * _ammoDef
Definition inv_shared.h:404
int _y
Definition inv_shared.h:406
int _amount
Definition inv_shared.h:409
int getWeight() const
Return the weight of an item.
bool isWeapon() const
Definition inv_shared.h:486
const fireDef_t * getFiredefs() const
Returns the firedefinitions for a given weapon/ammo.
bool isSameAs(const Item *const other) const
Check if the (physical) information of 2 items is exactly the same.
void setNext(Item *nx)
Definition inv_shared.h:426
void getFirstShapePosition(int *const x, int *const y) const
Calculates the first "true" bit in the shape and returns its position in the item.
const objDef_t * getReactionFireWeaponType() const
Checks whether this item is a reaction fire enabled weapon.
bool isReloadable() const
Definition inv_shared.h:479
int getNumFiredefs() const
void setAmmoLeft(int value)
Definition inv_shared.h:441
bool isHeldTwoHanded() const
Definition inv_shared.h:476
Item * getNext() const
Definition inv_shared.h:451
#define __attribute__(x)
Definition cxx.h:37
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
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/...
#define AIRCRAFTTYPE_MAX
Definition inv_shared.h:34
aircraftParams_t
Aircraft parameters.
Definition inv_shared.h:225
@ AIR_STATS_MAX
Definition inv_shared.h:237
@ AIR_STATS_ECM
Definition inv_shared.h:229
@ AIR_STATS_ANTIMATTER
Definition inv_shared.h:235
@ AIR_STATS_FUELSIZE
Definition inv_shared.h:232
@ AIR_STATS_WRANGE
Definition inv_shared.h:233
@ AIR_STATS_ACCURACY
Definition inv_shared.h:231
@ AIR_STATS_SPEED
Definition inv_shared.h:226
@ AIR_STATS_DAMAGE
Definition inv_shared.h:230
@ AIR_STATS_SHIELD
Definition inv_shared.h:228
@ AIR_STATS_MAXSPEED
Definition inv_shared.h:227
#define MAX_CONTAINERS
Definition inv_shared.h:394
const implantDef_t * INVSH_GetImplantByID(const char *id)
Returns the implant that belongs to the given id or nullptr if it wasn't found.
int32_t weaponFireDefIndex_t
Definition inv_shared.h:77
@ INV_FITS
Definition inv_shared.h:363
@ INV_DOES_NOT_FIT
Definition inv_shared.h:362
@ INV_FITS_ONLY_ROTATED
Definition inv_shared.h:364
@ INV_FITS_BOTH
Definition inv_shared.h:365
#define MAX_AMMOS_PER_OBJDEF
Definition inv_shared.h:41
int32_t fireDefIndex_t
Definition inv_shared.h:78
#define CID_MAX
Definition inv_shared.h:57
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.
aircraftItemType_t
All different types of craft items.
Definition inv_shared.h:197
@ AC_ITEM_WEAPON
Definition inv_shared.h:201
@ AC_ITEM_AMMO_LASER
Definition inv_shared.h:213
@ AC_ITEM_AMMO
Definition inv_shared.h:211
@ MAX_ACITEMS
Definition inv_shared.h:215
@ AC_ITEM_PILOT
Definition inv_shared.h:208
@ AC_ITEM_BASE_LASER
Definition inv_shared.h:200
@ AC_ITEM_ELECTRONICS
Definition inv_shared.h:205
@ AC_ITEM_SHIELD
Definition inv_shared.h:204
@ AC_ITEM_AMMO_MISSILE
Definition inv_shared.h:212
@ AC_ITEM_BASE_MISSILE
Definition inv_shared.h:199
int32_t containerIndex_t
Definition inv_shared.h:46
const implantDef_t * INVSH_GetImplantForObjDef(const objDef_t *od)
#define MAX_FIREDEFS_PER_WEAPON
Definition inv_shared.h:42
short humanAircraftType_t
Definition inv_shared.h:31
#define SHAPE_BIG_MAX_HEIGHT
defines the max height of an inventory container
Definition inv_shared.h:188
#define MAX_DAMAGETYPES
Definition inv_shared.h:258
effectStages_t
Definition inv_shared.h:80
@ EFFECT_ACTIVE
Definition inv_shared.h:81
@ EFFECT_INACTIVE
Definition inv_shared.h:82
@ EFFECT_MAX
Definition inv_shared.h:85
@ EFFECT_STRENGTHEN
Definition inv_shared.h:84
@ EFFECT_OVERDOSE
Definition inv_shared.h:83
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 * FIRESH_GetFiredef(const objDef_t *obj, const weaponFireDefIndex_t weapFdsIdx, const fireDefIndex_t fdIdx)
Get the fire definitions for a given object.
int INVSH_ShapeSize(const uint32_t shape)
Counts the used bits in a shape (item shape).
bool isValidContId(const containerIndex_t id)
Definition inv_shared.h:59
void INVSH_InitCSI(const struct csi_s *import) __attribute__((nonnull))
#define MAX_WEAPONS_PER_OBJDEF
Definition inv_shared.h:40
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
inventory_action_t
Possible inventory actions for moving items between containers.
Definition inv_shared.h:65
@ IA_NONE
Definition inv_shared.h:66
@ IA_NORELOAD
Definition inv_shared.h:74
@ IA_MOVE
Definition inv_shared.h:68
@ IA_ARMOUR
Definition inv_shared.h:69
@ IA_NOTIME
Definition inv_shared.h:73
@ IA_RELOAD
Definition inv_shared.h:70
@ IA_RELOAD_SWAP
Definition inv_shared.h:71
const invDef_t * INVSH_GetInventoryDefinitionByID(const char *id)
actorHands_t
Definition inv_shared.h:626
@ ACTOR_HAND_LEFT
Definition inv_shared.h:629
@ ACTOR_HAND_NOT_SET
Definition inv_shared.h:627
@ ACTOR_HAND_ENSURE_32BIT
Definition inv_shared.h:631
@ ACTOR_HAND_RIGHT
Definition inv_shared.h:628
#define MAX_OBJDEFS
Definition inv_shared.h:37
const objDef_t * INVSH_GetItemByIDSilent(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
QGL_EXTERN GLuint index
Definition r_gl.h:110
#define Q_streq(a, b)
Definition shared.h:136
#define MAX_VAR
Definition shared.h:36
Aircraft items.
Definition inv_shared.h:246
float stats[AIR_STATS_MAX]
Definition inv_shared.h:248
int installationTime
Definition inv_shared.h:252
aircraftItemType_t type
Definition inv_shared.h:247
float weaponDelay
Definition inv_shared.h:251
vec4_t beamColor
Definition inv_shared.h:255
bool bullets
Definition inv_shared.h:253
float weaponSpeed
Definition inv_shared.h:250
float weaponDamage
Definition inv_shared.h:249
const char * name
Definition inv_shared.h:607
int numItems[MAX_OBJDEFS]
Definition inv_shared.h:608
int minInterest
Definition inv_shared.h:611
byte numItemsLoose[MAX_OBJDEFS]
Definition inv_shared.h:609
int numAircraft[AIRCRAFTTYPE_MAX]
Definition inv_shared.h:610
int maxInterest
Definition inv_shared.h:612
void addClip(const Item *item)
Combine the rounds of partially used clips.
this is a fire definition for our weapons/ammo
Definition inv_shared.h:110
fireDefIndex_t fdIdx
Definition inv_shared.h:130
float fireAttenuation
Definition inv_shared.h:120
itemEffect_t * activeEffect
Definition inv_shared.h:131
itemEffect_t * deactiveEffect
Definition inv_shared.h:132
const char * fireSound
Definition inv_shared.h:117
const char * name
Definition inv_shared.h:111
float crouch
Definition inv_shared.h:151
byte dmgweight
Definition inv_shared.h:141
const struct objDef_s * obj
Definition inv_shared.h:125
itemEffect_t * overdoseEffect
Definition inv_shared.h:133
bool irgoggles
Definition inv_shared.h:140
vec2_t damage
Definition inv_shared.h:158
bool reaction
Definition inv_shared.h:139
int weaponSkill
Definition inv_shared.h:162
float splrad
Definition inv_shared.h:161
vec2_t spldmg
Definition inv_shared.h:160
float speed
Definition inv_shared.h:143
const char * projectile
Definition inv_shared.h:112
float delayBetweenShots
Definition inv_shared.h:155
const char * hitBodySound
Definition inv_shared.h:116
const char * bounceSound
Definition inv_shared.h:118
const char * impact
Definition inv_shared.h:113
vec2_t shotOrg
Definition inv_shared.h:145
int throughWall
Definition inv_shared.h:142
weaponFireDefIndex_t weapFdsIdx
Definition inv_shared.h:126
vec2_t spread
Definition inv_shared.h:146
float bounceFac
Definition inv_shared.h:150
bool soundOnce
Definition inv_shared.h:135
const char * impactSound
Definition inv_shared.h:114
float impactAttenuation
Definition inv_shared.h:121
const char * hitBody
Definition inv_shared.h:115
void getShotOrigin(const vec3_t from, const vec3_t dir, bool crouching, vec3_t shotOrigin) const
float range
Definition inv_shared.h:152
bool rolled
Definition inv_shared.h:138
bool launched
Definition inv_shared.h:137
bool gravity
Definition inv_shared.h:136
const struct objDef_s * item
Definition inv_shared.h:104
int installationTime
Definition inv_shared.h:105
const char * id
Definition inv_shared.h:102
inventory definition for our menus
Definition inv_shared.h:371
bool isFloorDef() const
Checks whether the inventory definition is the floor.
uint32_t shape[SHAPE_BIG_MAX_HEIGHT]
Definition inv_shared.h:384
bool scroll
Definition inv_shared.h:383
char name[MAX_VAR]
Definition inv_shared.h:372
bool isArmourDef() const
Checks whether a given inventory definition is of special type.
bool isLeftDef() const
Checks whether a given inventory definition is of special type.
bool unique
Definition inv_shared.h:380
bool headgear
Definition inv_shared.h:378
bool isEquipDef() const
Checks whether a given inventory definition is of special type.
containerIndex_t id
Definition inv_shared.h:373
bool single
Definition inv_shared.h:375
bool implant
Definition inv_shared.h:377
bool isRightDef() const
Checks whether the inventory definition is the right Hand.
bool temp
Definition inv_shared.h:381
bool armour
Definition inv_shared.h:376
float accuracy
Definition inv_shared.h:94
bool isPermanent
Definition inv_shared.h:89
Defines all attributes of objects used in the inventory.
Definition inv_shared.h:264
bool isUGVitem
Definition inv_shared.h:289
bool isAmmo() const
Definition inv_shared.h:343
const char * armourPath
Definition inv_shared.h:272
const struct objDef_s * ammos[MAX_AMMOS_PER_OBJDEF]
Definition inv_shared.h:307
int getReloadTime() const
Definition inv_shared.h:349
uint32_t getShapeRotated() const
Rotates a shape definition 90 degree to the left (CCW).
bool isVirtual
Definition inv_shared.h:284
const char * type
Definition inv_shared.h:271
bool holdTwoHanded
Definition inv_shared.h:278
uint32_t shape
Definition inv_shared.h:273
bool isPrimary
Definition inv_shared.h:285
bool deplete
Definition inv_shared.h:301
bool isBaseDefenceItem() const
Checks whether the item is a basedefence item.
int productionCost
Definition inv_shared.h:333
bool weapon
Definition inv_shared.h:277
bool headgear
Definition inv_shared.h:280
bool oneshot
Definition inv_shared.h:299
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
Definition inv_shared.h:314
bool isSecondary
Definition inv_shared.h:286
bool isDummy
Definition inv_shared.h:290
fireDefIndex_t numFiredefs[MAX_WEAPONS_PER_OBJDEF]
Definition inv_shared.h:315
byte dmgtype
Definition inv_shared.h:325
itemEffect_t * strengthenEffect
Definition inv_shared.h:283
short protection[MAX_DAMAGETYPES]
Definition inv_shared.h:322
int _reload
Definition inv_shared.h:296
bool isLoadableInWeapon(const objDef_s *weapon) const
Checks if an item can be used to reload a weapon.
int numAmmos
Definition inv_shared.h:308
bool fireTwoHanded
Definition inv_shared.h:279
bool notOnMarket
Definition inv_shared.h:336
const char * image
Definition inv_shared.h:270
short ratings[MAX_DAMAGETYPES]
Definition inv_shared.h:323
bool isReloadable() const
Definition inv_shared.h:352
char animationIndex
Definition inv_shared.h:327
craftItem craftitem
Definition inv_shared.h:331
bool isHeavy
Definition inv_shared.h:287
const char * model
Definition inv_shared.h:269
bool implant
Definition inv_shared.h:282
vec3_t center
Definition inv_shared.h:276
const char * id
Definition inv_shared.h:268
bool isMisc
Definition inv_shared.h:288
bool thrown
Definition inv_shared.h:281
bool isArmour() const
Definition inv_shared.h:346
float reloadAttenuation
Definition inv_shared.h:298
float scale
Definition inv_shared.h:275
int numWeapons
Definition inv_shared.h:317
const struct objDef_s * weapons[MAX_WEAPONS_PER_OBJDEF]
Definition inv_shared.h:311
const char * reloadSound
Definition inv_shared.h:297
bool isCraftItem() const
Checks whether a given item is an aircraftitem item.
int useable
Definition inv_shared.h:304
const char * name
Definition inv_shared.h:267
vec_t vec3_t[3]
Definition ufotypes.h:39
vec_t vec4_t[4]
Definition ufotypes.h:40
vec_t vec2_t[2]
Definition ufotypes.h:38