add WithCountersType and WithCountersAmount

This commit is contained in:
Hans Mackowiak
2021-01-28 07:49:39 +01:00
parent 68c312d912
commit c885b87f2e
2 changed files with 17 additions and 0 deletions

View File

@@ -553,6 +553,11 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
String[] parse = sa.getParam("WithCounters").split("_");
gameCard.addEtbCounter(CounterType.getType(parse[0]), Integer.parseInt(parse[1]), player);
}
if (sa.hasParam("WithCountersType")) {
CounterType cType = CounterType.getType(sa.getParam("WithCountersType"));
int cAmount = AbilityUtils.calculateAmount(hostCard, sa.getParamOrDefault("WithCountersAmount", "1"), sa);
gameCard.addEtbCounter(cType, cAmount, player);
}
if (sa.hasParam("GainControl")) {
if (sa.hasParam("NewController")) {
final Player p = Iterables.getFirst(AbilityUtils.getDefinedPlayers(hostCard, sa.getParam("NewController"), sa), null);
@@ -1122,6 +1127,12 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
String[] parse = sa.getParam("WithCounters").split("_");
c.addEtbCounter(CounterType.getType(parse[0]), Integer.parseInt(parse[1]), player);
}
if (sa.hasParam("WithCountersType")) {
CounterType cType = CounterType.getType(sa.getParam("WithCountersType"));
int cAmount = AbilityUtils.calculateAmount(source, sa.getParamOrDefault("WithCountersAmount", "1"), sa);
c.addEtbCounter(cType, cAmount, player);
}
if (sa.hasParam("Transformed")) {
if (c.isDoubleFaced()) {
c.changeCardState("Transform", null, sa);

View File

@@ -50,6 +50,12 @@ public abstract class TokenEffectBase extends SpellAbilityEffect {
tok.addEtbCounter(CounterType.getType(parse[0]), Integer.parseInt(parse[1]), creator);
}
if (sa.hasParam("WithCountersType")) {
CounterType cType = CounterType.getType(sa.getParam("WithCountersType"));
int cAmount = AbilityUtils.calculateAmount(host, sa.getParamOrDefault("WithCountersAmount", "1"), sa);
tok.addEtbCounter(cType, cAmount, creator);
}
if (clone) {
tok.setCopiedPermanent(prototype);
}