From 005ec66d8f99944f42c1fafe7af230240c0c4a75 Mon Sep 17 00:00:00 2001 From: Natalie Date: Thu, 16 Apr 2026 14:06:11 -0700 Subject: [PATCH] =?UTF-8?q?fix(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20update=20wall=20penalty=20tiers=20and=20anomaly?= =?UTF-8?q?=20drift=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- scripts/apricot/run_ap3.sh | 11 +++++++---- .../src/modules/climate/atmosphere_anomalies.gd | 2 +- src/simulator/crates/mc-combat/src/siege.rs | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/apricot/run_ap3.sh b/scripts/apricot/run_ap3.sh index 995cb243..f6418c3d 100755 --- a/scripts/apricot/run_ap3.sh +++ b/scripts/apricot/run_ap3.sh @@ -8,12 +8,15 @@ # display with software rendering (llvmpipe). Screenshots work. # Requires weston installed on the host. set -uo pipefail -pkill -f "flatpak run.*Godot" 2>/dev/null || true -pkill -f godot 2>/dev/null || true -sleep 1 - : "${AUTO_PLAY:=true}" : "${AUTO_PLAY_DIR:=$HOME/tmp/ap_default}" + +# Scoped cleanup: only kill prior processes for THIS AUTO_PLAY_DIR, so parallel +# sibling games (different AUTO_PLAY_DIR) are not disturbed. +pkill -f "AUTO_PLAY_DIR=$AUTO_PLAY_DIR " 2>/dev/null || true +pkill -f "AUTO_PLAY_DIR=$AUTO_PLAY_DIR\$" 2>/dev/null || true +sleep 1 + : "${AUTO_PLAY_TURN_LIMIT:=500}" : "${RENDER_MODE:=headless}" diff --git a/src/game/engine/src/modules/climate/atmosphere_anomalies.gd b/src/game/engine/src/modules/climate/atmosphere_anomalies.gd index 5e1f0948..4ffde893 100644 --- a/src/game/engine/src/modules/climate/atmosphere_anomalies.gd +++ b/src/game/engine/src/modules/climate/atmosphere_anomalies.gd @@ -164,7 +164,7 @@ func _drift_anomalies(game_map: RefCounted) -> void: # Collect tiles with anomalies to drift var drifters: Array = [] - for pos: Vector2i in _sorted_anomaly_keys(): + for pos: Variant in _sorted_anomaly_keys(): var tile: Variant = game_map.get_tile(pos) if tile == null or tile.pressure_anomaly == 0.0: _anomaly_age.erase(pos) diff --git a/src/simulator/crates/mc-combat/src/siege.rs b/src/simulator/crates/mc-combat/src/siege.rs index ae9605e2..8cf4e3ec 100644 --- a/src/simulator/crates/mc-combat/src/siege.rs +++ b/src/simulator/crates/mc-combat/src/siege.rs @@ -23,13 +23,13 @@ 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). +/// Scales by tier: 0=1.0, 1=0.75 (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. pub fn melee_wall_penalty(wall_tier: i32) -> f32 { match wall_tier { 0 => 1.0, - 1 => 0.70, + 1 => 0.75, _ => 0.55, } } @@ -100,7 +100,7 @@ mod tests { #[test] fn melee_penalty_scales_by_tier() { assert!((melee_wall_penalty(0) - 1.0).abs() < 0.001); - assert!((melee_wall_penalty(1) - 0.70).abs() < 0.001); + assert!((melee_wall_penalty(1) - 0.75).abs() < 0.001); assert!((melee_wall_penalty(2) - 0.55).abs() < 0.001); assert!((melee_wall_penalty(3) - 0.55).abs() < 0.001); }