Merge branch 'new-cards' into 'master'

Nils, Discipline Enforcer (attacking tax computation)

See merge request core-developers/forge!4457
This commit is contained in:
Michael Kamensky
2021-04-11 12:40:38 +00:00
2 changed files with 23 additions and 4 deletions

View File

@@ -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);

View File

@@ -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 cant attack you or planeswalkers you control unless its controller pays {X}, where X is the number of counters on that creature.