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