Fix horse standing, angry, ambient and baby horse voices

RandomStandGoal plays getAmbientStandSound (the ambient sound) for every horse, not entity.horse.angry for horses only; makeMad uses getAngrySound (zombie horse its own, skeleton horse none, baby horse baby_horse.angry); a baby horse and a skeleton horse in water pick their own ambient, hurt and death sounds.
This commit is contained in:
Kacpherek
2026-10-27 22:25:07 +01:00
parent d878f3bed2
commit ea6ebae264
2 changed files with 22 additions and 5 deletions
+12
View File
@@ -1466,6 +1466,18 @@ pub fn voice_sounds(m: &Mob) -> [&'static str; 3] {
};
[ambient, m.kind.sounds[1], m.kind.sounds[2]]
}
// Horse.getAmbientSound, getHurtSound and getDeathSound by age.
Species::Horse if m.is_baby() => [
"entity.baby_horse.ambient",
"entity.baby_horse.hurt",
"entity.baby_horse.death",
],
// SkeletonHorse.getAmbientSound: its own under water.
Species::SkeletonHorse if m.fluids.eye_in_water => [
"entity.skeleton_horse.ambient_water",
m.kind.sounds[1],
m.kind.sounds[2],
],
// The mob's sound variant set, the baby one for a baby.
Species::Pig | Species::Cow | Species::Chicken | Species::Wolf | Species::Cat => {
use super::finalize::variant_sound as v;
+10 -5
View File
@@ -292,13 +292,17 @@ pub fn make_mad(m: &mut Mob, events: &mut Vec<MobEvent>) {
m.extra.counter = 20;
m.extra.flag = false;
}
// getAngrySound: null (silent) for the skeleton horse.
let sound = match m.species() {
Species::SkeletonHorse => return,
Species::Donkey => "entity.donkey.angry",
Species::Mule => "entity.mule.angry",
Species::ZombieHorse => "entity.zombie_horse.angry",
Species::Llama | Species::TraderLlama => "entity.llama.angry",
_ if m.is_baby() => "entity.baby_horse.angry",
_ => "entity.horse.angry",
};
events.push(MobEvent::Sound(sound, m.center(), 1.0, 1.0));
m.voice(sound, events);
}
/// `RandomStandGoal`.
#[derive(Clone, Debug)]
@@ -324,10 +328,11 @@ impl Goal for RandomStand {
fn start(&mut self, m: &mut Mob, cx: &mut Cx) {
m.extra.counter = 20;
m.extra.flag = false;
if m.species() == Species::Horse {
cx.events
.push(MobEvent::Sound("entity.horse.angry", m.center(), 1.0, 1.0));
}
// playStandSound: getAmbientStandSound is the ambient sound, plain
// playSound(sound) at volume and pitch 1.
let sound = super::ai::voice_sounds(m)[0];
let at = [m.position.x, m.position.y, m.position.z];
cx.events.push(MobEvent::Sound(sound, at, 1.0, 1.0));
}
}
/// Horses that step with `AbstractHorse.playStepSound` (llamas and camels