Verify equipment reward resettlement

This commit is contained in:
2026-07-05 17:51:03 +09:00
parent 396f372746
commit 90dc9d0201

View File

@@ -118,8 +118,8 @@ try {
objectives: [],
units: alliedFirstBattleUnits,
bonds: firstScenario.bonds.map((bond) => ({ ...bond, battleExp: 0 })),
itemRewards: ['Bean x2'],
campaignRewards: { supplies: ['Bean x2'], equipment: [], reputation: [], recruits: [], unlocks: [] },
itemRewards: ['Bean x2', 'Iron Sword 1'],
campaignRewards: { supplies: ['Bean x2'], equipment: ['Iron Sword 1'], reputation: [], recruits: [], unlocks: [] },
completedCampDialogues: [],
completedCampVisits: [],
createdAt: '2026-07-03T09:00:00.000Z'
@@ -130,20 +130,23 @@ try {
assert(
repeatedSettlement.gold === 100 &&
repeatedSettlement.inventory.Bean === 2 &&
repeatedSettlement.inventory['Iron Sword'] === 1 &&
repeatedSettlement.battleHistory[firstScenario.id]?.rewardGold === 100,
`Expected repeated battle report settlement to avoid duplicate gold/items: ${JSON.stringify(repeatedSettlement)}`
);
setFirstBattleReport({
...firstBattleReport,
rewardGold: 140,
itemRewards: ['Bean x3', 'Wine'],
campaignRewards: { supplies: ['Bean x3', 'Wine'], equipment: [], reputation: [], recruits: [], unlocks: [] }
itemRewards: ['Bean x3', 'Wine', 'Iron Armor 1'],
campaignRewards: { supplies: ['Bean x3', 'Wine'], equipment: ['Iron Armor 1'], reputation: [], recruits: [], unlocks: [] }
});
const revisedSettlement = getCampaignState();
assert(
revisedSettlement.gold === 140 &&
revisedSettlement.inventory.Bean === 3 &&
revisedSettlement.inventory.Wine === 1,
revisedSettlement.inventory.Wine === 1 &&
revisedSettlement.inventory['Iron Sword'] === undefined &&
revisedSettlement.inventory['Iron Armor'] === 1,
`Expected revised battle report settlement to replace previous rewards instead of stacking: ${JSON.stringify(revisedSettlement)}`
);
applyCampVisitReward('repeat-visit', { gold: 10, itemRewards: ['Bean x2'] });