From 68f4cc43b8f5b2c159be58ac105c2f3796fb2d09 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 23 May 2022 09:55:35 -0400 Subject: [PATCH] [CLB] Implemented Rasaad yn Bashir --- .../src/mage/cards/r/RasaadYnBashir.java | 94 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 95 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RasaadYnBashir.java diff --git a/Mage.Sets/src/mage/cards/r/RasaadYnBashir.java b/Mage.Sets/src/mage/cards/r/RasaadYnBashir.java new file mode 100644 index 00000000000..6375f74d8fa --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RasaadYnBashir.java @@ -0,0 +1,94 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.ChooseABackgroundAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.HaveInitiativeCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RasaadYnBashir extends CardImpl { + + public RasaadYnBashir(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.MONK); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Each creature you control assigns combat damage equal to its toughness rather than its power. + this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessEffect( + StaticFilters.FILTER_PERMANENT_CREATURE, false + ))); + + // Whenever Rasaad yn Bashir attacks, if you have the initiative, double the toughness of each creature you control until end of turn. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new AttacksTriggeredAbility(new RasaadYnBashirEffect()), + HaveInitiativeCondition.instance, "Whenever {this} attacks, if you have the initiative, " + + "double the toughness of each creature you control until end of turn." + )); + + // Choose a Background + this.addAbility(ChooseABackgroundAbility.getInstance()); + } + + private RasaadYnBashir(final RasaadYnBashir card) { + super(card); + } + + @Override + public RasaadYnBashir copy() { + return new RasaadYnBashir(this); + } +} + +class RasaadYnBashirEffect extends OneShotEffect { + + RasaadYnBashirEffect() { + super(Outcome.Benefit); + } + + private RasaadYnBashirEffect(final RasaadYnBashirEffect effect) { + super(effect); + } + + @Override + public RasaadYnBashirEffect copy() { + return new RasaadYnBashirEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents( + StaticFilters.FILTER_CONTROLLED_CREATURE, source.getControllerId(), source, game + )) { + if (permanent.getPower().getValue() != 0) { + game.addEffect(new BoostTargetEffect( + permanent.getPower().getValue(), 0 + ).setTargetPointer(new FixedTarget(permanent, game)), source); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 11f2476590c..a6cd9ce1309 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -92,6 +92,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Plains", 451, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Raised by Giants", 250, Rarity.RARE, mage.cards.r.RaisedByGiants.class)); cards.add(new SetCardInfo("Raphael, Fiendish Savior", 292, Rarity.RARE, mage.cards.r.RaphaelFiendishSavior.class)); + cards.add(new SetCardInfo("Rasaad yn Bashir", 37, Rarity.UNCOMMON, mage.cards.r.RasaadYnBashir.class)); cards.add(new SetCardInfo("Reflecting Pool", 358, Rarity.RARE, mage.cards.r.ReflectingPool.class)); cards.add(new SetCardInfo("Renari, Merchant of Marvels", 90, Rarity.UNCOMMON, mage.cards.r.RenariMerchantOfMarvels.class)); cards.add(new SetCardInfo("Rilsa Rael, Kingpin", 293, Rarity.UNCOMMON, mage.cards.r.RilsaRaelKingpin.class));