61 if (!self->item && self->count) {
62 if (self->targetname) {
63 gi.BroadcastPrintf(
PRINT_HUD,
_(
"%s forces are attacking the %s!"), actorTeam, self->targetname);
66 gi.BroadcastPrintf(
PRINT_HUD,
_(
"%s forces are attacking %s target zone!"),
78 if (self->isSameTeamAs(actor)) {
86 touched = touched->
next;
89 if (self->targetname) {
90 gi.BroadcastPrintf(
PRINT_HUD,
_(
"%s forces have occupied the %s!"), actorTeam, self->targetname);
92 gi.BroadcastPrintf(
PRINT_HUD,
_(
"%s forces have occupied their target zone!"), actorTeam);
102 Item* item =
nullptr;
111 if (self->targetname) {
112 gi.BroadcastPrintf(
PRINT_HUD,
_(
"The %s was placed at the %s."), item->
def()->
name,
self->targetname);
127 if (!self->time || self->item)
132 if (self->isSameTeamAs(ent) && !(
G_IsDead(ent) || ent == activator)) {
135 touched = touched->
next;
137 if (activator->
getTeam() ==
self->getTeam()) {
139 if (self->targetname)
140 gi.BroadcastPrintf(
PRINT_HUD,
_(
"%s forces have left the %s!"), actTeam, self->targetname);
142 gi.BroadcastPrintf(
PRINT_HUD,
_(
"%s forces have left their target zone!"), actTeam);
155 gi.DPrintf(
"Target '%s' wasn't found for misc_mission\n", self->target);
165 self->target =
nullptr;
167 }
else if (target->
use)
168 target->
use(target, activator);
177 if (self->isSameTeamAs(ent) && !
G_IsDead(ent))
179 touched = touched->
next;
195 if (self->particle) {
196 self->link =
G_SpawnParticle(self->origin, self->spawnflags, self->particle);
199 self->particle =
nullptr;
216 for (; ic; ic = ic->
getNext()) {
239 if (!chain->
count || endTime < chain->time ||
240 (endTime == chain->
time && spawnIndex < currentIndex))
251 const bool endMission =
self->
target ==
nullptr;
254 const int team =
self->getTeam();
260 if (chain->
item !=
nullptr) {
262 if (item !=
nullptr) {
271 if (chain->
link !=
nullptr) {
273 if (particle !=
nullptr) {
277 chain->
link =
nullptr;
282 const char* msg = chain->
message;
void G_MissionAddVictoryMessage(const char *message)
void G_MatchEndTrigger(int team, int timeGap)
Triggers the end of the game. Will be executed in the next server (or game) frame.
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...
Edict * G_GetEdictFromPos(const pos3_t pos, const entity_type_t type)
Searches an edict of the given type at the given grid location.
Misc utility functions for game module.
bool G_InventoryRemoveItemByID(const char *itemID, Edict *ent, containerIndex_t container)
Removes one particular item from a given container.
bool(* use)(Edict *self, Edict *activator)
Mission related code - king of the hill and so on.
const objDef_t * def(void) const
bool G_MissionUse(Edict *self, Edict *activator)
Mission trigger use function.
void Com_Printf(const char *const fmt,...)
Defines all attributes of objects used in the inventory.
void G_AppearPerishEvent(playermask_t playerMask, bool appear, Edict &check, const Edict *ent)
Send the appear or perish event to the affected clients.
bool G_IsLivingActor(const Edict *ent)
Checks whether the given edict is a living actor.
Actor * makeActor(Edict *ent)
Convert an Edict pointer into an Actor pointer.
Edict * G_EdictsFindTargetEntity(const char *target)
Searches the edict that has the given target as targetname set.
bool G_MatchIsRunning(void)
Checks whether the game is running (active team and no intermission time)
item instance data, with linked list capability
#define G_IsCivilian(ent)
Edict * G_SpawnParticle(const vec3_t origin, int spawnflags, const char *particle)
playermask_t G_VisToPM(teammask_t teamMask)
Converts vis mask to player mask.
const invDef_t * def() const
#define INVDEF(containerID)
void G_MissionReset(Edict *self, Edict *activator)
Item * getNextItem(const Item *prev) const
static const char * G_MissionGetTeamString(const int team)
bool G_ActorInvMove(Actor *actor, const invDef_t *fromContType, Item *fItem, const invDef_t *toContType, int tx, int ty, bool checkaction)
Moves an item inside an inventory. Floors are handled special.
void G_MissionThink(Edict *self)
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
Brings new objects into the world.
#define CS_VICTORY_CONDITIONS
void G_EventPerish(const Edict &ent)
Send an event to all clients that are seeing the given edict, that it just has disappeared.
functions to handle the storage and lifecycle of all edicts in the game module.
bool(* destroy)(Edict *self)
bool G_UseEdict(Edict *ent, Edict *activator)
Call the 'use' function for the given edict and all its group members.
static bool G_MissionIsTouched(Edict *self)
Edict * G_GetFloorItems(Edict *ent)
Prepares a list of items on the floor at given entity position.
#define G_ValidMessage(ent)
void G_FreeEdict(Edict *ent)
Marks the edict as free.
bool G_MissionTouch(Edict *self, Edict *activator)
Mission trigger.
Interface for g_client.cpp.