From 243b48ba8316edc74bc7efd22b3fea0310d17a24 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sat, 16 Apr 2022 11:20:34 -0500 Subject: [PATCH] [SNC] Implemented For the Family --- Mage.Sets/src/mage/cards/f/ForTheFamily.java | 67 +++++++++++++++++++ .../src/mage/sets/StreetsOfNewCapenna.java | 1 + 2 files changed, 68 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/ForTheFamily.java diff --git a/Mage.Sets/src/mage/cards/f/ForTheFamily.java b/Mage.Sets/src/mage/cards/f/ForTheFamily.java new file mode 100644 index 00000000000..5706f2eaa8d --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/ForTheFamily.java @@ -0,0 +1,67 @@ +package mage.cards.f; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class ForTheFamily extends CardImpl { + + public ForTheFamily(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); + + // Target creature gets +2/+2 until end of turn. If you control four or more creatures, that creature gets +4/+4 until end of turn instead. + this.getSpellAbility().addEffect(new ForTheFamilyEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private ForTheFamily(final ForTheFamily card) { + super(card); + } + + @Override + public ForTheFamily copy() { + return new ForTheFamily(this); + } +} + +class ForTheFamilyEffect extends OneShotEffect { + + public ForTheFamilyEffect() { + super(Outcome.BoostCreature); + this.staticText = "Target creature gets +2/+2 until end of turn. If you control four or more creatures, that creature gets +4/+4 until end of turn instead"; + } + + private ForTheFamilyEffect(final ForTheFamilyEffect effect) { + super(effect); + } + + @Override + public ForTheFamilyEffect copy() { + return new ForTheFamilyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int boost; + if (game.getBattlefield().count(StaticFilters.FILTER_CONTROLLED_CREATURE, source.getControllerId(), source, game) >= 4) { + boost = 4; + } else { + boost = 2; + } + game.addEffect(new BoostTargetEffect(boost, boost), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index bfb12cfb394..0c63948932e 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -102,6 +102,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("Fatal Grudge", 187, Rarity.UNCOMMON, mage.cards.f.FatalGrudge.class)); cards.add(new SetCardInfo("Fight Rigging", 145, Rarity.RARE, mage.cards.f.FightRigging.class)); cards.add(new SetCardInfo("Fleetfoot Dancer", 188, Rarity.RARE, mage.cards.f.FleetfootDancer.class)); + cards.add(new SetCardInfo("For the Family", 146, Rarity.COMMON, mage.cards.f.ForTheFamily.class)); cards.add(new SetCardInfo("Forest", 270, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forge Boss", 189, Rarity.UNCOMMON, mage.cards.f.ForgeBoss.class)); cards.add(new SetCardInfo("Freelance Muscle", 147, Rarity.UNCOMMON, mage.cards.f.FreelanceMuscle.class));