diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantAttackBlock.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantAttackBlock.java index 79861483763..c55e03ff6ce 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantAttackBlock.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantAttackBlock.java @@ -20,6 +20,7 @@ package forge.game.staticability; import com.google.common.collect.Iterables; import forge.game.GameEntity; +import forge.game.ability.AbilityUtils; import forge.game.card.Card; import forge.game.card.CardCollectionView; import forge.game.card.CardFactoryUtil; @@ -128,14 +129,14 @@ public class StaticAbilityCantAttackBlock { * * @param stAb * a StaticAbility - * @param card + * @param attacker * the card * @return a Cost */ - public static Cost getAttackCost(final StaticAbility stAb, final Card card, final GameEntity target) { + public static Cost getAttackCost(final StaticAbility stAb, final Card attacker, final GameEntity target) { final Card hostCard = stAb.getHostCard(); - if (!stAb.matchesValidParam("ValidCard", card)) { + if (!stAb.matchesValidParam("ValidCard", attacker)) { return null; } @@ -144,7 +145,14 @@ public class StaticAbilityCantAttackBlock { } String costString = stAb.getParam("Cost"); if (stAb.hasSVar(costString)) { - costString = Integer.toString(CardFactoryUtil.xCount(hostCard, stAb.getSVar(costString))); + boolean remember = stAb.hasParam("RememberingAttacker"); + if (remember) { + hostCard.addRemembered(attacker); + } + costString = Integer.toString(AbilityUtils.calculateAmount(hostCard, stAb.getSVar(costString), stAb)); + if (remember) { + hostCard.removeRemembered(attacker); + } } return new Cost(costString, true); diff --git a/forge-gui/res/cardsfolder/upcoming/nils_discipline_enforcer.txt b/forge-gui/res/cardsfolder/upcoming/nils_discipline_enforcer.txt new file mode 100644 index 00000000000..0e1cb4dca48 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/nils_discipline_enforcer.txt @@ -0,0 +1,11 @@ +Name:Nils, Discipline Enforcer +ManaCost:2 W +Types:Legendary Creature Human Cleric +PT:2/2 +T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ PutCounterOneEach | TriggerDescription$ At the beginning of your end step, for each player, put a +1/+1 counter on up to one target creature that player controls. +SVar:PutCounterOneEach:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 1 | ValidTgts$ Creature | TgtPrompt$ Select up to one target creature each player controls. | TargetMin$ 0 | TargetMax$ OneEach | TargetsWithDifferentControllers$ True +S:Mode$ CantAttackUnless | ValidCard$ Creature.HasCounters | Target$ You,Planeswalker.YouCtrl | Cost$ X | RememberingAttacker$ True | Description$ Each creature with one or more counters on it can't attack you or a planeswalker you control unless its controller pays {X}, where X is the number of counters on that creature. +SVar:OneEach:PlayerCountPlayers$Amount +SVar:X:Remembered$CardCounters.ALL +DeckHas:Ability$Counters +Oracle:At the beginning of your end step, for each player, put a +1/+1 counter on up to one target creature that player controls.\nEach creature with one or more counters on it can’t attack you or planeswalkers you control unless its controller pays {X}, where X is the number of counters on that creature.