25 #include "../client.h"
44 else if (container !=
nullptr)
63 if (!weapon || !weapon->
def())
83 if (!weapon || !weapon->
def()) {
114 if (actor ==
nullptr)
151 if (actor ==
nullptr)
219 if (toContainer ==
NONE)
227 if (container ==
NONE)
250 if (!weapon || !weapon->
def()) {
283 if (actor ==
nullptr)
331 if (strlen(rest) >= 4) {
332 char const hand = rest[0];
333 int const index = atoi(rest + 3);
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.
void HUD_InitCallbacks(void)
Item * getLeftHandItem() const
static void HUD_ToggleReaction_f(void)
Toggles reaction fire states for the current selected actor.
void MSG_Write_PA(player_action_t playerAction, int entnum,...)
Writes player action with its data.
this is a fire definition for our weapons/ammo
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
weaponFireDefIndex_t weapFdsIdx
int getReloadTime() const
int HUD_CalcReloadTime(const le_t *le, const objDef_t *weapon, containerIndex_t toContainer)
Calculate total reload time for selected actor.
const fireDef_t * getFiredefs() const
Returns the firedefinitions for a given weapon/ammo.
const objDef_t * def(void) const
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
void Com_Printf(const char *const fmt,...)
static void HUD_ReloadLeft_f(void)
Reload left weapon.
Defines all attributes of objects used in the inventory.
bool holdsReactionFireWeapon() const
Checks if there is a weapon in the hands that can be used for reaction fire.
const struct objDef_s * obj
static bool HUD_CheckReload(const le_t *le, const Item *weapon, containerIndex_t container)
Check if reload is possible.
void Cmd_ExecuteString(const char *text,...)
A complete command line has been parsed, so try to execute it.
Item * getRightHandItem() const
item instance data, with linked list capability
void CL_ActorReserveTUs(const le_t *le, const reservation_types_t type, const int tus)
Replace the reserved TUs for a certain type.
static void HUD_ToggleCrouchReservation_f(void)
Toggles if the current actor reserves TUs for crouching.
const fireDef_t * HUD_GetFireDefinitionForHand(const le_t *actor, const actorHands_t hand)
Returns the fire definition of the item the actor has in the given hand.
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
int HUD_ReactionFireGetTUs(const le_t *actor)
Get the weapon firing TUs for reaction fire.
#define MAX_FIREDEFS_PER_WEAPON
int CL_ActorReservedTUs(const le_t *le, const reservation_types_t type)
Returns the amount of reserved TUs for a certain type.
static void HUD_ReloadRight_f(void)
Reload right weapon.
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
void CL_ActorReload(le_t *le, containerIndex_t containerID)
Reload weapon with actor.
Item * HUD_GetLeftHandWeapon(const le_t *actor, containerIndex_t *container)
returns the weapon the actor's left hand is touching. In case the actor holds a two handed weapon in ...
#define INVDEF(containerID)
int CL_ActorUsableTUs(const le_t *le)
Returns the amount of usable (overall-reserved) TUs for an actor.
int CL_ActorCheckAction(const le_t *le)
Checks that an action is valid.
bool isReloadable() const
static void HUD_ExecuteAction_f(void)
int CL_ActorTimeForFireDef(const le_t *le, const fireDef_t *fd, bool reaction)
Find the TUs needed for the given fireDef taking into account the actor wound penalties.
static bool HUD_CheckShooting(const le_t *le, Item *weapon)
Check if shooting is possible. i.e. The weapon has ammo and can be fired with the 'available' hands...
Item * getHandItem(actorHands_t hand) const
bool isHeldTwoHanded() const
void CL_ActorSetMode(le_t *actor, actorModes_t actorMode)
#define ACTOR_GET_HAND_INDEX(hand)
static void HUD_FireWeapon_f(void)
Starts aiming/target mode for selected left/right firemode.
int CL_ActorGetContainerForReload(Item **ammoItem, const Inventory *inv, const objDef_t *weapon)
Searches the clip with the least TU usage to put it into the weapon.
fireDefIndex_t currentSelectedFiremode
static void HUD_SetMoveMode_f(void)
void HUD_DisplayMessage(const char *text)
Displays a message on the hud.