feat(treasure): add treasure quest, quest modal, island node, quest widget

This commit is contained in:
shafin-r
2026-02-26 01:31:48 +06:00
parent 894863c196
commit f64d2cac4a
12 changed files with 4018 additions and 19 deletions

13
src/hooks/useCrewRank.ts Normal file
View File

@ -0,0 +1,13 @@
import { QUEST_ARCS } from "../data/questData";
// Returns the player's current crew rank, or a default if none earned yet
export function getCrewRank(arcs = QUEST_ARCS): string {
const earned = arcs
.flatMap((a) => a.nodes)
.filter((n) => n.status === "completed" && n.reward.title)
.map((n) => n.reward.title!);
// Return the last one — questData is ordered by difficulty,
// so the last earned title is always the highest rank
return earned.at(-1) ?? "Cabin Hand";
}