Commit Graph

82 Commits

Author SHA1 Message Date
hikari 49bfc6a109 feat: add in-game sound effects and browser notifications (#27)
CI / Lint, Build & Test (pull_request) Failing after 5s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Failing after 4s
Adds Web Audio API sound effects and browser notifications for key game
events: achievement unlocked, quest completed, quest failed, boss
defeated, prestige, transcendence, and apotheosis. Both features are
toggled via profile settings, with notification permission requested
on first enable.
2026-03-08 15:06:28 -07:00
hikari 746fd36fb5 feat: add support link button to resource bar (#26) 2026-03-08 14:15:19 -07:00
hikari b82a2d3da7 fix: display sub-one values with two decimal places (#25) 2026-03-08 14:11:53 -07:00
hikari d1d1f70c75 chore: fix lint, ensure full CI pipeline passes, add verify checklist
- Fix strict-boolean-expressions in 7 route files (runtime body validation)
- Fix no-unnecessary-condition in profile.ts and offlineProgress.ts (defensive null checks)
- Extend v8 ignore next-N counts in game.ts to reach 100% coverage
- Add CI requirements to CLAUDE.md (lint + build + test must pass before commit)
- Add manual verification checklist (verify.md)
- Remove progress.md
2026-03-08 13:59:38 -07:00
hikari b67eae9d46 test: add 100% coverage for apps/api and packages/types
Adds full Vitest test suites with @vitest/coverage-v8, targeting 100%
statement/branch/function/line coverage. Uses v8 ignore comments for
genuinely unreachable defensive branches.
2026-03-07 19:59:48 -08:00
hikari 5d2d71983a feat: add schema version system with outdated save detection
Introduces a schema version field to GameState. Saves without the
current schema version are flagged on load (showing a modal prompting
reset or proceed), and cloud saves from outdated clients are rejected
server-side. Removes all backfill code now that outdated saves are
handled via the reset flow instead.

New POST /game/reset endpoint creates a fresh save for players who
choose to reset. Save version and current schema version are displayed
in the sidebar below the app version.
2026-03-07 17:34:26 -08:00
hikari 4ed3ccc69c feat: add main questline / overarching story system (#24)
- 22 chapters across the full game arc (18 zone bosses + 4 milestones)
- Choice-based narrative with {characterName} dynamic substitution
- Story progress (unlocked + completed chapters) is permanent across all resets
- Server-side anti-cheat: chapters/choices can only accumulate, never be removed
- Tab badge and lower-right toast notifications for newly unlocked chapters
- Story choices displayed on the Character Sheet and Character Page
- How to Play entry added to About panel
2026-03-07 17:15:08 -08:00
hikari ad5f2ad226 fix: raise Sera/Mira/Vex companion unlock thresholds 2026-03-07 16:13:42 -08:00
hikari 4b0945d0f3 fix: increase companion unlock thresholds to match bonus power 2026-03-07 16:12:36 -08:00
hikari db860ee5d3 feat: add companion system with quest-time reduction server validation
Introduces 10 unlockable companions (Lyra, Finn, Wren, Aldric, Sera, Kael,
Zuri, Mira, Vex, Pria), each providing a unique bonus: passive gold, click
gold, boss damage, essence income, or quest-time reduction.

Quest-time reduction is validated server-side: computeQuestRewards applies
the active companion's reduction to the effective duration check, and the
income validation budget accounts for passive gold and essence bonuses.
Server recomputes unlockedCompanionIds on every save using DB-authoritative
lifetime stats and validates the active companion ID.

Companion bonuses are also applied in the client tick engine and
boss.ts calculatePartyStats.
2026-03-07 15:59:24 -08:00
hikari bcb523f598 fix: update dailyChallenges client state on boss defeat 2026-03-07 15:37:07 -08:00
hikari f79d88e31c chore: clarify v1.0.0 progress reset in early access notice 2026-03-07 15:35:18 -08:00
hikari c40ec41dd6 fix: create fresh game state when no save record exists
Replaces the 404 response with a fresh INITIAL_GAME_STATE seeded from
the player's existing Player record. Handles the v1 GameState nuke
gracefully β€” returning players get a clean slate instead of an error.
2026-03-07 15:30:17 -08:00
hikari 74d1d21419 feat: add auto-quest and auto-boss toggles
Adds optional automation to the quest and boss panels. Auto-quest
automatically starts the highest-zone available quest (respecting CP
requirements) as soon as none is active. Auto-boss automatically
challenges the highest available boss when one is ready. Both run
exclusively in the client-side RAF tick loop β€” offline calculations
are unaffected. Toggles persist in GameState via cloud save.
2026-03-07 15:26:41 -08:00
hikari bec972aed1 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.
2026-03-07 15:18:59 -08:00
hikari 3515de62ee feat: add public leaderboards with opt-out privacy setting 2026-03-07 15:06:42 -08:00
hikari bbdacf272c feat: show equipped items on character sheet and public profile 2026-03-07 14:57:53 -08:00
hikari b886928e49 feat: add titles system with unlock tracking and character sheet display
Titles are earned by reaching milestones (quests, bosses, gold, clicks,
adventurers, guild, prestige, transcendence, apotheosis, achievements,
longevity) and are permanent - never lost on prestige/transcendence/
apotheosis resets. 20 titles available at launch.

Also fixes a pre-existing P2034 write-conflict on the load backfill path
and the exactOptionalPropertyTypes violation in the quest failure handler.
2026-03-07 14:51:30 -08:00
hikari eef807343b feat: grant Discord role and post webhook on apotheosis 2026-03-07 14:21:15 -08:00
hikari cb5ea9fee6 feat: post Discord webhook on prestige, transcendence, and apotheosis 2026-03-07 14:15:22 -08:00
hikari 599c8fe5b7 feat: add share link button to character sheet panel 2026-03-07 14:03:35 -08:00
hikari 8f0d038da1 feat: add race/class to character sheet, public /character/:id page
Players can now set their character's race and class in the Character
tab. A new public page at /character/:id displays the full character
sheet β€” name, pronouns, race, class, bio, and guild lore.
2026-03-07 13:54:13 -08:00
hikari 924b9f541d feat: add character sheet panel with guild info
Adds pronouns, guildName, and guildDescription fields to the player
profile. A new Character tab provides an in-game view/edit panel for
character and guild lore.

Closes #16
2026-03-07 13:49:04 -08:00
hikari 4706f3f7f8 fix: backfill baseCost on adventurers from pre-existing saves 2026-03-07 13:40:30 -08:00
hikari 9be946a873 feat: scale adventurer tier costs progressively
Each adventurer tier now has a unique baseCost that scales ~7x per
tier (L1: 10 β†’ L32: ~2.5e27). The per-count scaling factor (1.15Γ—)
is unchanged.

Closes #10
2026-03-07 13:39:00 -08:00
hikari 3856dda734 feat: add batch size selector for hiring adventurers
Closes #12
2026-03-07 13:35:18 -08:00
hikari cddf4fa692 feat: use elysium avatar image for guild hall click button 2026-03-07 12:16:06 -08:00
hikari 25d4a11eeb feat: add zone-scaled quest failure chance
Quests now have a random chance of failing when their timer expires.
On failure the quest resets to available (no rewards lost, just time).
Failure chance scales by zone: 10% in Verdant Vale up to 40% in the
end-game zones. The Quest type gains lastFailedAt so the UI can show
a warning on subsequent attempts.
2026-03-07 12:13:35 -08:00
hikari 58e7000954 feat: limit players to one active exploration at a time
Server-side: check if any area is already in_progress before allowing
a new exploration to start. Client-side: derive hasActiveExploration
from the full areas list and disable all Explore buttons (with a
tooltip) whilst another area is underway. Closes #9.
2026-03-07 12:06:21 -08:00
hikari 01146a4999 refactor: use npm_package_version env var for API version
Replaces the readFileSync/path gymnastics with the simpler
npm_package_version environment variable that npm injects at runtime.
2026-03-07 12:05:27 -08:00
hikari 29f92fff88 feat: responsive layout for mobile and small screens
Stacks the sidebar above content on ≀768px, wraps the resource bar,
hides decorative labels/badges to reduce clutter, and collapses the
click area into a compact horizontal strip. Profile link button labels
hide on ≀480px leaving icon-only buttons. Tab bar already scrolled
horizontally so no further changes needed there.
2026-03-07 11:44:02 -08:00
hikari cd12d4dbec feat: show app version in sidebar, remove version from about page
Displays the app version below the Elysium title in the sidebar.
Removes the separate client/API version cards from the About panel.
Also fixes the Vite dev proxy port to match the API server.
2026-03-07 11:38:26 -08:00
hikari e01dc64919 feat: add game title and copyright to UI
Adds the Elysium title above the guild hall button and an NHCarrigan
copyright notice at the bottom of the sidebar, with matching styles.
2026-03-07 11:34:15 -08:00
hikari 11393757ec chore: add PORT and CORS_ORIGIN to prod.env 2026-03-07 04:28:21 -08:00
hikari efaa62c936 feat: reorder tabs, add early access notice, fix api version path
- Reorder game tabs to: Adventurers, Upgrades, Quests, Bosses, Equipment, Exploration, Crafting, Daily, Prestige, Transcendence, Apotheosis, Statistics, Achievements, Codex, About
- Add early access warning below guild hall click button
- Fix package.json resolution path in about route (prod/src/routes β†’ ../../../)
2026-03-07 04:17:02 -08:00
hikari 6ddf8e0b43 feat: add exploration and crafting systems
Adds two new game systems: Exploration (scouts collect materials from
timed area runs) and Crafting (combine materials into permanent
multipliers). Includes 72 exploration areas, 54 materials, 36 recipes,
and 108 new Codex lore entries. Removes unused characterName requirement
from prestige/transcendence/apotheosis reset flows.
2026-03-07 04:14:04 -08:00
hikari 2aa6362ad6 fix: always initialise transcendence and apotheosis in game state
Adds INITIAL_TRANSCENDENCE and INITIAL_APOTHEOSIS constants and includes
both in INITIAL_GAME_STATE so every save document contains these fields
from the very first write, rather than only appearing post-transcendence
or post-apotheosis.
2026-03-07 02:57:59 -08:00
hikari cb8e83377a feat: add transcendence and apotheosis badges to public profile
- PublicProfileResponse now includes transcendenceCount and apotheosisCount
- ProfileSettings adds showTranscendence and showApotheosis toggles (both on by default)
- Profile page displays ✨ Apotheosis, 🌌 Transcendence, and ⭐ Prestige badges in that order
- EditProfileModal exposes the two new visibility toggles under Current Run settings
- Styled to match the resource bar badges (gold for apotheosis, purple for transcendence)
2026-03-07 02:39:59 -08:00
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