UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_actor.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27/* vertical cursor offset */
28#define CURSOR_OFFSET UNIT_HEIGHT * 0.4
29/* distance from vertical center of grid-point to head when standing */
30#define EYE_HT_STAND UNIT_HEIGHT * 0.25
31/* distance from vertical center of grid-point to head when crouched */
32#define EYE_HT_CROUCH UNIT_HEIGHT * 0.06
33
43
44extern le_t* selActor;
45extern pos3_t truePos;
46extern pos3_t mousePos;
47
48#define ACTOR_GET_FIELDSIZE(actor) ((actor != nullptr) ? (actor)->fieldSize : ACTOR_SIZE_NORMAL)
49
50void MSG_Write_PA(player_action_t player_action, int num, ...);
51
52void ACTOR_InitStartup(void);
53
54int CL_ActorCheckAction(const le_t* le);
55void CL_ActorInvMove(const le_t* le, containerIndex_t fromContainer, int fromX, int fromY, containerIndex_t toContainer, int toX, int toY);
56
59int CL_ActorUsableTUs(const le_t* le);
61void CL_ActorReserveTUs(const le_t* le, reservation_types_t type, int tus);
62bool CL_ActorIsReactionFireOutOfRange(const le_t* shooter, const le_t* target);
63const fireDef_t* CL_ActorGetReactionFireFireDef(const le_t* shooter);
64
65int CL_ActorMoveMode(const le_t* le);
66void CL_ActorSetMode(le_t* actor, actorModes_t actorMode);
69le_t* CL_ActorGetClosest(const vec3_t origin, int team);
70bool CL_ActorSelect(le_t* le);
71bool CL_ActorSelectList(int num);
72bool CL_ActorSelectNext(void);
73bool CL_ActorSelectPrev(void);
76void CL_ActorCleanup(le_t* le);
77void CL_ActorSelectMouse(void);
78void CL_ActorReload(le_t* le, containerIndex_t containerID);
79void CL_ActorTurnMouse(void);
80void CL_ActorStartMove(le_t* le, const pos3_t to);
81void CL_ActorShoot(const le_t* le, const pos3_t at);
82int CL_ActorGetContainerForReload(Item** ic, const Inventory* inv, const objDef_t* weapon);
83void CL_ActorPlaySound(const le_t* le, actorSound_t soundType);
84float CL_ActorInjuryModifier(const le_t* le, const modifier_types_t type);
85int CL_ActorTimeForFireDef(const le_t* le, const fireDef_t* fd, bool reaction = false);
86
87void CL_ActorActionMouse(void);
88void CL_ActorSetFireDef(le_t* actor, const fireDef_t* fd);
89
90void CL_NextRound_f(void);
91
94bool CL_ActorMouseTrace(void);
95void CL_GetWorldCoordsUnderMouse(vec3_t groundIntersection, vec3_t upperTracePoint, vec3_t lowerTracePoint);
98
99bool CL_AddActor(le_t* le, entity_t* ent);
100bool CL_AddUGV(le_t* le, entity_t* ent);
101
102int CL_ActorGetNumber(const le_t* le);
103
104void CL_AddTargeting(void);
105void CL_AddPathing(void);
106void CL_AddActorPathing(void);
107void CL_ActorTargetAlign_f(void);
108
109void CL_DisplayFloorArrows(void);
reservation_types_t
Definition chr_shared.h:208
actorSound_t
Types of actor sounds being issued by CL_ActorPlaySound().
Definition chr_shared.h:218
modifier_types_t
Definition chr_shared.h:255
pos3_t mousePos
Definition cl_actor.cpp:51
pos3_t truePos
Definition cl_actor.cpp:50
le_t * selActor
Definition cl_actor.cpp:49
void CL_ActorStartMove(le_t *le, const pos3_t to)
Starts moving actor.
Definition cl_actor.cpp:847
void ACTOR_InitStartup(void)
le_t * CL_ActorGetFromCharacter(const character_t *chr)
Returns the local entity information for a character in the team list.
Definition cl_actor.cpp:141
void CL_ActorRemoveFromTeamList(le_t *le)
Removes an actor (from your team) from the team list.
Definition cl_actor.cpp:400
int CL_ActorTimeForFireDef(const le_t *le, const fireDef_t *fd, bool reaction=false)
Find the TUs needed for the given fireDef taking into account the actor wound penalties.
Definition cl_actor.cpp:342
int CL_ActorGetNumber(const le_t *le)
Returns the number of the actor in the teamlist.
Definition cl_actor.cpp:125
void CL_ActorSelectMouse(void)
Selects an actor using the mouse.
int CL_ActorCheckAction(const le_t *le)
Checks that an action is valid.
Definition cl_actor.cpp:713
int CL_ActorUsableTUs(const le_t *le)
Returns the amount of usable (overall-reserved) TUs for an actor.
Definition cl_actor.cpp:259
le_t * CL_ActorGetClosest(const vec3_t origin, int team)
Returns the actor that is closest to the given origin.
Definition cl_actor.cpp:694
void CL_ActorTurnMouse(void)
Turns the actor around without moving.
void CL_ActorSetMode(le_t *actor, actorModes_t actorMode)
Definition cl_actor.cpp:835
void CL_BattlescapeMouseDragging(void)
Scroll battlescape touchscreen-style, by clicking and dragging away.
bool CL_ActorMouseTrace(void)
Battlescape cursor positioning.
void CL_ActorSetFireDef(le_t *actor, const fireDef_t *fd)
Definition cl_actor.cpp:91
void CL_DisplayObstructionArrows(void)
Useful for debugging pathfinding.
void CL_AddTargeting(void)
Adds a target cursor when we render the world.
void CL_ActorTargetAlign_f(void)
Targets to the ground when holding the assigned button.
bool CL_ActorSelectPrev(void)
selects the previous actor
Definition cl_actor.cpp:558
void CL_NextRound_f(void)
int CL_ActorReservedTUs(const le_t *le, reservation_types_t type)
Returns the amount of reserved TUs for a certain type.
Definition cl_actor.cpp:214
void CL_InitBattlescapeMouseDragging(void)
Scroll battlescape touchscreen-style, by clicking and dragging away.
bool CL_AddUGV(le_t *le, entity_t *ent)
Adds an UGV to the render entities.
Definition cl_ugv.cpp:35
void CL_ActorReload(le_t *le, containerIndex_t containerID)
Reload weapon with actor.
Definition cl_actor.cpp:948
void CL_ActorAddToTeamList(le_t *le)
Adds the actor to the team list.
Definition cl_actor.cpp:362
int CL_ActorMoveMode(const le_t *le)
Decide how the actor will walk, taking into account autostanding.
Definition cl_actor.cpp:102
bool CL_AddActor(le_t *le, entity_t *ent)
Adds an actor to the render entities with all it's models and items.
void CL_ActorPlaySound(const le_t *le, actorSound_t soundType)
Plays various sounds on actor action.
bool CL_ActorFireModeActivated(const actorModes_t mode)
Checks whether we are in fire mode or node.
void CL_AddActorPathing(void)
Adds an actor pathing marker to the current floor when we render the world.
void CL_GetWorldCoordsUnderMouse(vec3_t groundIntersection, vec3_t upperTracePoint, vec3_t lowerTracePoint)
Get battlescape cell position under mouse cursor.
void CL_ActorReserveTUs(const le_t *le, reservation_types_t type, int tus)
Replace the reserved TUs for a certain type.
Definition cl_actor.cpp:273
void CL_ActorConditionalMoveCalc(le_t *le)
Recalculate forbidden list, available moves and actor's move length for the current selected actor.
Definition cl_actor.cpp:682
walkType_t
Definition cl_actor.h:35
@ WALKTYPE_AUTOSTAND_BUT_NOT_FAR_ENOUGH
Definition cl_actor.h:36
@ WALKTYPE_WALKING
Definition cl_actor.h:38
@ WALKTYPE_AUTOSTAND_BEING_USED
Definition cl_actor.h:37
@ WALKTYPE_MAX
Definition cl_actor.h:41
@ WALKTYPE_CROUCH_WALKING
Definition cl_actor.h:39
const fireDef_t * CL_ActorGetReactionFireFireDef(const le_t *shooter)
Definition cl_actor.cpp:171
void CL_ActorResetMoveLength(le_t *le)
Recalculates the currently selected Actor's move length.
Definition cl_actor.cpp:764
void CL_ActorShoot(const le_t *le, const pos3_t at)
Shoot with actor.
Definition cl_actor.cpp:888
void CL_ActorActionMouse(void)
initiates action with mouse.
bool CL_ActorSelect(le_t *le)
Selects an actor.
Definition cl_actor.cpp:440
void CL_ActorCleanup(le_t *le)
Definition cl_actor.cpp:389
void CL_ResetMouseLastPos(void)
bool CL_ActorIsReactionFireOutOfRange(const le_t *shooter, const le_t *target)
Definition cl_actor.cpp:199
void MSG_Write_PA(player_action_t player_action, int num,...)
Writes player action with its data.
Definition cl_actor.cpp:73
bool CL_ActorSelectList(int num)
Selects an actor from a list.
Definition cl_actor.cpp:506
void CL_AddPathing(void)
Adds a pathing marker to the current floor when we render the world.
bool CL_ActorSelectNext(void)
selects the next actor
Definition cl_actor.cpp:527
int CL_ActorGetContainerForReload(Item **ic, const Inventory *inv, const objDef_t *weapon)
Searches the clip with the least TU usage to put it into the weapon.
Definition cl_actor.cpp:916
void CL_ActorInvMove(const le_t *le, containerIndex_t fromContainer, int fromX, int fromY, containerIndex_t toContainer, int toX, int toY)
Sends an inventory move event to the server.
character_t * CL_ActorGetChr(const le_t *le)
Returns the character information for an actor in the teamlist.
Definition cl_actor.cpp:155
float CL_ActorInjuryModifier(const le_t *le, const modifier_types_t type)
Returns the actor injury modifier of the specified type.
Definition cl_actor.cpp:299
void CL_DisplayFloorArrows(void)
Useful for debugging pathfinding.
actorModes_t
Actor actions.
inventory definition with all its containers
Definition inv_shared.h:525
item instance data, with linked list capability
Definition inv_shared.h:402
int32_t containerIndex_t
Definition inv_shared.h:46
voidpf uLong int origin
Definition ioapi.h:45
const char int mode
Definition ioapi.h:41
player_action_t
Definition q_shared.h:189
QGL_EXTERN GLint GLenum type
Definition r_gl.h:94
Describes a character with all its attributes.
Definition chr_shared.h:388
this is a fire definition for our weapons/ammo
Definition inv_shared.h:110
a local entity
Defines all attributes of objects used in the inventory.
Definition inv_shared.h:264
pos_t pos3_t[3]
Definition ufotypes.h:58
vec_t vec3_t[3]
Definition ufotypes.h:39