Skip to content

feat(combat): Implement stun mechanic, skip turns and block actions for stunned units#37

Open
lightclient wants to merge 1 commit intoBKDaugherty:mainfrom
lightclient:impl-stun
Open

feat(combat): Implement stun mechanic, skip turns and block actions for stunned units#37
lightclient wants to merge 1 commit intoBKDaugherty:mainfrom
lightclient:impl-stun

Conversation

@lightclient
Copy link

@lightclient lightclient commented Feb 6, 2026

Adds full stun behavior so that stunned units lose their turn entirely.

Disclaimer: this could be slop, it was 100% generated by AI.

- add phase-start stun handling for Player/Enemy units (set Move/AP to 0, mark waited)
- wire stun processing into the battle phase effect chain alongside poison
- block stunned move/attack in execute_unit_actions via ActiveEffects guards
- emit UnitActionCompletedMessage when blocked to prevent turn-flow deadlocks
- add tests for phase-scoped stun application and stunned action blocking
Comment on lines +737 to +747
if active_effects
.map(|active_effects| active_effects.prevent_move())
.unwrap_or_default()
{
command_completed_writer.write(UnitActionCompletedMessage {
unit: message.entity,
action: UnitAction::Move,
});
continue;
}

Copy link
Owner

Choose a reason for hiding this comment

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

We probably would want to find a way to prevent the UnitExecuteAction itself as opposed to processing the action, but skipping the completion I think, but pretty impressive that the model came up with this imo

@BKDaugherty
Copy link
Owner

Adds full stun behavior so that stunned units lose their turn entirely.

Disclaimer: this could be slop, it was 100% generated by AI.

I mean definitely consider me proven wrong lol. I'm not sure this is how I want it implemented but this is pretty cool. Crazy that you had them playing the game

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants