fix(@projects/@magic-civilization): 🐛 update wall penalty tiers and anomaly drift logic

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-04-16 14:06:11 -07:00
parent 10e10b6662
commit 005ec66d8f
3 changed files with 11 additions and 8 deletions

View file

@ -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}"

View file

@ -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)

View file

@ -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);
}