Commit Graph

44 Commits

Author SHA1 Message Date
hikari a6f9844120 feat: add apotheosis third prestige layer and remove IDEAS.md
Apotheosis is the ultimate reset — wipes absolutely everything
including prestige and transcendence — in exchange for a pure
bragging-rights badge. No mechanical benefit whatsoever.

Unlock condition: all 15 Transcendence echo upgrades purchased.
Can be achieved multiple times; each cycle requires repurchasing
all Transcendence upgrades again.

What survives: Codex lore entries and lifetime profile statistics.
What is wiped: resources, prestige, runestones, transcendence data
(echoes, echo upgrades, multipliers), equipment, upgrades, bosses,
quests, zones, adventurers, achievements.

New files: Apotheosis.ts type, apotheosis service, apotheosis route,
ApotheosisPanel.tsx component.

Modified: GameState (apotheosis field), Api.ts, types/index.ts,
prestige service (carry apotheosis), transcendence service (carry
apotheosis), game.ts anti-cheat (cap apotheosis count), API client,
GameContext (apotheosis() function), GameLayout (new tab), ResourceBar
(gold apotheosis badge shown above transcendence and prestige badges),
styles.css, AboutPanel how-to-play.

Also removes IDEAS.md — all planned features are now implemented!
2026-03-07 02:37:08 -08:00
hikari e8881a81d5 feat: add transcendence second prestige layer
Implements the full Transcendence system — the ultimate endgame
mechanic, unlocked by defeating The Absolute One (requires Prestige 90).

Nuclear reset model: wipes resources, prestige, runestones, upgrades,
equipment, bosses, quests, zones, and achievements. Codex entries and
lifetime profile stats are preserved. Transcendence data is permanent
and accumulates across all future resets.

Echo formula: floor(853 / sqrt(prestigeCount)) × echoMetaMultiplier
Fewer prestiges = more Echoes, rewarding optimised play.

15 Echo upgrades across 5 categories:
- Income multipliers (×1.25 → ×5): 5 tiers, cost 5–80 echoes
- Combat multipliers (×1.25 → ×2): 3 tiers, cost 5–35 echoes
- Prestige threshold reductions (×0.9, ×0.8): cost 8–20 echoes
- Prestige runestone multipliers (×1.5, ×2): cost 8–20 echoes
- Echo meta multipliers (×1.25 → ×2): cost 10–50 echoes

New files: Transcendence.ts types, transcendence service, route,
data files (API + web), TranscendencePanel.tsx component.

Modified: GameState, Api, types/index, prestige service (carries
transcendence through resets, applies echo multipliers), boss route
(echoCombatMultiplier), game.ts anti-cheat (echo cap), tick.ts
(echoIncomeMultiplier), GameContext, API client, GameLayout (new tab),
ResourceBar (transcendence badge alongside prestige badge), styles.css,
AboutPanel, IDEAS.md.
2026-03-07 02:22:45 -08:00
hikari 298e1f4604 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
2026-03-07 02:08:41 -08:00
hikari 3cded34f4b fix: preserve codex lore entries across prestige resets 2026-03-07 01:21:37 -08:00
hikari fd286cd29f feat: add codex / lore book with 364 entries
Implements a full in-game Codex panel that tracks lore discovery across
seven categories: bosses (72), quests (95), zones (18), equipment (65),
adventurer tiers (32), upgrades (57), and prestige upgrades (25).

Lore entries unlock automatically as players progress — existing
completions are retroactively and silently added on first load. New
discoveries trigger a toast notification and badge counter on the
Codex tab.
2026-03-07 01:17:45 -08:00
hikari b0ed976a1d feat: add donate/discord nav buttons and fix runestone display
Adds Donate and Discord link buttons to the resource bar nav. Also
fixes a display discrepancy where the resource bar showed
resources.runestones (always 0) instead of the actual prestige
runestone balance from prestige.runestones.

 This feature was implemented with help from Hikari~ 🌸
2026-03-07 00:21:13 -08:00
hikari b27454669e feat: add auto-prestige toggle via runestone shop upgrade
Adds a new Utility category to the prestige shop with the "Autonomous Ascension" upgrade (100 runestones). Once purchased, a toggle button appears in the shop that enables automatic prestige — the client RAF loop checks the threshold on each tick and fires the prestige API automatically using the current character name.

 This feature was implemented with help from Hikari~ 🌸
2026-03-07 00:15:10 -08:00
hikari acda4c2fc4 fix: resolve pre-existing TypeScript strictness build errors
- Add @types/node to API devDependencies
- Create HonoEnv type and apply to all routers + auth middleware for
  proper context.get/set("discordId") typing
- Use conditional spreads for exactOptionalPropertyTypes dailyChallenges
  in GameContext, tick engine, and prestige route
- Use conditional spread for optional signature in SaveRequest calls
- Add non-null assertions in shuffle/template index for noUncheckedIndexedAccess
- Cast GameState to never for Prisma InputJsonValue fields
- Exclude vite.config.ts from web tsconfig (it runs in Node context)
2026-03-06 23:56:55 -08:00
hikari 078ae50e69 feat: add equipment set bonuses and boss bounty runestones
- Define EquipmentSet type + computeSetBonuses utility in packages/types
- Add setId field to Equipment type and assign sets to 27 equipment items
- Create 9 named equipment sets (Iron Vanguard → Eternal Throne) with 2pc/3pc bonuses
- Apply set combat multiplier in boss route
- Apply set gold/click multipliers in tick engine and click handler
- Include set bonuses in anti-cheat delta validation
- Show active set bonus strip + set badge per card in EquipmentPanel
- Add boss first-kill bounty runestones (scaling 1–10 per boss tier)
- Update AboutPanel and IDEAS.md
2026-03-06 23:56:45 -08:00
hikari 48bf74e713 feat: add milestone prestige bonuses every 5th prestige
Every 5th prestige awards a scaling runestone windfall:
milestone_number * 25 stones (prestige 5 = 25, 10 = 50, 50 = 250, etc).
Shown in the ascension success message when non-zero.
2026-03-06 23:34:05 -08:00
hikari f84654263e fix: apply boss bounty runestones to local client state immediately
Without this, the client would auto-save stale state (runestones: 0)
after a first-kill bounty, causing the server's validateAndSanitize to
overwrite the correctly-persisted DB value back to zero.
2026-03-06 23:28:45 -08:00
hikari 3ff17bda84 feat: add about page with versions, changelog, and how-to-play
- New GET /about API endpoint caches Gitea releases for 5 minutes
- AboutPanel displays client version (via Vite define), API version, collapsible changelog, and How to Play guide
- GiteaRelease and AboutResponse types added to shared package
2026-03-06 23:16:50 -08:00
hikari dc1353a15c fix: strengthen cloud save anti-cheat with resource delta validation
Replaces the flat RESOURCE_CAP on gold and essence with a per-save
maximum derived from the player's actual income rate. The server now
computes max legitimate earnings using the previous (DB-trusted) state's
adventurers, upgrades, prestige multipliers, and equipment, then applies
a 2x buffer to cover mid-session purchases. Quest rewards are only
credited when the quest was active with an expired timer in the previous
state (using authoritative game data to prevent reward/duration
tampering). Boss rewards are included as a race-condition safety buffer
for simultaneous boss-write and save requests. Runestones are capped at
the previous value since they are only granted server-side via prestige.
2026-03-06 22:56:45 -08:00
hikari aaeece1a18 feat: add daily challenges system
Three PST-midnight-resetting challenges generated deterministically per
day from click, boss, quest, and prestige types. Progress tracked
server-side for bosses and prestige, client-side for clicks and quests.
Crystal rewards awarded on completion and preserved through prestige resets.
2026-03-06 22:22:18 -08:00
hikari a7d4b72805 feat: add statistics panel with all-time, current run, and progress stats 2026-03-06 22:02:57 -08:00
hikari 5b4661b398 feat: content expansion, prestige shop, and offline earnings improvements
- Expand content to 18 zones, 72 bosses, 95 quests, 32 adventurer tiers
- Add prestige shop with 24 runestone upgrades across 5 categories
- Add PrestigeUpgrade type, data files, API routes, and frontend panel
- Fix offline earnings to include equipment and runestone multipliers
- Add offline essence calculation alongside offline gold
- Update OfflineModal to display both gold and essence earned
- Add IDEAS.md for tracking planned features
2026-03-06 21:55:42 -08:00
hikari 6bc116a86a fix: add missing prestige shop CSS styles 2026-03-06 21:06:00 -08:00
hikari 59c417e75e fix: apply formatNumber to adventurer, upgrade, and prestige panels
All cost/stat displays now respect the player's chosen number notation
format instead of rendering raw numbers or toLocaleString values.
2026-03-06 20:00:46 -08:00
hikari 4e32709e07 fix: prevent auto-save race condition during force sync
Skip auto-save when isSyncingRef is true and reset the auto-save timer
at the start of forceSync to prevent concurrent saves from sharing the
same HMAC signature and causing alternating save failures.
2026-03-06 19:30:38 -08:00
hikari 5aae3eb389 feat: show save errors in the UI instead of console
Add syncError state to GameContext. forceSync now catches errors
and displays them in the ResourceBar for 5 seconds, replacing the
cloud save timestamp with ' Save failed'. Signature mismatches
are also cleared from localStorage so the next save can proceed.
Auto-save silently self-heals bad signatures without surfacing an error.
2026-03-06 19:18:29 -08:00
hikari 50fe905610 fix: stamp lastSavedAt into game state blob on save 2026-03-06 19:10:12 -08:00
hikari 3e20613851 chore: add ANTI_CHEAT_SECRET to prod.env 2026-03-06 19:08:44 -08:00
hikari 46f095ff8b feat: add server-side anti-cheat (option A + D)
Option A — state validation on every save:
- Cap all resources to RESOURCE_CAP (server enforces, not just client)
- Block boss status rollback (defeated can't become non-defeated)
- Block quest status rollback (completed can't become non-completed)
- Block achievement rollback (unlockedAt can't be cleared or future-dated)
- Block prestige count rollback (count can only go up)

Option D — HMAC signed save chain:
- Server signs the saved state with ANTI_CHEAT_SECRET (env var)
- Signature returned from both /game/load and /game/save
- Client stores signature in localStorage, sends it with every save
- Server verifies signature matches the previous DB state before accepting
- Gracefully degrades: if secret unset or first save, checks are skipped

Both options combine: a valid signature doesn't bypass A-validation;
A-validation runs regardless and silently corrects tampered fields.
2026-03-06 19:06:11 -08:00
hikari 5ad2c44399 feat: add number format config, resource cap, and modal scroll fix
- Add user-configurable number format (suffix/scientific/engineering)
  - Suffix: K/M/B/T through Dc (1e33), then letter-based a/b/c... indefinitely
  - Scientific: 1.23e15 style via toExponential
  - Engineering: exponent always a multiple of 3 (1.23E15)
  - Stored in ProfileSettings, fetched from profile API on load
  - Picker UI in EditProfileModal with live examples
- Cap all resource accumulation at 1e300 (RESOURCE_CAP constant)
  - Per-resource FULL badge with tooltip in ResourceBar
  - Amber notice strip when any resource is at cap
  - handleClick also respects the cap
- Make EditProfileModal scrollable with viewport margin
  - Flex column layout with sticky header, scrollable form body
  - Bio textarea preserved as resizable with min-height
- Fix ReferenceError: formatNumber not defined in BossPanel/AchievementPanel
  - Pass formatNumber as prop to BossCard and AchievementCard
  - Pass formatNumber as parameter to conditionDescription
2026-03-06 18:59:43 -08:00
hikari 24beaf3131 feat: add cloud save timestamp and force sync button
Shows a relative time label (e.g. "☁️ 2m ago") in the resource bar
seeded from the server on load and updated after every auto-save or
manual save. A 💾 button lets players trigger an immediate cloud save
outside the 30-second auto-save cycle, with a  spinner and disabled
state while the request is in-flight.
2026-03-06 18:22:28 -08:00
hikari 285c38255b fix: sync prestigeRequirement from defaults during save backfill 2026-03-06 16:48:36 -08:00
hikari 18ff4ce547 fix: remove early prestige gates and improve quest unlock hints
- Remove prestigeRequirement from all original zone bosses (Shattered Ruins through Astral Void) — prestige gates now only apply to new endgame zones (Celestial Reaches onward)
- Show zone unlock hint on locked quests when the quest's zone is still locked, so players know what to do
- Switch quest reward numbers to use formatNumber instead of toLocaleString, fixing raw integer display for endgame values
2026-03-06 16:41:50 -08:00
hikari fa1c46f17f feat: major endgame content expansion
- Add 6 new zones (Celestial Reaches through Eternal Throne) with sequential unlock chain
- Add 30 new bosses (5 per zone) scaling to 3e24 HP for true endgame challenge
- Add 36 new quests (6 per zone) with timers up to 96h for long-term progression
- Add 6 new adventurer tiers (seraph_knight through eternal_champion) requiring prestige 6-25
- Add ~36 new equipment pieces with boss drops and purchasable essence/crystal sinks
- Add new upgrades including endgame click/global multipliers and adventurer-specific unlocks
- Add 17 new achievements covering clicks (100K/1M), gold (quadrillion/quintillion), bosses (20/30/60), quests (30/50/72), adventurers (50K), prestige (5/10/25), and equipment (25/40)
- Extend formatNumber to support Q/Qt/S/Sp suffixes for numbers up to 1e24
2026-03-06 16:34:35 -08:00
hikari e780dc5f6c feat: sequential zone unlocking with dual boss+quest gate conditions
Zones now unlock in strict linear order. Each zone requires both the
final boss AND the final quest of the previous zone to be completed:

Verdant Vale → Shattered Ruins (forest_giant + ancient_ruins)
Shattered Ruins → Frozen Peaks (elder_dragon + dragon_lair)
Frozen Peaks → Shadow Marshes (void_titan + storm_citadel)
Shadow Marshes → Volcanic Depths (mud_kraken + plague_ruins)
Volcanic Depths → Astral Void (phoenix_lord + the_forge)

- Zone type gains `unlockQuestId` field alongside `unlockBossId`
- boss.ts checks both conditions before unlocking zone on boss defeat
- tick.ts checks both conditions and unlocks zones + first boss on
  quest completion if the boss condition is already met
- GameContext optimistic update also respects dual-condition logic
- BossPanel zone-gate hints now show both "⚔️ Defeat: X & 📜 Complete: Y"
- game.ts backfill syncs unlockQuestId and re-verifies zone status
  using both conditions, reverting incorrectly-unlocked saves
2026-03-06 16:04:52 -08:00
hikari b9a230f40f fix: remove locked styling from zone tabs so all zones appear accessible 2026-03-06 15:31:39 -08:00
hikari 268504265c feat: allow browsing locked zones so players can preview content 2026-03-06 15:21:14 -08:00
hikari c5ea59ffb4 feat: display unlock conditions on all locked items
All locked items now show players exactly what they need to do next:
- Adventurers: "📜 Complete: [Quest Name]"
- Upgrades: "⚔️ Defeat: [Boss]" or "📜 Complete: [Quest]"
- Equipment (boss drops): "⚔️ Drop: [Boss Name]" instead of generic label
- Bosses: "⚔️ Defeat: [Previous Boss] first" or zone gate boss
- Quests: "📜 Complete: [Prerequisite Quest]"

Also wires adventurer unlocks through quests (militia through dragon_rider
had no unlock path), retroactively applies rewards on existing saves,
syncs boss reward arrays from defaults on load, and removes invalid
rune_stone reference from Forest Giant.
2026-03-06 15:08:08 -08:00
hikari 42db6e1991 fix: add show/hide locked toggle to adventurer panel 2026-03-06 14:40:53 -08:00
hikari 772d733e86 feat: major content expansion with essence and crystal sinks
- 6 zones (up from 3): Shadow Marshes, Volcanic Depths, Astral Void
- 18 bosses (up from 4): 3 per zone with zone-based sequential unlock
- 24 quests (up from 9): 3-4 per zone, reorganised by zone
- 15 adventurer tiers (up from 10): Shadow Assassin through Divine Champion
- 28 equipment pieces (up from 12): boss drops + purchasable with essence/crystals
- 24 upgrades (up from 13): crystal-cost upgrades + new adventurer upgrades
- 22 achievements (up from 14): new milestones for bosses, quests, gold, armies
- Purchasable equipment system: buy items directly with essence or crystals
- Crystal-cost upgrades: spend crystals on global and click power boosts
- Zone-based boss progression: defeating a zone's last boss unlocks the next zone
2026-03-06 14:36:41 -08:00
hikari 653c36c886 feat: add more profile stats and auto-populate edit modal
Exposes four new stats on public profiles (bosses defeated, quests
completed, adventurers recruited, achievements unlocked) with
corresponding visibility toggles. The edit modal now auto-populates
the character name, bio, and settings from the server on open.
2026-03-06 14:14:45 -08:00
hikari 7e04daa073 feat: add profile editing (bio, display name, stat visibility) 2026-03-06 13:56:12 -08:00
hikari 32c13f73c4 feat: add public player profile page 2026-03-06 13:49:14 -08:00
hikari f734176965 feat: add show/hide locked toggle to all panels 2026-03-06 13:46:28 -08:00
hikari 897eba5f64 feat: add zone system to bosses and quests 2026-03-06 13:42:40 -08:00
hikari e9e0df31fd feat: add equipment, achievements, and visual polish
- Equipment system: 12 items across weapon/armour/trinket slots with
  common/rare/epic/legendary rarities; starter commons auto-equipped,
  higher tiers drop from boss victories
- Achievement system: 15 milestones with typed conditions; checked
  each tick and crystal rewards applied automatically
- Achievement toast: slide-in notification, auto-dismisses after 4s
- Floating click text: +X gold floats on each manual click
- Expanded quests (9 total) and upgrades (12 total)
- Upgrade panel now shows locked upgrades so players can see their
  progression path
- formatNumber utility (K/M/B/T) used consistently across all panels
- Backfill logic for existing saves to add new content gracefully
- types package now emits .d.ts declarations
2026-03-06 13:27:48 -08:00
hikari a3daed1683 feat: initial elysium idle game prototype
Sets up the full monorepo with pnpm workspaces. Includes shared types
package, Hono API with Discord OAuth/JWT auth, Prisma v6 + MongoDB
Atlas, and React + Vite frontend with game loop, five tabs, and
Discord-linked save/load.
2026-03-06 11:26:19 -08:00
hikari c69e155de3 docs: update feedback section to use support forum
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2026-01-26 12:38:42 -08:00
naomi a2a2670361 feat: automated upload of .gitea/workflows/security.yml
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2025-12-18 03:09:17 +01:00
NHCarrigan 6d6335732f Initial commit 2025-07-14 21:17:39 -07:00