This commit is contained in:
tool4EvEr
2023-01-17 11:36:21 +01:00
parent d636668e16
commit cd5ef1580c
3 changed files with 6 additions and 5 deletions

View File

@@ -346,9 +346,9 @@ public class CombatUtil {
return attackCost;
}
public static CardCollection getOptionAttackCostCreatures(final Player attacker) {
public static CardCollection getOptionalAttackCostCreatures(final CardCollection attackers) {
final CardCollection exerters = new CardCollection();
for (final Card card : attacker.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) {
for (final Card card : attackers) {
for (final StaticAbility stAb : card.getStaticAbilities()) {
if (stAb.hasExertCost(card)) {
exerters.add(card);

View File

@@ -559,8 +559,8 @@ public class PhaseHandler implements java.io.Serializable {
}
}
// Exert creatures here
List<Card> possibleExerters = CombatUtil.getOptionAttackCostCreatures(whoDeclares);
// CR 508.1g
List<Card> possibleExerters = CombatUtil.getOptionalAttackCostCreatures(combat.getAttackers());
if (!possibleExerters.isEmpty()) {
possibleExerters = whoDeclares.getController().exertAttackers(possibleExerters);
}

View File

@@ -39,6 +39,7 @@ import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.card.CardState;
import forge.game.cost.Cost;
import forge.game.cost.CostExert;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
@@ -337,7 +338,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
if (this.isSuppressed() || !getParam("Mode").equals("OptionalAttackCost") || !this.checkConditions()) {
return false;
}
return StaticAbilityCantAttackBlock.getAttackCost(this, attacker, null) != null;
return StaticAbilityCantAttackBlock.getAttackCost(this, attacker, null).hasSpecificCostType(CostExert.class);
}
public final Cost getBlockCost(final Card blocker, final Card attacker) {