feat: add daily login bonus system with streak tracking

Awards escalating gold rewards each consecutive day (Day 7 grants bonus
crystals). Streak resets on missed days; a week multiplier boosts all
rewards for longer streaks. Shows a modal on first daily load and
displays the current streak on the character sheet.
This commit is contained in:
2026-03-07 15:18:59 -08:00
committed by Naomi Carrigan
parent 3515de62ee
commit bec972aed1
11 changed files with 367 additions and 6 deletions
+1
View File
@@ -41,6 +41,7 @@ export type {
LeaderboardCategory,
LeaderboardEntry,
LeaderboardResponse,
LoginBonusResult,
LoadResponse,
PrestigeRequest,
PrestigeResponse,
+17
View File
@@ -21,6 +21,19 @@ export interface SaveResponse {
signature?: string;
}
export interface LoginBonusResult {
/** Current login streak day count */
streak: number;
/** Gold awarded for today's login */
goldEarned: number;
/** Crystals awarded (day 7 bonus, scaled by week multiplier) */
crystalsEarned: number;
/** Day within the 7-day cycle (17) */
day: number;
/** Week number multiplier (week 1 = ×1, week 2 = ×2, …) */
weekMultiplier: number;
}
export interface LoadResponse {
state: GameState;
/** Offline gold earned since last save (server-calculated) */
@@ -31,6 +44,10 @@ export interface LoadResponse {
offlineSeconds: number;
/** HMAC-SHA256 signature of the loaded state — store and include in next save request */
signature?: string;
/** Daily login bonus awarded on this load (null if already claimed today) */
loginBonus: LoginBonusResult | null;
/** Current login streak (always present) */
loginStreak: number;
}
export interface BossChallengeRequest {