From 20ced127f98c59d9bc05bdde643082c40518cc57 Mon Sep 17 00:00:00 2001 From: autocommit Date: Wed, 29 Apr 2026 12:26:49 -0700 Subject: [PATCH] =?UTF-8?q?feat(simulator):=20=E2=9C=A8=20Update=20siege?= =?UTF-8?q?=20damage=20and=20success=20conditions=20to=20integrate=20with?= =?UTF-8?q?=20city=20HP=20for=20balanced=20simulation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/simulator/crates/mc-combat/src/siege.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/simulator/crates/mc-combat/src/siege.rs b/src/simulator/crates/mc-combat/src/siege.rs index ebba0987..f8b70f7e 100644 --- a/src/simulator/crates/mc-combat/src/siege.rs +++ b/src/simulator/crates/mc-combat/src/siege.rs @@ -27,14 +27,16 @@ const RANGED_CITY_HP_FRACTION: f32 = 0.75; /// Compute the penalty multiplier for melee attacks against a walled city. /// Returns a value < 1.0 that the attacker's effective strength is multiplied by. -/// Scales by tier: 0=1.0, 1=0.70 (walls), 2=0.55 (castle). -/// Paired with the melee-to-city damage fraction in resolver.rs that halves -/// structural damage from non-siege melee attacks. +/// Scales by tier: 0=1.0, 1=0.40 (walls), 2=0.25 (castle). +/// p1-29 R5a: tightened from 0.70/0.55 → 0.40/0.25 so a walled city resists +/// overwhelming siege ("+200% defense" handoff target). Paired with the +/// melee-to-city damage fraction in resolver.rs and the BASE_CITY_HP=500 bump +/// in mc-city. Siege units bypass via `siege_city_bonus`. pub fn melee_wall_penalty(wall_tier: i32) -> f32 { match wall_tier { 0 => 1.0, - 1 => 0.70, - _ => 0.55, + 1 => 0.40, + _ => 0.25, } } @@ -143,12 +145,12 @@ mod tests { "tier 0 (no walls) = 1.0" ); assert!( - (melee_wall_penalty(1) - 0.70).abs() < EPS, - "tier 1 (walls) = 0.70" + (melee_wall_penalty(1) - 0.40).abs() < EPS, + "tier 1 (walls) = 0.40" ); assert!( - (melee_wall_penalty(2) - 0.55).abs() < EPS, - "tier 2 (castle) = 0.55" + (melee_wall_penalty(2) - 0.25).abs() < EPS, + "tier 2 (castle) = 0.25" ); }