From 5aa1c91831e9e70ce646c2e6bc5e911a68a61853 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 25 Jul 2018 23:12:02 -0400 Subject: [PATCH] Implemented Nylea's Colossus --- .../src/mage/cards/n/NyleasColossus.java | 75 +++++++++++++++++++ Mage.Sets/src/mage/sets/Commander2018.java | 1 + 2 files changed, 76 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NyleasColossus.java diff --git a/Mage.Sets/src/mage/cards/n/NyleasColossus.java b/Mage.Sets/src/mage/cards/n/NyleasColossus.java new file mode 100644 index 0000000000..4f0f7caf7e --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NyleasColossus.java @@ -0,0 +1,75 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.abilityword.ConstellationAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class NyleasColossus extends CardImpl { + + public NyleasColossus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{6}{G}"); + + this.subtype.add(SubType.GIANT); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Constellation — Whenever Nylea's Colossus or another enchantment enters the battlefield under your control, double target creature's power and toughness until end of turn. + Ability ability = new ConstellationAbility(new NyleasColossusEffect(), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public NyleasColossus(final NyleasColossus card) { + super(card); + } + + @Override + public NyleasColossus copy() { + return new NyleasColossus(this); + } +} + +class NyleasColossusEffect extends OneShotEffect { + + public NyleasColossusEffect() { + super(Outcome.BoostCreature); + this.staticText = "double target creature's power and toughness until end of turn"; + } + + public NyleasColossusEffect(final NyleasColossusEffect effect) { + super(effect); + } + + @Override + public NyleasColossusEffect copy() { + return new NyleasColossusEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + int power = permanent.getPower().getValue(); + int toughness = permanent.getToughness().getValue(); + game.addEffect(new BoostTargetEffect(power, toughness, Duration.EndOfTurn), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2018.java b/Mage.Sets/src/mage/sets/Commander2018.java index 8715427215..60475043cd 100644 --- a/Mage.Sets/src/mage/sets/Commander2018.java +++ b/Mage.Sets/src/mage/sets/Commander2018.java @@ -50,6 +50,7 @@ public final class Commander2018 extends ExpansionSet { cards.add(new SetCardInfo("Loyal Guardian", 31, Rarity.UNCOMMON, mage.cards.l.LoyalGuardian.class)); cards.add(new SetCardInfo("Loyal Subordinate", 16, Rarity.UNCOMMON, mage.cards.l.LoyalSubordinate.class)); cards.add(new SetCardInfo("Nesting Dragon", 24, Rarity.RARE, mage.cards.n.NestingDragon.class)); + cards.add(new SetCardInfo("Nylea's Colossus", 33, Rarity.COMMON, mage.cards.n.NyleasColossus.class)); cards.add(new SetCardInfo("Octopus Umbra", 11, Rarity.RARE, mage.cards.o.OctopusUmbra.class)); cards.add(new SetCardInfo("Rampaging Baloths", 158, Rarity.RARE, mage.cards.r.RampagingBaloths.class)); cards.add(new SetCardInfo("Retrofitter Foundry", 57, Rarity.RARE, mage.cards.r.RetrofitterFoundry.class));