diff --git a/Mage.Sets/src/mage/cards/s/SovereignOkinecAhau.java b/Mage.Sets/src/mage/cards/s/SovereignOkinecAhau.java new file mode 100644 index 00000000000..7475382ed48 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SovereignOkinecAhau.java @@ -0,0 +1,80 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.constants.*; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * + * @author Grath + */ +public final class SovereignOkinecAhau extends CardImpl { + + public SovereignOkinecAhau(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{W}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.CAT); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Ward {2} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"))); + + // Whenever Sovereign Okinec Ahau attacks, for each creature you control with power greater than that + // creature's base power, put a number of +1/+1 counters on that creature equal to the difference. + this.addAbility(new AttacksTriggeredAbility(new SovereignOkinecAhauEffect())); + } + + private SovereignOkinecAhau(final SovereignOkinecAhau card) { + super(card); + } + + @Override + public SovereignOkinecAhau copy() { + return new SovereignOkinecAhau(this); + } +} + + +class SovereignOkinecAhauEffect extends OneShotEffect { + + SovereignOkinecAhauEffect() { + super(Outcome.Benefit); + staticText = "for each creature you control with power greater than that" + + "creature's base power, put a number of +1/+1 counters on that creature equal to the difference."; + } + + private SovereignOkinecAhauEffect(final SovereignOkinecAhauEffect effect) { + super(effect); + } + + @Override + public SovereignOkinecAhauEffect copy() { + return new SovereignOkinecAhauEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, source.getControllerId(), source, game)) { + int powerDiff = permanent.getPower().getValue() - permanent.getPower().getModifiedBaseValue(); + if (powerDiff > 0) { + permanent.addCounters(CounterType.P1P1.createInstance(powerDiff), source.getControllerId(), source, game); + } + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java index 1035cf29327..7e44fde777b 100644 --- a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java +++ b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java @@ -90,6 +90,7 @@ public final class TheLostCavernsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Sanguine Evangelist", 34, Rarity.RARE, mage.cards.s.SanguineEvangelist.class)); cards.add(new SetCardInfo("Skullcap Snail", 119, Rarity.COMMON, mage.cards.s.SkullcapSnail.class)); cards.add(new SetCardInfo("Song of Stupefaction", 77, Rarity.COMMON, mage.cards.s.SongOfStupefaction.class)); + cards.add(new SetCardInfo("Sovereign Okinec Ahau", 240, Rarity.MYTHIC, mage.cards.s.SovereignOkinecAhau.class)); cards.add(new SetCardInfo("Sovereign's Macuahuitl", 155, Rarity.COMMON, mage.cards.s.SovereignsMacuahuitl.class)); cards.add(new SetCardInfo("Spring-Loaded Sawblades", 36, Rarity.UNCOMMON, mage.cards.s.SpringLoadedSawblades.class)); cards.add(new SetCardInfo("Spyglass Siren", 78, Rarity.UNCOMMON, mage.cards.s.SpyglassSiren.class));