]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/damage.qh
Merge branch 'master' into Juhu/strafehud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / damage.qh
1 #pragma once
2
3 #if defined(CSQC)
4 #elif defined(MENUQC)
5 #elif defined(SVQC)
6     #include <common/weapons/_all.qh>
7     #include <common/stats.qh>
8     #include <server/items/items.qh>
9     #include <lib/warpzone/common.qh>
10     #include <common/constants.qh>
11     #include <common/teams.qh>
12     #include <common/util.qh>
13     #include <common/weapons/_all.qh>
14     #include "weapons/accuracy.qh"
15     #include "weapons/csqcprojectile.qh"
16     #include "weapons/selection.qh"
17     #include "autocvars.qh"
18     #include <common/notifications/all.qh>
19     #include <common/deathtypes/all.qh>
20     #include <server/mutators/_mod.qh>
21     #include <common/turrets/sv_turrets.qh>
22     #include <common/vehicles/all.qh>
23     #include <lib/csqcmodel/sv_model.qh>
24     #include <common/playerstats.qh>
25     #include "hook.qh"
26     #include "scores.qh"
27     #include "spawnpoints.qh"
28 #endif
29
30 .void(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) event_damage;
31
32 .bool(entity targ, entity inflictor, float amount, float limit) event_heal;
33
34 .float dmg;
35 .float dmg_edge;
36 .float dmg_force;
37 .float dmg_radius;
38
39 bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf);
40
41 void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner);
42
43 float checkrules_firstblood;
44
45 .float damagedbycontents;
46 .float damagedbytriggers;
47
48 float yoda;
49 float damage_goodhits;
50 float damage_gooddamage;
51
52 .float pain_finished; // Added by Supajoe
53
54 .float dmg_team;
55 .float teamkill_complain;
56 .float teamkill_soundtime;
57 .entity teamkill_soundsource;
58 .entity pusher;
59 .bool istypefrag;
60 .float taunt_soundtime;
61
62 .float spawnshieldtime;
63
64 .int totalfrags;
65
66 .bool canteamdamage;
67
68 .vector death_origin;
69
70 .float damage_dealt, typehitsound, killsound;
71
72 // used for custom deathtype
73 string deathmessage;
74
75 float IsFlying(entity a);
76
77 void UpdateFrags(entity player, int f);
78
79 // NOTE: f=0 means still count as a (positive) kill, but count no frags for it
80 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
81 void GiveFrags (entity attacker, entity targ, float f, int deathtype, .entity weaponentity);
82
83 string AppendItemcodes(string s, entity player);
84
85 void LogDeath(string mode, int deathtype, entity killer, entity killed);
86
87 void Obituary_SpecialDeath(
88         entity notif_target,
89         float murder,
90         int deathtype,
91         string s1, string s2, string s3,
92         float f1, float f2, float f3);
93
94 float w_deathtype;
95 float Obituary_WeaponDeath(
96         entity notif_target,
97         float murder,
98         int deathtype,
99         string s1, string s2, string s3,
100         float f1, float f2);
101
102 void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .entity weaponentity);
103
104 // Frozen status effect
105 //const int FROZEN_NOT              = 0;
106 const int FROZEN_NORMAL             = 1;
107 const int FROZEN_TEMP_REVIVING      = 2;
108 const int FROZEN_TEMP_DYING         = 3;
109
110 .float revival_time; // time at which player was last revived
111 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
112 .float freeze_time;
113 .entity iceblock;
114 .entity frozen_by; // for ice fields
115
116 void Ice_Think(entity this);
117
118 void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint);
119
120 void Unfreeze(entity targ, bool reset_health);
121
122 // WEAPONTODO
123 #define DMG_NOWEP (weaponentities[0])
124
125 // NOTE: the .weaponentity parameter can be set to DMG_NOWEP if the attack wasn't caused by a weapon or player
126 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
127
128 float RadiusDamage_running;
129 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);
130         // Returns total damage applies to creatures
131
132 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity);
133
134 .float damageforcescale;
135 const float MIN_DAMAGEEXTRARADIUS = 2;
136 const float MAX_DAMAGEEXTRARADIUS = 16;
137 .float damageextraradius;
138
139 // Calls .event_heal on the target so that they can handle healing themselves
140 // a limit of RES_LIMIT_NONE should be handled by the entity as its max health (if applicable)
141 bool Heal(entity targ, entity inflictor, float amount, float limit);
142
143 .float fire_damagepersec;
144 .float fire_endtime;
145 .float fire_deathtype;
146 .entity fire_owner;
147 .float fire_hitsound;
148 .entity fire_burner;
149
150 void fireburner_think(entity this);
151
152 float Fire_IsBurning(entity e);
153
154 float Fire_AddDamage(entity e, entity o, float d, float t, float dt);
155
156 void Fire_ApplyDamage(entity e);
157
158 void Fire_ApplyEffect(entity e);
159
160 IntrusiveList g_damagedbycontents;
161 STATIC_INIT(g_damagedbycontents) { g_damagedbycontents = IL_NEW(); }