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