mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
declareAttackers fixes
This commit is contained in:
committed by
Anthony Calosa
parent
bd4e3b56ac
commit
c0ede21c31
@@ -47,6 +47,7 @@ import forge.game.cost.Cost;
|
||||
import forge.game.keyword.Keyword;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellAbilityPredicates;
|
||||
import forge.game.trigger.Trigger;
|
||||
import forge.game.trigger.TriggerType;
|
||||
import forge.game.zone.Zone;
|
||||
@@ -135,13 +136,11 @@ public class AiAttackController {
|
||||
if (c.isToken() && c.getCopiedPermanent() == null) {
|
||||
continue;
|
||||
}
|
||||
for (SpellAbility sa : c.getSpellAbilities()) {
|
||||
if (sa.getApi() == ApiType.Animate) {
|
||||
if (ComputerUtilCost.canPayCost(sa, defender, false)
|
||||
&& sa.getRestrictions().checkOtherRestrictions(c, sa, defender)) {
|
||||
Card animatedCopy = AnimateAi.becomeAnimated(c, sa);
|
||||
defenders.add(animatedCopy);
|
||||
}
|
||||
for (SpellAbility sa : Iterables.filter(c.getSpellAbilities(), SpellAbilityPredicates.isApi(ApiType.Animate))) {
|
||||
if (ComputerUtilCost.canPayCost(sa, defender, false)
|
||||
&& sa.getRestrictions().checkOtherRestrictions(c, sa, defender)) {
|
||||
Card animatedCopy = AnimateAi.becomeAnimated(c, sa);
|
||||
defenders.add(animatedCopy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1150,9 +1150,9 @@ public class AiBlockController {
|
||||
//Check for validity of blocks in case something slipped through
|
||||
for (Card attacker : attackers) {
|
||||
if (!CombatUtil.canAttackerBeBlockedWithAmount(attacker, combat.getBlockers(attacker).size(), combat)) {
|
||||
for (final Card blocker : combat.getBlockers(attacker)) {
|
||||
if (blocker.getController() == ai) // don't touch other player's blockers
|
||||
combat.removeFromCombat(blocker);
|
||||
for (final Card blocker : CardLists.filterControlledBy(combat.getBlockers(attacker), ai)) {
|
||||
// don't touch other player's blockers
|
||||
combat.removeFromCombat(blocker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2037,7 +2037,7 @@ public class ComputerUtilCombat {
|
||||
|
||||
} // attacker no double strike
|
||||
return false;// should never arrive here
|
||||
} // canDestroyBlocker
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
Reference in New Issue
Block a user