mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Fixed AI blocking creatures with "CARDNAME can't be blocked except by two or more creatures."
This commit is contained in:
@@ -318,10 +318,13 @@ public class ComputerUtilBlock {
|
|||||||
private static Combat makeGoodBlocks(final Combat combat) {
|
private static Combat makeGoodBlocks(final Combat combat) {
|
||||||
|
|
||||||
CardList currentAttackers = new CardList(ComputerUtilBlock.getAttackersLeft().toArray());
|
CardList currentAttackers = new CardList(ComputerUtilBlock.getAttackersLeft().toArray());
|
||||||
currentAttackers = currentAttackers.getNotKeyword("CARDNAME can't be blocked except by two or more creatures.");
|
|
||||||
|
|
||||||
for (final Card attacker : ComputerUtilBlock.getAttackersLeft()) {
|
for (final Card attacker : ComputerUtilBlock.getAttackersLeft()) {
|
||||||
|
|
||||||
|
if (attacker.hasKeyword("CARDNAME can't be blocked except by two or more creatures.")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Card blocker = new Card();
|
Card blocker = new Card();
|
||||||
|
|
||||||
final CardList blockers = ComputerUtilBlock.getPossibleBlockers(attacker,
|
final CardList blockers = ComputerUtilBlock.getPossibleBlockers(attacker,
|
||||||
@@ -502,10 +505,14 @@ public class ComputerUtilBlock {
|
|||||||
private static Combat makeTradeBlocks(final Combat combat) {
|
private static Combat makeTradeBlocks(final Combat combat) {
|
||||||
|
|
||||||
CardList currentAttackers = new CardList(ComputerUtilBlock.getAttackersLeft().toArray());
|
CardList currentAttackers = new CardList(ComputerUtilBlock.getAttackersLeft().toArray());
|
||||||
currentAttackers = currentAttackers.getNotKeyword("CARDNAME can't be blocked except by two or more creatures.");
|
|
||||||
CardList killingBlockers;
|
CardList killingBlockers;
|
||||||
|
|
||||||
for (final Card attacker : ComputerUtilBlock.getAttackersLeft()) {
|
for (final Card attacker : ComputerUtilBlock.getAttackersLeft()) {
|
||||||
|
|
||||||
|
if (attacker.hasKeyword("CARDNAME can't be blocked except by two or more creatures.")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
killingBlockers = ComputerUtilBlock.getKillingBlockers(attacker,
|
killingBlockers = ComputerUtilBlock.getKillingBlockers(attacker,
|
||||||
ComputerUtilBlock.getPossibleBlockers(attacker, ComputerUtilBlock.getBlockersLeft(), combat),
|
ComputerUtilBlock.getPossibleBlockers(attacker, ComputerUtilBlock.getBlockersLeft(), combat),
|
||||||
combat);
|
combat);
|
||||||
@@ -533,10 +540,14 @@ public class ComputerUtilBlock {
|
|||||||
private static Combat makeChumpBlocks(final Combat combat) {
|
private static Combat makeChumpBlocks(final Combat combat) {
|
||||||
|
|
||||||
CardList currentAttackers = new CardList(ComputerUtilBlock.getAttackersLeft().toArray());
|
CardList currentAttackers = new CardList(ComputerUtilBlock.getAttackersLeft().toArray());
|
||||||
currentAttackers = currentAttackers.getNotKeyword("CARDNAME can't be blocked except by two or more creatures.");
|
|
||||||
CardList chumpBlockers;
|
CardList chumpBlockers;
|
||||||
|
|
||||||
for (final Card attacker : ComputerUtilBlock.getAttackersLeft()) {
|
for (final Card attacker : ComputerUtilBlock.getAttackersLeft()) {
|
||||||
|
|
||||||
|
if (attacker.hasKeyword("CARDNAME can't be blocked except by two or more creatures.")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
chumpBlockers = ComputerUtilBlock
|
chumpBlockers = ComputerUtilBlock
|
||||||
.getPossibleBlockers(attacker, ComputerUtilBlock.getBlockersLeft(), combat);
|
.getPossibleBlockers(attacker, ComputerUtilBlock.getBlockersLeft(), combat);
|
||||||
if ((chumpBlockers.size() > 0) && CombatUtil.lifeInDanger(combat)) {
|
if ((chumpBlockers.size() > 0) && CombatUtil.lifeInDanger(combat)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user