]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
PlayerDamage_Calculate -> Damage_Calculate
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 3e448363655f6ce712a84efb3af74f3202a68db1..b921143423fa6ce9dcee70c7d55392e3a754b475 100644 (file)
@@ -264,6 +264,18 @@ float Obituary_WeaponDeath(
        return false;
 }
 
+bool frag_centermessage_override(entity attacker, entity targ, int deathtype, int kill_count_to_attacker, int kill_count_to_target)
+{
+       if(deathtype == DEATH_FIRE.m_id)
+       {
+               Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : targ.ping));
+               Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping));
+               return true;
+       }
+
+       return MUTATOR_CALLHOOK(FragCenterMessage, attacker, targ, deathtype, kill_count_to_attacker, kill_count_to_target);
+}
+
 .int buffs = _STAT(BUFFS); // TODO: remove
 entity buff_FirstFromFlags(int _buffs);
 void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
@@ -277,7 +289,6 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
 
        // Set final information for the death
        targ.death_origin = targ.origin;
-       if(targ != attacker) { targ.killer_origin = attacker.origin; }
        string deathlocation = (autocvar_notification_server_allows_location ? NearestLocation(targ.death_origin) : "");
 
        #ifdef NOTIFICATIONS_DEBUG
@@ -413,7 +424,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                                        (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping)
                                );
                        }
-                       else
+                       else if(!frag_centermessage_override(attacker, targ, deathtype, kill_count_to_attacker, kill_count_to_target))
                        {
                                Send_Notification(
                                        NOTIF_ONE,
@@ -560,7 +571,10 @@ void Unfreeze (entity targ)
                return;
 
        if(STAT(FROZEN, targ) && STAT(FROZEN, targ) != 3) // only reset health if target was frozen
+       {
                targ.health = ((IS_PLAYER(targ)) ? start_health : targ.max_health);
+               targ.pauseregen_finished = time + autocvar_g_balance_pause_health_regen;
+       }
 
        STAT(FROZEN, targ) = 0;
        targ.revive_progress = 0;
@@ -699,7 +713,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                }
 
                // should this be changed at all? If so, in what way?
-               MUTATOR_CALLHOOK(PlayerDamage_Calculate, inflictor, attacker, targ, deathtype, damage, mirrordamage, force);
+               MUTATOR_CALLHOOK(Damage_Calculate, inflictor, attacker, targ, deathtype, damage, mirrordamage, force);
                damage = M_ARGV(4, float);
                mirrordamage = M_ARGV(5, float);
                force = M_ARGV(6, vector);