[PR #2340] [MERGED] Scale cave spider poison and husk hunger with the difficulty #4220

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

📋 Pull Request Information

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

Base: main ← Head: fix/cave-spider-husk-difficulty


📝 Commits (4)

  • fe8565b Scale cave spider poison and husk hunger with the difficulty
  • e98d939 Use the mob's own chunk for its local difficulty
  • 7a0610a Merge main into fix/cave-spider-husk-difficulty
  • 8709026 Merge main into fix/cave-spider-husk-difficulty

📊 Changes

4 files changed (+29 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+3 -0)
📝 crates/horizon-client/src/mobs.rs (+2 -1)
📝 crates/horizon-client/src/mobs/ai.rs (+20 -11)
📝 crates/horizon-client/src/mobs/spawning.rs (+4 -0)

📄 Description

What and why

A cave spider always poisoned for 7 seconds and a husk always gave 140 ticks of hunger, whatever the difficulty. In vanilla:

  • Cave spider: no poison on Easy, 7 seconds on Normal, 15 seconds on Hard.
  • Husk: hunger for 140 * (int) effective difficulty ticks, and only when the husk's main hand is empty.

The world difficulty id is now kept on LocalDifficulty (base), and both attacks use it. A husk holding an item no longer gives hunger, and the effect is skipped when the whole-number difficulty is 0 (a zero-length effect).

Both are in the same attack function, so they are one change. The effective difficulty is the one near the player (the husk is next to the player when it attacks), as the rest of the mob code does.

Vanilla reference

  • CaveSpider.doHurtTarget: Difficulty.NORMAL gives 7, HARD gives 15, poison time * 20.
  • Husk.doHurtTarget: getMainHandItem().isEmpty(), 140 * (int) getEffectiveDifficulty().

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/2340 **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/cave-spider-husk-difficulty` --- ### 📝 Commits (4) - [`fe8565b`](https://github.com/horizon-rust/horizon/commit/fe8565b8740eb6b1282a390a9e6ee4a8d8caf9d4) Scale cave spider poison and husk hunger with the difficulty - [`e98d939`](https://github.com/horizon-rust/horizon/commit/e98d939919169ba833f424ab6d03ede68b591bf2) Use the mob's own chunk for its local difficulty - [`7a0610a`](https://github.com/horizon-rust/horizon/commit/7a0610ade8a3b57cfb6f869a030db1ab3cc3482b) Merge main into fix/cave-spider-husk-difficulty - [`8709026`](https://github.com/horizon-rust/horizon/commit/8709026be3be1532b32ec4f462bb33a4c8f59be5) Merge main into fix/cave-spider-husk-difficulty ### 📊 Changes **4 files changed** (+29 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs.rs` (+2 -1) 📝 `crates/horizon-client/src/mobs/ai.rs` (+20 -11) 📝 `crates/horizon-client/src/mobs/spawning.rs` (+4 -0) </details> ### 📄 Description ## What and why A cave spider always poisoned for 7 seconds and a husk always gave 140 ticks of hunger, whatever the difficulty. In vanilla: - Cave spider: no poison on Easy, 7 seconds on Normal, 15 seconds on Hard. - Husk: hunger for `140 * (int) effective difficulty` ticks, and only when the husk's main hand is empty. The world difficulty id is now kept on `LocalDifficulty` (`base`), and both attacks use it. A husk holding an item no longer gives hunger, and the effect is skipped when the whole-number difficulty is 0 (a zero-length effect). Both are in the same attack function, so they are one change. The effective difficulty is the one near the player (the husk is next to the player when it attacks), as the rest of the mob code does. ## Vanilla reference - `CaveSpider.doHurtTarget`: `Difficulty.NORMAL` gives 7, `HARD` gives 15, poison time `* 20`. - `Husk.doHurtTarget`: `getMainHandItem().isEmpty()`, `140 * (int) getEffectiveDifficulty()`. ## 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:35 +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#4220
No description provided.