Make a swing hurt each enemy once, or again at a steady pace
A sword that stays inside an enemy for six frames either deals six hits at once or, if you stop it, makes spinning attacks useless. Here is a small memory for who was hit and when, so one swing counts once and a whirlwind hits at its own steady beat.
Why this works
One swing is one event, so an enemy it passes through should feel it once, however many frames the blade stays inside. A spinning blade is different: it should repeat at a steady beat. A short memory per swing handles both with one rule.
When not to use it
Don't use it for damage that should build up with contact, such as fire, acid or standing in a beam, where staying longer should hurt more. Use damage over time with its own rhythm there, and don't tie it to a single swing.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 19 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 "Make a swing hurt each enemy once, or again at a steady pace" (read_entry one-hit-per-swing-and-timed-rehits) 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