RotNot / src /config /xp.ts
deploy
Deploy RotNot
9580dce
Raw History Blame Contribute Delete
1.66 kB
export const CATEGORIES = [
"chess",
"reading",
"feynman",
"logic",
"critical-thinking",
"quests",
"coding",
] as const;
export type Category = (typeof CATEGORIES)[number];
export const CATEGORY_LABELS: Record<Category, string> = {
chess: "Chess",
reading: "Deep Reading",
feynman: "Feynman",
logic: "Logic Puzzles",
"critical-thinking": "Critical Thinking",
quests: "Skill Quests",
coding: "Coding Training",
};
export const CATEGORY_COLORS: Record<Category, string> = {
chess: "#f59e0b",
reading: "#10b981",
feynman: "#06b6d4",
logic: "#8b5cf6",
"critical-thinking": "#f43f5e",
quests: "#f97316",
coding: "#3b82f6",
};
export const EXERCISE_XP: Record<
Category,
{ baseXp: number; maxQualityBonus: number }
> = {
chess: { baseXp: 20, maxQualityBonus: 20 },
reading: { baseXp: 30, maxQualityBonus: 30 },
feynman: { baseXp: 40, maxQualityBonus: 40 },
logic: { baseXp: 15, maxQualityBonus: 25 },
"critical-thinking": { baseXp: 50, maxQualityBonus: 30 },
quests: { baseXp: 25, maxQualityBonus: 25 },
coding: { baseXp: 45, maxQualityBonus: 35 },
};
export const CRITICAL_HIT_CHANCE = 0.1;
export const CRITICAL_HIT_MULTIPLIER = 2;
/**
* XP required to go from level N to level N+1.
* Level 2 → 100 XP
* Level 10 → ~350 XP
* Level 50 → ~1,500 XP
*/
export function xpForLevel(level: number): number {
return Math.round(100 * Math.pow(level / 2, 0.8));
}
/**
* Total cumulative XP to reach a given level from level 1.
*/
export function totalXpForLevel(level: number): number {
let total = 0;
for (let i = 2; i <= level; i++) {
total += xpForLevel(i);
}
return total;
}