generated from nhcarrigan/template
feat: add lifetime stats to player profile
Introduce six lifetime stat fields (gold, clicks, bosses, quests, adventurers, achievements) that accumulate across all prestige and transcendence resets and are never cleared. - schema: add six new Float fields to the Player model - prestige route: capture current-run totals and increment lifetime fields before resetting per-run counters to zero - profile route: return lifetime fields as the All Time section data; add four new ProfileSettings toggles for visibility control - ProfilePage: display lifetime bosses/quests/adventurers/achievements in All Time section; remove GameProvider dependency by importing formatNumber directly (fixes crash on public profile pages) - EditProfileModal: add four new All Time stat toggles - types: update Player, ProfileSettings, and PublicProfileResponse
This commit is contained in:
@@ -18,8 +18,14 @@ model Player {
|
|||||||
profileSettings Json?
|
profileSettings Json?
|
||||||
createdAt Float
|
createdAt Float
|
||||||
lastSavedAt Float
|
lastSavedAt Float
|
||||||
totalGoldEarned Float @default(0)
|
totalGoldEarned Float @default(0)
|
||||||
totalClicks Float @default(0)
|
totalClicks Float @default(0)
|
||||||
|
lifetimeGoldEarned Float @default(0)
|
||||||
|
lifetimeClicks Float @default(0)
|
||||||
|
lifetimeBossesDefeated Float @default(0)
|
||||||
|
lifetimeQuestsCompleted Float @default(0)
|
||||||
|
lifetimeAdventurersRecruited Float @default(0)
|
||||||
|
lifetimeAchievementsUnlocked Float @default(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
model GameState {
|
model GameState {
|
||||||
|
|||||||
@@ -62,6 +62,12 @@ authRouter.get("/callback", async (context) => {
|
|||||||
lastSavedAt: player.lastSavedAt,
|
lastSavedAt: player.lastSavedAt,
|
||||||
totalGoldEarned: player.totalGoldEarned,
|
totalGoldEarned: player.totalGoldEarned,
|
||||||
totalClicks: player.totalClicks,
|
totalClicks: player.totalClicks,
|
||||||
|
lifetimeGoldEarned: player.lifetimeGoldEarned,
|
||||||
|
lifetimeClicks: player.lifetimeClicks,
|
||||||
|
lifetimeBossesDefeated: player.lifetimeBossesDefeated,
|
||||||
|
lifetimeQuestsCompleted: player.lifetimeQuestsCompleted,
|
||||||
|
lifetimeAdventurersRecruited: player.lifetimeAdventurersRecruited,
|
||||||
|
lifetimeAchievementsUnlocked: player.lifetimeAchievementsUnlocked,
|
||||||
};
|
};
|
||||||
|
|
||||||
const initialState = INITIAL_GAME_STATE(playerShape, playerShape.characterName);
|
const initialState = INITIAL_GAME_STATE(playerShape, playerShape.characterName);
|
||||||
|
|||||||
@@ -63,6 +63,12 @@ prestigeRouter.post("/", async (context) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Capture current-run stats to accumulate into lifetime totals before resetting
|
||||||
|
const runBossesDefeated = state.bosses.filter((b) => b.status === "defeated").length;
|
||||||
|
const runQuestsCompleted = state.quests.filter((q) => q.status === "completed").length;
|
||||||
|
const runAdventurersRecruited = state.adventurers.reduce((sum, a) => sum + a.count, 0);
|
||||||
|
const runAchievementsUnlocked = (state.achievements ?? []).filter((a) => a.unlockedAt !== null).length;
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
await prisma.gameState.update({
|
await prisma.gameState.update({
|
||||||
where: { discordId },
|
where: { discordId },
|
||||||
@@ -73,8 +79,16 @@ prestigeRouter.post("/", async (context) => {
|
|||||||
where: { discordId },
|
where: { discordId },
|
||||||
data: {
|
data: {
|
||||||
characterName,
|
characterName,
|
||||||
|
// Reset current-run counters
|
||||||
totalGoldEarned: 0,
|
totalGoldEarned: 0,
|
||||||
totalClicks: 0,
|
totalClicks: 0,
|
||||||
|
// Accumulate into lifetime totals — never reset
|
||||||
|
lifetimeGoldEarned: { increment: state.player.totalGoldEarned },
|
||||||
|
lifetimeClicks: { increment: state.player.totalClicks },
|
||||||
|
lifetimeBossesDefeated: { increment: runBossesDefeated },
|
||||||
|
lifetimeQuestsCompleted: { increment: runQuestsCompleted },
|
||||||
|
lifetimeAdventurersRecruited: { increment: runAdventurersRecruited },
|
||||||
|
lifetimeAchievementsUnlocked: { increment: runAchievementsUnlocked },
|
||||||
lastSavedAt: now,
|
lastSavedAt: now,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,8 +22,14 @@ const parseProfileSettings = (raw: unknown): ProfileSettings => {
|
|||||||
return {
|
return {
|
||||||
showTotalGold: obj.showTotalGold !== false,
|
showTotalGold: obj.showTotalGold !== false,
|
||||||
showTotalClicks: obj.showTotalClicks !== false,
|
showTotalClicks: obj.showTotalClicks !== false,
|
||||||
showPrestige: obj.showPrestige !== false,
|
showLifetimeBossesDefeated: obj.showLifetimeBossesDefeated !== false,
|
||||||
|
showLifetimeQuestsCompleted: obj.showLifetimeQuestsCompleted !== false,
|
||||||
|
showLifetimeAdventurersRecruited: obj.showLifetimeAdventurersRecruited !== false,
|
||||||
|
showLifetimeAchievementsUnlocked: obj.showLifetimeAchievementsUnlocked !== false,
|
||||||
showGuildFounded: obj.showGuildFounded !== false,
|
showGuildFounded: obj.showGuildFounded !== false,
|
||||||
|
showCurrentGold: obj.showCurrentGold !== false,
|
||||||
|
showCurrentClicks: obj.showCurrentClicks !== false,
|
||||||
|
showPrestige: obj.showPrestige !== false,
|
||||||
showBossesDefeated: obj.showBossesDefeated !== false,
|
showBossesDefeated: obj.showBossesDefeated !== false,
|
||||||
showQuestsCompleted: obj.showQuestsCompleted !== false,
|
showQuestsCompleted: obj.showQuestsCompleted !== false,
|
||||||
showAdventurersRecruited: obj.showAdventurersRecruited !== false,
|
showAdventurersRecruited: obj.showAdventurersRecruited !== false,
|
||||||
@@ -63,14 +69,22 @@ profileRouter.get("/:discordId", async (context) => {
|
|||||||
avatar: player.avatar ?? null,
|
avatar: player.avatar ?? null,
|
||||||
bio: player.bio ?? "",
|
bio: player.bio ?? "",
|
||||||
profileSettings,
|
profileSettings,
|
||||||
|
createdAt: player.createdAt,
|
||||||
|
// All Time stats — cumulative across all runs, never reset
|
||||||
|
totalGoldEarned: player.lifetimeGoldEarned,
|
||||||
|
totalClicks: player.lifetimeClicks,
|
||||||
|
lifetimeBossesDefeated: player.lifetimeBossesDefeated,
|
||||||
|
lifetimeQuestsCompleted: player.lifetimeQuestsCompleted,
|
||||||
|
lifetimeAdventurersRecruited: player.lifetimeAdventurersRecruited,
|
||||||
|
lifetimeAchievementsUnlocked: player.lifetimeAchievementsUnlocked,
|
||||||
|
// Current Run stats — from live GameState, reset on prestige & transcendence
|
||||||
|
currentRunGold: state?.player.totalGoldEarned ?? 0,
|
||||||
|
currentRunClicks: state?.player.totalClicks ?? 0,
|
||||||
prestigeCount,
|
prestigeCount,
|
||||||
totalGoldEarned: player.totalGoldEarned,
|
|
||||||
totalClicks: player.totalClicks,
|
|
||||||
bossesDefeated,
|
bossesDefeated,
|
||||||
questsCompleted,
|
questsCompleted,
|
||||||
adventurersRecruited,
|
adventurersRecruited,
|
||||||
achievementsUnlocked,
|
achievementsUnlocked,
|
||||||
createdAt: player.createdAt,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -86,8 +100,14 @@ profileRouter.put("/", authMiddleware, async (context) => {
|
|||||||
const profileSettings: ProfileSettings = {
|
const profileSettings: ProfileSettings = {
|
||||||
showTotalGold: body.profileSettings?.showTotalGold !== false,
|
showTotalGold: body.profileSettings?.showTotalGold !== false,
|
||||||
showTotalClicks: body.profileSettings?.showTotalClicks !== false,
|
showTotalClicks: body.profileSettings?.showTotalClicks !== false,
|
||||||
showPrestige: body.profileSettings?.showPrestige !== false,
|
showLifetimeBossesDefeated: body.profileSettings?.showLifetimeBossesDefeated !== false,
|
||||||
|
showLifetimeQuestsCompleted: body.profileSettings?.showLifetimeQuestsCompleted !== false,
|
||||||
|
showLifetimeAdventurersRecruited: body.profileSettings?.showLifetimeAdventurersRecruited !== false,
|
||||||
|
showLifetimeAchievementsUnlocked: body.profileSettings?.showLifetimeAchievementsUnlocked !== false,
|
||||||
showGuildFounded: body.profileSettings?.showGuildFounded !== false,
|
showGuildFounded: body.profileSettings?.showGuildFounded !== false,
|
||||||
|
showCurrentGold: body.profileSettings?.showCurrentGold !== false,
|
||||||
|
showCurrentClicks: body.profileSettings?.showCurrentClicks !== false,
|
||||||
|
showPrestige: body.profileSettings?.showPrestige !== false,
|
||||||
showBossesDefeated: body.profileSettings?.showBossesDefeated !== false,
|
showBossesDefeated: body.profileSettings?.showBossesDefeated !== false,
|
||||||
showQuestsCompleted: body.profileSettings?.showQuestsCompleted !== false,
|
showQuestsCompleted: body.profileSettings?.showQuestsCompleted !== false,
|
||||||
showAdventurersRecruited: body.profileSettings?.showAdventurersRecruited !== false,
|
showAdventurersRecruited: body.profileSettings?.showAdventurersRecruited !== false,
|
||||||
|
|||||||
@@ -8,14 +8,29 @@ interface EditProfileModalProps {
|
|||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const STAT_TOGGLES: { key: keyof ProfileSettings; label: string; icon: string }[] = [
|
interface StatToggle {
|
||||||
{ key: "showTotalGold", label: "Total Gold Earned", icon: "🪙" },
|
key: keyof ProfileSettings;
|
||||||
{ key: "showTotalClicks", label: "Total Clicks", icon: "👆" },
|
label: string;
|
||||||
|
icon: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CURRENT_RUN_TOGGLES: StatToggle[] = [
|
||||||
|
{ key: "showCurrentGold", label: "Gold Earned This Run", icon: "🪙" },
|
||||||
|
{ key: "showCurrentClicks", label: "Clicks This Run", icon: "👆" },
|
||||||
{ key: "showPrestige", label: "Prestige Level", icon: "⭐" },
|
{ key: "showPrestige", label: "Prestige Level", icon: "⭐" },
|
||||||
{ key: "showBossesDefeated", label: "Bosses Defeated", icon: "💀" },
|
{ key: "showBossesDefeated", label: "Bosses Defeated", icon: "💀" },
|
||||||
{ key: "showQuestsCompleted", label: "Quests Completed", icon: "📜" },
|
{ key: "showQuestsCompleted", label: "Quests Completed", icon: "📜" },
|
||||||
{ key: "showAdventurersRecruited", label: "Adventurers Recruited", icon: "⚔️" },
|
{ key: "showAdventurersRecruited", label: "Adventurers Recruited", icon: "⚔️" },
|
||||||
{ key: "showAchievementsUnlocked", label: "Achievements Unlocked", icon: "🏆" },
|
{ key: "showAchievementsUnlocked", label: "Achievements Unlocked", icon: "🏆" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const ALL_TIME_TOGGLES: StatToggle[] = [
|
||||||
|
{ key: "showTotalGold", label: "Total Gold Earned", icon: "🪙" },
|
||||||
|
{ key: "showTotalClicks", label: "Total Clicks", icon: "👆" },
|
||||||
|
{ key: "showLifetimeBossesDefeated", label: "Bosses Defeated", icon: "💀" },
|
||||||
|
{ key: "showLifetimeQuestsCompleted", label: "Quests Completed", icon: "📜" },
|
||||||
|
{ key: "showLifetimeAdventurersRecruited", label: "Adventurers Recruited", icon: "⚔️" },
|
||||||
|
{ key: "showLifetimeAchievementsUnlocked", label: "Achievements Unlocked", icon: "🏆" },
|
||||||
{ key: "showGuildFounded", label: "Guild Founded Date", icon: "📅" },
|
{ key: "showGuildFounded", label: "Guild Founded Date", icon: "📅" },
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -126,8 +141,27 @@ export const EditProfileModal = ({ onClose }: EditProfileModalProps): React.JSX.
|
|||||||
<div className="edit-profile-section">
|
<div className="edit-profile-section">
|
||||||
<p className="edit-profile-label">Visible Stats</p>
|
<p className="edit-profile-label">Visible Stats</p>
|
||||||
<p className="edit-profile-sublabel">Choose which stats appear on your public profile.</p>
|
<p className="edit-profile-sublabel">Choose which stats appear on your public profile.</p>
|
||||||
|
|
||||||
|
<p className="edit-profile-stat-group-heading">Current Run</p>
|
||||||
<div className="stat-toggles">
|
<div className="stat-toggles">
|
||||||
{STAT_TOGGLES.map(({ key, label, icon }) => (
|
{CURRENT_RUN_TOGGLES.map(({ key, label, icon }) => (
|
||||||
|
<button
|
||||||
|
key={key}
|
||||||
|
className={`stat-toggle-btn ${settings[key] ? "stat-toggle-on" : "stat-toggle-off"}`}
|
||||||
|
onClick={() => { toggleSetting(key); }}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<span>{icon} {label}</span>
|
||||||
|
<span className="stat-toggle-indicator">
|
||||||
|
{settings[key] ? "✓ Shown" : "Hidden"}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className="edit-profile-stat-group-heading">All Time</p>
|
||||||
|
<div className="stat-toggles">
|
||||||
|
{ALL_TIME_TOGGLES.map(({ key, label, icon }) => (
|
||||||
<button
|
<button
|
||||||
key={key}
|
key={key}
|
||||||
className={`stat-toggle-btn ${settings[key] ? "stat-toggle-on" : "stat-toggle-off"}`}
|
className={`stat-toggle-btn ${settings[key] ? "stat-toggle-on" : "stat-toggle-off"}`}
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
import type { PublicProfileResponse } from "@elysium/types";
|
import type { PublicProfileResponse } from "@elysium/types";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useGame } from "../../context/GameContext.js";
|
import { formatNumber } from "../../utils/format.js";
|
||||||
|
|
||||||
interface ProfilePageProps {
|
interface ProfilePageProps {
|
||||||
discordId: string;
|
discordId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface StatEntry {
|
||||||
|
icon: string;
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
date: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element => {
|
export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element => {
|
||||||
const { formatNumber } = useGame();
|
|
||||||
const [profile, setProfile] = useState<PublicProfileResponse | null>(null);
|
const [profile, setProfile] = useState<PublicProfileResponse | null>(null);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
@@ -51,6 +57,7 @@ export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element
|
|||||||
}
|
}
|
||||||
|
|
||||||
const s = profile.profileSettings;
|
const s = profile.profileSettings;
|
||||||
|
const fmt = (n: number): string => formatNumber(n, s.numberFormat);
|
||||||
|
|
||||||
const avatarUrl = profile.avatar
|
const avatarUrl = profile.avatar
|
||||||
? `https://cdn.discordapp.com/avatars/${discordId}/${profile.avatar}.png?size=128`
|
? `https://cdn.discordapp.com/avatars/${discordId}/${profile.avatar}.png?size=128`
|
||||||
@@ -62,17 +69,17 @@ export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element
|
|||||||
day: "numeric",
|
day: "numeric",
|
||||||
});
|
});
|
||||||
|
|
||||||
const visibleStats = [
|
const currentRunStats = [
|
||||||
s.showTotalGold && {
|
s.showCurrentGold && {
|
||||||
icon: "🪙",
|
icon: "🪙",
|
||||||
value: formatNumber(profile.totalGoldEarned),
|
value: fmt(profile.currentRunGold),
|
||||||
label: "Total Gold Earned",
|
label: "Gold Earned",
|
||||||
date: false,
|
date: false,
|
||||||
},
|
},
|
||||||
s.showTotalClicks && {
|
s.showCurrentClicks && {
|
||||||
icon: "👆",
|
icon: "👆",
|
||||||
value: formatNumber(profile.totalClicks),
|
value: fmt(profile.currentRunClicks),
|
||||||
label: "Total Clicks",
|
label: "Clicks",
|
||||||
date: false,
|
date: false,
|
||||||
},
|
},
|
||||||
s.showBossesDefeated && {
|
s.showBossesDefeated && {
|
||||||
@@ -89,7 +96,7 @@ export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element
|
|||||||
},
|
},
|
||||||
s.showAdventurersRecruited && {
|
s.showAdventurersRecruited && {
|
||||||
icon: "⚔️",
|
icon: "⚔️",
|
||||||
value: formatNumber(profile.adventurersRecruited),
|
value: fmt(profile.adventurersRecruited),
|
||||||
label: "Adventurers Recruited",
|
label: "Adventurers Recruited",
|
||||||
date: false,
|
date: false,
|
||||||
},
|
},
|
||||||
@@ -99,13 +106,66 @@ export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element
|
|||||||
label: "Achievements Unlocked",
|
label: "Achievements Unlocked",
|
||||||
date: false,
|
date: false,
|
||||||
},
|
},
|
||||||
|
].filter(Boolean) as StatEntry[];
|
||||||
|
|
||||||
|
const allTimeStats = [
|
||||||
|
s.showTotalGold && {
|
||||||
|
icon: "🪙",
|
||||||
|
value: fmt(profile.totalGoldEarned),
|
||||||
|
label: "Total Gold Earned",
|
||||||
|
date: false,
|
||||||
|
},
|
||||||
|
s.showTotalClicks && {
|
||||||
|
icon: "👆",
|
||||||
|
value: fmt(profile.totalClicks),
|
||||||
|
label: "Total Clicks",
|
||||||
|
date: false,
|
||||||
|
},
|
||||||
|
s.showLifetimeBossesDefeated && {
|
||||||
|
icon: "💀",
|
||||||
|
value: String(profile.lifetimeBossesDefeated),
|
||||||
|
label: "Bosses Defeated",
|
||||||
|
date: false,
|
||||||
|
},
|
||||||
|
s.showLifetimeQuestsCompleted && {
|
||||||
|
icon: "📜",
|
||||||
|
value: String(profile.lifetimeQuestsCompleted),
|
||||||
|
label: "Quests Completed",
|
||||||
|
date: false,
|
||||||
|
},
|
||||||
|
s.showLifetimeAdventurersRecruited && {
|
||||||
|
icon: "⚔️",
|
||||||
|
value: fmt(profile.lifetimeAdventurersRecruited),
|
||||||
|
label: "Adventurers Recruited",
|
||||||
|
date: false,
|
||||||
|
},
|
||||||
|
s.showLifetimeAchievementsUnlocked && {
|
||||||
|
icon: "🏆",
|
||||||
|
value: String(profile.lifetimeAchievementsUnlocked),
|
||||||
|
label: "Achievements Unlocked",
|
||||||
|
date: false,
|
||||||
|
},
|
||||||
s.showGuildFounded && {
|
s.showGuildFounded && {
|
||||||
icon: "📅",
|
icon: "📅",
|
||||||
value: memberSince,
|
value: memberSince,
|
||||||
label: "Guild Founded",
|
label: "Guild Founded",
|
||||||
date: true,
|
date: true,
|
||||||
},
|
},
|
||||||
].filter(Boolean) as Array<{ icon: string; value: string; label: string; date: boolean }>;
|
].filter(Boolean) as StatEntry[];
|
||||||
|
|
||||||
|
const renderStats = (stats: StatEntry[]): React.JSX.Element => (
|
||||||
|
<div className="profile-stats">
|
||||||
|
{stats.map((stat) => (
|
||||||
|
<div key={stat.label} className="profile-stat">
|
||||||
|
<span className="profile-stat-icon">{stat.icon}</span>
|
||||||
|
<span className={`profile-stat-value ${stat.date ? "profile-stat-date" : ""}`}>
|
||||||
|
{stat.value}
|
||||||
|
</span>
|
||||||
|
<span className="profile-stat-label">{stat.label}</span>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="profile-page">
|
<div className="profile-page">
|
||||||
@@ -131,17 +191,17 @@ export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element
|
|||||||
<p className="profile-bio">{profile.bio}</p>
|
<p className="profile-bio">{profile.bio}</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{visibleStats.length > 0 && (
|
{currentRunStats.length > 0 && (
|
||||||
<div className="profile-stats">
|
<div className="profile-stats-section">
|
||||||
{visibleStats.map((stat) => (
|
<h3 className="profile-stats-heading">Current Run</h3>
|
||||||
<div key={stat.label} className="profile-stat">
|
{renderStats(currentRunStats)}
|
||||||
<span className="profile-stat-icon">{stat.icon}</span>
|
</div>
|
||||||
<span className={`profile-stat-value ${stat.date ? "profile-stat-date" : ""}`}>
|
)}
|
||||||
{stat.value}
|
|
||||||
</span>
|
{allTimeStats.length > 0 && (
|
||||||
<span className="profile-stat-label">{stat.label}</span>
|
<div className="profile-stats-section">
|
||||||
</div>
|
<h3 className="profile-stats-heading">All Time</h3>
|
||||||
))}
|
{renderStats(allTimeStats)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -97,14 +97,22 @@ export interface PublicProfileResponse {
|
|||||||
avatar: string | null;
|
avatar: string | null;
|
||||||
bio: string;
|
bio: string;
|
||||||
profileSettings: ProfileSettings;
|
profileSettings: ProfileSettings;
|
||||||
prestigeCount: number;
|
createdAt: number;
|
||||||
|
/** All Time stats — cumulative across all runs, never reset */
|
||||||
totalGoldEarned: number;
|
totalGoldEarned: number;
|
||||||
totalClicks: number;
|
totalClicks: number;
|
||||||
|
lifetimeBossesDefeated: number;
|
||||||
|
lifetimeQuestsCompleted: number;
|
||||||
|
lifetimeAdventurersRecruited: number;
|
||||||
|
lifetimeAchievementsUnlocked: number;
|
||||||
|
/** Current Run stats — sourced from the live GameState, reset on prestige & transcendence */
|
||||||
|
currentRunGold: number;
|
||||||
|
currentRunClicks: number;
|
||||||
|
prestigeCount: number;
|
||||||
bossesDefeated: number;
|
bossesDefeated: number;
|
||||||
questsCompleted: number;
|
questsCompleted: number;
|
||||||
adventurersRecruited: number;
|
adventurersRecruited: number;
|
||||||
achievementsUnlocked: number;
|
achievementsUnlocked: number;
|
||||||
createdAt: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateProfileRequest {
|
export interface UpdateProfileRequest {
|
||||||
|
|||||||
@@ -9,8 +9,20 @@ export interface Player {
|
|||||||
createdAt: number;
|
createdAt: number;
|
||||||
/** Unix timestamp of the last server-side save */
|
/** Unix timestamp of the last server-side save */
|
||||||
lastSavedAt: number;
|
lastSavedAt: number;
|
||||||
/** Total lifetime gold ever collected (for prestige eligibility) */
|
/** Gold earned this run (reset on prestige; used for prestige eligibility) */
|
||||||
totalGoldEarned: number;
|
totalGoldEarned: number;
|
||||||
/** Total lifetime clicks */
|
/** Clicks this run (reset on prestige) */
|
||||||
totalClicks: number;
|
totalClicks: number;
|
||||||
|
/** Cumulative gold earned across all runs — never reset */
|
||||||
|
lifetimeGoldEarned: number;
|
||||||
|
/** Cumulative clicks across all runs — never reset */
|
||||||
|
lifetimeClicks: number;
|
||||||
|
/** Cumulative bosses defeated across all runs — never reset */
|
||||||
|
lifetimeBossesDefeated: number;
|
||||||
|
/** Cumulative quests completed across all runs — never reset */
|
||||||
|
lifetimeQuestsCompleted: number;
|
||||||
|
/** Cumulative adventurers recruited across all runs — never reset */
|
||||||
|
lifetimeAdventurersRecruited: number;
|
||||||
|
/** Cumulative achievements unlocked across all runs — never reset */
|
||||||
|
lifetimeAchievementsUnlocked: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
export type NumberFormat = "suffix" | "scientific" | "engineering";
|
export type NumberFormat = "suffix" | "scientific" | "engineering";
|
||||||
|
|
||||||
export interface ProfileSettings {
|
export interface ProfileSettings {
|
||||||
|
/** All Time section */
|
||||||
showTotalGold: boolean;
|
showTotalGold: boolean;
|
||||||
showTotalClicks: boolean;
|
showTotalClicks: boolean;
|
||||||
showPrestige: boolean;
|
showLifetimeBossesDefeated: boolean;
|
||||||
|
showLifetimeQuestsCompleted: boolean;
|
||||||
|
showLifetimeAdventurersRecruited: boolean;
|
||||||
|
showLifetimeAchievementsUnlocked: boolean;
|
||||||
showGuildFounded: boolean;
|
showGuildFounded: boolean;
|
||||||
|
/** Current Run section */
|
||||||
|
showCurrentGold: boolean;
|
||||||
|
showCurrentClicks: boolean;
|
||||||
|
showPrestige: boolean;
|
||||||
showBossesDefeated: boolean;
|
showBossesDefeated: boolean;
|
||||||
showQuestsCompleted: boolean;
|
showQuestsCompleted: boolean;
|
||||||
showAdventurersRecruited: boolean;
|
showAdventurersRecruited: boolean;
|
||||||
@@ -15,8 +23,14 @@ export interface ProfileSettings {
|
|||||||
export const DEFAULT_PROFILE_SETTINGS: ProfileSettings = {
|
export const DEFAULT_PROFILE_SETTINGS: ProfileSettings = {
|
||||||
showTotalGold: true,
|
showTotalGold: true,
|
||||||
showTotalClicks: true,
|
showTotalClicks: true,
|
||||||
showPrestige: true,
|
showLifetimeBossesDefeated: true,
|
||||||
|
showLifetimeQuestsCompleted: true,
|
||||||
|
showLifetimeAdventurersRecruited: true,
|
||||||
|
showLifetimeAchievementsUnlocked: true,
|
||||||
showGuildFounded: true,
|
showGuildFounded: true,
|
||||||
|
showCurrentGold: true,
|
||||||
|
showCurrentClicks: true,
|
||||||
|
showPrestige: true,
|
||||||
showBossesDefeated: true,
|
showBossesDefeated: true,
|
||||||
showQuestsCompleted: true,
|
showQuestsCompleted: true,
|
||||||
showAdventurersRecruited: true,
|
showAdventurersRecruited: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user