Cap max bond experience gains
This commit is contained in:
@@ -206,6 +206,45 @@ try {
|
||||
dialogueResynced.firstBattleReport?.completedCampDialogues.includes('repeat-dialogue'),
|
||||
`Expected report-only camp dialogue completion to resync without duplicate bond exp: ${JSON.stringify(dialogueResynced)}`
|
||||
);
|
||||
const maxedBondState = getCampaignState();
|
||||
const maxedCampaignBond = maxedBondState.bonds.find((bond) => bond.id === repeatBondId);
|
||||
const maxedReportBond = maxedBondState.firstBattleReport?.bonds.find((bond) => bond.id === repeatBondId);
|
||||
assert(maxedCampaignBond && maxedReportBond, `Expected repeat bond to exist before max-level checks: ${JSON.stringify(maxedBondState)}`);
|
||||
maxedCampaignBond.level = 100;
|
||||
maxedCampaignBond.exp = 95;
|
||||
maxedCampaignBond.battleExp = 3;
|
||||
maxedReportBond.level = 100;
|
||||
maxedReportBond.exp = 95;
|
||||
maxedReportBond.battleExp = 3;
|
||||
maxedBondState.completedCampDialogues = maxedBondState.completedCampDialogues.filter((id) => id !== 'maxed-dialogue');
|
||||
maxedBondState.firstBattleReport.completedCampDialogues = maxedBondState.firstBattleReport.completedCampDialogues.filter((id) => id !== 'maxed-dialogue');
|
||||
maxedBondState.completedCampVisits = maxedBondState.completedCampVisits.filter((id) => id !== 'maxed-visit');
|
||||
maxedBondState.firstBattleReport.completedCampVisits = maxedBondState.firstBattleReport.completedCampVisits.filter((id) => id !== 'maxed-visit');
|
||||
setCampaignState(maxedBondState);
|
||||
applyCampBondExp('maxed-dialogue', repeatBondId, 10);
|
||||
const maxedDialogueState = getCampaignState();
|
||||
const maxedDialogueBond = maxedDialogueState.bonds.find((bond) => bond.id === repeatBondId);
|
||||
const maxedDialogueReportBond = maxedDialogueState.firstBattleReport?.bonds.find((bond) => bond.id === repeatBondId);
|
||||
assert(
|
||||
maxedDialogueBond?.level === 100 &&
|
||||
maxedDialogueBond.exp === 100 &&
|
||||
maxedDialogueBond.battleExp === 13 &&
|
||||
maxedDialogueReportBond?.exp === 100 &&
|
||||
maxedDialogueReportBond.battleExp === 13,
|
||||
`Expected max-level dialogue bond exp to cap instead of wrapping: ${JSON.stringify(maxedDialogueState)}`
|
||||
);
|
||||
applyCampVisitReward('maxed-visit', { bondId: repeatBondId, bondExp: 10 });
|
||||
const maxedVisitState = getCampaignState();
|
||||
const maxedVisitBond = maxedVisitState.bonds.find((bond) => bond.id === repeatBondId);
|
||||
const maxedVisitReportBond = maxedVisitState.firstBattleReport?.bonds.find((bond) => bond.id === repeatBondId);
|
||||
assert(
|
||||
maxedVisitBond?.level === 100 &&
|
||||
maxedVisitBond.exp === 100 &&
|
||||
maxedVisitBond.battleExp === 23 &&
|
||||
maxedVisitReportBond?.exp === 100 &&
|
||||
maxedVisitReportBond.battleExp === 23,
|
||||
`Expected max-level visit bond exp to cap instead of wrapping: ${JSON.stringify(maxedVisitState)}`
|
||||
);
|
||||
|
||||
storage.clear();
|
||||
storage.set(
|
||||
|
||||
Reference in New Issue
Block a user