X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fdamage.qc;h=7825b9f1cae385c6a14dcec2109657bf7ea78789;hb=221325d0a55851348e3397354225f04cd472d42f;hp=e3660b21a295c01ce7a079187898f6bfba1b1d3b;hpb=82dbcadfd0556053b74638f2e3ae2e57103ddf26;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index e3660b21a..7825b9f1c 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -1,18 +1,23 @@ -#if defined(CSQC) - #include "../dpdefs/csprogsdefs.qh" - #include "defs.qh" - #include "../common/constants.qh" - #include "../common/util.qh" - #include "../common/weapons/weapons.qh" - #include "autocvars.qh" - #include "../common/deathtypes.qh" - #include "damage.qh" - #include "movetypes.qh" - #include "prandom.qh" - #include "vehicles/vehicles.qh" -#elif defined(MENUQC) -#elif defined(SVQC) -#endif +#include "damage.qh" +#include "_all.qh" + +#include "gibs.qh" +#include "prandom.qh" + +#include "../common/vehicles/cl_vehicles.qh" + +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/movetypes/movetypes.qh" +#include "../common/util.qh" + +#include "../common/weapons/all.qh" + +.entity tag_entity; + +.float cnt; +.int state; +.bool isplayermodel; void DamageEffect_Think() { @@ -47,7 +52,7 @@ void DamageEffect_Think() pointparticles(self.team, org, '0 0 0', 1); } -void DamageEffect(vector hitorg, float dmg, int type, int specnum) +void DamageEffect(vector hitorg, float thedamage, int type, int specnum) { // particle effects for players and objects damaged by weapons (eg: flames coming out of victims shot with rockets) @@ -92,7 +97,7 @@ void DamageEffect(vector hitorg, float dmg, int type, int specnum) return; // allow a single damage on non-skeletal models } - life = bound(autocvar_cl_damageeffect_lifetime_min, dmg * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max); + life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max); effectname = get_weaponinfo(DEATH_WEAPONOF(type)).netname; @@ -121,7 +126,7 @@ void DamageEffect(vector hitorg, float dmg, int type, int specnum) void Ent_DamageInfo(float isNew) { - float dmg, rad, edge, thisdmg; + float thedamage, rad, edge, thisdmg; bool hitplayer = false; int species, forcemul; vector force, thisforce; @@ -137,7 +142,7 @@ void Ent_DamageInfo(float isNew) w_org.y = ReadCoord(); w_org.z = ReadCoord(); - dmg = ReadByte(); + thedamage = ReadByte(); rad = ReadByte(); edge = ReadByte(); force = decompressShortVector(ReadShort()); @@ -168,10 +173,10 @@ void Ent_DamageInfo(float isNew) continue; if(thisdmg < 0) thisdmg = 0; - if(dmg) + if(thedamage) { - thisdmg = dmg + (edge - dmg) * thisdmg; - thisforce = forcemul * vlen(force) * (thisdmg / dmg) * normalize(self.origin - w_org); + thisdmg = thedamage + (edge - thedamage) * thisdmg; + thisforce = forcemul * vlen(force) * (thisdmg / thedamage) * normalize(self.origin - w_org); } else { @@ -184,7 +189,7 @@ void Ent_DamageInfo(float isNew) if(vlen(nearest - w_org) > bound(MIN_DAMAGEEXTRARADIUS, self.damageextraradius, MAX_DAMAGEEXTRARADIUS)) continue; - thisdmg = dmg; + thisdmg = thedamage; thisforce = forcemul * force; } @@ -352,7 +357,7 @@ void Ent_DamageInfo(float isNew) w_random = prandom(); traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); - if(trace_fraction < 1 && hitwep != WEP_VORTEX && hitwep != WEP_VAPORIZER) + if(trace_fraction < 1 && hitwep != WEP_VORTEX.m_id && hitwep != WEP_VAPORIZER.m_id) w_backoff = trace_plane_normal; else w_backoff = -1 * normalize(force);