UFO: Alien Invasion
|
Trigger functions. More...
#include "g_trigger.h"
#include "g_client.h"
#include "g_combat.h"
#include "g_actor.h"
#include "g_edicts.h"
#include "g_match.h"
#include "g_spawn.h"
#include "g_utils.h"
#include "g_health.h"
Go to the source code of this file.
Macros | |
#define | TRIGGER_TOUCH_ONCE (1 << 0) |
Functions | |
bool | G_TriggerIsInList (Edict *self, Edict *activator) |
Checks whether the activator of this trigger_touch was already recognized. More... | |
void | G_TriggerAddToList (Edict *self, Edict *activator) |
Adds the activator to the list of recognized edicts for this trigger_touch edict. More... | |
bool | G_TriggerRemoveFromList (Edict *self, Edict *activator) |
Removes an activator from the list of recognized edicts. More... | |
Edict * | G_TriggerSpawn (Edict *owner) |
static bool | Touch_NextMapTrigger (Edict *self, Edict *activator) |
Next map trigger that is going to get active once all opponents are killed. More... | |
void | Think_NextMapTrigger (Edict *self) |
Register this think function once you would like to end the match This think function will register the touch callback and spawns the particles for the client to see the next map trigger. More... | |
void | SP_trigger_nextmap (Edict *ent) |
bool | Touch_HurtTrigger (Edict *self, Edict *activator) |
Hurt trigger. More... | |
void | SP_trigger_hurt (Edict *ent) |
Trigger for grid fields if they are under fire. More... | |
static bool | Touch_TouchTrigger (Edict *self, Edict *activator) |
Touch trigger. More... | |
static void | Reset_TouchTrigger (Edict *self, Edict *activator) |
void | SP_trigger_touch (Edict *ent) |
Touch trigger to call the use function of the attached target. More... | |
static bool | Touch_RescueTrigger (Edict *self, Edict *activator) |
Rescue trigger. More... | |
static void | Reset_RescueTrigger (Edict *self, Edict *activator) |
void | SP_trigger_rescue (Edict *ent) |
Rescue trigger to mark an actor to be in the rescue zone. Aborting a game would not kill the actors inside this trigger area. More... | |
Trigger functions.
Definition in file g_trigger.cpp.
#define TRIGGER_TOUCH_ONCE (1 << 0) |
Definition at line 274 of file g_trigger.cpp.
Referenced by Reset_TouchTrigger(), and Touch_TouchTrigger().
Adds the activator to the list of recognized edicts for this trigger_touch edict.
self | The trigger self pointer |
activator | The activating edict (might be nullptr) |
Definition at line 67 of file g_trigger.cpp.
References linkedList_t::data, G_TagMalloc, G_TriggerIsInList(), linkedList_t::next, and TAG_LEVEL.
Referenced by G_TouchTriggers(), and Touch_Breakable().
Checks whether the activator of this trigger_touch was already recognized.
self | The trigger self pointer |
activator | The activating edict (might be nullptr) |
true
if the activator is already in the list of recognized edicts or no activator was given, false
if the activator is not yet part of the list Definition at line 47 of file g_trigger.cpp.
References linkedList_t::data, and linkedList_t::next.
Referenced by G_ResetTriggers(), and G_TriggerAddToList().
Removes an activator from the list of recognized edicts.
self | The trigger self pointer |
activator | The activating edict (might be nullptr) |
true
if removal was successful or not needed, false
if the activator wasn't found in the list Definition at line 87 of file g_trigger.cpp.
References linkedList_t::data, G_MemFree, and linkedList_t::next.
Referenced by Destroy_Breakable(), and G_ResetTriggers().
Definition at line 106 of file g_trigger.cpp.
References Edict::_owner, Edict::absBox, Edict::entBox, ET_TRIGGER, AABB::expandXY(), G_Spawn(), gi, Edict::reset, AABB::set(), Edict::solid, SOLID_TRIGGER, Edict::type, and UNIT_SIZE.
Referenced by SP_func_door().
Definition at line 359 of file g_trigger.cpp.
References G_IsActor, makeActor(), and Actor::setInRescueZone().
Referenced by SP_trigger_rescue().
Definition at line 306 of file g_trigger.cpp.
References FL_CLIENTACTION, G_ActorSetClientAction(), G_UseEdict(), and TRIGGER_TOUCH_ONCE.
Referenced by SP_trigger_touch().
Trigger for grid fields if they are under fire.
Definition at line 255 of file g_trigger.cpp.
References Edict::classname, game_import_s::csi, csi_s::damFire, Edict::dmg, Edict::dmgtype, ET_TRIGGER_HURT, gi, Edict::model, Edict::reset, Edict::setChild(), Edict::setTouch(), Edict::solid, SOLID_TRIGGER, Touch_HurtTrigger(), and Edict::type.
Definition at line 171 of file g_trigger.cpp.
References Edict::classname, ET_TRIGGER_NEXTMAP, G_FreeEdict(), G_IsMultiPlayer, gi, level, level_locals_s::mapname, Edict::model, Edict::nextmap, Edict::particle, Q_streq, Edict::reset, Edict::setChild(), Edict::solid, SOLID_TRIGGER, and Edict::type.
Rescue trigger to mark an actor to be in the rescue zone. Aborting a game would not kill the actors inside this trigger area.
Definition at line 375 of file g_trigger.cpp.
References Edict::classname, ET_TRIGGER_RESCUE, G_FreeEdict(), G_IsMultiPlayer, gi, Edict::model, Edict::reset, Reset_RescueTrigger(), Edict::setChild(), Edict::setTouch(), Edict::solid, SOLID_TRIGGER, Edict::spawnflags, Touch_RescueTrigger(), and Edict::type.
Touch trigger to call the use function of the attached target.
Definition at line 320 of file g_trigger.cpp.
References Edict::classname, ET_TRIGGER_TOUCH, G_FreeEdict(), gi, Edict::model, Edict::reset, Reset_TouchTrigger(), Edict::setChild(), Edict::setTouch(), Edict::solid, SOLID_TRIGGER, Edict::target, Touch_TouchTrigger(), and Edict::type.
Register this think function once you would like to end the match This think function will register the touch callback and spawns the particles for the client to see the next map trigger.
Definition at line 153 of file g_trigger.cpp.
References _, G_EventCenterViewAt(), G_SpawnParticle(), gi, PM_ALL, PRINT_HUD, Touch_NextMapTrigger(), and VecToPos.
Referenced by G_MatchEndTrigger().
Hurt trigger.
Definition at line 212 of file g_trigger.cpp.
References Edict::addStun(), Edict::chr, game_import_s::csi, csi_s::damShock, csi_s::damStunElectro, csi_s::damStunGas, Edict::dmgtype, G_ApplyProtection(), G_CheckDeathOrKnockout(), G_DamageActor(), G_EventSpawnSound(), G_IsLivingActor(), G_PlayerToPM, character_s::gender, teamDef_s::getActorSound(), Edict::getPlayer(), gi, makeActor(), teamDef_s::robot, SND_HURT, and character_s::teamDef.
Referenced by SP_misc_fire(), SP_misc_smoke(), SP_misc_smokestun(), and SP_trigger_hurt().
Next map trigger that is going to get active once all opponents are killed.
Definition at line 131 of file g_trigger.cpp.
References _, Com_sprintf(), level_locals_s::day, G_ClientPrintf(), G_MatchEndTrigger(), G_TagMalloc, Edict::getPlayer(), Edict::isSameTeamAs(), level, level_locals_s::mapEndCommand, MAX_VAR, level_locals_s::nextMapSwitch, PRINT_HUD, Q_strncpyz(), and TAG_GAME.
Referenced by Think_NextMapTrigger().
Rescue trigger.
Definition at line 345 of file g_trigger.cpp.
References G_IsActor, G_IsDead, makeActor(), and Actor::setInRescueZone().
Referenced by SP_trigger_rescue().
Touch trigger.
Definition at line 280 of file g_trigger.cpp.
References FL_CLIENTACTION, G_ActorSetClientAction(), G_EdictsFindTargetEntity(), G_FreeEdict(), G_IsDead, G_UseEdict(), gi, Edict::owner(), and TRIGGER_TOUCH_ONCE.
Referenced by SP_trigger_touch().