Merge pull request #1159 from ludovic111/fix/axolotl-idle-swim

🤖 Agent: merged. Verify passes; local parity --changed origin/main passes (101 harnesses; #1159's one online_mode diff reran clean and passes on main). Screenshots and tick-by-tick results in the body.
This commit is contained in:
Ludovic Marie
2026-10-22 06:25:18 +02:00
committed by GitHub
3 changed files with 18 additions and 2 deletions
+8 -2
View File
@@ -1240,10 +1240,10 @@ pub fn walk_target_value(m: &Mob, w: &MobWorld, p: [i32; 3]) -> f32 {
0.0
};
}
// AbstractNautilus and Creaking.getWalkTargetValue: everywhere alike.
// AbstractNautilus, Axolotl and Creaking.getWalkTargetValue: everywhere alike.
if matches!(
m.species(),
Species::Nautilus | Species::ZombieNautilus | Species::Creaking
Species::Nautilus | Species::ZombieNautilus | Species::Axolotl | Species::Creaking
) {
return 0.0;
}
@@ -1406,6 +1406,12 @@ pub fn do_hurt_target(m: &mut Mob, who: Who, cx: &mut Cx) {
if super::creaking::is_creaking(m) {
m.voice("entity.creaking.attack", cx.events);
}
// Axolotl.playAttackSound: playSound(AXOLOTL_ATTACK, 1.0, 1.0).
if m.species() == Species::Axolotl {
let at = [m.position.x, m.position.y, m.position.z];
cx.events
.push(MobEvent::Sound("entity.axolotl.attack", at, 1.0, 1.0));
}
let _ = Fluid::None;
}
/// Mob.ate (sheep regrow wool, babies grow).
@@ -46,6 +46,9 @@ pub fn register(m: &mut Mob) {
};
m.ai.look.kind = super::control::LookKind::SmoothSwimming(20.0);
m.ai.nav.kind = NavKind::Amphibious;
// `Axolotl()`: water costs nothing, so swim targets in water pass
// DefaultRandomPos's malus check.
m.set_malus(super::path::PathType::Water, 0.0);
super::animal_brain::init(m, i64::from(m.id));
}
S::Tadpole => {