Add support for keyword: CARDNAME must be blocked by exactly one creature if able.

This commit is contained in:
Northmoc
2021-04-22 12:00:18 -04:00
parent 0b9755405e
commit 18d0bf1c7b

View File

@@ -840,6 +840,8 @@ public class CombatUtil {
if (attacker.hasStartOfKeyword("All creatures able to block CARDNAME do so.") if (attacker.hasStartOfKeyword("All creatures able to block CARDNAME do so.")
|| (attacker.hasStartOfKeyword("CARDNAME must be blocked if able.") || (attacker.hasStartOfKeyword("CARDNAME must be blocked if able.")
&& combat.getBlockers(attacker).isEmpty()) && combat.getBlockers(attacker).isEmpty())
|| (attacker.hasStartOfKeyword("CARDNAME must be blocked by exactly one creature if able.")
&& combat.getBlockers(attacker).size() != 1)
|| (attacker.hasStartOfKeyword("CARDNAME must be blocked by two or more creatures if able.") || (attacker.hasStartOfKeyword("CARDNAME must be blocked by two or more creatures if able.")
&& combat.getBlockers(attacker).size() < 2)) { && combat.getBlockers(attacker).size() < 2)) {
attackersWithLure.add(attacker); attackersWithLure.add(attacker);
@@ -990,6 +992,7 @@ public class CombatUtil {
// attacker with lure, the blocker can't block the former // attacker with lure, the blocker can't block the former
if (!attacker.hasKeyword("All creatures able to block CARDNAME do so.") if (!attacker.hasKeyword("All creatures able to block CARDNAME do so.")
&& !(attacker.hasKeyword("CARDNAME must be blocked if able.") && combat.getBlockers(attacker).isEmpty()) && !(attacker.hasKeyword("CARDNAME must be blocked if able.") && combat.getBlockers(attacker).isEmpty())
&& !(attacker.hasKeyword("CARDNAME must be blocked by exactly one creature if able.") && combat.getBlockers(attacker).size() != 1)
&& !(attacker.hasKeyword("CARDNAME must be blocked by two or more creatures if able.") && combat.getBlockers(attacker).size() < 2) && !(attacker.hasKeyword("CARDNAME must be blocked by two or more creatures if able.") && combat.getBlockers(attacker).size() < 2)
&& !(blocker.getMustBlockCards() != null && blocker.getMustBlockCards().contains(attacker)) && !(blocker.getMustBlockCards() != null && blocker.getMustBlockCards().contains(attacker))
&& !mustBeBlockedBy && !mustBeBlockedBy