Skip to content

Attack block req#9913

Draft
Hanmac wants to merge 6 commits intomasterfrom
attackBlockReq
Draft

Attack block req#9913
Hanmac wants to merge 6 commits intomasterfrom
attackBlockReq

Conversation

@Hanmac
Copy link
Copy Markdown
Contributor

@Hanmac Hanmac commented Feb 25, 2026

Closes #1424
Closes #6000

Still Draft/WIP

This is going to replace AttackRestrictionType in the future

right now, it renames:

  • AttackRestrict to AttackRestrictNum
  • BlockRestrict to BlockRestrictNum

@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented Mar 19, 2026

@tool4ever your opinion? does it go into the right direction?

@tool4ever
Copy link
Copy Markdown
Contributor

maybe? the big challenge is adapting the logic in AttackConstraints and that's not been done yet

@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented Mar 19, 2026

maybe? the big challenge is adapting the logic in AttackConstraints and that's not been done yet

i started with one of them today

@tool4ever
Copy link
Copy Markdown
Contributor

yes, I see it but I meant that one is also not complete yet

@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented Mar 19, 2026

First test with Scarred Puma seems to work, will do the rest later

@Hanmac Hanmac requested review from Agetian and tool4ever March 25, 2026 11:25
@tool4ever
Copy link
Copy Markdown
Contributor

uhm what you need a review for - want a proof that all the code you just removed from getLegalAttackers() without replacement served a purpose...?

@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented Mar 25, 2026

uhm what you need a review for - want a proof that all the code you just removed from getLegalAttackers() without replacement served a purpose...?

Maybe, i think the code needs to be refactored anyway.
But i have no idea right now where to start with this.

@tool4ever
Copy link
Copy Markdown
Contributor

tool4ever commented Mar 25, 2026

Imo the problem is this:
right now the logic was stripped down to only handle their direct attack restriction part
but since these also interact with other attackers you also need to consider if they have any requirements

508.1d. The active player checks each creature they control to see whether it's affected by any requirements (effects that say a creature attacks if able, or that it attacks if some condition is met). If the number of requirements that are being obeyed is fewer than the maximum possible number of requirements that could be obeyed without disobeying any restrictions, the declaration of attackers is illegal...

or in other words:
in addition to the (obvious) answer "currently not possible" we also need "could be possible"

@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented Mar 26, 2026

@Agetian probably needs to help me with the Logic for this

@Agetian
Copy link
Copy Markdown
Contributor

Agetian commented Mar 26, 2026

I might be able to take a look into this, hopefully closer to the weekend :)

@Agetian
Copy link
Copy Markdown
Contributor

Agetian commented Mar 26, 2026

I agree that this needs the proper AI handling before merge though, currently it's missing quite a good deal of restriction considerations on the AI part. I'll see what I can do, not sure how well I can figure it out though, seems like a pretty good chunk of code that was rewired ^^;

@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented Mar 26, 2026

I might be able to take a look into this, hopefully closer to the weekend :)

It's more about the piece that @tool4ever was talking about, finding out if there is a legal way for them to attack or not

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttackRestriction should be moved to StaticAbilityCantAttackBlock Attack and Block Restrictions should use Static Abilities

3 participants