Skip to content

Spend imminent overflow mana safely - #108

Merged
adrunkhuman merged 1 commit into
masterfrom
server/train-magic-level
Aug 17, 2026
Merged

Spend imminent overflow mana safely#108
adrunkhuman merged 1 commit into
masterfrom
server/train-magic-level

Conversation

@adrunkhuman

Copy link
Copy Markdown
Owner

Summary

  • Forecast the earliest actual mana-regeneration cycle across food, equipment, and other regeneration conditions, including finite final ticks and same-cycle aggregation.
  • Outside hunting, cast one explicitly audited safe spell only when that cycle would lose mana above the maximum; exact full mana and protection-zone pauses do not trigger.
  • Prefer useful Haste, Great Light, then Light, with cheapest audited refresh-safe fallback, while preserving 20 emergency mana and normal engine legality.
  • Arbitrate the opportunity below service, rewards, spell learning, and equipment but above the next hunt, then immediately resume normal goals without a training window or persistent state.

Verification

  • pwsh -File scripts/test-playerbot-gameplay.ps1 -MagicTraining -Focused -SkipBuild - passed 16 forecast, spell preference, overflow, arbitration, failure, continuation, and restart scenarios
  • pwsh -File scripts/test-playerbot-gameplay.ps1 -SpellUse -SpellCalibration -AdaptiveChallenge -Focused -SkipBuild - passed existing spell-use, calibration, and hunt-pressure regressions
  • pwsh -File scripts/test-playerbot-gameplay.ps1 -FullNavigation -CorpseLoot -Focused -SkipBuild - passed navigation and corpse-loot regressions
  • pwsh -File scripts/test-knight-spell-contract.ps1 - passed audited Knight spell contract

Limits

Magic-training scenarios use controlled Lua setup; they prove engine forecast arithmetic, arbitration, and selected normal casts, not long-running live frequency. Regeneration phase intentionally resets through condition serialization, so restart recomputes a fresh forecast.

The existing -SpellTraining route fixture passed once on this branch but timed out on repeated runs after its spell-learning transaction failed and normal equipment/service behavior continued. Failure logs contained no selected magic-training candidate, so this appears unrelated to #98.

Closes #98.

@adrunkhuman
adrunkhuman merged commit 4511690 into master Aug 17, 2026
1 check passed
@adrunkhuman
adrunkhuman deleted the server/train-magic-level branch August 17, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Train magic level from safe surplus mana

1 participant