generated from nhcarrigan/template
feat: v1 prototype — core game systems #30
@@ -30,6 +30,8 @@ const parseProfileSettings = (raw: unknown): ProfileSettings => {
|
||||
showCurrentGold: obj.showCurrentGold !== false,
|
||||
showCurrentClicks: obj.showCurrentClicks !== false,
|
||||
showPrestige: obj.showPrestige !== false,
|
||||
showTranscendence: obj.showTranscendence !== false,
|
||||
showApotheosis: obj.showApotheosis !== false,
|
||||
showBossesDefeated: obj.showBossesDefeated !== false,
|
||||
showQuestsCompleted: obj.showQuestsCompleted !== false,
|
||||
showAdventurersRecruited: obj.showAdventurersRecruited !== false,
|
||||
@@ -54,6 +56,8 @@ profileRouter.get("/:discordId", async (context) => {
|
||||
|
||||
const state = gameStateRecord?.state as unknown as GameState | undefined;
|
||||
const prestigeCount = state?.prestige.count ?? 0;
|
||||
const transcendenceCount = state?.transcendence?.count ?? 0;
|
||||
const apotheosisCount = state?.apotheosis?.count ?? 0;
|
||||
const profileSettings = parseProfileSettings(player.profileSettings);
|
||||
|
||||
const bossesDefeated = state?.bosses.filter((b) => b.status === "defeated").length ?? 0;
|
||||
@@ -81,6 +85,8 @@ profileRouter.get("/:discordId", async (context) => {
|
||||
currentRunGold: state?.player.totalGoldEarned ?? 0,
|
||||
currentRunClicks: state?.player.totalClicks ?? 0,
|
||||
prestigeCount,
|
||||
transcendenceCount,
|
||||
apotheosisCount,
|
||||
bossesDefeated,
|
||||
questsCompleted,
|
||||
adventurersRecruited,
|
||||
@@ -108,6 +114,8 @@ profileRouter.put("/", authMiddleware, async (context) => {
|
||||
showCurrentGold: body.profileSettings?.showCurrentGold !== false,
|
||||
showCurrentClicks: body.profileSettings?.showCurrentClicks !== false,
|
||||
showPrestige: body.profileSettings?.showPrestige !== false,
|
||||
showTranscendence: body.profileSettings?.showTranscendence !== false,
|
||||
showApotheosis: body.profileSettings?.showApotheosis !== false,
|
||||
showBossesDefeated: body.profileSettings?.showBossesDefeated !== false,
|
||||
showQuestsCompleted: body.profileSettings?.showQuestsCompleted !== false,
|
||||
showAdventurersRecruited: body.profileSettings?.showAdventurersRecruited !== false,
|
||||
|
||||
@@ -17,6 +17,8 @@ interface StatToggle {
|
||||
const CURRENT_RUN_TOGGLES: StatToggle[] = [
|
||||
{ key: "showCurrentGold", label: "Gold Earned This Run", icon: "🪙" },
|
||||
{ key: "showCurrentClicks", label: "Clicks This Run", icon: "👆" },
|
||||
{ key: "showApotheosis", label: "Apotheosis Badge", icon: "✨" },
|
||||
{ key: "showTranscendence", label: "Transcendence Badge", icon: "🌌" },
|
||||
{ key: "showPrestige", label: "Prestige Level", icon: "⭐" },
|
||||
{ key: "showBossesDefeated", label: "Bosses Defeated", icon: "💀" },
|
||||
{ key: "showQuestsCompleted", label: "Quests Completed", icon: "📜" },
|
||||
|
||||
@@ -179,6 +179,16 @@ export const ProfilePage = ({ discordId }: ProfilePageProps): React.JSX.Element
|
||||
<div className="profile-identity">
|
||||
<h1 className="profile-character-name">{profile.characterName}</h1>
|
||||
<p className="profile-username">@{profile.username}</p>
|
||||
{s.showApotheosis && profile.apotheosisCount > 0 && (
|
||||
<span className="profile-apotheosis-badge">
|
||||
✨ Apotheosis {profile.apotheosisCount}
|
||||
</span>
|
||||
)}
|
||||
{s.showTranscendence && profile.transcendenceCount > 0 && (
|
||||
<span className="profile-transcendence-badge">
|
||||
🌌 Transcendence {profile.transcendenceCount}
|
||||
</span>
|
||||
)}
|
||||
{s.showPrestige && profile.prestigeCount > 0 && (
|
||||
<span className="profile-prestige-badge">
|
||||
⭐ Prestige {profile.prestigeCount}
|
||||
|
||||
@@ -1466,6 +1466,27 @@ body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.profile-apotheosis-badge {
|
||||
background: linear-gradient(135deg, rgba(120, 53, 15, 0.2), rgba(217, 119, 6, 0.2));
|
||||
border: 1px solid rgba(217, 119, 6, 0.5);
|
||||
border-radius: 1rem;
|
||||
color: #fbbf24;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
padding: 0.2rem 0.6rem;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.profile-transcendence-badge {
|
||||
background: rgba(124, 58, 237, 0.15);
|
||||
border: 1px solid rgba(124, 58, 237, 0.4);
|
||||
border-radius: 1rem;
|
||||
color: #a78bfa;
|
||||
font-size: 0.8rem;
|
||||
padding: 0.2rem 0.6rem;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.profile-prestige-badge {
|
||||
background: rgba(255, 215, 0, 0.15);
|
||||
border: 1px solid rgba(255, 215, 0, 0.4);
|
||||
|
||||
@@ -109,6 +109,8 @@ export interface PublicProfileResponse {
|
||||
currentRunGold: number;
|
||||
currentRunClicks: number;
|
||||
prestigeCount: number;
|
||||
transcendenceCount: number;
|
||||
apotheosisCount: number;
|
||||
bossesDefeated: number;
|
||||
questsCompleted: number;
|
||||
adventurersRecruited: number;
|
||||
|
||||
@@ -13,6 +13,8 @@ export interface ProfileSettings {
|
||||
showCurrentGold: boolean;
|
||||
showCurrentClicks: boolean;
|
||||
showPrestige: boolean;
|
||||
showTranscendence: boolean;
|
||||
showApotheosis: boolean;
|
||||
showBossesDefeated: boolean;
|
||||
showQuestsCompleted: boolean;
|
||||
showAdventurersRecruited: boolean;
|
||||
@@ -31,6 +33,8 @@ export const DEFAULT_PROFILE_SETTINGS: ProfileSettings = {
|
||||
showCurrentGold: true,
|
||||
showCurrentClicks: true,
|
||||
showPrestige: true,
|
||||
showTranscendence: true,
|
||||
showApotheosis: true,
|
||||
showBossesDefeated: true,
|
||||
showQuestsCompleted: true,
|
||||
showAdventurersRecruited: true,
|
||||
|
||||
Reference in New Issue
Block a user