X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=cd6a7000c4f56ac586ad46031d40d8128c526602;hb=6143f483810ae1e181fc53b77cca98e6603be2d1;hp=24bce642d8c7509785f328464225ec793e34daa0;hpb=403009a6838f98e3857e5708f5402c781ec003ce;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 24bce642d..cd6a7000c 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -12,9 +12,11 @@ #include "weapons/accuracy.qh" #include "weapons/csqcprojectile.qh" #include "weapons/selection.qh" +#include "../common/buffs.qh" #include "../common/constants.qh" #include "../common/deathtypes.qh" #include "../common/notifications.qh" +#include "../common/movetypes/movetypes.qh" #include "../common/playerstats.qh" #include "../common/teams.qh" #include "../common/util.qh" @@ -61,18 +63,6 @@ void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad Net_LinkEntity(e, false, 0.2, Damage_DamageInfo_SendEntity); } -float IsFlying(entity a) -{ - if(a.flags & FL_ONGROUND) - return 0; - if(a.waterlevel >= WATERLEVEL_SWIMMING) - return 0; - traceline(a.origin, a.origin - '0 0 48', MOVE_NORMAL, a); - if(trace_fraction < 1) - return 0; - return 1; -} - void UpdateFrags(entity player, float f) { PlayerTeamScore_AddScore(player, f); @@ -157,10 +147,7 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype) entity oldself; oldself = self; self = attacker; - frag_attacker = attacker; - frag_target = targ; - frag_score = f; - if(MUTATOR_CALLHOOK(GiveFragsForKill)) + if(MUTATOR_CALLHOOK(GiveFragsForKill, attacker, targ, f)) { f = frag_score; self = oldself; @@ -494,8 +481,12 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) ); } + float f3 = 0; + if(deathtype == DEATH_BUFF) + f3 = attacker.buffs; + if (!Obituary_WeaponDeath(targ, true, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker)) - Obituary_SpecialDeath(targ, true, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker, 0); + Obituary_SpecialDeath(targ, true, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker, f3); } } @@ -755,13 +746,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d } // should this be changed at all? If so, in what way? - frag_attacker = attacker; - frag_target = targ; - frag_damage = damage; - frag_force = force; - frag_deathtype = deathtype; - frag_mirrordamage = mirrordamage; - MUTATOR_CALLHOOK(PlayerDamage_Calculate); + MUTATOR_CALLHOOK(PlayerDamage_Calculate, attacker, targ, deathtype, damage, mirrordamage, force); damage = frag_damage; mirrordamage = frag_mirrordamage; force = frag_force; @@ -775,7 +760,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d { Unfreeze(targ); targ.health = autocvar_g_freezetag_revive_falldamage_health; - pointparticles(particleeffectnum("iceorglass"), targ.origin, '0 0 0', 3); + Send_Effect("iceorglass", targ.origin, '0 0 0', 3); Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname); Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF); } @@ -786,7 +771,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d if(targ.frozen && deathtype == DEATH_HURTTRIGGER && !autocvar_g_freezetag_frozen_damage_trigger) { - pointparticles(particleeffectnum("teleport"), targ.origin, '0 0 0', 1); + Send_Effect("teleport", targ.origin, '0 0 0', 1); entity oldself = self; self = targ; @@ -816,7 +801,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d self.oldorigin = self.origin; self.prevorigin = self.origin; - pointparticles(particleeffectnum("teleport"), self.origin, '0 0 0', 1); + Send_Effect("teleport", self.origin, '0 0 0', 1); } self = oldself; @@ -850,7 +835,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d // count the damage if(attacker) if(!targ.deadflag) - if(deathtype != DEATH_BUFF_VENGEANCE) + if(deathtype != DEATH_BUFF) if(targ.takedamage == DAMAGE_AIM) if(targ != attacker) { @@ -924,8 +909,12 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d farcent.think = SUB_Remove; } else + { self.velocity = self.velocity + farce; + self.move_velocity = self.velocity; + } self.flags &= ~FL_ONGROUND; + self.move_flags &= ~FL_ONGROUND; UpdateCSQCProjectile(self); } // apply damage @@ -1128,7 +1117,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in RadiusDamage_running = 0; if(!DEATH_ISSPECIAL(deathtype)) - accuracy_add(attacker, DEATH_WEAPONOFWEAPONDEATH(deathtype), 0, min(coredamage, stat_damagedone)); + accuracy_add(attacker, DEATH_WEAPONOF(deathtype), 0, min(coredamage, stat_damagedone)); return total_damage_to_creatures; } @@ -1244,7 +1233,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt) } } if(accuracy_isgooddamage(o, e)) - accuracy_add(o, DEATH_WEAPONOFWEAPONDEATH(dt), 0, max(0, totaldamage - mindamage)); + accuracy_add(o, DEATH_WEAPONOF(dt), 0, max(0, totaldamage - mindamage)); return max(0, totaldamage - mindamage); // can never be negative, but to make sure } else @@ -1258,7 +1247,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt) e.fire_owner = o; e.fire_hitsound = false; if(accuracy_isgooddamage(o, e)) - accuracy_add(o, DEATH_WEAPONOFWEAPONDEATH(dt), 0, d); + accuracy_add(o, DEATH_WEAPONOF(dt), 0, d); return d; } }