[PR #3240] [MERGED] Spears: the jab animates in first and third person #4860

Closed
opened 2026-11-03 05:08:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3240
Author: @some-du6e
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/spear-jab-animation


📝 Commits (1)

  • f52af64 Spears: the jab animates in first and third person

📊 Changes

9 files changed (+150 additions, -25 deletions)

View changed files

📝 crates/horizon-client/src/first_person.rs (+5 -0)
📝 crates/horizon-client/src/game.rs (+8 -0)
📝 crates/horizon-client/src/game/perspective.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+1 -1)
📝 crates/horizon-client/src/mobs.rs (+2 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+14 -11)
📝 crates/horizon-client/src/mobs/anim.rs (+43 -12)
📝 crates/horizon-client/src/mobs/render.rs (+14 -1)
📝 crates/horizon-client/src/spear.rs (+62 -0)

📄 Description

A player reported that jabbing with a spear (left click) has no animation: the spear just does the normal punch swing, in first and third person. #2731 already sends the jab as a STAB swing (SwingAnimationType 2, from Kinetic::attack_animation), but nothing reads the swing's type, so every swing is drawn as a WHACK.

This ports the three jab curves of vanilla's SpearAnimations into spear.rs, next to #2682's charge ones, and uses them wherever a swing is a STAB:

  • First person: firstPersonAttack after applyItemArmTransform (ItemPose::Stab), picked when the hand's current swing is a STAB.
  • Third person, arm: HumanoidModel.setupAttackAnimation's STAB case (thirdPersonAttackHand). The body still turns, but the arm thrusts instead of whacking.
  • Third person, item: ItemInHandLayer's thirdPersonAttackItem on the swinging arm, using the main hand's forward_movement.
  • Other players and mobs: they now keep the swing's type (MobExtra::swing_stab). swing_hand_modified takes the packet's whole SwingAnimation instead of only its duration. The local player's own model reads it from SwingState.

What I checked:

  • cargo clippy -p horizon-client --lib --bins --tests -D warnings is clean.
  • spear::tests::the_jab_starts_and_ends_at_rest (new) and mobs::anim tests, including a new STAB case in swimming_strokes_the_arms_and_kicks, pass.
  • tools/check_public_tree.py passes.

The same curves ran in game on an earlier branch of mine, against prepared 26.3 resources on both single-player paths: the jab thrusts toward the crosshair and the arm swings in F5. I haven't run this port onto main's spear code in game; it's checked by the tests above. No parity harness covers these animations.

Note

Filed by Claude Opus 5.5 using Claude Code.

Fixes #3135


🔄 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/3240 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/spear-jab-animation` --- ### 📝 Commits (1) - [`f52af64`](https://github.com/horizon-rust/horizon/commit/f52af64e8914ac48b5f1ae2762f62d38bc70d2b3) Spears: the jab animates in first and third person ### 📊 Changes **9 files changed** (+150 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/first_person.rs` (+5 -0) 📝 `crates/horizon-client/src/game.rs` (+8 -0) 📝 `crates/horizon-client/src/game/perspective.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -1) 📝 `crates/horizon-client/src/mobs.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+14 -11) 📝 `crates/horizon-client/src/mobs/anim.rs` (+43 -12) 📝 `crates/horizon-client/src/mobs/render.rs` (+14 -1) 📝 `crates/horizon-client/src/spear.rs` (+62 -0) </details> ### 📄 Description A player reported that jabbing with a spear (left click) has no animation: the spear just does the normal punch swing, in first and third person. #2731 already sends the jab as a STAB swing (`SwingAnimationType` 2, from `Kinetic::attack_animation`), but nothing reads the swing's type, so every swing is drawn as a WHACK. This ports the three jab curves of vanilla's `SpearAnimations` into `spear.rs`, next to #2682's charge ones, and uses them wherever a swing is a STAB: - **First person:** `firstPersonAttack` after `applyItemArmTransform` (`ItemPose::Stab`), picked when the hand's current swing is a STAB. - **Third person, arm:** `HumanoidModel.setupAttackAnimation`'s STAB case (`thirdPersonAttackHand`). The body still turns, but the arm thrusts instead of whacking. - **Third person, item:** `ItemInHandLayer`'s `thirdPersonAttackItem` on the swinging arm, using the main hand's `forward_movement`. - **Other players and mobs:** they now keep the swing's type (`MobExtra::swing_stab`). `swing_hand_modified` takes the packet's whole `SwingAnimation` instead of only its duration. The local player's own model reads it from `SwingState`. What I checked: - `cargo clippy -p horizon-client --lib --bins --tests -D warnings` is clean. - `spear::tests::the_jab_starts_and_ends_at_rest` (new) and `mobs::anim` tests, including a new STAB case in `swimming_strokes_the_arms_and_kicks`, pass. - `tools/check_public_tree.py` passes. The same curves ran in game on an earlier branch of mine, against prepared 26.3 resources on both single-player paths: the jab thrusts toward the crosshair and the arm swings in F5. I haven't run this port onto main's spear code in game; it's checked by the tests above. No parity harness covers these animations. > [!NOTE] > Filed by Claude Opus 5.5 using Claude Code. Fixes #3135 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:28 +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#4860
No description provided.