feat: v1 prototype — core game systems #30

Merged
naomi merged 84 commits from feat/prototype into main 2026-03-08 15:53:39 -07:00
Showing only changes of commit bcb523f598 - Show all commits
+12 -2
View File
@@ -23,6 +23,10 @@ const applyBossResult = (prev: GameState, bossId: string, result: BossChallengeR
return firstBoss?.id;
}).filter(Boolean);
const challengeUpdate = prev.dailyChallenges
? updateChallengeProgress(prev.dailyChallenges, "bossesDefeated", 1)
: { updatedChallenges: undefined, crystalsAwarded: 0 };
return {
...prev,
bosses: prev.bosses.map((b) => {
@@ -42,14 +46,20 @@ const applyBossResult = (prev: GameState, bossId: string, result: BossChallengeR
prev.quests.some((q) => q.id === z.unlockQuestId && q.status === "completed");
return questOk ? { ...z, status: "unlocked" as const } : z;
}),
...(challengeUpdate.updatedChallenges !== undefined
? { dailyChallenges: challengeUpdate.updatedChallenges }
: {}),
resources: result.rewards
? {
...prev.resources,
gold: prev.resources.gold + result.rewards.gold,
essence: prev.resources.essence + result.rewards.essence,
crystals: prev.resources.crystals + result.rewards.crystals,
crystals: prev.resources.crystals + result.rewards.crystals + challengeUpdate.crystalsAwarded,
}
: prev.resources,
: {
...prev.resources,
crystals: prev.resources.crystals + challengeUpdate.crystalsAwarded,
},
prestige: result.rewards?.bountyRunestones
? { ...prev.prestige, runestones: prev.prestige.runestones + result.rewards.bountyRunestones }
: prev.prestige,