Merge pull request #2202 from kacpherek/fix/evoker-and-vex-rules
🤖 Agent: Gate check by Ludovic's AI agent (Claude). Checked against 26.3: the evoker's vex summon and cooldowns, the fang lines and circle, the vex limits, and the wololo spell (blue sheep only, with `mob_griefing`). Gate: this wave's 55 PRs merged on main in one tree: clippy `-D warnings` clean, 1186 horizon-client and 163 horizon-world tests pass, and of the 101 harnesses `parity.py --changed-files` picked, 100 pass (`block_removal` failed on one spawner case from #2199's orb merging, fixed there). `lan_e2e.py` passes 24 checks with the host on its server thread and in-frame (chest, xp, pvp, doors, villagers, beds, frames, projectiles, arrows, fishing, damage, mobs, blast, drops, elytra, breath, predict, cracks, barter, kills, hurt, contacts, underwater, plates), plus forced-levels on the server thread. Thanks @kacpherek!
This commit is contained in:
@@ -81,16 +81,28 @@ impl Game<'_> {
|
||||
};
|
||||
bite(self);
|
||||
self.each_guest_hit(bite);
|
||||
// `AbstractIllager.considersEntityAsAlly`: with no teams, the illager
|
||||
// tag is allied; `Evoker.considersEntityAsAlly` adds a vex whose
|
||||
// owner is allied (itself or another illager). Teams are not modelled.
|
||||
let illager = |s: Species| {
|
||||
matches!(
|
||||
s,
|
||||
Species::Evoker | Species::Illusioner | Species::Pillager | Species::Vindicator
|
||||
)
|
||||
};
|
||||
let illagers: Vec<u32> = self
|
||||
.mobs
|
||||
.iter()
|
||||
.filter(|m| illager(m.species()))
|
||||
.map(|m| m.id)
|
||||
.collect();
|
||||
// A missing owner hurts everyone (`currentOwner == null`).
|
||||
let owner_known = illagers.contains(&f.owner);
|
||||
for m in &mut self.mobs {
|
||||
let ally = matches!(
|
||||
m.species(),
|
||||
Species::Evoker
|
||||
| Species::Illusioner
|
||||
| Species::Vex
|
||||
| Species::Pillager
|
||||
| Species::Vindicator
|
||||
| Species::Witch
|
||||
);
|
||||
let ally = owner_known
|
||||
&& (illager(m.species())
|
||||
|| m.species() == Species::Vex
|
||||
&& illagers.contains(&(m.extra.counter2 as u32)));
|
||||
if m.id != f.owner && !ally && m.alive() && m.bounds().intersects(b) {
|
||||
m.damage(
|
||||
6.0,
|
||||
|
||||
@@ -179,8 +179,8 @@ impl Goal for UseSpell {
|
||||
fn can_use(&mut self, m: &mut Mob, cx: &mut Cx) -> bool {
|
||||
let age = i64::from(m.age);
|
||||
if self.spell == Spell::Wololo {
|
||||
// EvokerWololoSpellGoal.canUse: a blue sheep within 16 (4 up or
|
||||
// down), no target, griefing on.
|
||||
// EvokerWololoSpellGoal.canUse: a blue sheep within the box
|
||||
// (16 sideways, 4 up or down) and `range(16)`, no target, griefing on.
|
||||
if m.ai.target.is_some() || m.extra.counter > 0 || age < self.next || !cx.w.mob_griefing
|
||||
{
|
||||
return false;
|
||||
@@ -196,6 +196,7 @@ impl Goal for UseSpell {
|
||||
&& (s.position.x - p.x).abs() <= 16.0
|
||||
&& (s.position.y - p.y).abs() <= 4.0
|
||||
&& (s.position.z - p.z).abs() <= 16.0
|
||||
&& s.position.distance_squared(p) <= 16.0 * 16.0
|
||||
})
|
||||
.map(|s| s.id)
|
||||
.collect();
|
||||
@@ -210,7 +211,8 @@ impl Goal for UseSpell {
|
||||
return false;
|
||||
}
|
||||
if self.spell == Spell::Vexes {
|
||||
// EvokerSummonSpellGoal: fewer vexes nearby than a roll of 1..8.
|
||||
// EvokerSummonSpellGoal: fewer vexes within `range(16)` than a
|
||||
// roll of 1..8.
|
||||
let p = m.position;
|
||||
let vexes =
|
||||
cx.w.others
|
||||
@@ -218,7 +220,7 @@ impl Goal for UseSpell {
|
||||
.filter(|s| {
|
||||
s.species == Species::Vex
|
||||
&& s.alive
|
||||
&& s.position.distance_squared(p) <= 16.0 * 16.0 * 3.0
|
||||
&& s.position.distance_squared(p) <= 16.0 * 16.0
|
||||
})
|
||||
.count() as i32;
|
||||
return m.random.next_int_bound(8).unwrap_or(0) + 1 > vexes;
|
||||
|
||||
@@ -29,6 +29,7 @@ pub fn register(m: &mut Mob) {
|
||||
g.add(8, RandomMove);
|
||||
g.add(9, LookAtPlayer::new(3.0).probability(1.0));
|
||||
g.add(10, LookAtPlayer::mobs(8.0));
|
||||
// `HurtByTargetGoal(this, Raider.class)`: raiders are ignored, vexes are not.
|
||||
let mut hurt = HurtByTarget::new().alert();
|
||||
hurt.ignore = vec![
|
||||
Species::Pillager,
|
||||
@@ -36,7 +37,7 @@ pub fn register(m: &mut Mob) {
|
||||
Species::Evoker,
|
||||
Species::Illusioner,
|
||||
Species::Witch,
|
||||
Species::Vex,
|
||||
Species::Ravager,
|
||||
];
|
||||
m.ai.targets.add(1, hurt);
|
||||
m.ai.targets.add(2, CopyOwnerTarget);
|
||||
|
||||
Reference in New Issue
Block a user