feat(combat): stagger enemies after successful parries - #288
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4af8d9f15d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| animationPresenter?.SetMovementRequested(false); | ||
| return; |
There was a problem hiding this comment.
Drain queued knockback while the stagger lock is active
When a barrier pulse overlaps a stagger, BarrierPulseEmitter.ApplyWavefront continues adding knockback every Update, but this early return bypasses EnemyLocomotion.ExecuteMovement, the only runtime path that calls EnemyKnockbackReceiver.ConsumeDisplacement and decays that velocity. A one-second stagger can therefore accumulate many pulse impulses and apply them immediately after recovery, launching the enemy several units; consume, decay, or explicitly clear knockback while holding the stagger position.
Useful? React with 👍 / 👎.
| _rb.velocity = Vector2.zero; | ||
| _rb.angularVelocity = 0f; | ||
| _rb.position = staggerReceiver.LockPosition; |
There was a problem hiding this comment.
Constrain the dynamic body for the whole stagger
When the staggered melee goblin is touching the player or another enemy, zeroing velocity and assigning Rigidbody2D.position during FixedUpdate does not keep its dynamic body fixed: the 2D contact solver runs afterward and can displace it before the next update. Because the prefab keeps collisions enabled and freezes only rotation, crowded combat can make staggered enemies slide or jitter away from LockPosition; temporarily preserve position constraints or otherwise enforce the lock through the physics simulation.
Useful? React with 👍 / 👎.
Why
Successful parries need a deterministic tactical reward on the exact attacker, while parry capacity must remain tunable without changing an active defense activation.
What changed
How to test
Checklist
Related