Skip to content

feat(combat): stagger enemies after successful parries - #288

Merged
f1cklepickle merged 2 commits into
mainfrom
codex/268-enemy-parry-stagger
Aug 7, 2026
Merged

feat(combat): stagger enemies after successful parries#288
f1cklepickle merged 2 commits into
mainfrom
codex/268-enemy-parry-stagger

Conversation

@f1cklepickle

@f1cklepickle f1cklepickle commented Aug 6, 2026

Copy link
Copy Markdown
Owner

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

  • Added activation-snapshotted parry capacity and window timing with first-received consumption ordering
  • Added enemy-owned stagger eligibility, timing, ignored-repeat, cleanup, and target-refresh recovery state
  • Routed successful melee parry results back to the exact attacker and cancelled active swings safely, including re-entrant impact delivery
  • Locked staggered melee goblins against movement, turning, attack decisions, attack-clock progress, and damage delivery
  • Added continuous yellow stagger feedback with brief red damage flashes layered above it
  • Authored the melee goblin with an eligible one-second stagger while leaving ranged goblins and Lurkers unchanged

How to test

  1. Open the main prototype scene and approach a melee goblin
  2. Press and hold defense immediately before its frontal melee impact; verify gold parry confirmation, one-second yellow enemy stagger, no movement/turning/damage, then clean recovery
  3. Verify the first parry changes held defense to normal blocking, and verify damage during stagger briefly flashes red before yellow resumes
  4. Run tests:
    • EditMode
    • PlayMode

Checklist

  • Unit tests (EditMode) added or updated
  • PlayMode test or manual validation included
  • Demo scene updated (N/A - existing prototype scene consumes the updated melee goblin prefab)
  • Prefab links, tags, and layers validated
  • README / Docs touched (TEST_LOG.md updated)

Related

@f1cklepickle f1cklepickle added apk Opt-in signal to generate an Android APK build for testing (CI artifacts). feature New feature or request gameplay Anything affecting the core loop (combat, waves, health). testing Work specifically related to adding or fixing test setups labels Aug 6, 2026 — with ChatGPT Codex Connector
@f1cklepickle f1cklepickle added ai Enemy movement, targeting, behavior trees, etc. prefab Adding/updating prefabs. labels Aug 6, 2026 — with ChatGPT Codex Connector
@f1cklepickle f1cklepickle removed the apk Opt-in signal to generate an Android APK build for testing (CI artifacts). label Aug 6, 2026
@f1cklepickle f1cklepickle added the apk Opt-in signal to generate an Android APK build for testing (CI artifacts). label Aug 6, 2026 — with ChatGPT Codex Connector
@f1cklepickle f1cklepickle reopened this Aug 6, 2026
@f1cklepickle
f1cklepickle marked this pull request as ready for review August 7, 2026 01:36
@f1cklepickle
f1cklepickle merged commit 6428df1 into main Aug 7, 2026
6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +209 to +210
animationPresenter?.SetMovementRequested(false);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +202 to +204
_rb.velocity = Vector2.zero;
_rb.angularVelocity = 0f;
_rb.position = staggerReceiver.LockPosition;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@f1cklepickle
f1cklepickle deleted the codex/268-enemy-parry-stagger branch August 7, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Enemy movement, targeting, behavior trees, etc. apk Opt-in signal to generate an Android APK build for testing (CI artifacts). feature New feature or request gameplay Anything affecting the core loop (combat, waves, health). prefab Adding/updating prefabs. testing Work specifically related to adding or fixing test setups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(combat): stagger enemies after successful parries

1 participant