UFO: Alien Invasion
Loading...
Searching...
No Matches
Actor Class Reference

An Edict of type Actor. More...

#include <g_edict.h>

Inheritance diagram for Actor:
Inheritance graph
Collaboration diagram for Actor:
Collaboration graph

Public Member Functions

int getMorale () const
bool isState (int flag) const
bool isShaken () const
bool isStunned () const
bool isPanicked () const
bool isReaction () const
bool isRaged () const
bool isInsane () const
bool isDazed () const
bool isCrouched () const
bool isDead () const
void setState (int flag)
void setShaken ()
void setStunned ()
void setPanicked ()
void setReaction ()
void setRaged ()
void setInsane ()
void setDazed ()
void setCrouched ()
void unsetState (int flag)
void removeShaken ()
void removeStunned ()
void removePanicked ()
void removeReaction ()
void removeRaged ()
void removeInsane ()
void removeDazed ()
void removeCrouched ()
unsigned int getBody () const
void setBody (unsigned int body_)
unsigned int getHead () const
void setHead (unsigned int head_)
int getUsableTUs () const
 Calculates the amount of usable TUs. This is without the reserved TUs.
bool isInRescueZone () const
 Checks whether the given actor is currently standing in a rescue zone.
void setInRescueZone (bool inRescueZone_)
 Set the rescue zone flag.
Public Member Functions inherited from Edict
void init (int idx)
void setPlayerNum (int num)
void setTeam (int team_)
void setChild (Edict *child)
void nativeReset ()
void setActive ()
void toggleActive ()
void resetContainer (const containerIndex_t idx)
void setFloor (const Edict *other)
void resetFloor ()
void calcOrigin ()
 Calculate the edict's origin vector from it's grid position.
void setOrigin (const pos3_t newPos)
 Set the edict's pos and origin vector to the given grid position.
int getIdNum () const
int getPlayerNum () const
Edictchild ()
Edictowner ()
ItemgetContainer (const containerIndex_t idx) const
ItemgetArmour () const
ItemgetRightHandItem () const
ItemgetLeftHandItem () const
ItemgetHandItem (actorHands_t hand) const
ItemgetFloor () const
Player & getPlayer () const
int getTeam () const
bool isSameAs (const Edict *other) const
bool isSameTeamAs (const Edict *other) const
bool isSamePosAs (const pos3_t cmpPos)
 Check whether the edict is on the given position.
bool isOpponent (const Actor *actor) const
 Check if given actor is an enemy.
void setStun (int stu)
void addStun (int stu)
int getStun () const
void setMorale (int mor)
void setTus (int tus)
int getTus () const
void setTouch (bool(*touch_)(Edict *self, Edict *activator))
bool hasTouch () const
bool callTouch (Edict *activator)
int getReservedTUs () const
 Calculates the amount of all currently reserved TUs.

Additional Inherited Members

Data Fields inherited from Edict
bool inuse
int linkcount
int number
vec3_t origin
vec3_t angles
pos3_t pos
solid_t solid
AABB entBox
AABB absBox
vec3_t size
Edict_child
Edict_owner
int modelindex
const char * classname
int mapNum
const char * model
EdictparticleLink
const Edictlink
entity_type_t type
teammask_t visflags
int contentFlags
byte dir
int TU
int HP
int _STUN
int morale
int state
int frame
char * group
EdictclientAction
character_t chr
int spawnflags
float angle
int radius
int speed
const char * target
const char * targetname
const char * item
const char * particle
const char * nextmap
const char * message
const char * description
const char * noise
edictMaterial_t material
camera_edict_data_t camera
int count
int time
int sounds
int dmg
byte dmgtype
actorSizeEnum_t fieldSize
bool hiding
bool(* _touch )(Edict *self, Edict *activator)
void(* reset )(Edict *self, Edict *activator)
float nextthink
void(* think )(Edict *self)
bool(* use )(Edict *self, Edict *activator)
bool(* destroy )(Edict *self)
linkedList_ttouchedList
int doorState
moveinfo_t moveinfo
EdictgroupChain
EdictgroupMaster
int flags
AI_t AI
pos3_tforbiddenListPos
int forbiddenListSize
bool active
Protected Attributes inherited from Edict
int team
int pnum
unsigned int body
unsigned int head
bool inRescueZone

Detailed Description

An Edict of type Actor.

Note
Let's try to split the 'god-class' Edict into smaller chunks. Class Actor is intended to receive members and functions from Edict that are only used with actors. There will be other classes (eg. Trigger, Field, Item,...) in the future.

Definition at line 348 of file g_edict.h.

Member Function Documentation

◆ getBody()

unsigned int Actor::getBody ( ) const
inline

Definition at line 384 of file g_edict.h.

References Edict::body.

Referenced by G_EventActorAppear().

◆ getHead()

unsigned int Actor::getHead ( ) const
inline

Definition at line 390 of file g_edict.h.

References Edict::head.

Referenced by G_EventActorAppear().

◆ getMorale()

int Actor::getMorale ( ) const
inline

Definition at line 350 of file g_edict.h.

References Edict::morale.

Referenced by actorL_morale().

◆ getUsableTUs()

int Actor::getUsableTUs ( ) const
inline

Calculates the amount of usable TUs. This is without the reserved TUs.

Returns
The amount of usable TUs for the given actor edict

Definition at line 400 of file g_edict.h.

References Edict::getReservedTUs(), and Edict::getTus().

Referenced by actorL_TU(), AI_CheckForMissionTargets(), AI_CivilianCalcActionScore(), AI_FighterCalcActionScore(), AI_PanicCalcActionScore(), AI_PrepBestAction(), AI_TurnIntoDirection(), and AIL_positionshoot().

◆ isCrouched()

◆ isDazed()

bool Actor::isDazed ( ) const
inline

Definition at line 360 of file g_edict.h.

References isState(), and STATE_DAZED.

Referenced by ReactionFire::canReact(), and G_ActorGiveTimeUnits().

◆ isDead()

◆ isInRescueZone()

bool Actor::isInRescueZone ( ) const
inline

Checks whether the given actor is currently standing in a rescue zone.

Returns
true if the actor is standing in a rescue zone, false otherwise.

Definition at line 407 of file g_edict.h.

References Edict::inRescueZone.

Referenced by G_MatchSendResults(), and setInRescueZone().

◆ isInsane()

◆ isPanicked()

bool Actor::isPanicked ( ) const
inline

◆ isRaged()

bool Actor::isRaged ( ) const
inline

◆ isReaction()

bool Actor::isReaction ( ) const
inline

◆ isShaken()

bool Actor::isShaken ( ) const
inline

Definition at line 354 of file g_edict.h.

References isState(), and STATE_SHAKEN.

Referenced by G_ClientStateChange(), ReactionFire::isEnemy(), and ReactionFire::shoot().

◆ isState()

bool Actor::isState ( int flag) const
inline

◆ isStunned()

◆ removeCrouched()

void Actor::removeCrouched ( )
inline

Definition at line 382 of file g_edict.h.

References STATE_CROUCHED, and unsetState().

Referenced by G_MoralePanic().

◆ removeDazed()

void Actor::removeDazed ( )
inline

Definition at line 381 of file g_edict.h.

References STATE_DAZED, and unsetState().

Referenced by G_ActorGiveTimeUnits().

◆ removeInsane()

void Actor::removeInsane ( )
inline

Definition at line 380 of file g_edict.h.

References STATE_INSANE, and unsetState().

Referenced by G_MoraleStopPanic(), and G_MoraleStopRage().

◆ removePanicked()

void Actor::removePanicked ( )
inline

Definition at line 377 of file g_edict.h.

References STATE_PANIC, and unsetState().

Referenced by G_MoraleStopPanic().

◆ removeRaged()

void Actor::removeRaged ( )
inline

Definition at line 379 of file g_edict.h.

References STATE_RAGE, and unsetState().

Referenced by G_MoraleStopRage().

◆ removeReaction()

void Actor::removeReaction ( )
inline

Definition at line 378 of file g_edict.h.

References STATE_REACTION, and unsetState().

Referenced by ReactionFire::canReact(), G_ClientStateChange(), and G_Damage().

◆ removeShaken()

void Actor::removeShaken ( )
inline

Definition at line 375 of file g_edict.h.

References STATE_SHAKEN, and unsetState().

Referenced by G_ReactionFireReset(), and ReactionFire::tryToShoot().

◆ removeStunned()

void Actor::removeStunned ( )
inline

Definition at line 376 of file g_edict.h.

References STATE_STUN, and unsetState().

Referenced by G_ActorDie(), and G_ActorRevitalise().

◆ setBody()

void Actor::setBody ( unsigned int body_)
inline

Definition at line 387 of file g_edict.h.

References Edict::body.

Referenced by AI_InitPlayer(), and G_ClientAssignDefaultActorValues().

◆ setCrouched()

void Actor::setCrouched ( )
inline

Definition at line 372 of file g_edict.h.

References setState(), and STATE_CROUCHED.

◆ setDazed()

void Actor::setDazed ( )
inline

Definition at line 371 of file g_edict.h.

References setState(), and STATE_DAZED.

Referenced by G_Damage().

◆ setHead()

void Actor::setHead ( unsigned int head_)
inline

Definition at line 393 of file g_edict.h.

References Edict::head.

Referenced by AI_InitPlayer(), and G_ClientAssignDefaultActorValues().

◆ setInRescueZone()

void Actor::setInRescueZone ( bool inRescueZone_)
inline

Set the rescue zone flag.

Parameters
[in]inRescueZone_true if the actor is in the rescue zone, false otherwise

Definition at line 414 of file g_edict.h.

References Edict::inRescueZone, and isInRescueZone().

Referenced by Reset_RescueTrigger(), and Touch_RescueTrigger().

◆ setInsane()

void Actor::setInsane ( )
inline

Definition at line 370 of file g_edict.h.

References setState(), and STATE_INSANE.

Referenced by G_MoraleBehaviour().

◆ setPanicked()

void Actor::setPanicked ( )
inline

Definition at line 367 of file g_edict.h.

References setState(), and STATE_PANIC.

Referenced by G_MoralePanic().

◆ setRaged()

void Actor::setRaged ( )
inline

Definition at line 369 of file g_edict.h.

References setState(), and STATE_RAGE.

Referenced by G_MoraleRage().

◆ setReaction()

void Actor::setReaction ( )
inline

Definition at line 368 of file g_edict.h.

References setState(), and STATE_REACTION.

◆ setShaken()

void Actor::setShaken ( )
inline

Definition at line 365 of file g_edict.h.

References setState(), and STATE_SHAKEN.

Referenced by G_MoraleBehaviour().

◆ setState()

void Actor::setState ( int flag)
inline

Definition at line 364 of file g_edict.h.

References Edict::state.

Referenced by setCrouched(), setDazed(), setInsane(), setPanicked(), setRaged(), setReaction(), setShaken(), and setStunned().

◆ setStunned()

void Actor::setStunned ( )
inline

Definition at line 366 of file g_edict.h.

References setState(), and STATE_STUN.

◆ unsetState()

void Actor::unsetState ( int flag)
inline

The documentation for this class was generated from the following file: