X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=2ba82251de5c95823ecdd66fca2073f3ac704e53;hb=6c3104a65005223002dfb708d4dec7481722c355;hp=046e0f5137981e426082c31a524140697f4c72cb;hpb=2f2fd66d1b78236228005a04f5bc193e7ff37251;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 046e0f513..2ba82251d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -47,8 +47,6 @@ float checkrules_firstblood; float yoda; float damage_goodhits; float damage_gooddamage; -float headshot; -float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after use .float dmg_team; .float teamkill_complain; @@ -86,15 +84,6 @@ float IsFlying(entity a) return 1; } -vector GetHeadshotMins(entity targ) -{ - return '-0.5 0 0' * PL_HEAD_x + '0 -0.5 0' * PL_HEAD_y + '0 0 1' * (targ.maxs_z - PL_HEAD_z); -} -vector GetHeadshotMaxs(entity targ) -{ - return '0.5 0 0' * PL_HEAD_x + '0 0.5 0' * PL_HEAD_y + '0 0 1' * targ.maxs_z; -} - void UpdateFrags(entity player, float f) { PlayerTeamScore_AddScore(player, f); @@ -131,10 +120,6 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype) PlayerScore_Add(targ, SP_DEATHS, 1); - if(g_arena || g_ca) - if(autocvar_g_arena_roundbased) - return; - if(targ != attacker) // not for suicides if(g_weaponarena_random) { @@ -310,13 +295,13 @@ void LogDeath(string mode, float deathtype, entity killer, entity killed) void Send_KillNotification (string s1, string s2, string s3, float msg, float type) { - WriteByte(MSG_ALL, SVC_TEMPENTITY); - WriteByte(MSG_ALL, TE_CSQC_KILLNOTIFY); - WriteString(MSG_ALL, s1); - WriteString(MSG_ALL, s2); - WriteString(MSG_ALL, s3); - WriteShort(MSG_ALL, msg); - WriteByte(MSG_ALL, type); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_CSQC_KILLNOTIFY); + WriteString(MSG_BROADCAST, s1); + WriteString(MSG_BROADCAST, s2); + WriteString(MSG_BROADCAST, s3); + WriteShort(MSG_BROADCAST, msg); + WriteByte(MSG_BROADCAST, type); } // Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases) @@ -339,7 +324,7 @@ void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) { string s, a, msg; - float w, type; + float type; if (targ.classname == "player") { @@ -373,7 +358,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) deathtype = KILL_TEAM_BLUE; } - Send_KillNotification(s, msg, ftos(w), deathtype, MSG_SUICIDE); + Send_KillNotification(s, msg, "", deathtype, MSG_SUICIDE); } else if (attacker.classname == "player") { @@ -640,7 +625,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float attacker.dmg_take += v_x; attacker.dmg_save += v_y; attacker.dmg_inflictor = inflictor; - mirrordamage = 0; + mirrordamage = v_z; // = 0, to make fteqcc stfu mirrorforce = 0; } @@ -792,31 +777,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(targ.takedamage == DAMAGE_AIM) if(targ != attacker) { - if(damage_headshotbonus) - { - if(targ.classname == "player") - { - // HEAD SHOT: - // find height of hit on player axis - // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot - vector headmins, headmaxs, org; - org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker)); - headmins = org + GetHeadshotMins(targ); - headmaxs = org + GetHeadshotMaxs(targ); - if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs)) - { - deathtype |= HITTYPE_HEADSHOT; - } - } - else if(targ.classname == "turret_head") - { - deathtype |= HITTYPE_HEADSHOT; - } - if(deathtype & HITTYPE_HEADSHOT) - if(damage_headshotbonus > 0) - damage *= 1 + damage_headshotbonus; - } - entity victim; if((targ.vehicle_flags & VHF_ISVEHICLE) && targ.owner) victim = targ.owner; @@ -850,12 +810,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(g_minstagib) if(victim.items & IT_STRENGTH) yoda = 1; - - if(deathtype & HITTYPE_HEADSHOT) - headshot = 1; } - if(g_ca) - PlayerScore_Add(attacker, SP_SCORE, damage * autocvar_g_ca_damage2score_multiplier); } } else @@ -1048,10 +1003,7 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e myblastorigin = WarpZone_TransformOrigin(targ, blastorigin); // if it's a player, use the view origin as reference - if (targ.classname == "player") - center = targ.origin + targ.view_ofs; - else - center = targ.origin + (targ.mins + targ.maxs) * 0.5; + center = CENTER_OR_VIEWOFS(targ); force = normalize(center - myblastorigin); force = force * (finaldmg / coredamage) * forceintensity;