]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/damage.qh
Merge branch 'master' into terencehill/lms_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / damage.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4
5 bool autocvar_g_throughfloor_debug;
6 float autocvar_g_throughfloor_damage;
7 float autocvar_g_throughfloor_force;
8 float autocvar_g_throughfloor_damage_max_stddev;
9 float autocvar_g_throughfloor_force_max_stddev;
10 float autocvar_g_throughfloor_min_steps_player;
11 float autocvar_g_throughfloor_max_steps_player;
12 float autocvar_g_throughfloor_min_steps_other;
13 float autocvar_g_throughfloor_max_steps_other;
14 float autocvar_g_mirrordamage;
15 bool autocvar_g_mirrordamage_virtual;
16 bool autocvar_g_mirrordamage_onlyweapons;
17 float autocvar_g_maxpushtime;
18 float autocvar_g_balance_damagepush_speedfactor;
19 int autocvar_g_balance_firetransfer_damage;
20 int autocvar_g_balance_firetransfer_time;
21 float autocvar_g_balance_armor_blockpercent;
22 float autocvar_g_teamdamage_resetspeed;
23 float autocvar_g_teamdamage_threshold;
24 float autocvar_g_balance_selfdamagepercent;
25 float autocvar_g_friendlyfire;
26 float autocvar_g_friendlyfire_virtual;
27 float autocvar_g_friendlyfire_virtual_force;
28 float autocvar_g_frozen_revive_falldamage;
29 int autocvar_g_frozen_revive_falldamage_health;
30 bool autocvar_g_frozen_damage_trigger;
31 float autocvar_g_frozen_force;
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
46 float checkrules_firstblood;
47
48 .float damagedbycontents;
49 .float damagedbytriggers;
50
51 float yoda;
52 int impressive_hits;
53
54 .float pain_finished; // Added by Supajoe
55
56 .float dmg_team;
57 .float teamkill_complain;
58 .float teamkill_soundtime;
59 .entity teamkill_soundsource;
60 .entity pusher;
61 .bool istypefrag;
62 .float taunt_soundtime;
63
64 .float spawnshieldtime;
65
66 .int totalfrags;
67
68 .bool canteamdamage;
69
70 .vector death_origin;
71
72 .float damage_dealt, typehitsound, killsound;
73
74 // used for custom deathtype
75 string deathmessage;
76
77 float IsFlying(entity a);
78
79 void UpdateFrags(entity player, int f);
80
81 // NOTE: f=0 means still count as a (positive) kill, but count no frags for it
82 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
83 void GiveFrags (entity attacker, entity targ, float f, int deathtype, .entity weaponentity);
84
85 string AppendItemcodes(string s, entity player);
86
87 void LogDeath(string mode, int deathtype, entity killer, entity killed);
88
89 void Obituary_SpecialDeath(
90         entity notif_target,
91         float murder,
92         int deathtype,
93         string s1, string s2, string s3,
94         float f1, float f2, float f3);
95
96 float w_deathtype;
97 float Obituary_WeaponDeath(
98         entity notif_target,
99         float murder,
100         int deathtype,
101         string s1, string s2, string s3,
102         float f1, float f2);
103
104 void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .entity weaponentity);
105
106 // Frozen status effect
107 //const int FROZEN_NOT              = 0;
108 const int FROZEN_NORMAL             = 1;
109 const int FROZEN_TEMP_REVIVING      = 2;
110 const int FROZEN_TEMP_DYING         = 3;
111
112 .float revival_time; // time at which player was last revived
113 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
114 .float freeze_time;
115 .entity iceblock;
116 .entity frozen_by; // for ice fields
117
118 void Ice_Think(entity this);
119
120 void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint);
121
122 void Unfreeze(entity targ, bool reset_health);
123
124 // WEAPONTODO
125 #define DMG_NOWEP (weaponentities[0])
126
127 // NOTE: the .weaponentity parameter can be set to DMG_NOWEP if the attack wasn't caused by a weapon or player
128 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
129
130 float RadiusDamage_running;
131 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);
132         // Returns total damage applies to creatures
133
134 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity);
135
136 .float damageforcescale;
137 const float MIN_DAMAGEEXTRARADIUS = 2;
138 const float MAX_DAMAGEEXTRARADIUS = 16;
139 .float damageextraradius;
140
141 // Calls .event_heal on the target so that they can handle healing themselves
142 // a limit of RES_LIMIT_NONE should be handled by the entity as its max health (if applicable)
143 bool Heal(entity targ, entity inflictor, float amount, float limit);
144
145 .float fire_damagepersec;
146 .float fire_deathtype;
147 .entity fire_owner;
148 .float fire_hitsound;
149 .entity fire_burner;
150
151 float Fire_AddDamage(entity e, entity o, float d, float t, float dt);
152
153 void Fire_ApplyDamage(entity e);
154
155 IntrusiveList g_damagedbycontents;
156 STATIC_INIT(g_damagedbycontents) { g_damagedbycontents = IL_NEW(); }