Let a vindicator named Johnny attack other raiders too

Vanilla's Johnny goal targets any living entity that can be attacked.
Horizon skipped pillagers, vindicators, witches, evokers, illusioners
and ravagers, so Johnny left them alone. Remove that filter.
This commit is contained in:
Kacpherek
2026-10-26 19:30:38 +01:00
parent 68db8847e7
commit 575cef1d26
+3 -14
View File
@@ -13,18 +13,6 @@ use horizon_core::geometry::trig::Mth;
use horizon_core::{geometry::Vec3, random::RandomSource};
use std::f32::consts::PI;
/// The species raiders do not fight (`Raider`'s allies).
fn raider(s: Species) -> bool {
matches!(
s,
Species::Pillager
| Species::Vindicator
| Species::Witch
| Species::Evoker
| Species::Illusioner
| Species::Ravager
)
}
fn targets(m: &mut Mob, villagers_seen: bool) {
let mut hurt = HurtByTarget::new().alert();
hurt.ignore = vec![
@@ -78,10 +66,11 @@ pub fn register_vindicator(m: &mut Mob) {
g.add(9, LookAtPlayer::new(3.0).probability(1.0));
g.add(10, LookAtPlayer::mobs(8.0));
targets(m, true);
// VindicatorJohnnyAttackGoal: a vindicator named Johnny attacks anything.
// VindicatorJohnnyAttackGoal: a vindicator named Johnny attacks any
// living entity, other raiders included.
m.ai.targets.add(
4,
NearestTarget::new(Prey::Filter(|s| !raider(s.species)), true)
NearestTarget::new(Prey::Filter(|_| true), true)
.interval(0)
.when(|m, _| m.custom_name.as_deref() == Some("Johnny")),
);