feat(treasure): add treasure quest, quest modal, island node, quest widget
This commit is contained in:
13
src/hooks/useCrewRank.ts
Normal file
13
src/hooks/useCrewRank.ts
Normal 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";
|
||||
}
|
||||
Reference in New Issue
Block a user