From 4495f0c06e49a88764dda1c5a00e4a6a5fcb4597 Mon Sep 17 00:00:00 2001 From: hided62 Date: Sun, 26 Jul 2026 17:03:53 +0000 Subject: [PATCH] compare: expose status transition fields --- hwe/compare/turn_command_trace.php | 8 ++++++++ hwe/compare/turn_state_snapshot.php | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hwe/compare/turn_command_trace.php b/hwe/compare/turn_command_trace.php index be5d1e25..ad7dd40f 100644 --- a/hwe/compare/turn_command_trace.php +++ b/hwe/compare/turn_command_trace.php @@ -380,6 +380,8 @@ function comparisonApplyTurnFixtureSetup(mixed $setup): void 'dex3' => 'dex3', 'dex4' => 'dex4', 'dex5' => 'dex5', + 'specAge' => 'specage', + 'specAge2' => 'specage2', 'killTurn' => 'killturn', 'npcState' => 'npc', 'blockState' => 'block', @@ -394,6 +396,12 @@ function comparisonApplyTurnFixtureSetup(mixed $setup): void if (isset($row['meta'])) { $patch['aux'] = Json::encode($row['meta']); } + if (array_key_exists('penalty', $row)) { + if (!is_array($row['penalty'])) { + throw new \InvalidArgumentException('setup.generals.penalty must be an object'); + } + $patch['penalty'] = Json::encode($row['penalty']); + } if (isset($row['lastTurn']) && is_array($row['lastTurn'])) { $patch['last_turn'] = Json::encode($row['lastTurn']); } diff --git a/hwe/compare/turn_state_snapshot.php b/hwe/compare/turn_state_snapshot.php index fce5ece5..2c39618e 100644 --- a/hwe/compare/turn_state_snapshot.php +++ b/hwe/compare/turn_state_snapshot.php @@ -292,6 +292,7 @@ function comparisonTurnStateSnapshot(array $request): array 'recentWarTime' => 'recent_war', 'lastTurn' => 'last_turn', 'meta' => 'aux', + 'penalty' => 'penalty', 'leadershipExp' => 'leadership_exp', 'strengthExp' => 'strength_exp', 'intelExp' => 'intel_exp', @@ -300,6 +301,8 @@ function comparisonTurnStateSnapshot(array $request): array 'dex3' => 'dex3', 'dex4' => 'dex4', 'dex5' => 'dex5', + 'specAge' => 'specage', + 'specAge2' => 'specage2', 'killTurn' => 'killturn', 'mySet' => 'myset', 'specialDomestic' => 'special', @@ -310,7 +313,7 @@ function comparisonTurnStateSnapshot(array $request): array 'itemBook' => 'book', 'itemExtra' => 'item', ], - ['last_turn', 'aux'], + ['last_turn', 'aux', 'penalty'], ); foreach ([ 'specialDomestic',