[PR #6872] [CLOSED] Play the sitting attack's growl and the dying phase's puff on the host #7164

Closed
opened 2026-11-03 06:35:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6872
Author: @MSedgeMC
Created: 11/2/2026
Status: ❌ Closed

Base: main ← Head: fix/dragon-phase-client-effects


📝 Commits (1)

  • e96dcf9 Play the sitting attack's growl and the dying phase's puff on the host

📊 Changes

1 file changed (+82 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+82 -11)

📄 Description

Vanilla behaviour

EnderDragon.aiStep ends by running the current phase's tick on the side it is
on (doClientTick on a client), and it runs only while the dragon is alive —
tickDeath takes over once health reaches 0.

  • DragonSittingAttackingPhase.doClientTick: playLocalSound(ENDER_DRAGON_GROWL, 2.5F, 0.8F + random.nextFloat() * 0.3F) at the dragon, on every client
    tick of the 40.
  • DragonDeathPhase.doClientTick: ++time; if (time % 10 == 0) an
    EXPLOSION_EMITTER at x + (nextFloat() - 0.5) * 8, y + 2 + (nextFloat() - 0.5) * 4, z + (nextFloat() - 0.5) * 8, so ticks 10, 20, …
    and never tick 0.

What Horizon got wrong

The fight's own client is the host, and it ran neither:

  • the Attacking arm of tick_phase did nothing but count the 40 ticks — its
    comment left the growl to remote_dragon_phase_tick, which is only reached
    from tick_remote_dragon (a server's client). A single player facing a
    perched dragon got silence where vanilla growls every tick;
  • the Dying arm counted its 200 ticks with no puff, so a dragon dying on the
    podium sent only tickDeath's 180-to-200 bursts. The server's-client path did
    puff, but on tick 0, 10, … because it checked time % 10 before advancing it.

Both are now death_puff / death_puff_due / sitting_growl_pitch:
tick_phase's Attacking arm growls at pos (the position the tick started
at, as vanilla's client tick does), its Dying arm puffs, and
remote_dragon_phase_tick shares the same two helpers and advances time
before the check, so its first puff moves from tick 0 to tick 10.

The growl's pitch and the puff's offsets come from the world's random on the
host: the dragon's own stream is the fight's (Mob.baseTick's ambient roll,
the crystal scan, tickDeath's bursts), and vanilla's client copy never draws
on the server copy's stream.

Proven

cargo test -q -p horizon-client --lib game::dragon — 19 passed, 0 failed,
1 ignored
(the render fixture). Two new tests:

  • the_dying_flight_puffs_every_ten_ticks: no puff at 0, 1 or 9, one at 10 and
    200, none at 201, twenty across a 200-tick phase, and every puff within four
    blocks of the dragon and two above it.
  • a_sitting_attack_growl_pitches_between_08_and_11: 32 draws all inside
    [0.8, 1.1) and not all equal.

cargo clippy -q -p horizon-client --lib -- -D warnings clean;
rustfmt --edition 2024 --check crates/horizon-client/src/game/dragon.rs clean.

Not proven

No in-game check: a perched dragon's growl and a dragon dying on the podium need
a real End fight, which the harness does not stage. The unit tests pin the
cadence and the values, not what is heard or seen.

The two tools/port_map/classes-01.tsv rows for these methods stay as they are:
the corrections for them are held for a batch, and PR #6837 already edits the
rows next to them in that file.


🔄 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/6872 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/dragon-phase-client-effects` --- ### 📝 Commits (1) - [`e96dcf9`](https://github.com/horizon-rust/horizon/commit/e96dcf91908c04392972e8b33658bc0908bbc32c) Play the sitting attack's growl and the dying phase's puff on the host ### 📊 Changes **1 file changed** (+82 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+82 -11) </details> ### 📄 Description ## Vanilla behaviour `EnderDragon.aiStep` ends by running the current phase's tick on the side it is on (`doClientTick` on a client), and it runs only while the dragon is alive — `tickDeath` takes over once health reaches 0. - `DragonSittingAttackingPhase.doClientTick`: `playLocalSound(ENDER_DRAGON_GROWL, 2.5F, 0.8F + random.nextFloat() * 0.3F)` at the dragon, on **every** client tick of the 40. - `DragonDeathPhase.doClientTick`: `++time; if (time % 10 == 0)` an `EXPLOSION_EMITTER` at `x + (nextFloat() - 0.5) * 8`, `y + 2 + (nextFloat() - 0.5) * 4`, `z + (nextFloat() - 0.5) * 8`, so ticks 10, 20, … and never tick 0. ## What Horizon got wrong The fight's own client is the host, and it ran neither: - the `Attacking` arm of `tick_phase` did nothing but count the 40 ticks — its comment left the growl to `remote_dragon_phase_tick`, which is only reached from `tick_remote_dragon` (a server's client). A single player facing a perched dragon got silence where vanilla growls every tick; - the `Dying` arm counted its 200 ticks with no puff, so a dragon dying on the podium sent only `tickDeath`'s 180-to-200 bursts. The server's-client path did puff, but on tick 0, 10, … because it checked `time % 10` before advancing it. Both are now `death_puff` / `death_puff_due` / `sitting_growl_pitch`: `tick_phase`'s `Attacking` arm growls at `pos` (the position the tick started at, as vanilla's client tick does), its `Dying` arm puffs, and `remote_dragon_phase_tick` shares the same two helpers and advances `time` before the check, so its first puff moves from tick 0 to tick 10. The growl's pitch and the puff's offsets come from the world's random on the host: the dragon's own stream is the fight's (`Mob.baseTick`'s ambient roll, the crystal scan, `tickDeath`'s bursts), and vanilla's client copy never draws on the server copy's stream. ## Proven `cargo test -q -p horizon-client --lib game::dragon` — **19 passed, 0 failed, 1 ignored** (the render fixture). Two new tests: - `the_dying_flight_puffs_every_ten_ticks`: no puff at 0, 1 or 9, one at 10 and 200, none at 201, twenty across a 200-tick phase, and every puff within four blocks of the dragon and two above it. - `a_sitting_attack_growl_pitches_between_08_and_11`: 32 draws all inside `[0.8, 1.1)` and not all equal. `cargo clippy -q -p horizon-client --lib -- -D warnings` clean; `rustfmt --edition 2024 --check crates/horizon-client/src/game/dragon.rs` clean. ## Not proven No in-game check: a perched dragon's growl and a dragon dying on the podium need a real End fight, which the harness does not stage. The unit tests pin the cadence and the values, not what is heard or seen. The two `tools/port_map/classes-01.tsv` rows for these methods stay as they are: the corrections for them are held for a batch, and PR #6837 already edits the rows next to them in that file. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:35:06 +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#7164
No description provided.