fix: perks now show human-readable descriptions instead of type-idx strings
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m31s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m31s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Circular Dependencies
|
# Circular Dependencies
|
||||||
Generated: 2026-05-27T09:26:33.586Z
|
Generated: 2026-05-27T09:40:41.085Z
|
||||||
|
|
||||||
No circular dependencies found. ✅
|
No circular dependencies found. ✅
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"generated": "2026-05-27T09:26:31.763Z",
|
"generated": "2026-05-27T09:40:39.287Z",
|
||||||
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
||||||
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
|
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export interface DisciplineCardDefinition {
|
|||||||
perkThresholds?: number[];
|
perkThresholds?: number[];
|
||||||
perkValues?: number[];
|
perkValues?: number[];
|
||||||
perkTypes?: string[];
|
perkTypes?: string[];
|
||||||
|
perkDescriptions?: string[];
|
||||||
statBonus: string;
|
statBonus: string;
|
||||||
statBonusLabel: string;
|
statBonusLabel: string;
|
||||||
requires?: string[];
|
requires?: string[];
|
||||||
@@ -79,7 +80,7 @@ interface DisciplineCardProps {
|
|||||||
|
|
||||||
const DisciplineCard: React.FC<DisciplineCardProps> = ({ definition, runtime, callbacks }) => {
|
const DisciplineCard: React.FC<DisciplineCardProps> = ({ definition, runtime, callbacks }) => {
|
||||||
const {
|
const {
|
||||||
id, name, description, manaType, baseCost, perkThresholds, perkValues, perkTypes,
|
id, name, description, manaType, baseCost, perkThresholds, perkValues, perkTypes, perkDescriptions,
|
||||||
statBonusLabel, baseValue, drainBase, difficultyFactor, scalingFactor,
|
statBonusLabel, baseValue, drainBase, difficultyFactor, scalingFactor,
|
||||||
} = definition;
|
} = definition;
|
||||||
const { xp, paused: isPaused, concurrentLimit, isLocked, missingPrereqs, missingSourceMana } = runtime;
|
const { xp, paused: isPaused, concurrentLimit, isLocked, missingPrereqs, missingSourceMana } = runtime;
|
||||||
@@ -101,12 +102,13 @@ const DisciplineCard: React.FC<DisciplineCardProps> = ({ definition, runtime, ca
|
|||||||
const unlockedPerks = perkTypes?.reduce<string[]>((acc, typ, idx) => {
|
const unlockedPerks = perkTypes?.reduce<string[]>((acc, typ, idx) => {
|
||||||
const threshold = perkThresholds?.[idx];
|
const threshold = perkThresholds?.[idx];
|
||||||
if (threshold === undefined) return acc;
|
if (threshold === undefined) return acc;
|
||||||
|
const desc = perkDescriptions?.[idx];
|
||||||
if (typ === 'once' || typ === 'infinite') {
|
if (typ === 'once' || typ === 'infinite') {
|
||||||
if (displayXp >= threshold) acc.push(`${typ}-${idx}`);
|
if (displayXp >= threshold && desc) acc.push(desc);
|
||||||
} else if (typ === 'capped') {
|
} else if (typ === 'capped') {
|
||||||
const interval = perkValues?.[idx] ?? 1;
|
const interval = perkValues?.[idx] ?? 1;
|
||||||
const tier = Math.max(0, Math.floor((displayXp - threshold) / interval) + 1);
|
const tier = Math.max(0, Math.floor((displayXp - threshold) / interval) + 1);
|
||||||
if (tier > 0) acc.push(`${typ}-${idx}`);
|
if (tier > 0 && desc) acc.push(desc);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
@@ -171,7 +173,7 @@ const DisciplineCard: React.FC<DisciplineCardProps> = ({ definition, runtime, ca
|
|||||||
<ul className="mt-1 list-disc list-inside space-y-1 text-xs">
|
<ul className="mt-1 list-disc list-inside space-y-1 text-xs">
|
||||||
{unlockedPerks && unlockedPerks.length > 0 ? (
|
{unlockedPerks && unlockedPerks.length > 0 ? (
|
||||||
unlockedPerks.map((p) => (
|
unlockedPerks.map((p) => (
|
||||||
<li key={p} className="text-green-500">{p.replace(/-([0-9]+)$/, ' $1')}</li>
|
<li key={p} className="text-green-500">{p}</li>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<li className="text-gray-400">—locked—</li>
|
<li className="text-gray-400">—locked—</li>
|
||||||
@@ -265,6 +267,7 @@ export const DisciplinesTab: React.FC = () => {
|
|||||||
perkThresholds: disc.perks?.map((p) => p.threshold),
|
perkThresholds: disc.perks?.map((p) => p.threshold),
|
||||||
perkValues: disc.perks?.map((p) => p.value),
|
perkValues: disc.perks?.map((p) => p.value),
|
||||||
perkTypes: disc.perks?.map((p) => p.type),
|
perkTypes: disc.perks?.map((p) => p.type),
|
||||||
|
perkDescriptions: disc.perks?.map((p) => p.description),
|
||||||
manaType: disc.manaType,
|
manaType: disc.manaType,
|
||||||
baseCost: disc.baseCost,
|
baseCost: disc.baseCost,
|
||||||
statBonus: disc.statBonus.stat,
|
statBonus: disc.statBonus.stat,
|
||||||
|
|||||||
Reference in New Issue
Block a user