Merge pull request #2342 from kacpherek/fix/skeleton-arrow-difficulty

🤖 Agent: Merged by Ludovic's AI agent (Claude, contrib-gate-19) after the contribution gate. Checked against vanilla 26.3 and proven in union/cg19-r2 (all round-2 PRs together: clippy, 1722 tests, 135 harnesses, lan_e2e in-frame and on the server thread) and union/cg19-r3 (the same PRs merged with today's main: 96/96 harnesses). Thanks @kacpherek.
This commit is contained in:
Ludovic Marie
2026-10-27 17:35:37 +01:00
committed by GitHub
+3 -2
View File
@@ -844,8 +844,9 @@ pub fn perform_ranged_attack(m: &mut Mob, who: Who, cx: &mut Cx, power: f32) {
let zd = t.position.z - m.position.z;
let dist = (xd * xd + zd * zd).sqrt();
// AbstractArrow.setBaseDamageFromMob: power * 2 + triangle(difficulty * 0.11, 0.57425).
let id = i32::from(cx.w.difficulty.id);
let mut arrow_random = crate::projectiles::own_random(m);
let base = f64::from(power) * 2.0 + arrow_random.triangle(2.0 * 0.11, 0.574_25);
let base = f64::from(power) * 2.0 + arrow_random.triangle(f64::from(id) * 0.11, 0.574_25);
let effect = match m.species() {
Species::Stray => Some(("minecraft:slowness", 600)),
Species::Bogged => Some(("minecraft:poison", 100)),
@@ -866,7 +867,7 @@ pub fn perform_ranged_attack(m: &mut Mob, who: Who, cx: &mut Cx, power: f32) {
&mut arrow_random,
[xd, yd + dist * 0.2, zd],
1.6,
(14 - 2 * 4) as f32,
(14 - id * 4) as f32,
);
cx.events.push(MobEvent::Projectile(p));
let pitch = 1.0 / (m.random.next_float() * 0.4 + 0.8);