[PR #2164] [MERGED] Witches stand still while drinking and skip potions a target already has #4064

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

📋 Pull Request Information

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

Base: main ← Head: fix/witch-drinking


📝 Commits (2)

  • d0509e2 Witches stand still while drinking and skip potions a target already has
  • f8415ef Merge origin/main into fix/witch-drinking

📊 Changes

5 files changed (+44 additions, -4 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+1 -0)
📝 crates/horizon-client/src/mobs.rs (+24 -1)
📝 crates/horizon-client/src/mobs/witch.rs (+17 -3)

📄 Description

What and why

Two small witch differences:

  • Drinking. While a witch drinks a potion, vanilla adds a drinking speed modifier (-0.25, ADD_VALUE) to its movement speed and removes it when the drink is done, so the witch stands still for the 32 ticks. Horizon's witch kept walking. Its movement speed now drops by 0.25 (not below 0) while it drinks.
  • Throwing. Witch.performRangedAttack only picks slowness, poison or weakness if the target does not already have that effect. Horizon chose them from distance and health alone, so a witch kept throwing the same potion at a target that had it. The three branches now check the target's effects first, for a player (a LAN guest's own effects too) and for a mob. The weakness check keeps vanilla's order, so the random draw only happens when the earlier tests pass.

To read a target's effects, PlayerView and Seen now carry the ids of the active effects, with a has_effect helper on each.

Vanilla reference

  • Witch.aiStep (SPEED_MODIFIER_DRINKING, added when a drink starts and removed when usingTime runs out)
  • Witch.performRangedAttack (hasEffect(SLOWNESS / POISON / WEAKNESS))

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/2164 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/witch-drinking` --- ### 📝 Commits (2) - [`d0509e2`](https://github.com/horizon-rust/horizon/commit/d0509e2beeb38dfcb3b927e973e3d3ef6ccd5967) Witches stand still while drinking and skip potions a target already has - [`f8415ef`](https://github.com/horizon-rust/horizon/commit/f8415efe29f4da44041ac3db596982d7848a74c4) Merge origin/main into fix/witch-drinking ### 📊 Changes **5 files changed** (+44 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs.rs` (+24 -1) 📝 `crates/horizon-client/src/mobs/witch.rs` (+17 -3) </details> ### 📄 Description ## What and why Two small witch differences: - **Drinking.** While a witch drinks a potion, vanilla adds a `drinking` speed modifier (-0.25, `ADD_VALUE`) to its movement speed and removes it when the drink is done, so the witch stands still for the 32 ticks. Horizon's witch kept walking. Its movement speed now drops by 0.25 (not below 0) while it drinks. - **Throwing.** `Witch.performRangedAttack` only picks slowness, poison or weakness if the target does not already have that effect. Horizon chose them from distance and health alone, so a witch kept throwing the same potion at a target that had it. The three branches now check the target's effects first, for a player (a LAN guest's own effects too) and for a mob. The weakness check keeps vanilla's order, so the random draw only happens when the earlier tests pass. To read a target's effects, `PlayerView` and `Seen` now carry the ids of the active effects, with a `has_effect` helper on each. ## Vanilla reference - `Witch.aiStep` (`SPEED_MODIFIER_DRINKING`, added when a drink starts and removed when `usingTime` runs out) - `Witch.performRangedAttack` (`hasEffect(SLOWNESS / POISON / WEAKNESS)`) ## 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:14:25 +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#4064
No description provided.