ebb9d15e9e
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 4m35s
- Added getTotalAttunementConversionDrain function to calculate total conversion drain - Updated computeRegen to include attunement regen bonus - Added computeEffectiveRegenForDisplay function for UI display - Added conversionDrains to GameState to track per-attunement drain - Updated tick function to track and persist conversion drains - Build passes successfully
55 lines
2.1 KiB
Markdown
55 lines
2.1 KiB
Markdown
# Sub-Task 8 Progress: Mana System Conversion Regen Deduction
|
||
|
||
## Status: Completed
|
||
|
||
## Completed Steps
|
||
- [x] Understand current mana regen calculation logic
|
||
- [x] Implement conversion rate deduction from raw regen
|
||
- [x] Verify calculation with example values (3.8 raw regen − 0.2 transference conversion = 3.6 effective raw regen)
|
||
- [x] Update any UI elements showing regen rates (for Sub-Task 9)
|
||
- [x] Test mana regen in-game (build successful)
|
||
- [x] Commit and push changes
|
||
|
||
## Summary of Changes
|
||
|
||
### 1. Added `getTotalAttunementConversionDrain` function
|
||
- File: `src/lib/game/data/attunements.ts`
|
||
- Calculates total conversion drain from all active attunements per hour
|
||
- Uses level-scaled conversion rates
|
||
|
||
### 2. Updated `computeRegen` function
|
||
- File: `src/lib/game/store.ts`
|
||
- Now includes attunement raw mana regen bonus
|
||
- Full raw regen is returned (without conversion drain deduction)
|
||
|
||
### 3. Added `computeEffectiveRegenForDisplay` function
|
||
- Files: `src/lib/game/store.ts`, `src/lib/game/utils/mana-utils.ts`
|
||
- Returns object with `rawRegen`, `conversionDrain`, and `effectiveRegen`
|
||
- Used for UI display (Sub-Task 9)
|
||
|
||
### 4. Updated `GameState` type
|
||
- File: `src/lib/game/types/game.ts`
|
||
- Added `conversionDrains: Record<string, number>` field to track per-attunement conversion drains
|
||
|
||
### 5. Updated tick function
|
||
- File: `src/lib/game/store.ts`
|
||
- Tracks `conversionDrains` during attunement mana conversion
|
||
- Persists `conversionDrains` in state and localStorage
|
||
|
||
### 6. Updated mana-utils.ts
|
||
- File: `src/lib/game/utils/mana-utils.ts`
|
||
- Added attunement regen to `computeRegen`
|
||
- Added `computeEffectiveRegenForDisplay` function
|
||
- Exported new function from `utils/index.ts`
|
||
|
||
## Example Calculation
|
||
- Raw regen: 3.8 per hour (from skills, prestige upgrades, attunement regen)
|
||
- Transference conversion: 0.2 per hour (from Enchanter attunement)
|
||
- Effective raw regen: 3.6 per hour (what actually increases raw mana)
|
||
- Conversion: 0.2 per hour (transference increases)
|
||
|
||
## Notes
|
||
- The effective regen is used for all mana regeneration in-game
|
||
- Conversion drains are properly tracked and available for UI display (Sub-Task 9)
|
||
- Build completed successfully with no errors
|