From d061526924628fd6bfecb1cae8d7974c88cdb0da Mon Sep 17 00:00:00 2001 From: Alex Vasile <48962821+Alex-Vasile@users.noreply.github.com> Date: Wed, 25 May 2022 09:33:43 -0600 Subject: [PATCH] Cleaned up MinscBooTimelessHeroes slightly --- .../mage/cards/m/MinscBooTimelessHeroes.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/Mage.Sets/src/mage/cards/m/MinscBooTimelessHeroes.java b/Mage.Sets/src/mage/cards/m/MinscBooTimelessHeroes.java index 51754e1712a..7089c41c156 100644 --- a/Mage.Sets/src/mage/cards/m/MinscBooTimelessHeroes.java +++ b/Mage.Sets/src/mage/cards/m/MinscBooTimelessHeroes.java @@ -43,8 +43,8 @@ public final class MinscBooTimelessHeroes extends CardImpl { static { filter.add(Predicates.or( new AbilityPredicate(TrampleAbility.class), - new AbilityPredicate(HasteAbility.class) - )); + new AbilityPredicate(HasteAbility.class)) + ); } public MinscBooTimelessHeroes(UUID ownerId, CardSetInfo setInfo) { @@ -54,22 +54,28 @@ public final class MinscBooTimelessHeroes extends CardImpl { this.subtype.add(SubType.MINSC); this.setStartingLoyalty(3); - // When Minsc & Boo, Timeless Heroes enters the battlefield and at the beginning of your upkeep, you may create Boo, a legendary 1/1 red Hamster creature token with trample and haste. + // When Minsc & Boo, Timeless Heroes enters the battlefield and at the beginning of your upkeep, + // you may create Boo, a legendary 1/1 red Hamster creature token with trample and haste. this.addAbility(new OrTriggeredAbility( - Zone.BATTLEFIELD, new CreateTokenEffect(new BooToken()), true, + Zone.BATTLEFIELD, + new CreateTokenEffect(new BooToken()), + true, "When {this} enters the battlefield and at the beginning of your upkeep, ", new EntersBattlefieldTriggeredAbility(null, false), - new BeginningOfUpkeepTriggeredAbility(null, TargetController.YOU, false) - )); + new BeginningOfUpkeepTriggeredAbility(null, TargetController.YOU, false)) + ); // +1: Put three +1/+1 counters on up to one target creature with trample or haste. Ability ability = new LoyaltyAbility( - new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)), 1 + new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)), + 1 ); ability.addTarget(new TargetPermanent(0, 1, filter)); this.addAbility(ability); - // −2: Sacrifice a creature. When you do, Minsc & Boo, Timeless Heroes deals X damage to any target, where X is that creature's power. If the sacrificed creature was a Hamster, draw X cards. + // −2: Sacrifice a creature. + // When you do, Minsc & Boo, Timeless Heroes deals X damage to any target, where X is that creature's power. + // If the sacrificed creature was a Hamster, draw X cards. this.addAbility(new LoyaltyAbility(new MinscBooTimelessHeroesEffect(), -2)); // Minsc & Boo, Timeless Heroes can be your commander. @@ -106,27 +112,37 @@ class MinscBooTimelessHeroesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player == null || !game.getBattlefield().contains( - StaticFilters.FILTER_CONTROLLED_CREATURE, source, game, 1 - )) { + if (player == null) { return false; } + + if (!game.getBattlefield().contains(StaticFilters.FILTER_CONTROLLED_CREATURE, source, game, 1)) { + return false; + } + TargetPermanent target = new TargetControlledCreaturePermanent(); target.setNotTarget(true); player.choose(outcome, target, source, game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); if (permanent == null || !permanent.sacrifice(source, game)) { return false; } + int power = permanent.getPower().getValue(); ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( - new DamageTargetEffect(power), false, "deals X damage to any target, " + - "where X is that creature's power. If the sacrificed creature was a Hamster, draw X cards" + new DamageTargetEffect(power), + false, + "deals X damage to any target, where X is that creature's power. " + + "If the sacrificed creature was a Hamster, draw X cards" ); + if (permanent.hasSubtype(SubType.HAMSTER, game)) { ability.addEffect(new DrawCardSourceControllerEffect(power)); } + ability.addTarget(new TargetAnyTarget()); + game.fireReflexiveTriggeredAbility(ability, source); return true; }