47 Com_sprintf(smallBuf,
sizeof(smallBuf),
"(%i) Team %i %s status: %s\n", p->getNum(),
48 p->getTeam(), p->pers.netname, (p->roundDone ?
"waiting" :
"playing"));
51 if (strlen(smallBuf) + strlen(largeBuf) >
sizeof(largeBuf) - 100) {
52 Q_strcat(largeBuf,
sizeof(largeBuf),
"...\n");
55 Q_strcat(largeBuf,
sizeof(largeBuf),
"%s", smallBuf);
68 if (
level.time < player.pers.flood_locktill) {
72 int i = player.pers.flood_whenhead -
flood_msgs->value + 1;
74 i = (
sizeof(player.pers.flood_when)/
sizeof(player.pers.flood_when[0])) +
i;
80 player.pers.flood_whenhead = (player.pers.flood_whenhead + 1) %
81 (
sizeof(player.pers.flood_when)/
sizeof(player.pers.flood_when[0]));
82 player.pers.flood_when[player.pers.flood_whenhead] =
level.time;
87static void G_Say_f (Player& player,
bool arg0,
bool team)
89 if (
gi.Cmd_Argc() < 2 && !arg0)
97 Com_sprintf(text,
sizeof(text),
"%s %s",
gi.Cmd_Argv(0),
gi.Cmd_Args());
104 if (s[0] ==
'"' && s[strlen(s) - 1] ==
'"') {
105 s[strlen(s) - 1] =
'\0';
111 gi.DPrintf(
"%s: %s\n", player.pers.netname, s);
113 gi.DPrintf(
"^B%s (team): %s\n", player.pers.netname, s);
118 if (team && p->getTeam() != player.getTeam())
133static void G_KillTeam_f (
void)
140 if (
gi.Cmd_Argc() >= 2) {
141 teamToKill = atoi(
gi.Cmd_Argv(1));
142 if (
gi.Cmd_Argc() >= 3)
143 amount = atoi(
gi.Cmd_Argv(2));
148 if (teamToKill >= 0) {
149 Actor* actor =
nullptr;
172static void G_StunTeam_f (
void)
178 if (
gi.Cmd_Argc() >= 2)
179 teamToKill = atoi(
gi.Cmd_Argv(1));
181 if (teamToKill >= 0) {
182 Actor* actor =
nullptr;
202static void G_ListMissionScore_f (
void)
207 if (
gi.Cmd_Argc() >= 2) {
208 team = atoi(
gi.Cmd_Argv(1));
210 gi.DPrintf(
"Usage: %s <teamnumber>\n",
gi.Cmd_Argv(0));
214 Actor* actor =
nullptr;
216 if (team >= 0 && actor->
getTeam() != team)
221 gi.DPrintf(
"Soldier: %s\n", actor->
chr.
name);
226 gi.DPrintf(
" Kills:");
232 gi.DPrintf(
" Stuns:");
239 gi.DPrintf(
" Fired:");
245 gi.DPrintf(
" Hits:\n");
247 gi.DPrintf(
" Skill%i: ",
i);
255 gi.DPrintf(
" Fired Splash:");
261 gi.DPrintf(
" Hits Splash:\n");
263 gi.DPrintf(
" Skill%i: ",
i);
270 gi.DPrintf(
" Splash Damage:\n");
272 gi.DPrintf(
" Skill%i: ",
i);
280 gi.DPrintf(
" Kills per skill:");
294void G_InvList_f (
const Player& player)
296 gi.DPrintf(
"Print inventory for '%s'\n", player.pers.netname);
298 Actor* actor =
nullptr;
300 gi.DPrintf(
"actor: '%s'\n", actor->
chr.
name);
305 Item* item =
nullptr;
307 Com_Printf(
".. item.def(): %i, item.ammo: %i, item.ammoLeft: %i, x: %i, y: %i\n",
321 const int tuPenalty = tus - normalTU;
323 Com_Printf(
"Weight: %g/%i, Encumbrance: %s (%.0f%%), TU's: %i (normal: %i, penalty/bonus: %+i)\n", invWeight, maxWeight, penaltyStr, invWeight / maxWeight * 100.0f, tus, normalTU, tuPenalty);
327static void G_TouchEdict_f (
void)
329 if (
gi.Cmd_Argc() < 2) {
330 gi.DPrintf(
"Usage: %s <entnum>\n",
gi.Cmd_Argv(0));
334 const int i = atoi(
gi.Cmd_Argv(1));
340 gi.DPrintf(
"No touch function for entity %s\n", e->
classname);
348 gi.DPrintf(
"Call touch function for %s\n", e->
classname);
352static void G_UseEdict_f (
void)
354 if (
gi.Cmd_Argc() < 2) {
355 gi.DPrintf(
"Usage: %s <entnum>\n",
gi.Cmd_Argv(0));
359 const int i = atoi(
gi.Cmd_Argv(1));
361 gi.DPrintf(
"No entity with number %i\n",
i);
367 gi.DPrintf(
"No use function for entity %s\n", e->
classname);
371 gi.DPrintf(
"Call use function for %s\n", e->
classname);
375static void G_DestroyEdict_f (
void)
377 if (
gi.Cmd_Argc() < 2) {
378 gi.DPrintf(
"Usage: %s <entnum>\n",
gi.Cmd_Argv(0));
382 const int i = atoi(
gi.Cmd_Argv(1));
388 gi.DPrintf(
"No destroy function for entity %s\n", e->
classname);
392 gi.DPrintf(
"Call destroy function for %s\n", e->
classname);
396static void G_StateChange_f (
void)
398 if (
gi.Cmd_Argc() < 3) {
399 gi.DPrintf(
"Usage: %s <entnum> <state>\n States are: panic, rage, shaken",
gi.Cmd_Argv(0));
403 const int entnum = atoi(
gi.Cmd_Argv(1));
408 const char* state =
gi.Cmd_Argv(2);
425 if (!player.isInUse())
428 const char* cmd =
gi.Cmd_Argv(0);
444 G_ListMissionScore_f();
Item * getNextItem(const Item *prev) const
bool(* use)(Edict *self, Edict *activator)
bool callTouch(Edict *activator)
bool(* destroy)(Edict *self)
int getWeight() const
Get the weight of the items in the given inventory (excluding those in temp containers).
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
item instance data, with linked list capability
const objDef_t * ammoDef(void) const
const objDef_t * def(void) const
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Printf(const char *const fmt,...)
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,...
Player * G_PlayerGetNextActiveHuman(Player *lastPlayer)
Iterate through the list of players.
void G_ClientPrintf(const Player &player, int printLevel, const char *fmt,...)
Interface for g_client.cpp.
static void G_Say_f(Player &player, bool arg0, bool team)
void G_ClientCommand(Player &player)
static void G_Players_f(const Player &player)
static bool G_CheckFlood(Player &player)
Check whether the user can talk.
Actor * G_EdictsGetNextLivingActorOfTeam(Actor *lastEnt, const int team)
Iterate through the living actor entities of the given team.
Actor * G_EdictsGetNextLivingActor(Actor *lastEnt)
Iterate through the living actor entities.
bool G_EdictsIsValidNum(const int num)
Check if the given number could point to an existing entity.
Edict * G_EdictsGetByNum(const int num)
Get an entity by it's number.
functions to handle the storage and lifecycle of all edicts in the game module.
Local definitions for game module.
void G_MoraleBehaviour(int team)
Applies morale behaviour on actors.
void G_MatchEndCheck(void)
Checks whether there are still actors to fight with left. If none are the match end will be triggered...
Shared parsing functions.
#define WEIGHT_NORMAL_PENALTY
#define GET_ENCUMBRANCE_PENALTY(weight, max)
#define WEIGHT_HEAVY_PENALTY
#define Q_strcasecmp(a, b)
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
chrScoreMission_t * scoreMission
int skills[SKILL_NUM_TYPES]
int hitsSplashDamage[SKILL_NUM_TYPES][KILLED_NUM_TYPES]
int fired[SKILL_NUM_TYPES]
int firedSplash[SKILL_NUM_TYPES]
int hitsSplash[SKILL_NUM_TYPES][KILLED_NUM_TYPES]
int hits[SKILL_NUM_TYPES][KILLED_NUM_TYPES]
int stuns[KILLED_NUM_TYPES]
int skillKills[SKILL_NUM_TYPES]
int kills[KILLED_NUM_TYPES]