Improve prestige

This commit is contained in:
2026-04-08 08:18:10 +02:00
parent ee374a3d74
commit 6c031aa381
7 changed files with 212 additions and 43 deletions

View File

@@ -21,8 +21,8 @@ PrestigeManager (autoload node)
├── Calculates pending gain
├── Applies multipliers to generators
└── PrestigePanel (UI)
├── Shows current/pending prestige
└── Trigger reset button
├── Shows current/pending prestige
└── Trigger reset button
```
## PrestigeConfig
@@ -33,23 +33,23 @@ Resource defining prestige rules.
```gdscript
enum BasisType {
LIFETIME_TOTAL, # All-time currency acquired
RUN_TOTAL, # Currency this run
RUN_MAX # Peak currency this run
LIFETIME_TOTAL, # All-time currency acquired
RUN_TOTAL, # Currency this run
RUN_MAX # Peak currency this run
}
enum FormulaType {
POWER, # gain = scale * (ratio^exponent)
TRIANGULAR_INVERSE # gain based on triangular number inverse
POWER, # gain = scale * (ratio^exponent)
TRIANGULAR_INVERSE # gain based on triangular number inverse
}
enum RoundingMode {
FLOOR, ROUND, CEIL
FLOOR, ROUND, CEIL
}
enum MultiplierMode {
ADDITIVE, # +X per prestige
MULTIPLICATIVE_POWER # x^(multiplier_per_prestige)
ADDITIVE, # +X per prestige
MULTIPLICATIVE_POWER # x^(multiplier_per_prestige)
}
```
@@ -119,7 +119,7 @@ raw_gain = scale * (ratio^exponent) + flat_bonus
# Cumulative basis subtracts already earned
if basis == LIFETIME_TOTAL:
gain = raw_gain - total_prestige_earned
gain = raw_gain - total_prestige_earned
```
**Triangular Inverse Formula**:
@@ -129,7 +129,7 @@ k = basis_value / threshold
target_total = (sqrt(1 + 8k) - 1) * 0.5
if basis == LIFETIME_TOTAL:
gain = target_total - total_prestige_earned
gain = target_total - total_prestige_earned
```
### Multiplier Application
@@ -185,13 +185,13 @@ Generators apply prestige multipliers automatically:
```gdscript
func get_effective_auto_run_multiplier() -> float:
return run_multiplier * buff_multiplier * _get_prestige_multiplier()
return run_multiplier * buff_multiplier * _get_prestige_multiplier()
func _get_prestige_multiplier() -> float:
var manager = get_node_or_null("/root/PrestigeManager")
if manager:
return manager.get_total_multiplier()
return 1.0
var manager = get_node_or_null("/root/PrestigeManager")
if manager:
return manager.get_total_multiplier()
return 1.0
```
## Save Integration
@@ -201,12 +201,12 @@ Prestige state stored in `GameState` external save:
```json
{
"prestige": {
"total_prestige_earned": {"m": 10.0, "e": 0},
"current_prestige_unspent": {"m": 5.0, "e": 0},
"prestige_resets_count": 3,
"run_start_total_source_currency": {"m": 1000.0, "e": 0},
"run_peak_source_currency": {"m": 5000.0, "e": 0},
"last_reset_time": 1234567890
"total_prestige_earned": {"m": 10.0, "e": 0},
"current_prestige_unspent": {"m": 5.0, "e": 0},
"prestige_resets_count": 3,
"run_start_total_source_currency": {"m": 1000.0, "e": 0},
"run_peak_source_currency": {"m": 5000.0, "e": 0},
"last_reset_time": 1234567890
}
}
```