Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Break deadlock for one must/can't be blocked pair. #13182

Merged

Conversation

Grath
Copy link
Contributor

@Grath Grath commented Dec 23, 2024

Handle the case where a 'must be blocked if able' creature is attacking but there aren't enough available creatures to block it due to Menace or other effects which increase getMinBlockedBy.

This bug resulted in me winning a game of Commander which I should not have won on Friday, because an opponent was forced to concede due to being unable to declare blockers.

Handle the case where a 'must be blocked if able' creature is attacking but there aren't enough available creatures to block it.
@xenohedron
Copy link
Contributor

Is this something that can be picked up by the test framework or not?

@Grath
Copy link
Contributor Author

Grath commented Dec 23, 2024

It is not, it isn't forced to block and it throws an UnsupportedOperationException if you tell it to block with just the one creature.

@Grath Grath merged commit 8de9fb0 into magefree:master Dec 25, 2024
2 checks passed
JayDi85 added a commit that referenced this pull request Dec 31, 2024
JayDi85 added a commit that referenced this pull request Dec 31, 2024
@JayDi85
Copy link
Member

JayDi85 commented Dec 31, 2024

Tests added by b2279a8, related test for PR in bd1f6a4 (test_MustBeBlockedWithMenace_low_blockers_auto)

P.S. Whole blockers logic has many potential problems:

  • it use auto-fix of blocker configuration with AI related code inside -- it's will be hard to integrate AI simulations (Documentation about developing an AI player? #10154) for declare blocker step without rework (human declare block + AI declare code + configuration checking code);
  • there are some bad use cases with restriction/require effects -- so auto-fix blockers configuration fails on it (see some ignored tests), e.g. AI can use all blockers instead required only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants