3.3 KiB
Executable File
3.3 KiB
Executable File
Mana Loop — Agent Guide
Browser incremental/idle game. Next.js 16 + Zustand, no backend.
🔑 Git
https://n8n-gitea:tkF9HFgxL2k4cmT@gitea.tailf367e3.ts.net/Anexim/Mana-Loop.git
git config --global user.name "n8n-gitea"
git config --global user.email "n8n-gitea@anexim.local"
Workflow
cd /home/user/repos/Mana-Loop && git pull origin master
# ... work ...
git add -A && git commit -m "type: desc" && git push origin master
Session Start
docs/project-structure.txtdocs/dependency-graph.jsonget_repo_summary→ resume in-progress or pick top todoupdate_issue_status→ai:in-progress- Work, log with
add_comment, thenupdate_issue_status→ai:done
Labels
ai:todo | ai:in-progress | ai:review | ai:blocked | ai:done
Terminal Tool
Always pair run_command → get_process_status in same turn. Use wait: 120 for long tasks.
Sub-Agents
Use for 3+ sequential independent calls. Zero context from parent — paste everything needed.
Architecture
- Stack: Next.js 16, TS 5, Tailwind 4 + shadcn/ui, Zustand+persist, Vitest/Playwright, Bun
- Active stores:
src/lib/game/stores/{game,mana,combat,prestige,discipline,ui}Store.ts - Legacy (migrating):
src/lib/game/store/andstore-modules/ - Crafting: 3-step flow — Design → Prepare → Apply via
crafting-actions/ - Disciplines:
data/disciplines/+stores/discipline-slice.ts+utils/discipline-math.ts - Effects: All stat mods through
getUnifiedEffects()— discipline bonuses enter viacomputeDisciplineEffects()
Adding Effects
data/enchantment-effects.tseffects.ts→computeEquipmentEffects()- Access via
getUnifiedEffects(state)
Adding Disciplines
- Choose the correct data file under
data/disciplines/:base.ts— available to all attunementsenchanter.ts— requires Enchanter attunementinvoker.ts— requires Invoker attunementfabricator.ts— requires Fabricator attunement
- Define a
DisciplineDefinition(seetypes/disciplines.ts):statBonus.statmust match a key consumed bycomputeDisciplineEffects()- Set
difficultyFactorandscalingFactorto control growth rate - Add perks (
once,capped, orinfinite)
- Re-export from
data/disciplines/index.tsso it appears inALL_DISCIPLINES - Add any new
statBonus.statkeys todiscipline-effects.ts→computeDisciplineEffects()
Discipline Math (quick reference)
StatBonus = baseValue × (XP / scalingFactor)^0.65
ManaDrainPerTick = drainBase × (1 + (XP / difficultyFactor)^0.4)
- XP accrues every tick the discipline is active and mana drain is met
concurrentLimitstarts at 1 and expands by 1 per 500 total XP (max +3)
Adding Spells
constants/spells.tsdata/enchantment-effects.tsEFFECT_RESEARCH_MAPPING
Banned
Lifesteal/healing, scroll crafting, ascension skills, LabTab, pause, mana types: life, blood, wood, mental, force
File Limit
400 lines max (pre-commit hook enforces).
Mana Types
Base (7): Fire 🔥 Water 💧 Air 🌬️ Earth ⛰️ Light ☀️ Dark 🌑 Death 💀
Utility (1): Transference 🔗
Compound (3): Fire+Earth=Metal, Earth+Water=Sand, Fire+Air=Lightning
Exotic (3): Sand+Sand+Light=Crystal, Fire+Fire+Light=Stellar, Dark+Dark+Death=Void