compare: expose status transition fields

This commit is contained in:
2026-07-26 17:03:53 +00:00
parent 312711b7ed
commit 4495f0c06e
2 changed files with 12 additions and 1 deletions
+8
View File
@@ -380,6 +380,8 @@ function comparisonApplyTurnFixtureSetup(mixed $setup): void
'dex3' => 'dex3', 'dex3' => 'dex3',
'dex4' => 'dex4', 'dex4' => 'dex4',
'dex5' => 'dex5', 'dex5' => 'dex5',
'specAge' => 'specage',
'specAge2' => 'specage2',
'killTurn' => 'killturn', 'killTurn' => 'killturn',
'npcState' => 'npc', 'npcState' => 'npc',
'blockState' => 'block', 'blockState' => 'block',
@@ -394,6 +396,12 @@ function comparisonApplyTurnFixtureSetup(mixed $setup): void
if (isset($row['meta'])) { if (isset($row['meta'])) {
$patch['aux'] = Json::encode($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'])) { if (isset($row['lastTurn']) && is_array($row['lastTurn'])) {
$patch['last_turn'] = Json::encode($row['lastTurn']); $patch['last_turn'] = Json::encode($row['lastTurn']);
} }
+4 -1
View File
@@ -292,6 +292,7 @@ function comparisonTurnStateSnapshot(array $request): array
'recentWarTime' => 'recent_war', 'recentWarTime' => 'recent_war',
'lastTurn' => 'last_turn', 'lastTurn' => 'last_turn',
'meta' => 'aux', 'meta' => 'aux',
'penalty' => 'penalty',
'leadershipExp' => 'leadership_exp', 'leadershipExp' => 'leadership_exp',
'strengthExp' => 'strength_exp', 'strengthExp' => 'strength_exp',
'intelExp' => 'intel_exp', 'intelExp' => 'intel_exp',
@@ -300,6 +301,8 @@ function comparisonTurnStateSnapshot(array $request): array
'dex3' => 'dex3', 'dex3' => 'dex3',
'dex4' => 'dex4', 'dex4' => 'dex4',
'dex5' => 'dex5', 'dex5' => 'dex5',
'specAge' => 'specage',
'specAge2' => 'specage2',
'killTurn' => 'killturn', 'killTurn' => 'killturn',
'mySet' => 'myset', 'mySet' => 'myset',
'specialDomestic' => 'special', 'specialDomestic' => 'special',
@@ -310,7 +313,7 @@ function comparisonTurnStateSnapshot(array $request): array
'itemBook' => 'book', 'itemBook' => 'book',
'itemExtra' => 'item', 'itemExtra' => 'item',
], ],
['last_turn', 'aux'], ['last_turn', 'aux', 'penalty'],
); );
foreach ([ foreach ([
'specialDomestic', 'specialDomestic',