X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fdamage.qc;h=3626c44c617408555c5bb4c4eaede028fe6399db;hb=d9b16a719396d1afe1a767dd35e8cc5de779a22d;hp=000ef8bcc9f45106d9c33e38c085c1e66653ebb3;hpb=e3507f4fdbc2b3e15b663365e57e0aa60f3cf1a6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 000ef8bcc..3626c44c6 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 "vehicles/all.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; }