From 0947df181e9f4c7d4f6b372fd35c1a562ce57a07 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 7 Sep 2019 08:09:37 -0400 Subject: [PATCH] Implemented Oko, Thief of Crowns --- .../src/mage/cards/o/OkoThiefOfCrowns.java | 89 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + .../src/main/java/mage/constants/SubType.java | 1 + 3 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java diff --git a/Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java b/Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java new file mode 100644 index 0000000000..a87c2fd372 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OkoThiefOfCrowns.java @@ -0,0 +1,89 @@ +package mage.cards.o; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.effects.common.continuous.ExchangeControlTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterOpponentsCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.permanent.token.FoodToken; +import mage.game.permanent.token.TokenImpl; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OkoThiefOfCrowns extends CardImpl { + + private static final FilterPermanent filter = new FilterOpponentsCreaturePermanent("creature an opponent controls with power 3 or less"); + + static { + filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 4)); + } + + public OkoThiefOfCrowns(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{G}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.OKO); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); + + // +2: Create a Food token. + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new FoodToken(), 2))); + + // +1: Target artifact or creature loses all abilities and becomes a green Elk creature with base power and toughness 3/3. + Ability ability = new LoyaltyAbility(new BecomesCreatureTargetEffect( + new OkoThiefOfCrownsToken(), true, false, Duration.Custom + ).setText("target artifact or creature loses all abilities and becomes a green Elk creature with base power and toughness 3/3"), 1); + ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_CREATURE)); + this.addAbility(ability); + + // −5: Exchange control of target artifact or creature you control and target creature an opponent controls with power 3 or less. + ability = new LoyaltyAbility(new ExchangeControlTargetEffect( + Duration.EndOfGame, "exchange control of target artifact or creature you control " + + "and target creature an opponent controls with power 3 or less", false, true + ), -5); + ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE)); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + private OkoThiefOfCrowns(final OkoThiefOfCrowns card) { + super(card); + } + + @Override + public OkoThiefOfCrowns copy() { + return new OkoThiefOfCrowns(this); + } +} + +class OkoThiefOfCrownsToken extends TokenImpl { + + OkoThiefOfCrownsToken() { + super("", "green Elk creature with base power and toughness 3/3"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add(SubType.ELK); + power = new MageInt(3); + toughness = new MageInt(3); + } + + private OkoThiefOfCrownsToken(final OkoThiefOfCrownsToken token) { + super(token); + } + + public OkoThiefOfCrownsToken copy() { + return new OkoThiefOfCrownsToken(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 526fe60a6c..d3770d9598 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -59,6 +59,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Lovestruck Beast", 165, Rarity.RARE, mage.cards.l.LovestruckBeast.class)); cards.add(new SetCardInfo("Mace of the Valiant", 314, Rarity.RARE, mage.cards.m.MaceOfTheValiant.class)); cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class)); + cards.add(new SetCardInfo("Oko, Thief of Crowns", 197, Rarity.MYTHIC, mage.cards.o.OkoThiefOfCrowns.class)); cards.add(new SetCardInfo("Order of Midnight", 99, Rarity.UNCOMMON, mage.cards.o.OrderOfMidnight.class)); cards.add(new SetCardInfo("Rankle, Master of Pranks", 101, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class)); cards.add(new SetCardInfo("Rosethorn Acolyte", 174, Rarity.COMMON, mage.cards.r.RosethornAcolyte.class)); diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index 0310341a25..d11656ccc5 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -407,6 +407,7 @@ public enum SubType { NISSA("Nissa", SubTypeSet.PlaneswalkerType), NIXILIS("Nixilis", SubTypeSet.PlaneswalkerType), OBI_WAN("Obi-Wan", SubTypeSet.PlaneswalkerType, true), // Star Wars + OKO("Oko", SubTypeSet.PlaneswalkerType), RAL("Ral", SubTypeSet.PlaneswalkerType), ROWAN("Rowan", SubTypeSet.PlaneswalkerType), SAHEELI("Saheeli", SubTypeSet.PlaneswalkerType),