[PR #3895] [MERGED] Mobs: apply Weakness, Slowness and Health Boost attribute modifiers #5275

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3895
Author: @ccclosed
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/mob-effect-attribute-modifiers


📝 Commits (2)

  • 410bde7 Mobs: apply the Weakness, Slowness and Health Boost attribute modifiers
  • 3b6972a Slowness: the -0.15F modifier widened from a float, as vanilla's MobEffects

📊 Changes

1 file changed (+53 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/mobs/finalize.rs (+53 -12)

📄 Description

🤖 Opened by ccclosed's AI agent (DeepSeek Harness, deepseek-v4.1-flash), not by ccclosed personally.

What and why

Fixes #3887. effect_modifiers in crates/horizon-client/src/mobs/finalize.rs only mapped strength and speed, so a mob under Weakness kept its full melee damage and one under Slowness kept its full movement speed (e.g. a zombie under Weakness I still hit for 3.0 instead of 0, and under Slowness I moved at 0.23 instead of 0.1955).

Add the vanilla effect rows, each scaled by amplifier + 1 exactly as MobEffect.addAttributeModifier does:

effect attribute amount per level operation
weakness attack damage −4.0 ADD_VALUE
slowness movement speed −0.15 ADD_MULTIPLIED_TOTAL
health_boost max health +4.0 ADD_VALUE

The per-effect table moves into effect_modifier(effect, amplifier, attr), so it is unit-testable without loading mob data; the existing strength/speed rows keep their amounts and the new test covers all five rows plus the "does not touch this attribute" cases.

Vanilla reference

MobEffects.WEAKNESS (ATTACK_DAMAGE, -4.0, ADD_VALUE), MobEffects.SLOWNESS (MOVEMENT_SPEED, -0.15, ADD_MULTIPLIED_TOTAL), MobEffects.HEALTH_BOOST (MAX_HEALTH, +4.0, ADD_VALUE), all applied per level by MobEffect.addAttributeModifier.

Tests

$ cargo test -p horizon-client --lib --no-default-features mobs::finalize::tests::weakness -- --nocapture
test mobs::finalize::tests::weakness_slowness_and_health_boost_carry_attribute_modifiers ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 696 filtered out

$ cargo fmt -p horizon-client -- --check
(clean)

Self-check

python3 tools/parity.py --changed-files lists 361 harnesses depending on this file (attribute, attribute_updates, attribute_health, active_effects, …); CI's parity job will run the selected set. pr_ready.py was not run on this machine: the checkout has no prepared .local vanilla data (only an external prepared tree), so the focused unit test + fmt are what was run locally.

🤖 Generated with DeepSeek Harness


🔄 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/3895 **Author:** [@ccclosed](https://github.com/ccclosed) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/mob-effect-attribute-modifiers` --- ### 📝 Commits (2) - [`410bde7`](https://github.com/horizon-rust/horizon/commit/410bde729b90902580c32878a2f8e003c2bfc358) Mobs: apply the Weakness, Slowness and Health Boost attribute modifiers - [`3b6972a`](https://github.com/horizon-rust/horizon/commit/3b6972a40a245369536adc7d0811170068c0a97e) Slowness: the -0.15F modifier widened from a float, as vanilla's MobEffects ### 📊 Changes **1 file changed** (+53 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/finalize.rs` (+53 -12) </details> ### 📄 Description > 🤖 Opened by ccclosed's AI agent (DeepSeek Harness, deepseek-v4.1-flash), not by ccclosed personally. ## What and why Fixes #3887. `effect_modifiers` in `crates/horizon-client/src/mobs/finalize.rs` only mapped `strength` and `speed`, so a mob under Weakness kept its full melee damage and one under Slowness kept its full movement speed (e.g. a zombie under Weakness I still hit for 3.0 instead of 0, and under Slowness I moved at 0.23 instead of 0.1955). Add the vanilla effect rows, each scaled by `amplifier + 1` exactly as `MobEffect.addAttributeModifier` does: | effect | attribute | amount per level | operation | |---|---|---|---| | weakness | attack damage | −4.0 | `ADD_VALUE` | | slowness | movement speed | −0.15 | `ADD_MULTIPLIED_TOTAL` | | health_boost | max health | +4.0 | `ADD_VALUE` | The per-effect table moves into `effect_modifier(effect, amplifier, attr)`, so it is unit-testable without loading mob data; the existing strength/speed rows keep their amounts and the new test covers all five rows plus the "does not touch this attribute" cases. ## Vanilla reference `MobEffects.WEAKNESS` (`ATTACK_DAMAGE`, `-4.0`, `ADD_VALUE`), `MobEffects.SLOWNESS` (`MOVEMENT_SPEED`, `-0.15`, `ADD_MULTIPLIED_TOTAL`), `MobEffects.HEALTH_BOOST` (`MAX_HEALTH`, `+4.0`, `ADD_VALUE`), all applied per level by `MobEffect.addAttributeModifier`. ## Tests ``` $ cargo test -p horizon-client --lib --no-default-features mobs::finalize::tests::weakness -- --nocapture test mobs::finalize::tests::weakness_slowness_and_health_boost_carry_attribute_modifiers ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 696 filtered out $ cargo fmt -p horizon-client -- --check (clean) ``` ## Self-check `python3 tools/parity.py --changed-files` lists 361 harnesses depending on this file (`attribute`, `attribute_updates`, `attribute_health`, `active_effects`, …); CI's parity job will run the selected set. `pr_ready.py` was not run on this machine: the checkout has no prepared `.local` vanilla data (only an external prepared tree), so the focused unit test + fmt are what was run locally. 🤖 Generated with [DeepSeek Harness](https://deepseek.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:27 +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#5275
No description provided.