Skip to content

Commit

Permalink
Merge pull request #122 from nekosoffy/main
Browse files Browse the repository at this point in the history
Add "Well-Read" achievement tracking - Closes #118
  • Loading branch information
jacc authored Nov 29, 2024
2 parents aefd130 + a3d8595 commit 0be405d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/pages/skills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
const reqs: Record<string, number> = {
"Singular Talent": 1, // platform specific
"Master Of The Five Ways": 5, // platform specific
"Well-Read": 19,
};

export default function SkillsMasteryPowers() {
Expand All @@ -49,6 +50,7 @@ export default function SkillsMasteryPowers() {
if (activePlayer) {
const skills = new Set(["Singular Talent", "Master Of The Five Ways"]);
const quests = new Set(["Gofer", "A Big Help"]);
const powers = new Set(["Well-Read"]);

if (skills.has(name)) {
// use maxLevelCount and compare to reqs
Expand All @@ -64,6 +66,11 @@ export default function SkillsMasteryPowers() {
else {
additionalDescription = ` - ${reqs[name] - questsCompleted} left`;
}
} else if (powers.has(name)) {
if (playerPowers.size >= reqs[name]) completed = true;
else {
additionalDescription = ` - ${reqs[name] - playerPowers.size} left`;
}
}
}

Expand Down Expand Up @@ -474,6 +481,25 @@ export default function SkillsMasteryPowers() {
</AccordionTrigger>
<AccordionContent>
<div className="space-y-3">
<div className="grid grid-cols-1 gap-4 md:grid-cols-1">
{Object.values(achievements)
.filter((achievement) =>
achievement.description.includes("power book"),
)
.map((achievement) => {
const { completed, additionalDescription } =
getAchievementProgress(achievement.name);

return (
<AchievementCard
key={achievement.id}
achievement={achievement}
completed={completed}
additionalDescription={additionalDescription}
/>
);
})}
</div>
<div className="grid grid-cols-1 gap-4 lg:grid-cols-3 xl:grid-cols-4">
{Object.entries(powers)
.filter(([key, power]) => key.includes("Book_"))
Expand Down

0 comments on commit 0be405d

Please sign in to comment.