Pick a new target when the chosen one is already dead
Two heroes attack the same goblin; the second blow lands on a corpse and the turn is wasted, or the game crashes. Players expect a sensible redirect, but not always the same one, for example when healing or reviving. Here is the rule that handles both.
Why this works
A plan made earlier can be out of date by the time it runs. Falling back to the nearest valid choice on the same side keeps what the player meant, and an action with nothing valid left does nothing and costs nothing, so a death never wastes a turn.
When not to use it
Skip it when a wasted turn is part of the lesson, as in a hard tactics game where planning ahead is the skill, or for moves aimed at one named spot only. There let the move fizzle on purpose and say so.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 21 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Pick a new target when the chosen one is already dead" (read_entry retarget-after-target-dies) 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