mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
[BOK] Fix Waxmane Baku ability to be targeted, not choose on resolution
This commit is contained in:
parent
840058b246
commit
15a6d939b7
7 changed files with 61 additions and 199 deletions
|
|
@ -1,30 +1,34 @@
|
|||
|
||||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.MultipliedValue;
|
||||
import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class BlademaneBaku extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new MultipliedValue(RemovedCountersForCostValue.instance, 2);
|
||||
|
||||
public BlademaneBaku(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
|
@ -32,12 +36,14 @@ public final class BlademaneBaku extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Skullmane Baku.
|
||||
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Blademane Baku.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.FILTER_SPIRIT_OR_ARCANE_CARD, true));
|
||||
|
||||
// {1}, Remove X ki counters from Blademane Baku: For each counter removed, Blademane Baku gets +2/+0 until end of turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlademaneBakuBoostEffect(), new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(1)));
|
||||
Effect effect = new BoostSourceEffect(xValue, StaticValue.get(0), Duration.EndOfTurn);
|
||||
effect.setText("for each counter removed, {this} gets +2/+0 until end of turn");
|
||||
Ability ability = new SimpleActivatedAbility(effect, new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
@ -49,37 +55,4 @@ public final class BlademaneBaku extends CardImpl {
|
|||
public BlademaneBaku copy() {
|
||||
return new BlademaneBaku(this);
|
||||
}
|
||||
|
||||
static class BlademaneBakuBoostEffect extends OneShotEffect {
|
||||
|
||||
public BlademaneBakuBoostEffect() {
|
||||
super(Outcome.UnboostCreature);
|
||||
staticText = "For each counter removed, {this} gets +2/+0 until end of turn";
|
||||
}
|
||||
|
||||
public BlademaneBakuBoostEffect(BlademaneBakuBoostEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int numberToBoost = 0;
|
||||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof RemoveVariableCountersSourceCost) {
|
||||
numberToBoost = ((RemoveVariableCountersSourceCost)cost).getAmount() * 2;
|
||||
}
|
||||
}
|
||||
if (numberToBoost >= 0) {
|
||||
game.addEffect(new BoostSourceEffect(numberToBoost, 0, Duration.EndOfTurn), source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlademaneBakuBoostEffect copy() {
|
||||
return new BlademaneBakuBoostEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -9,14 +8,12 @@ import mage.abilities.costs.common.TapSourceCost;
|
|||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
||||
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.SunburstAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
|
@ -26,16 +23,15 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public final class InfusedArrows extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new SignInversionDynamicValue(RemovedCountersForCostValue.instance);
|
||||
|
||||
public InfusedArrows(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
|
||||
|
||||
// Sunburst
|
||||
this.addAbility(new SunburstAbility(this));
|
||||
// {tap}, Remove X charge counters from Infused Arrows: Target creature gets -X/-X until end of turn.
|
||||
DynamicValue value = new SignInversionDynamicValue(RemovedCountersForCostValue.instance);
|
||||
Effect effect = new BoostTargetEffect(value, value, Duration.EndOfTurn);
|
||||
effect.setText("Target creature gets -X/-X until end of turn");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
||||
Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), new TapSourceCost());
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -7,7 +6,7 @@ import mage.Mana;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
|
|
@ -31,18 +30,17 @@ public final class PetalmaneBaku extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Skullmane Baku.
|
||||
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Petalmane Baku.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.FILTER_SPIRIT_OR_ARCANE_CARD, true));
|
||||
|
||||
// {1}, Remove X ki counters from Petalmane Baku: Add X mana of any one color.
|
||||
Ability ability = new DynamicManaAbility(
|
||||
new Mana(0, 0, 0, 0, 0, 0, 1, 0),
|
||||
RemovedCountersForCostValue.instance,
|
||||
new ManaCostsImpl<>("{1}"),
|
||||
new GenericManaCost(1),
|
||||
"Add X mana of any one color",
|
||||
true, new CountersSourceCount(CounterType.KI));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(),
|
||||
"Remove X ki counters from {this}"));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,22 +9,18 @@ import mage.abilities.costs.Cost;
|
|||
import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
|
||||
|
|
@ -33,6 +29,8 @@ import mage.target.targetadjustment.TargetAdjuster;
|
|||
*/
|
||||
public final class QuillmaneBaku extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with mana value X or less");
|
||||
|
||||
public QuillmaneBaku(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
|
@ -40,14 +38,14 @@ public final class QuillmaneBaku extends CardImpl {
|
|||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Skullmane Baku.
|
||||
// Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Quillmane Baku.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.FILTER_SPIRIT_OR_ARCANE_CARD, true));
|
||||
|
||||
// {1}, Tap, Remove X ki counters from Quillmane Baku: Return target creature with converted mana cost X or less to its owner's hand.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new QuillmaneBakuReturnEffect(), new GenericManaCost(1));
|
||||
// {1}, {T}, Remove X ki counters from Quillmane Baku: Return target creature with mana value X or less to its owner's hand.
|
||||
Ability ability = new SimpleActivatedAbility(new ReturnToHandTargetEffect(), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(1)));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance()));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
ability.setTargetAdjuster(QuillmaneBakuAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -67,46 +65,15 @@ enum QuillmaneBakuAdjuster implements TargetAdjuster {
|
|||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
int maxConvManaCost = 0;
|
||||
int xValue = 0;
|
||||
for (Cost cost : ability.getCosts()) {
|
||||
if (cost instanceof RemoveVariableCountersSourceCost) {
|
||||
maxConvManaCost = ((RemoveVariableCountersSourceCost) cost).getAmount();
|
||||
xValue = ((RemoveVariableCountersSourceCost) cost).getAmount();
|
||||
}
|
||||
}
|
||||
ability.getTargets().clear();
|
||||
FilterCreaturePermanent newFilter = new FilterCreaturePermanent("creature with mana value " + maxConvManaCost + " or less");
|
||||
newFilter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, maxConvManaCost + 1));
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent(newFilter);
|
||||
ability.getTargets().add(target);
|
||||
}
|
||||
}
|
||||
|
||||
class QuillmaneBakuReturnEffect extends OneShotEffect {
|
||||
|
||||
public QuillmaneBakuReturnEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
this.staticText = "Return target creature with mana value X or less to its owner's hand";
|
||||
}
|
||||
|
||||
public QuillmaneBakuReturnEffect(final QuillmaneBakuReturnEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuillmaneBakuReturnEffect copy() {
|
||||
return new QuillmaneBakuReturnEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
controller.moveCards(permanent, Zone.HAND, source, game);
|
||||
}
|
||||
return true;
|
||||
FilterCreaturePermanent newFilter = new FilterCreaturePermanent("creature with mana value " + xValue + " or less");
|
||||
newFilter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||
ability.addTarget(new TargetCreaturePermanent(newFilter));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -6,33 +5,30 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
||||
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class SkullmaneBaku extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new SignInversionDynamicValue(RemovedCountersForCostValue.instance);
|
||||
|
||||
public SkullmaneBaku(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
|
@ -44,9 +40,9 @@ public final class SkullmaneBaku extends CardImpl {
|
|||
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.FILTER_SPIRIT_OR_ARCANE_CARD, true));
|
||||
|
||||
// {1}, {T}, Remove X ki counters from Skullmane Baku: Target creature gets -X/-X until end of turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SkullmaneBakuUnboostEffect(), new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(1)));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance()));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -59,39 +55,4 @@ public final class SkullmaneBaku extends CardImpl {
|
|||
public SkullmaneBaku copy() {
|
||||
return new SkullmaneBaku(this);
|
||||
}
|
||||
|
||||
static class SkullmaneBakuUnboostEffect extends OneShotEffect {
|
||||
|
||||
public SkullmaneBakuUnboostEffect() {
|
||||
super(Outcome.UnboostCreature);
|
||||
staticText = "Target creature gets -X/-X until end of turn";
|
||||
}
|
||||
|
||||
public SkullmaneBakuUnboostEffect(SkullmaneBakuUnboostEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int numberToUnboost = 0;
|
||||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof RemoveVariableCountersSourceCost) {
|
||||
numberToUnboost = ((RemoveVariableCountersSourceCost) cost).getAmount() * -1;
|
||||
}
|
||||
}
|
||||
Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (creature != null && numberToUnboost != 0) {
|
||||
ContinuousEffect effect = new BoostTargetEffect(numberToUnboost, numberToUnboost, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(creature, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkullmaneBakuUnboostEffect copy() {
|
||||
return new SkullmaneBakuUnboostEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
|
||||
package mage.cards.w;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -11,21 +8,18 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
|||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
|
|
@ -43,8 +37,9 @@ public final class WaxmaneBaku extends CardImpl {
|
|||
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.FILTER_SPIRIT_OR_ARCANE_CARD, true));
|
||||
|
||||
// {1}, Remove X ki counters from Waxmane Baku: Tap X target creatures.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new WaxmaneBakuTapEffect(), new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(1)));
|
||||
Ability ability = new SimpleActivatedAbility(new TapTargetEffect("tap X target creatures"), new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance()));
|
||||
ability.setTargetAdjuster(WaxmaneBakuAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
@ -58,45 +53,18 @@ public final class WaxmaneBaku extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class WaxmaneBakuTapEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
public WaxmaneBakuTapEffect() {
|
||||
super(Outcome.Tap);
|
||||
staticText = "Tap X target creatures";
|
||||
}
|
||||
|
||||
public WaxmaneBakuTapEffect(final WaxmaneBakuTapEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
enum WaxmaneBakuAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int numberToTap = 0;
|
||||
for (Cost cost : source.getCosts()) {
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
int xValue = 0;
|
||||
for (Cost cost : ability.getCosts()) {
|
||||
if (cost instanceof RemoveVariableCountersSourceCost) {
|
||||
numberToTap = ((RemoveVariableCountersSourceCost) cost).getAmount();
|
||||
xValue = ((RemoveVariableCountersSourceCost) cost).getAmount();
|
||||
}
|
||||
}
|
||||
TargetPermanent target = new TargetPermanent(numberToTap, filter);
|
||||
if (target.canChoose(source.getSourceId(), source.getControllerId(), game) && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
List<UUID> targets = target.getTargets();
|
||||
for (UUID targetId : targets) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.tap(source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WaxmaneBakuTapEffect copy() {
|
||||
return new WaxmaneBakuTapEffect(this);
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetCreaturePermanent(xValue));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public enum RemovedCountersForCostValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "number of removed counters";
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -37,5 +37,4 @@ public enum RemovedCountersForCostValue implements DynamicValue {
|
|||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue