42 switch (weaponSkill) {
44 return _(
"Close quarters");
54 return _(
"Explosives");
56 return _(
"Unknown weapon skill");
72 Cvar_Set(
"mn_firemodename",
"%s",
"");
139 Q_strcat(itemText,
sizeof(itemText),
"\n");
140 Q_strcat(itemText,
sizeof(itemText),
_(
"^BDamage type:\tProtection:\n"));
155 Q_strcat(itemText,
sizeof(itemText),
_(
"Max ammo:\t%i\n"), od->
ammo);
158 for (weaponIndex = 0; (weaponIndex < odAmmo->
numWeapons) && (odAmmo->
weapons[weaponIndex] != od); weaponIndex++) {}
184 Q_strcat(itemText,
sizeof(itemText),
_(
"Time units:\t%i\n"), fd->
time);
189 Com_sprintf(itemText,
sizeof(itemText),
_(
"%s. No detailed info available.\n"), od->
isAmmo() ?
_(
"Ammunition") :
_(
"Weapon"));
196 if (effect !=
nullptr) {
199 Q_strcat(itemText,
sizeof(itemText),
_(
"Period:\t%i\n"), effect->
period);
201 Q_strcat(itemText,
sizeof(itemText),
_(
"Price:\t%i c\n"), od->
price);
211 Q_strcat(itemText,
sizeof(itemText),
_(
"Action:\t%s\n"),
_(fd->
name));
212 Q_strcat(itemText,
sizeof(itemText),
_(
"Time units:\t%i\n"), fd->
time);
220 Com_sprintf(itemText,
sizeof(itemText),
_(
"Unknown - not useable"));
327 bool changeTab =
true;
342 if (var && var->
integer != filter) {
371 const int tuPenalty = tus - normalTU;
378 for (
Item* invList = cont->
_invList, *next; invList; invList = next) {
379 next = invList->getNext();
380 const fireDef_t* fireDef = invList->getFiredefs();
381 if (fireDef ==
nullptr)
384 if (fireDef[
i].time <= 0)
386 if (fireDef[
i].time <= tus)
402 (
count > 0 ?
_(
"Warning!") :
""));
403 Com_sprintf(tooltip,
sizeof(tooltip),
"%s %i (%+i)",
_(
"TU:"), tus, tuPenalty);
const char * Cmd_Argv(int arg)
Returns a given argument.
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
#define WEIGHT_NORMAL_PENALTY
static const objDef_t * currentDisplayedObject
void UI_RegisterText(int dataId, const char *text)
share a text with a data id
static void INV_DecreaseItem_f(void)
Decreases the number of the firemode to display (for ammo) or the ammo to display (for weapon) ...
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
Describes a character with all its attributes.
Shared game type headers.
void Com_Printf(const char *const fmt,...)
Header file for inventory handling and Equipment menu.
short ratings[MAX_DAMAGETYPES]
itemEffect_t * strengthenEffect
static const char * CL_WeaponSkillToName(int weaponSkill)
Translate a weaponSkill integer to a translated string.
int GAME_GetChrMaxLoad(const character_t *chr)
Returns the max weight the given character can carry.
Share stuff between the different cgame implementations.
const invDef_t * def() const
const struct objDef_s * ammos[MAX_AMMOS_PER_OBJDEF]
void UI_ResetData(int dataId)
Reset a shared data. Type became NONE and value became nullptr.
static void INV_DecreaseFiremode_f(void)
Decreases the number of the firemode to display.
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
void INV_ItemDescription(const objDef_t *od)
Prints the description for items (weapons, armour, ...)
#define MAX_FIREDEFS_PER_WEAPON
item instance data, with linked list capability
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
character_t * GAME_GetSelectedChr(void)
Returns the currently selected character.
const struct objDef_s * weapons[MAX_WEAPONS_PER_OBJDEF]
static void INV_IncreaseFiremode_f(void)
Increases the number of the firemode to display.
#define GET_ENCUMBRANCE_PENALTY(weight, max)
damageType_t dts[MAX_DAMAGETYPES]
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
fireDefIndex_t numFiredefs[MAX_WEAPONS_PER_OBJDEF]
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
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).
static void INV_IncreaseItem_f(void)
Increases the number of the weapon to display (for ammo) or the ammo to display (for weapon) ...
this is a fire definition for our weapons/ammo
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
cvar_t * Cvar_ForceSet(const char *varName, const char *value)
Will set the variable even if NOSET or LATCH.
int skills[SKILL_NUM_TYPES]
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
cvar_t * Cvar_Set(const char *varName, const char *value,...)
Sets a cvar value.
itemFilterTypes_t INV_GetFilterFromItem(const objDef_t *obj)
void INV_InitCallbacks(void)
bool GAME_ItemIsUseable(const objDef_t *od)
static void INV_UpdateActorLoad_f(void)
Update the equipment weight for the selected actor.
void Cvar_SetValue(const char *varName, float value)
Expands value to a string and calls Cvar_Set.
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
cvar_t * Cvar_FindVar(const char *varName)
Searches for a cvar given by parameter.
static void INV_UpdateObject_f(void)
Update the GUI with the selected item.
void UI_ExecuteConfunc(const char *fmt,...)
Executes confunc - just to identify those confuncs in the code - in this frame.