Skip to main content

Overview

The PrestigeService handles the prestige mechanic, which allows players to reset their progress in exchange for prestige cores. These cores are spent on permanent upgrades that persist across prestige cycles.

Dependencies

The service injects:
characterService = inject(CharacterService);
prestigeUgpradeService = inject(PrestigeUpgradeService);

Methods

prestige

prestige(): void
Executes a prestige operation, resetting character progress and awarding prestige cores based on current stage. Actions:
  1. Calculate prestige cores earned using calculatePrestigeCores()
  2. Reset character stats (preserves prestige progress)
  3. Add earned prestige cores to character
  4. Increment prestige level by 1
Usage:
prestigeService.prestige();
This permanently resets character stats, stage, and wave progress. The operation cannot be undone.
The following values are preserved during prestige:
  • Existing prestige cores (new cores are added)
  • Prestige level (incremented)
  • Prestige multipliers
  • Gold (preserved, not reset)
Example flow:
// Player reaches stage 25
const coresEarned = prestigeService.calculatePrestigeCores(); // Returns ~10 cores

// Execute prestige
prestigeService.prestige();

// Character is now:
// - Level 1
// - Stage 1, Wave 1
// - Base stats reset to 1
// - Prestige level increased by 1
// - Prestige cores increased by ~10

calculatePrestigeCores

calculatePrestigeCores(): number
Calculates the number of prestige cores that would be earned from prestiging at the current stage. Formula:
if (currentStage < 20) return 0;

const baseCores = Math.floor(4 * Math.log10(currentStage));
const multiplier = 1 + prestigeUpgradeBoost; // From "Kaizen Mastery" upgrade
return Math.floor(baseCores * multiplier);
Returns: Number of prestige cores that would be earned (0 if below stage 20) Usage:
const coresAvailable = prestigeService.calculatePrestigeCores();

if (coresAvailable > 0) {
  // Show prestige button
  console.log(`Prestige now to earn ${coresAvailable} cores`);
}
Stage requirements:
  • Minimum stage 20 to earn any prestige cores
  • Formula uses logarithmic scaling: 4 * log10(stage)

Prestige Core Earning Table

Here’s how many cores you earn at various stages (without multiplier upgrades):
StageCores EarnedFormula
190Below minimum
2054 * log10(20)
2554 * log10(25)
3054 * log10(30)
5064 * log10(50)
7574 * log10(75)
10084 * log10(100)
15084 * log10(150)
20094 * log10(200)
500104 * log10(500)
1000124 * log10(1000)
The “Kaizen Mastery” prestige upgrade increases core gain by 10% per level, multiplying the base value.Example: At stage 100 with Kaizen Mastery level 3:
  • Base cores: 8
  • Multiplier: 1 + (0.1 × 3) = 1.3
  • Total cores: 8 × 1.3 = 10.4 → 10 cores

Prestige Strategy

Optimal prestige timing:The logarithmic formula means diminishing returns as you progress. It’s generally more efficient to prestige more frequently rather than pushing to higher stages.Example:
  • Stage 20 → 30: Gain 0 additional cores (still 5)
  • Stage 100 → 200: Gain only 1 additional core (8 → 9)
Prestiging at earlier stages and spending cores on permanent upgrades often provides better long-term progression.
  • CharacterService - Manages character state and reset logic
  • PrestigeUpgradeService - Handles spending prestige cores on permanent upgrades
  • GameStateService - Coordinates prestige with database persistence

Build docs developers (and LLMs) love