[PR #2248] [MERGED] Count resisted, absorbed, shield-blocked damage and player kills #4140

Closed
opened 2026-11-03 04:14:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2248
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/stats-combat


📝 Commits (4)

  • 273729a Count the combat statistics
  • 49ad610 Count shield damage only for accepted hits and skip kills saved by a totem
  • ad70f75 Merge main into fix/stats-combat
  • 6a65ee1 A guest saved by a totem is not a player kill

📊 Changes

2 files changed (+37 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/combat.rs (+13 -0)
📝 crates/horizon-client/src/game/lan_pvp.rs (+24 -0)

📄 Description

What and why

Four combat statistics never went up:

  • damage_resisted: damage the Resistance effect removed (the damage code already reported it, nothing counted it)
  • damage_absorbed: damage the absorption hearts took (same)
  • damage_blocked_by_shield: damage a raised shield blocked
  • player_kills: the killing blow of a player hit on another player (melee, for the host and for guests on the server thread)

Amounts are in tenths of a heart, as in vanilla.

Not included: damage_dealt_resisted and damage_dealt_absorbed, because mobs here have no Resistance or absorption to take damage from.

Vanilla reference

  • LivingEntity.getDamageAfterMagicAbsorb (DAMAGE_RESISTED)
  • Player.actuallyHurt (DAMAGE_ABSORBED)
  • LivingEntity.hurtServer (DAMAGE_BLOCKED_BY_SHIELD)
  • ServerPlayer.awardKillScore (PLAYER_KILLS)

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2248 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/stats-combat` --- ### 📝 Commits (4) - [`273729a`](https://github.com/horizon-rust/horizon/commit/273729aac8e7d6f6de6730688b900663efce2d8c) Count the combat statistics - [`49ad610`](https://github.com/horizon-rust/horizon/commit/49ad61035b285c0d24bca0cde1027fd3bf60b41e) Count shield damage only for accepted hits and skip kills saved by a totem - [`ad70f75`](https://github.com/horizon-rust/horizon/commit/ad70f755d7ae81bdb0e85180932c14a943fabc65) Merge main into fix/stats-combat - [`6a65ee1`](https://github.com/horizon-rust/horizon/commit/6a65ee1124f05011034be6499d137e49fb319616) A guest saved by a totem is not a player kill ### 📊 Changes **2 files changed** (+37 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/combat.rs` (+13 -0) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+24 -0) </details> ### 📄 Description ## What and why Four combat statistics never went up: - `damage_resisted`: damage the Resistance effect removed (the damage code already reported it, nothing counted it) - `damage_absorbed`: damage the absorption hearts took (same) - `damage_blocked_by_shield`: damage a raised shield blocked - `player_kills`: the killing blow of a player hit on another player (melee, for the host and for guests on the server thread) Amounts are in tenths of a heart, as in vanilla. Not included: `damage_dealt_resisted` and `damage_dealt_absorbed`, because mobs here have no Resistance or absorption to take damage from. ## Vanilla reference - `LivingEntity.getDamageAfterMagicAbsorb` (`DAMAGE_RESISTED`) - `Player.actuallyHurt` (`DAMAGE_ABSORBED`) - `LivingEntity.hurtServer` (`DAMAGE_BLOCKED_BY_SHIELD`) - `ServerPlayer.awardKillScore` (`PLAYER_KILLS`) ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:58 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4140
No description provided.