Xonotic
damage.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/weapons/_all.qh>
4 
32 
33 .void(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) event_damage;
34 
35 .bool(entity targ, entity inflictor, float amount, float limit) event_heal;
36 
37 .float dmg;
38 .float dmg_edge;
39 .float dmg_force;
40 .float dmg_radius;
41 
42 bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf);
43 
44 void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner);
45 
47 
50 
51 float yoda;
53 
54 .float pain_finished; // Added by Supajoe
55 
56 .float dmg_team;
60 .entity pusher;
61 .bool istypefrag;
63 
65 
67 
69 
70 .vector death_origin;
71 
74 
75 // used for custom deathtype
76 string deathmessage;
77 
78 float IsFlying(entity a);
79 
80 void UpdateFrags(entity player, int f);
81 
82 // NOTE: f=0 means still count as a (positive) kill, but count no frags for it
83 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
84 void GiveFrags (entity attacker, entity targ, float f, int deathtype, .entity weaponentity);
85 
86 string AppendItemcodes(string s, entity player);
87 
88 void LogDeath(string mode, int deathtype, entity killer, entity killed);
89 
91  entity notif_target,
92  float murder,
93  int deathtype,
94  string s1, string s2, string s3,
95  float f1, float f2, float f3);
96 
99  entity notif_target,
100  float murder,
101  int deathtype,
102  string s1, string s2, string s3,
103  float f1, float f2);
104 
105 void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .entity weaponentity);
106 
107 // Frozen status effect
108 //const int FROZEN_NOT = 0;
109 const int FROZEN_NORMAL = 1;
110 const int FROZEN_TEMP_REVIVING = 2;
111 const int FROZEN_TEMP_DYING = 3;
112 
113 .float revival_time; // time at which player was last revived
114 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
115 .float freeze_time;
116 .entity iceblock;
117 .entity frozen_by; // for ice fields
118 
119 void Ice_Think(entity this);
120 
121 void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint);
122 
123 void Unfreeze(entity targ, bool reset_health);
124 
125 // WEAPONTODO
126 #define DMG_NOWEP (weaponentities[0])
127 
128 // NOTE: the .weaponentity parameter can be set to DMG_NOWEP if the attack wasn't caused by a weapon or player
129 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
130 
132 float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity);
133  // Returns total damage applies to creatures
134 
135 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity);
136 
138 const float MIN_DAMAGEEXTRARADIUS = 2;
139 const float MAX_DAMAGEEXTRARADIUS = 16;
141 
142 // Calls .event_heal on the target so that they can handle healing themselves
143 // a limit of RES_LIMIT_NONE should be handled by the entity as its max health (if applicable)
144 bool Heal(entity targ, entity inflictor, float amount, float limit);
145 
148 .entity fire_owner;
150 
151 float Fire_AddDamage(entity e, entity o, float d, float t, float dt);
152 
153 void Fire_ApplyDamage(entity e);
154 
156 STATIC_INIT(g_damagedbycontents) { g_damagedbycontents = IL_NEW(); }
int autocvar_g_balance_firetransfer_time
Definition: damage.qh:20
string deathmessage
Definition: damage.qh:76
void Ice_Think(entity this)
Definition: damage.qc:481
bool autocvar_g_frozen_damage_trigger
Definition: damage.qh:30
int totalfrags
Definition: damage.qh:66
void Obituary(entity attacker, entity inflictor, entity targ, int deathtype,.entity weaponentity)
Definition: damage.qc:229
float dmg_radius
Definition: damage.qh:40
float spawnshieldtime
Definition: damage.qh:64
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
Definition: selection.qc:243
spree_inf s1 s2 s3loc s2 s1
Definition: all.inc:265
bool istypefrag
Definition: damage.qh:61
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1 f1points s1 s2
Definition: all.inc:438
float RadiusDamage_running
Definition: damage.qh:131
int autocvar_g_balance_firetransfer_damage
Definition: damage.qh:19
float teamkill_complain
Definition: damage.qh:57
#define IL_NEW()
float autocvar_g_frozen_revive_falldamage
Definition: damage.qh:28
const float MIN_DAMAGEEXTRARADIUS
Definition: damage.qh:138
float damageextraradius
Definition: damage.qh:140
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
Definition: damage.qc:1057
float damageforcescale
Definition: damage.qh:137
IntrusiveList g_damagedbycontents
Definition: damage.qh:155
entity() spawn
float fire_hitsound
Definition: damage.qh:149
float autocvar_g_friendlyfire_virtual
Definition: damage.qh:26
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition: damage.qc:583
float fire_damagepersec
Definition: damage.qh:146
entity iceblock
Definition: damage.qh:116
float dmg_team
Definition: damage.qh:56
entity to
Definition: self.qh:96
float Obituary_WeaponDeath(entity notif_target, float murder, int deathtype, string s1, string s2, string s3, float f1, float f2)
Definition: damage.qc:170
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
float autocvar_g_throughfloor_min_steps_other
Definition: damage.qh:12
STATIC_INIT(g_damagedbycontents)
Definition: damage.qh:156
float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
Definition: damage.qc:1077
bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf)
float hitsound_damage_dealt
Definition: damage.qh:72
float autocvar_g_throughfloor_damage
Definition: damage.qh:6
float checkrules_firstblood
Definition: damage.qh:46
int impressive_hits
Definition: damage.qh:52
float autocvar_g_throughfloor_min_steps_player
Definition: damage.qh:10
void LogDeath(string mode, int deathtype, entity killer, entity killed)
Definition: damage.qc:106
float taunt_soundtime
Definition: damage.qh:62
float autocvar_g_maxpushtime
Definition: damage.qh:17
int autocvar_g_frozen_revive_falldamage_health
Definition: damage.qh:29
float autocvar_g_throughfloor_max_steps_other
Definition: damage.qh:13
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1
Definition: all.inc:654
void Fire_ApplyDamage(entity e)
Definition: damage.qc:1187
void GiveFrags(entity attacker, entity targ, float f, int deathtype,.entity weaponentity)
Definition: damage.qc:49
entity frozen_by
Definition: damage.qh:117
float IsFlying(entity a)
Definition: player.qc:804
float autocvar_g_frozen_force
Definition: damage.qh:31
bool autocvar_g_mirrordamage_onlyweapons
Definition: damage.qh:16
float autocvar_g_friendlyfire_virtual_force
Definition: damage.qh:27
void Unfreeze(entity targ, bool reset_health)
Definition: damage.qc:546
float dmg_edge
Definition: damage.qh:38
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1 f1points f2
Definition: all.inc:348
float autocvar_g_balance_selfdamagepercent
Definition: damage.qh:24
string AppendItemcodes(string s, entity player)
Definition: damage.qc:87
float autocvar_g_teamdamage_threshold
Definition: damage.qh:23
float damagedbycontents
Definition: damage.qh:48
void UpdateFrags(entity player, int f)
Definition: damage.qc:44
entity pusher
Definition: damage.qh:60
const int FROZEN_NORMAL
Definition: damage.qh:109
float freeze_time
Definition: damage.qh:115
int typehitsound
Definition: damage.qh:73
bool canteamdamage
Definition: damage.qh:68
float teamkill_soundtime
Definition: damage.qh:58
int killsound
Definition: damage.qh:73
float dmg_force
Definition: damage.qh:39
float autocvar_g_friendlyfire
Definition: damage.qh:25
entity fire_owner
Definition: damage.qh:148
float autocvar_g_balance_damagepush_speedfactor
Definition: damage.qh:18
float w_deathtype
Definition: damage.qh:97
float pain_finished
Definition: damage.qh:54
float autocvar_g_throughfloor_max_steps_player
Definition: damage.qh:11
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float autocvar_g_throughfloor_force
Definition: damage.qh:7
vector death_origin
Definition: damage.qh:70
const int FROZEN_TEMP_REVIVING
Definition: damage.qh:110
void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint)
Definition: damage.qc:494
bool autocvar_g_mirrordamage_virtual
Definition: damage.qh:15
bool Heal(entity targ, entity inflictor, float amount, float limit)
Definition: damage.qc:1063
float autocvar_g_mirrordamage
Definition: damage.qh:14
float RadiusDamageForSource(entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype,.entity weaponentity, entity directhitentity)
Definition: damage.qc:866
const float MAX_DAMAGEEXTRARADIUS
Definition: damage.qh:139
void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
void Obituary_SpecialDeath(entity notif_target, float murder, int deathtype, string s1, string s2, string s3, float f1, float f2, float f3)
Definition: damage.qc:125
float damagedbytriggers
Definition: damage.qh:49
float autocvar_g_teamdamage_resetspeed
Definition: damage.qh:22
float autocvar_g_balance_armor_blockpercent
Definition: damage.qh:21
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
float autocvar_g_throughfloor_damage_max_stddev
Definition: damage.qh:8
entity teamkill_soundsource
Definition: damage.qh:59
float fire_deathtype
Definition: damage.qh:147
float revive_speed
Definition: damage.qh:114
const int FROZEN_TEMP_DYING
Definition: damage.qh:111
float revival_time
Definition: damage.qh:113
float autocvar_g_throughfloor_force_max_stddev
Definition: damage.qh:9
float yoda
Definition: damage.qh:51
bool autocvar_g_throughfloor_debug
Definition: damage.qh:5
float dmg
Definition: damage.qh:37