From 2b618b1dfefa62e4cb4f19645c6d14184385f44d Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Fri, 9 Oct 2026 13:18:31 +0200 Subject: [PATCH] Let witches heal raiders and name the ominous banner During a raid a witch looks for the other raiders, throws them Regeneration, or Healing once they are almost dead, and the potion cloud heals every raider it reaches. The ominous banner shows its own name and uncommon rarity in tooltips. Co-Authored-By: Claude Sonnet 5.5 --- crates/horizon-client/src/game/creatures.rs | 26 ++++++++++++++++++ crates/horizon-client/src/game/stations.rs | 7 +++++ crates/horizon-client/src/mobs/witch.rs | 30 ++++++++++++++++++++- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index f7068662e..59145f16c 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -1636,6 +1636,32 @@ impl Game<'_> { } } } + // A witch's healing potions reach the raiders around the splash. + if matches!( + *effect, + "minecraft:instant_health" | "minecraft:regeneration" + ) { + let center = at; + for m in &mut self.mobs { + let d2 = m.position.distance_squared(center); + if !m.alive() + || d2 >= 16.0 + || !horizon_client::mobs::raider::is_raider(m.species()) + { + continue; + } + let scale = 1.0 - d2.sqrt() / 4.0; + if *effect == "minecraft:instant_health" { + let heal = (4 << *amplifier) as f64 * scale; + m.health = (m.health + heal as f32).min(m.attrs.max_health); + } else { + let t = (f64::from(*ticks) * scale + 0.5) as i32; + if t > 20 { + m.add_effect(effect, t, *amplifier); + } + } + } + } self.audio.play( "minecraft:entity.splash_potion.break", Some(atp), diff --git a/crates/horizon-client/src/game/stations.rs b/crates/horizon-client/src/game/stations.rs index eb6f8c24d..215dc7b91 100644 --- a/crates/horizon-client/src/game/stations.rs +++ b/crates/horizon-client/src/game/stations.rs @@ -1725,6 +1725,10 @@ impl Game<'_> { let e: &Enchantments = &self.res.stations.enchantments; let props = e.props(&stack.item); let mut rarity = props.map_or("common", |p| p.rarity.as_str()); + // The ominous banner's rarity component. + if stack.data().is_some_and(|d| d.ominous_banner) { + rarity = "uncommon"; + } if !stack.enchantments().is_empty() { rarity = match rarity { "common" | "uncommon" => "rare", @@ -1740,6 +1744,9 @@ impl Game<'_> { }; let name = if let Some(n) = stack.custom_name() { n.to_owned() + } else if stack.data().is_some_and(|d| d.ominous_banner) { + e.translate("block.minecraft.ominous_banner") + .map_or_else(|| "Ominous Banner".to_owned(), str::to_owned) } else if stack.data().and_then(|d| d.potion.as_ref()).is_some() || stack.item.ends_with("potion") || &*stack.item == "minecraft:tipped_arrow" diff --git a/crates/horizon-client/src/mobs/witch.rs b/crates/horizon-client/src/mobs/witch.rs index 59b4ecff7..9fc0b0171 100644 --- a/crates/horizon-client/src/mobs/witch.rs +++ b/crates/horizon-client/src/mobs/witch.rs @@ -19,6 +19,18 @@ pub fn register(m: &mut Mob) { g.add(3, LookAtPlayer::new(8.0)); g.add(3, RandomLookAround::default()); m.ai.targets.add(1, HurtByTarget::new()); + // NearestHealableRaiderTargetGoal: in a raid, go and heal the other raiders. + m.ai.targets.add( + 2, + NearestTarget::new( + super::goals::Prey::Filter(|s| { + super::raider::is_raider(s.species) && s.species != Species::Witch + }), + true, + ) + .interval(1) + .when(|m, _| super::raider::has_active_raid(m)), + ); m.ai.targets .add(3, NearestTarget::player(true).interval(10)); } @@ -129,7 +141,23 @@ fn witch_attack(m: &mut Mob, who: Who, _power: f32, cx: &mut Cx) { }) .map_or(20.0, |s| s.health) }; - let (effect, ticks, amplifier) = if dist >= 8.0 { + // A raider target is healed instead: Healing when nearly dead, else + // Regeneration, and the witch drops the target afterwards. + let heals = match who { + Who::Mob(id) => { + cx.w.seen(id) + .is_some_and(|s| super::raider::is_raider(s.species)) + } + Who::Player => false, + }; + let (effect, ticks, amplifier) = if heals { + m.ai.target = None; + if health <= 4.0 { + ("minecraft:instant_health", 1, 0) + } else { + ("minecraft:regeneration", 900, 0) + } + } else if dist >= 8.0 { ("minecraft:slowness", 1800, 0) } else if health >= 8.0 { ("minecraft:poison", 900, 0)