[priority: medium] feat: Add Raw Mana Regen discipline with perks #140

Closed
opened 2026-05-26 15:26:05 +02:00 by Anexim · 2 comments
Owner

Summary

Add a new Raw Mana Regen discipline (thematic name suggestion: "Mana Circulation", "Inner Reservoir", or "Vitality Flow") to the BASE attunement tab. This discipline increases the raw mana regen rate and has two perks:

  1. Infinite perk: A percentage bonus to raw mana regen that scales infinitely at a fixed interval (e.g. every 100 XP: +10% raw mana regen)
  2. Capped perk: Improves the meditation multiplier, scaling across 7 tiers from 1.5 up to 5.0:
    • Tier 1: 1.5× → 2.0×
    • Tier 2: 2.0× → 2.5×
    • Tier 3: 2.5× → 3.0×
    • Tier 4: 3.0× → 3.5×
    • Tier 5: 3.5× → 4.0×
    • Tier 6: 4.0× → 4.5×
    • Tier 7: 4.5× → 5.0× (max)

Thematic Context

This is a BASE discipline available to all attunements. It represents the practitioner's ability to cultivate and circulate raw mana through their body — the foundation upon which all elemental work is built.

Stat Bonuses

  • statBonus.stat: regenBonus (the existing raw mana regen stat key)
  • statBonus.baseValue: tuned appropriately (suggest 0.2/tick as base)

Perk Implementation Notes

Infinite perk (regen % boost):

  • Type: infinite
  • Threshold: 100
  • Value: 100 (interval)
  • Structured bonus: { stat: 'regenMultiplier', amount: 0.10 } (10% per tier)

Capped perk (meditation multiplier):

  • Type: capped
  • Threshold: 100
  • Value: 100 (interval — one tier per 100 XP)
  • Max tier: 7
  • Each tier adds +0.5 to the meditation multiplier cap
  • This requires the meditation multiplier system to support a configurable cap (currently hardcoded in getMeditationBonus())

What Needs to Change

  1. src/lib/game/data/disciplines/base.ts — add the new discipline definition
  2. src/lib/game/types/disciplines.ts — add BonusSpec type for structured perk bonuses (see issue #1)
  3. src/lib/game/utils/mana-utils.tsgetMeditationBonus() needs to accept a configurable max multiplier parameter (defaulting to current behavior)
  4. src/lib/game/stores/gameStore.ts — pass the discipline-provided meditation cap into the tick's meditation calculation
  5. src/lib/game/effects/discipline-effects.ts — handle the new regenMultiplier and meditation cap bonuses (blocked on issue #1)

Files

  • src/lib/game/data/disciplines/base.ts
  • src/lib/game/types/disciplines.ts
  • src/lib/game/utils/mana-utils.ts
  • src/lib/game/stores/gameStore.ts
  • src/lib/game/effects/discipline-effects.ts
## Summary Add a new **Raw Mana Regen** discipline (thematic name suggestion: **"Mana Circulation"**, **"Inner Reservoir"**, or **"Vitality Flow"**) to the BASE attunement tab. This discipline increases the raw mana regen rate and has two perks: 1. **Infinite perk**: A percentage bonus to raw mana regen that scales infinitely at a fixed interval (e.g. every 100 XP: +10% raw mana regen) 2. **Capped perk**: Improves the **meditation multiplier**, scaling across 7 tiers from 1.5 up to 5.0: - Tier 1: 1.5× → 2.0× - Tier 2: 2.0× → 2.5× - Tier 3: 2.5× → 3.0× - Tier 4: 3.0× → 3.5× - Tier 5: 3.5× → 4.0× - Tier 6: 4.0× → 4.5× - Tier 7: 4.5× → 5.0× (max) ## Thematic Context This is a BASE discipline available to all attunements. It represents the practitioner's ability to cultivate and circulate raw mana through their body — the foundation upon which all elemental work is built. ## Stat Bonuses - `statBonus.stat`: `regenBonus` (the existing raw mana regen stat key) - `statBonus.baseValue`: tuned appropriately (suggest 0.2/tick as base) ## Perk Implementation Notes **Infinite perk (regen % boost):** - Type: `infinite` - Threshold: 100 - Value: 100 (interval) - Structured bonus: `{ stat: 'regenMultiplier', amount: 0.10 }` (10% per tier) **Capped perk (meditation multiplier):** - Type: `capped` - Threshold: 100 - Value: 100 (interval — one tier per 100 XP) - Max tier: 7 - Each tier adds +0.5 to the meditation multiplier cap - This requires the meditation multiplier system to support a configurable cap (currently hardcoded in `getMeditationBonus()`) ## What Needs to Change 1. `src/lib/game/data/disciplines/base.ts` — add the new discipline definition 2. `src/lib/game/types/disciplines.ts` — add `BonusSpec` type for structured perk bonuses (see issue #1) 3. `src/lib/game/utils/mana-utils.ts` — `getMeditationBonus()` needs to accept a configurable max multiplier parameter (defaulting to current behavior) 4. `src/lib/game/stores/gameStore.ts` — pass the discipline-provided meditation cap into the tick's meditation calculation 5. `src/lib/game/effects/discipline-effects.ts` — handle the new `regenMultiplier` and meditation cap bonuses (blocked on issue #1) ## Files - `src/lib/game/data/disciplines/base.ts` - `src/lib/game/types/disciplines.ts` - `src/lib/game/utils/mana-utils.ts` - `src/lib/game/stores/gameStore.ts` - `src/lib/game/effects/discipline-effects.ts`
Anexim added the ai:todo label 2026-05-26 15:26:05 +02:00
n8n-gitea was assigned by Anexim 2026-05-26 15:26:05 +02:00
Anexim changed title from feat: Add Raw Mana Regen discipline with perks to [priority: medium] feat: Add Raw Mana Regen discipline with perks 2026-05-26 15:30:36 +02:00
Author
Owner

Starting implementation of Raw Mana Regen discipline (Mana Circulation). Plan:

  1. Add regenMultiplier and meditationCapBonus to discipline effects system
  2. Update getMeditationBonus() to accept configurable max multiplier
  3. Update all callers to pass discipline meditation cap
  4. Add the new discipline definition to base.ts
  5. Build, commit, and push
Starting implementation of Raw Mana Regen discipline (Mana Circulation). Plan: 1. Add regenMultiplier and meditationCapBonus to discipline effects system 2. Update getMeditationBonus() to accept configurable max multiplier 3. Update all callers to pass discipline meditation cap 4. Add the new discipline definition to base.ts 5. Build, commit, and push
Author
Owner

Implementation complete. Added the Mana Circulation discipline to the base attunement tab with:

  1. base.ts — New mana-circulation discipline definition with:

    • regenBonus stat (0.2/tick base) for raw mana regen scaling
    • Infinite perk: every 100 XP → +10% raw mana regen (regenMultiplier +0.10)
    • Capped perk: every 100 XP → +0.5 max meditation multiplier (max 7 tiers, up to +3.5)
  2. discipline-effects.ts — Handles regenMultiplier (routed to multipliers) and meditationCapBonus (dedicated field on result). Added maxTier support for capped perks.

  3. mana-utils.tsgetMeditationBonus() now accepts disciplineMeditationCap parameter. The meditation cap formula: maxMultiplier = 5.0 + disciplineMeditationCap.

  4. gameStore.ts — Wires disciplineEffects.meditationCapBonus into tick meditation calc, and applies regenMultiplier to base regen.

  5. Display callers (page.tsx, LeftPanel.tsx, useGameDerived.ts, gameHooks.ts) — Updated to pass discipline meditation cap.

  6. disciplines.ts type — Added optional maxTier field to DisciplinePerk.

All files under 400 lines. No new TypeScript errors (2 pre-existing errors unrelated to these changes).

Implementation complete. Added the **Mana Circulation** discipline to the base attunement tab with: 1. **`base.ts`** — New `mana-circulation` discipline definition with: - `regenBonus` stat (0.2/tick base) for raw mana regen scaling - Infinite perk: every 100 XP → +10% raw mana regen (`regenMultiplier` +0.10) - Capped perk: every 100 XP → +0.5 max meditation multiplier (max 7 tiers, up to +3.5) 2. **`discipline-effects.ts`** — Handles `regenMultiplier` (routed to multipliers) and `meditationCapBonus` (dedicated field on result). Added `maxTier` support for capped perks. 3. **`mana-utils.ts`** — `getMeditationBonus()` now accepts `disciplineMeditationCap` parameter. The meditation cap formula: `maxMultiplier = 5.0 + disciplineMeditationCap`. 4. **`gameStore.ts`** — Wires `disciplineEffects.meditationCapBonus` into tick meditation calc, and applies `regenMultiplier` to base regen. 5. **Display callers** (`page.tsx`, `LeftPanel.tsx`, `useGameDerived.ts`, `gameHooks.ts`) — Updated to pass discipline meditation cap. 6. **`disciplines.ts`** type — Added optional `maxTier` field to `DisciplinePerk`. All files under 400 lines. No new TypeScript errors (2 pre-existing errors unrelated to these changes).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#140