UFO: Alien Invasion
Loading...
Searching...
No Matches
g_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#include "g_local.h"
28
29#define G_IsState(ent, s) ((ent)->state & (s))
30#define G_IsStunned(ent) (G_IsState(ent, STATE_STUN) & ~STATE_DEAD)
31#define G_IsPanicked(ent) G_IsState(ent, STATE_PANIC)
32#define G_IsCrouched(ent) G_IsState(ent, STATE_CROUCHED)
34#define G_IsDead(ent) G_IsState(ent, STATE_DEAD)
35
36#define G_SetState(ent, s) (ent)->state |= (s)
37#define G_SetStunned(ent) G_SetState((ent), STATE_STUN)
38#define G_SetDead(ent) G_SetState((ent), STATE_DEAD)
39#define G_SetCrouched(ent) G_SetState((ent), STATE_CROUCHED)
40
41#define G_ToggleState(ent, s) (ent)->state ^= (s)
42#define G_ToggleCrouched(ent) G_ToggleState(ent, STATE_CROUCHED)
43
44bool G_IsLivingActor(const Edict* ent) __attribute__((nonnull));
45void G_ActorUseDoor(Actor* actor, Edict* door);
46void G_ActorSetClientAction(Edict* actor, Edict* ent);
47int G_ActorUsableTUs(const Edict* ent);
49void G_ActorReserveTUs(Edict* ent, int resReaction, int resShot, int resCrouch);
50int G_ActorDoTurn(Edict* ent, byte dir);
51void G_ActorSetMaxs(Actor* actor);
52int G_ActorCalculateMaxTU(const Edict* ent);
53void G_ActorGiveTimeUnits(Actor* actor);
54void G_ActorSetTU(Edict* ent, int tus);
55void G_ActorUseTU(Edict* ent, int tus);
56void G_ActorModifyCounters(const Edict* attacker, const Edict* victim, int deltaAlive, int deltaKills, int deltaStuns);
57void G_ActorGetEyeVector(const Edict* actor, vec3_t eye);
58void G_ActorCheckRevitalise(Actor* actor);
59bool G_ActorDieOrStun(Actor* actor, Edict* attacker);
61bool G_ActorInvMove(Actor* actor, const invDef_t* from, Item* fItem, const invDef_t* to, int tx, int ty, bool checkaction);
62bool G_ActorReload(Actor* actor, const invDef_t* invDef);
63int G_ActorGetModifiedTimeForFiredef(const Edict* ent, const fireDef_t* const fd, bool reaction);
An Edict of type Actor.
Definition g_edict.h:348
item instance data, with linked list capability
Definition inv_shared.h:402
#define __attribute__(x)
Definition cxx.h:37
void G_ActorReserveTUs(Edict *ent, int resReaction, int resShot, int resCrouch)
Reserves TUs for different actor actions.
Definition g_actor.cpp:136
bool G_ActorDieOrStun(Actor *actor, Edict *attacker)
Reports and handles death or stun of an actor. If the HP of an actor is zero the actor will die,...
Definition g_actor.cpp:435
bool G_ActorReload(Actor *actor, const invDef_t *invDef)
Reload weapon with actor.
Definition g_actor.cpp:714
int G_ActorGetModifiedTimeForFiredef(const Edict *ent, const fireDef_t *const fd, bool reaction)
Definition g_actor.cpp:764
void G_ActorGiveTimeUnits(Actor *actor)
Set time units for the given edict. Based on speed skills.
Definition g_actor.cpp:260
int G_ActorUsableTUs(const Edict *ent)
Calculates the amount of usable TUs. This is without the reserved TUs.
Definition g_actor.cpp:102
void G_ActorModifyCounters(const Edict *attacker, const Edict *victim, int deltaAlive, int deltaKills, int deltaStuns)
Definition g_actor.cpp:299
void G_ActorCheckRevitalise(Actor *actor)
Definition g_actor.cpp:386
void G_ActorSetClientAction(Edict *actor, Edict *ent)
Handles the client actions (interaction with the world).
Definition g_actor.cpp:82
bool G_IsLivingActor(const Edict *ent) __attribute__((nonnull))
Checks whether the given edict is a living actor.
Definition g_actor.cpp:43
void G_ActorUseDoor(Actor *actor, Edict *door)
Make the actor use (as in open/close) a door edict.
Definition g_actor.cpp:55
int G_ActorCalculateMaxTU(const Edict *ent)
Definition g_actor.cpp:247
void G_ActorSetTU(Edict *ent, int tus)
Definition g_actor.cpp:267
int G_ActorGetTUForReactionFire(const Edict *ent)
Calculates the amount of TUs that are needed for the current selected reaction fire mode.
Definition g_actor.cpp:116
void G_ActorUseTU(Edict *ent, int tus)
Definition g_actor.cpp:278
int G_ActorDoTurn(Edict *ent, byte dir)
Turns an actor around.
Definition g_actor.cpp:154
void G_ActorSetMaxs(Actor *actor)
Sets correct bounding box for actor (state dependent).
Definition g_actor.cpp:226
int G_ActorGetContentFlags(const vec3_t origin)
Get the content flags from where the actor is currently standing.
Definition g_actor.cpp:484
bool G_ActorInvMove(Actor *actor, const invDef_t *from, Item *fItem, const invDef_t *to, int tx, int ty, bool checkaction)
Moves an item inside an inventory. Floors are handled special.
Definition g_actor.cpp:506
void G_ActorGetEyeVector(const Edict *actor, vec3_t eye)
Fills a vector with the eye position of a given actor.
Definition g_actor.cpp:357
Local definitions for game module.
voidpf uLong int origin
Definition ioapi.h:45
this is a fire definition for our weapons/ammo
Definition inv_shared.h:110
inventory definition for our menus
Definition inv_shared.h:371
vec_t vec3_t[3]
Definition ufotypes.h:39