Spielerando

Reserve mana for a spell that takes time to cast

If mana is only taken when the spell finishes, a player can start two long spells with the mana for one, and the second just fails at the end. If it is taken at the start, a cancelled spell eats it for nothing. Here is the middle path, including interruptions.

Why this works

A promise is not a payment. Setting the cost aside keeps it from being used twice, while leaving payment for the end lets a cancelled cast give everything back. Interruption costs only part, so protecting the caster matters.

When not to use it

Skip it when spells are instant or when only one cast can ever run at a time. Then paying the cost at the start is simpler and the player never sees a difference.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • A diagram of every state
  • 25 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Reserve mana for a spell that takes time to cast" (read_entry reserve-mana-while-casting) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP