Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
all.qh
Go to the documentation of this file.
1#pragma once
2
4
5REGISTRY(Deathtypes, BITS(8))
6REGISTER_REGISTRY(Deathtypes)
7REGISTRY_CHECK(Deathtypes)
8
9REGISTRY_DEFINE_GET(Deathtypes, NULL)
10
11// .m_name is the deathtype's name
12// .message is an extra msg to differentiate types
17
18#define REGISTER_DEATHTYPE(id, msg_death, msg_death_by, msg_death_ent, msg_death_ent_by, extra) \
19 REGISTER(Deathtypes, DEATH, id, m_id, new_pure(deathtype)) \
20 { \
21 this.m_id += DT_FIRST; \
22 this.m_name = #id; \
23 this.message = extra; \
24 this.death_msgself = msg_death; \
25 this.death_msgmurder = msg_death_by; \
26 this.death_msg_ent_self = msg_death_ent; \
27 this.death_msg_ent_murder = msg_death_ent_by; \
28 }
29
30const int DEATH_WEAPONMASK = BITS(8);
31const int HITTYPE_SECONDARY = BIT(8);
32const int HITTYPE_SPLASH = BIT(9);
33const int HITTYPE_BOUNCE = BIT(10);
34const int HITTYPE_ARMORPIERCE = BIT(11);
35const int HITTYPE_SOUND = BIT(12);
36const int HITTYPE_SPAM = BIT(13);
38// normal deaths begin
39const int DT_FIRST = BIT(14);
40
41#define DEATH_ISSPECIAL(t) (t >= DT_FIRST)
42#define DEATH_IS(t, dt) (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)) == dt)
43#define DEATH_ENT(t) (DEATH_ISSPECIAL(t) ? (REGISTRY_GET(Deathtypes, t - DT_FIRST)) : NULL)
44#define DEATH_ISVEHICLE(t) (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).message == "vehicle")
45#define DEATH_ISTURRET(t) (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).message == "turret")
46#define DEATH_ISMONSTER(t) (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)).message == "monster")
47#define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? WEP_Null : REGISTRY_GET(Weapons, (t) & DEATH_WEAPONMASK))
48#define DEATH_ISWEAPON(t, w) (DEATH_WEAPONOF(t) == (w))
49
50string Deathtype_Name(int deathtype);
51
52#include "all.inc"
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
#define BITS(n)
Definition bits.qh:9
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int HITTYPE_ARMORPIERCE
ignore armor calculations
Definition all.qh:34
entity death_msgmurder
Definition all.qh:14
const int DEATH_WEAPONMASK
Definition all.qh:30
const int DT_FIRST
Definition all.qh:39
const int HITTYPE_BOUNCE
set manually after projectile has bounced
Definition all.qh:33
entity death_msg_ent_self
Definition all.qh:15
entity death_msgself
Definition all.qh:13
const int DEATH_HITTYPEMASK
Definition all.qh:37
const int HITTYPE_SPAM
set manually after first RadiusDamage, stops effect spam
Definition all.qh:36
string Deathtype_Name(int deathtype)
Definition all.qc:3
const int HITTYPE_SPLASH
automatically set by RadiusDamage
Definition all.qh:32
entity death_msg_ent_murder
Definition all.qh:16
const int HITTYPE_SECONDARY
Definition all.qh:31
const int HITTYPE_SOUND
cause bleeding from ears
Definition all.qh:35
#define NULL
Definition post.qh:14
#define REGISTER_REGISTRY(id)
Definition registry.qh:270
#define REGISTRY(id, max)
Declares a new registry.
Definition registry.qh:23
#define REGISTRY_CHECK(id)
Definition registry.qh:213
#define REGISTRY_DEFINE_GET(id, null)
Definition registry.qh:50