From 49ad61035b285c0d24bca0cde1027fd3bf60b41e Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 16:47:11 +0100 Subject: [PATCH] Count shield damage only for accepted hits and skip kills saved by a totem --- crates/horizon-client/src/game/combat.rs | 5 ++++- crates/horizon-client/src/game/lan_pvp.rs | 4 +++- crates/horizon-client/src/game/shield.rs | 7 ------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/horizon-client/src/game/combat.rs b/crates/horizon-client/src/game/combat.rs index 197c77f17..fee887f97 100644 --- a/crates/horizon-client/src/game/combat.rs +++ b/crates/horizon-client/src/game/combat.rs @@ -74,11 +74,14 @@ impl Game<'_> { for e in events { let (name, amount) = match e { // LivingEntity.getDamageAfterMagicAbsorb (Resistance) and - // Player.actuallyHurt (absorption hearts), in tenths. + // Player.actuallyHurt (absorption hearts) and + // LivingEntity.hurtServer (the shield, only for an accepted + // hit), in tenths. MotionEvent::Health(HealthEvent::Statistic { name, amount }) => { match *name { "resisted" => self.stats.custom("damage_resisted", *amount), "absorbed" => self.stats.custom("damage_absorbed", *amount), + "blocked" => self.stats.custom("damage_blocked_by_shield", *amount), _ => {} } continue; diff --git a/crates/horizon-client/src/game/lan_pvp.rs b/crates/horizon-client/src/game/lan_pvp.rs index a2ff13444..276a33c83 100644 --- a/crates/horizon-client/src/game/lan_pvp.rs +++ b/crates/horizon-client/src/game/lan_pvp.rs @@ -256,10 +256,12 @@ impl Game<'_> { // ServerPlayer.awardKillScore: the blow that kills a player. if hurt { let died = match victim { + // A totem that fired is applied on the next tick_totem, so the + // host is still at zero health but is not dying. Victim::Host => self .player .as_ref() - .is_some_and(|p| p.health.dead_or_dying()), + .is_some_and(|p| p.health.dead_or_dying() && !p.health.totem_used), Victim::Guest(conn) => host .hub .guest(conn) diff --git a/crates/horizon-client/src/game/shield.rs b/crates/horizon-client/src/game/shield.rs index f4642f272..c4f7f98d1 100644 --- a/crates/horizon-client/src/game/shield.rs +++ b/crates/horizon-client/src/game/shield.rs @@ -121,13 +121,6 @@ impl Game<'_> { attacker: Option, projectile: bool, ) { - // LivingEntity.hurtServer: the damage the shield took, in tenths. - if outcome.blocked > 0.0 { - self.stats.custom( - "damage_blocked_by_shield", - (outcome.blocked * 10.0).round() as i32, - ); - } let Some((slot, _)) = self.using else { return }; let Some(stack) = self.stack_in(slot).cloned() else { return;