[PR #2375] [MERGED] Push sonic boom targets only when hit, by their knockback resistance #4256

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

📋 Pull Request Information

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

Base: main ← Head: fix/warden-sonic-boom-knockback


📝 Commits (4)

  • c5a37c0 Push sonic boom targets only when hit, by their knockback resistance
  • d0df238 Include equipment modifiers in a mob's knockback resistance for the sonic boom push
  • 70dd250 Merge main into fix/warden-sonic-boom-knockback
  • 47e6541 Merge main into fix/warden-sonic-boom-knockback

📊 Changes

7 files changed (+154 additions, -77 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+8 -0)
📝 crates/horizon-client/src/game/creatures.rs (+90 -47)
📝 crates/horizon-client/src/game/lan_attributes.rs (+31 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+4 -0)
📝 crates/horizon-client/src/mobs.rs (+9 -0)
📝 crates/horizon-client/src/mobs/finalize.rs (+8 -3)
📝 crates/horizon-client/src/mobs/warden.rs (+4 -27)

📄 Description

What and why

A warden's sonic boom always pushed its target, even when the hit did not land (a player blocking, or inside the hurt cooldown), and it ignored the target's knockback resistance, so a player in netherite armor flew as far as one in no armor.

The warden now sends one SonicBoom event. The game applies the 10 damage first and pushes only if the target was hurt, scaling the push by 1 - knockback_resistance of the target (the player's attribute, or the mob's). It also works for LAN guests, since the event is routed to the guest it hits like the other player hits.

Vanilla reference

  • SonicBoom.tick: if (target.hurtServer(...)) then knockbackVertical = 0.5 * (1.0 - KNOCKBACK_RESISTANCE) and knockbackHorizontal = 2.5 * (1.0 - KNOCKBACK_RESISTANCE), followed by target.push(...).

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/2375 **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/warden-sonic-boom-knockback` --- ### 📝 Commits (4) - [`c5a37c0`](https://github.com/horizon-rust/horizon/commit/c5a37c02de3101da524236010243244d278c5bd4) Push sonic boom targets only when hit, by their knockback resistance - [`d0df238`](https://github.com/horizon-rust/horizon/commit/d0df2389726563ee5d65efb184108c60f2de0df8) Include equipment modifiers in a mob's knockback resistance for the sonic boom push - [`70dd250`](https://github.com/horizon-rust/horizon/commit/70dd250ae63966853dcb87982ee6661c0205e973) Merge main into fix/warden-sonic-boom-knockback - [`47e6541`](https://github.com/horizon-rust/horizon/commit/47e65417315bab25e83662323f687b7915f216ef) Merge main into fix/warden-sonic-boom-knockback ### 📊 Changes **7 files changed** (+154 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+8 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+90 -47) 📝 `crates/horizon-client/src/game/lan_attributes.rs` (+31 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+4 -0) 📝 `crates/horizon-client/src/mobs.rs` (+9 -0) 📝 `crates/horizon-client/src/mobs/finalize.rs` (+8 -3) 📝 `crates/horizon-client/src/mobs/warden.rs` (+4 -27) </details> ### 📄 Description ## What and why A warden's sonic boom always pushed its target, even when the hit did not land (a player blocking, or inside the hurt cooldown), and it ignored the target's knockback resistance, so a player in netherite armor flew as far as one in no armor. The warden now sends one `SonicBoom` event. The game applies the 10 damage first and pushes only if the target was hurt, scaling the push by `1 - knockback_resistance` of the target (the player's attribute, or the mob's). It also works for LAN guests, since the event is routed to the guest it hits like the other player hits. ## Vanilla reference - `SonicBoom.tick`: `if (target.hurtServer(...))` then `knockbackVertical = 0.5 * (1.0 - KNOCKBACK_RESISTANCE)` and `knockbackHorizontal = 2.5 * (1.0 - KNOCKBACK_RESISTANCE)`, followed by `target.push(...)`. ## 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:15:50 +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#4256
No description provided.