Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
common.qh
Go to the documentation of this file.
1#pragma once
2
4
10
11bool W_DualWielding(entity player);
12void W_GiveWeapon (entity e, float wep);
13void W_PlayStrengthSound(entity player);
14float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception);
15void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode);
16
18
20
21.float dmg_radius; // reused field, as the distance the laser damage occurs over
22.vector dest; // reused field, as the adjusted hit location
23void W_LaserPlay(entity this, float rad, float damage, float edgedamage, float burntime, WarpZone_FindRadius_cond_callback_t cb);
24
25float W_SeekOutEnemy(entity this, float speed_decel, float speed_accel, float speed_max, float turn_rate, bool smart, float smart_mindist, float smart_trace_min, float smart_trace_max);
26
27.float dmg_last;
28.float teleport_time; // reused field, as the time the damage started
29void W_DamageOverTime_Think(entity this, float duration, float duration_power, float damage, float edgedamage, float rad, float force, entity cantbe, float think_delay);
30
32
34
35.float fade_time;
36.float fade_rate;
37
38.entity realowner;
39
40#define PROJECTILE_TOUCH(e,t) MACRO_BEGIN if (WarpZone_Projectile_Touch(e,t)) return; MACRO_END
41
42// FIXME: some behaviours can't be achieved or would require kludges in physics code,
43// eg we can't make electro bolts hit electro orbs only (without causing other problems) when g_projectiles_interact == 1,
44// see also WarpZone_Projectile_Touch_ImpactFilter_Callback().
45// Ideally, extend engine to support any combination of 'hit a and b but not x or y' and 'take hits from c and d but not w or z'.
46#define PROJECTILE_MAKETRIGGER(e) \
47MACRO_BEGIN \
48 (e).solid = SOLID_CORPSE; \
49 (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; \
50 if (!autocvar_g_projectiles_interact || (autocvar_g_projectiles_interact == 1 && (e).classname != "blasterbolt")) \
51 (e).clipgroup = 1; \
52MACRO_END
53
54// when doing this, hagar can go through clones
55// #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX
56
58const int MIF_SPLASH = BIT(1);
59const int MIF_ARC = BIT(2);
60const int MIF_PROXY = BIT(3);
61const int MIF_GUIDED_MANUAL = BIT(4);
62const int MIF_GUIDED_HEAT = BIT(5);
63const int MIF_GUIDED_LASER = BIT(6);
64const int MIF_GUIDED_AI = BIT(7);
65const int MIF_GUIDED_TAG = BIT(7);
69
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
float dmg_radius
Definition breakable.qc:14
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
float teleport_time
Definition player.qh:218
#define IL_NEW()
vector dest
Definition jumppads.qh:54
bool(entity e) WarpZone_FindRadius_cond_callback_t
Definition common.qh:67
fade_rate
Definition projectile.qh:14
entity entity toucher
Definition self.qh:76
float autocvar_sv_strengthsound_antispam_refire_threshold
Definition common.qh:8
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
Definition common.qc:45
bool WarpZone_Projectile_Touch_ImpactFilter_Callback(entity this, entity toucher)
Definition common.qc:150
void W_PlayStrengthSound(entity player)
Definition common.qc:40
const int MIF_SPLASH
Definition common.qh:58
int projectiledeathtype
Definition common.qh:33
const int MIF_GUIDED_ALL
Definition common.qh:66
const int MIF_GUIDED_TRACKING
Definition common.qh:67
void W_LaserPlay(entity this, float rad, float damage, float edgedamage, float burntime, WarpZone_FindRadius_cond_callback_t cb)
Randomly chooses a player within the radius to shoot a laser towards.
Definition common.qc:191
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
Definition common.qc:87
void W_DamageOverTime_Think(entity this, float duration, float duration_power, float damage, float edgedamage, float rad, float force, entity cantbe, float think_delay)
Applies damage over time, called within a think function.
Definition common.qc:285
float dmg_last
Definition common.qh:27
int missile_flags
Definition common.qh:57
const int MIF_GUIDED_HEAT
Definition common.qh:62
float fade_time
Definition common.qh:35
IntrusiveList g_projectiles
Definition common.qh:70
const int MIF_PROXY
Definition common.qh:60
const int MIF_GUIDED_TAG
Definition common.qh:65
const int MIF_ARC
Definition common.qh:59
const int MIF_GUIDED_LASER
Definition common.qh:63
float autocvar_sv_strengthsound_antispam_time
Definition common.qh:9
const int MIF_GUIDED_AI
Definition common.qh:64
bool autocvar_g_projectiles_keep_owner
Definition common.qh:7
const int MIF_GUIDED_CONFUSABLE
Definition common.qh:68
float W_SeekOutEnemy(entity this, float speed_decel, float speed_accel, float speed_max, float turn_rate, bool smart, float smart_mindist, float smart_trace_min, float smart_trace_max)
Automatically guides a projectile towards its enemy.
Definition common.qc:239
void W_GiveWeapon(entity e, float wep)
float misc_bulletcounter
Definition common.qh:31
int autocvar_g_projectiles_damage
Definition common.qh:5
int autocvar_g_projectiles_interact
Definition common.qh:6
const int MIF_GUIDED_MANUAL
Definition common.qh:61
void adaptor_think2use_hittype_splash(entity this)
Definition common.qc:106
bool W_DualWielding(entity player)
Definition common.qc:20
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:33
entity realowner