Xonotic
all.qh File Reference
#include <common/notifications/all.qh>
#include "all.inc"
+ Include dependency graph for all.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEATH_ENT(t)   (DEATH_ISSPECIAL(t) ? (REGISTRY_GET(Deathtypes, t - DT_FIRST)) : NULL)
 
#define DEATH_IS(t, dt)   (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)) == dt)
 
#define DEATH_ISMONSTER(t)   (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).death_msgextra == "monster")
 
#define DEATH_ISSPECIAL(t)   (t >= DT_FIRST)
 
#define DEATH_ISTURRET(t)   (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).death_msgextra == "turret")
 
#define DEATH_ISVEHICLE(t)   (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).death_msgextra == "vehicle")
 
#define DEATH_ISWEAPON(t, w)   (DEATH_WEAPONOF(t) == (w))
 
#define DEATH_WEAPONOF(t)   (DEATH_ISSPECIAL(t) ? WEP_Null : REGISTRY_GET(Weapons, (t) & DEATH_WEAPONMASK))
 
#define REGISTER_DEATHTYPE(id, msg_death, msg_death_by, extra)
 

Functions

string Deathtype_Name (int deathtype)
 

Variables

const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_ARMORPIERCE | HITTYPE_SOUND
 
string death_msgextra
 
entity death_msgmurder
 
entity death_msgself
 
const int DEATH_WEAPONMASK = BITS(8)
 
const int DT_FIRST = BIT(13)
 
const int HITTYPE_ARMORPIERCE = BITS(1) << 11
 
const int HITTYPE_BOUNCE = BITS(1) << 10
 
const int HITTYPE_SECONDARY = BITS(1) << 8
 
const int HITTYPE_SOUND = BITS(1) << 12
 
const int HITTYPE_SPLASH = BITS(1) << 9
 automatically set by RadiusDamage More...
 

Macro Definition Documentation

◆ DEATH_ENT

#define DEATH_ENT (   t)    (DEATH_ISSPECIAL(t) ? (REGISTRY_GET(Deathtypes, t - DT_FIRST)) : NULL)

Definition at line 37 of file all.qh.

Referenced by MUTATOR_HOOKFUNCTION(), and Obituary().

◆ DEATH_IS

#define DEATH_IS (   t,
  dt 
)    (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)) == dt)

Definition at line 36 of file all.qh.

Referenced by decompressShotOrigin().

◆ DEATH_ISMONSTER

#define DEATH_ISMONSTER (   t)    (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).death_msgextra == "monster")

Definition at line 40 of file all.qh.

◆ DEATH_ISSPECIAL

#define DEATH_ISSPECIAL (   t)    (t >= DT_FIRST)

◆ DEATH_ISTURRET

#define DEATH_ISTURRET (   t)    (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).death_msgextra == "turret")

Definition at line 39 of file all.qh.

◆ DEATH_ISVEHICLE

#define DEATH_ISVEHICLE (   t)    (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).death_msgextra == "vehicle")

Definition at line 38 of file all.qh.

◆ DEATH_ISWEAPON

#define DEATH_ISWEAPON (   t,
 
)    (DEATH_WEAPONOF(t) == (w))

Definition at line 42 of file all.qh.

Referenced by Damage(), MUTATOR_HOOKFUNCTION(), and vehicles_damage().

◆ DEATH_WEAPONOF

◆ REGISTER_DEATHTYPE

#define REGISTER_DEATHTYPE (   id,
  msg_death,
  msg_death_by,
  extra 
)
Value:
REGISTER(Deathtypes, DEATH, id, m_id, new_pure(deathtype)) { \
this.m_id += DT_FIRST; \
this.nent_name = #id; \
this.death_msgextra = extra; \
this.death_msgself = msg_death; \
this.death_msgmurder = msg_death_by; \
}
#define REGISTER(...)
Register a new entity with a registry.
Definition: registry.qh:87
const int DT_FIRST
Definition: all.qh:33
int m_id
Definition: effect.qh:19
#define new_pure(class)
purely logical entities (.origin doesn&#39;t work)
Definition: oo.qh:62

Definition at line 15 of file all.qh.

Function Documentation

◆ Deathtype_Name()

string Deathtype_Name ( int  deathtype)

Definition at line 3 of file all.qc.

References backtrace, DEATH_ISSPECIAL, DT_FIRST, entity(), ftos(), and REGISTRY_GET.

Referenced by LogDeath(), and Obituary().

4 {
5  if (DEATH_ISSPECIAL(deathtype)) {
6  entity deathent = REGISTRY_GET(Deathtypes, deathtype - DT_FIRST);
7  if (!deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; }
8  return deathent.nent_name;
9  }
10  return ftos(deathtype);
11 }
entity() spawn
const int DT_FIRST
Definition: all.qh:33
#define REGISTRY_GET(id, i)
Definition: registry.qh:43
#define backtrace(msg)
Definition: log.qh:105
#define DEATH_ISSPECIAL(t)
Definition: all.qh:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ DEATH_HITTYPEMASK

Definition at line 31 of file all.qh.

◆ death_msgextra

string death_msgextra

Definition at line 13 of file all.qh.

◆ death_msgmurder

entity death_msgmurder

Definition at line 12 of file all.qh.

◆ death_msgself

entity death_msgself

Definition at line 11 of file all.qh.

◆ DEATH_WEAPONMASK

const int DEATH_WEAPONMASK = BITS(8)

Definition at line 24 of file all.qh.

◆ DT_FIRST

const int DT_FIRST = BIT(13)

Definition at line 33 of file all.qh.

Referenced by Deathtype_Name(), and Obituary_SpecialDeath().

◆ HITTYPE_ARMORPIERCE

const int HITTYPE_ARMORPIERCE = BITS(1) << 11

Definition at line 29 of file all.qh.

Referenced by decompressShotOrigin().

◆ HITTYPE_BOUNCE

const int HITTYPE_BOUNCE = BITS(1) << 10

Definition at line 28 of file all.qh.

Referenced by RadiusDamageForSource().

◆ HITTYPE_SECONDARY

const int HITTYPE_SECONDARY = BITS(1) << 8

Definition at line 25 of file all.qh.

Referenced by MUTATOR_HOOKFUNCTION(), RadiusDamageForSource(), and W_Nexball_Attack2().

◆ HITTYPE_SOUND

const int HITTYPE_SOUND = BITS(1) << 12

Definition at line 30 of file all.qh.

Referenced by Damage(), PlayerDamage(), and RadiusDamageForSource().

◆ HITTYPE_SPLASH

const int HITTYPE_SPLASH = BITS(1) << 9

automatically set by RadiusDamage

Definition at line 27 of file all.qh.

Referenced by adaptor_think2use_hittype_splash(), door_damage(), MUTATOR_HOOKFUNCTION(), and RadiusDamageForSource().