From 4e313e8792afbc2f85a15941c5ce7753e2bd537c Mon Sep 17 00:00:00 2001 From: jack-the-BOSS <38446944+jack-the-BOSS@users.noreply.github.com> Date: Tue, 17 Apr 2018 08:59:08 -0500 Subject: [PATCH 1/5] Update CardImpl.java Added adjustTargets case for Aryel, Knight of Windgrace --- Mage/src/main/java/mage/cards/CardImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index 2ebac99fff3..15fcbcaf0d8 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -389,6 +389,16 @@ public abstract class CardImpl extends MageObjectImpl implements Card { ability.getTargets().clear(); ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false)); break; + case ARYEL:// Aryel, Knight of Windgrace only + xValue = ability.cost.getFixedCostsFromAnnouncedValue(); + oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0); + minTargets = oldTargetPermanent.getMinNumberOfTargets(); + maxTargets = oldTargetPermanent.getMaxNumberOfTargets(); + permanentFilter = oldTargetPermanent.getFilter().copy(); + permanentFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); + ability.getTargets().clear(); + ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false)); + break; case VERSE_COUNTER_TARGETS: Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(ability.getSourceId()); if (sourcePermanent != null) { From bb5cdffd014af7073746194685b06f00fd9a792c Mon Sep 17 00:00:00 2001 From: jack-the-BOSS <38446944+jack-the-BOSS@users.noreply.github.com> Date: Tue, 17 Apr 2018 09:03:01 -0500 Subject: [PATCH 2/5] Create AryelKnightOfWindgrace Implemented Aryel, Knight of Windgrace --- .../src/mage/cards/a/AryelKnightOfWindgrace | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace diff --git a/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace b/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace new file mode 100644 index 00000000000..9f6d52c1b27 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace @@ -0,0 +1,141 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.permanent.token.KnightToken; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.target.TargetAdjustment; + +/** + * + * @author jack-the-BOSS + */ +public class AryelKnightOfWindgrace extends CardImpl { + + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature with power X or less"); + + public AryelKnightOfWindgrace(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // {2}{W}, {T}: Create a 2/2 white Knight creature token with vigilance. + Ability createAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new KnightToken()), new ManaCostsImpl("{2}{W}")); + createAbility.addCost(new TapSourceCost()); + this.addAbility(createAbility); + + // {B}, {T}, Tap X untapped Knights you control: Destroy target creature with power X or less. + + //Simple costs + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}")); + ability.addCost(new TapSourceCost()); + + // Variable cost: Tapping X Knights + TapXTargetCost cost = new TapXTargetCost(); + int xValue = cost.getFixedCostsFromAnnouncedValue(); + ability.addCost(xValue); + + //Setting Legal Target to destroy + filter2.add(new PowerPredicate(new StringBuilder("creature with power ").append(xValue).append(" or less").toString()); + ability.addTarget(new TargetPermanent(filter2)); + ability.setTargetAdjustment(TargetAdjustment.ARYEL); + ability.addTarget(target); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.addAbility(ability); + } + + public AryelKnightOfWindgrace(final AryelKnightOfWindgrace card) { + super(card); + } + + @Override + public AryelKnightOfWindgrace copy() { + return new AryelKnightOfWindgrace(this); + } +} + +class TapXTargetCost extends VariableCostImpl { + + static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Knights you control"); + static { + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate(SubType.KNIGHT)); + } + + public TapXTargetCost() { + super("controlled untapped Knights you would like to tap"); + this.text = "Tap X untapped Knights you control"; + } + + public TapXTargetCost(final TapXTargetCost cost) { + super(cost); + } + + @Override + public TapXTargetCost copy() { + return new TapXTargetCost(this); + } + + @Override + public int getMaxValue(Ability source, Game game) { + return game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); + } + + @Override + public Cost getFixedCostsFromAnnouncedValue(int xValue) { + TargetControlledPermanent target = new TargetControlledPermanent(xValue, xValue, filter, true); + return new TapTargetCost(target); + } +} From 404146143347f47a36ca0862296998403313405b Mon Sep 17 00:00:00 2001 From: jack-the-BOSS <38446944+jack-the-BOSS@users.noreply.github.com> Date: Tue, 17 Apr 2018 09:03:45 -0500 Subject: [PATCH 3/5] Rename AryelKnightOfWindgrace to AryelKnightOfWindgrace.java --- .../a/{AryelKnightOfWindgrace => AryelKnightOfWindgrace.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Mage.Sets/src/mage/cards/a/{AryelKnightOfWindgrace => AryelKnightOfWindgrace.java} (100%) diff --git a/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace b/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java similarity index 100% rename from Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace rename to Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java From d59cddd6099aca7a9cdd0e4a2496bcd1a9da6cce Mon Sep 17 00:00:00 2001 From: jack-the-BOSS <38446944+jack-the-BOSS@users.noreply.github.com> Date: Tue, 17 Apr 2018 09:24:25 -0500 Subject: [PATCH 4/5] Update Dominaria.java Added Aryel --- Mage.Sets/src/mage/sets/Dominaria.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/sets/Dominaria.java b/Mage.Sets/src/mage/sets/Dominaria.java index 597b3772174..afc14a2f501 100644 --- a/Mage.Sets/src/mage/sets/Dominaria.java +++ b/Mage.Sets/src/mage/sets/Dominaria.java @@ -65,6 +65,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Arcane Flight", 43, Rarity.COMMON, mage.cards.a.ArcaneFlight.class)); cards.add(new SetCardInfo("Artificer's Assistant", 44, Rarity.COMMON, mage.cards.a.ArtificersAssistant.class)); cards.add(new SetCardInfo("Arvad the Cursed", 191, Rarity.UNCOMMON, mage.cards.a.ArvadTheCursed.class)); + cards.add(new SetCardInfo("Aryel, Knight of Windgrace", 192, Rarity.RARE, mage.cards.a.AryelKnightOfWindgrace.class)); cards.add(new SetCardInfo("Aven Sentry", 3, Rarity.COMMON, mage.cards.a.AvenSentry.class)); cards.add(new SetCardInfo("Baird, Steward of Argive", 4, Rarity.UNCOMMON, mage.cards.b.BairdStewardOfArgive.class)); cards.add(new SetCardInfo("Baloth Gorger", 156, Rarity.COMMON, mage.cards.b.BalothGorger.class)); @@ -104,7 +105,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Drudge Sentinel", 89, Rarity.COMMON, mage.cards.d.DrudgeSentinel.class)); cards.add(new SetCardInfo("Dub", 15, Rarity.SPECIAL, mage.cards.d.Dub.class)); cards.add(new SetCardInfo("Eviscerate", 91, Rarity.COMMON, mage.cards.e.Eviscerate.class)); - cards.add(new SetCardInfo("Evra, Halcyon Witness", 16, Rarity.RARE, mage.cards.e.EvraHalcyonWitness.class)); + cards.add(new SetCardInfo("Evra, Halcyon Witness", 16, Rarity.RARE, mage.cards.e.EvraHalcyonWitness.class)); cards.add(new SetCardInfo("Excavation Elephant", 17, Rarity.COMMON, mage.cards.e.ExcavationElephant.class)); cards.add(new SetCardInfo("Fall of the Thran", 18, Rarity.RARE, mage.cards.f.FallOfTheThran.class)); cards.add(new SetCardInfo("Feral Abomination", 92, Rarity.COMMON, mage.cards.f.FeralAbomination.class)); @@ -140,7 +141,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Homarid Explorer", 53, Rarity.UNCOMMON, mage.cards.h.HomaridExplorer.class)); cards.add(new SetCardInfo("Howling Golem", 218, Rarity.UNCOMMON, mage.cards.h.HowlingGolem.class)); cards.add(new SetCardInfo("Icy Manipulator", 219, Rarity.UNCOMMON, mage.cards.i.IcyManipulator.class)); - cards.add(new SetCardInfo("In Bolas's Clutches", 54, Rarity.UNCOMMON, mage.cards.i.InBolassClutches.class)); + cards.add(new SetCardInfo("In Bolas's Clutches", 54, Rarity.UNCOMMON, mage.cards.i.InBolassClutches.class)); cards.add(new SetCardInfo("Invoke the Divine", 22, Rarity.COMMON, mage.cards.i.InvokeTheDivine.class)); cards.add(new SetCardInfo("Island", 254, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 255, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); @@ -158,7 +159,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Karn, Scion of Urza", 1, Rarity.MYTHIC, mage.cards.k.KarnScionOfUrza.class)); cards.add(new SetCardInfo("Karn's Temporal Sundering", 55, Rarity.RARE, mage.cards.k.KarnsTemporalSundering.class)); cards.add(new SetCardInfo("Karplusan Hound", 277, Rarity.UNCOMMON, mage.cards.k.KarplusanHound.class)); - cards.add(new SetCardInfo("Kazarov, Sengir Pureblood", 96, Rarity.RARE, mage.cards.k.KazarovSengirPureblood.class)); + cards.add(new SetCardInfo("Kazarov, Sengir Pureblood", 96, Rarity.RARE, mage.cards.k.KazarovSengirPureblood.class)); cards.add(new SetCardInfo("Keldon Overseer", 134, Rarity.COMMON, mage.cards.k.KeldonOverseer.class)); cards.add(new SetCardInfo("Keldon Raider", 135, Rarity.COMMON, mage.cards.k.KeldonRaider.class)); cards.add(new SetCardInfo("Keldon Warcaller", 136, Rarity.COMMON, mage.cards.k.KeldonWarcaller.class)); @@ -166,7 +167,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Knight of Malice", 97, Rarity.UNCOMMON, mage.cards.k.KnightOfMalice.class)); cards.add(new SetCardInfo("Knight of New Benalia", 24, Rarity.COMMON, mage.cards.k.KnightOfNewBenalia.class)); cards.add(new SetCardInfo("Kwende, Pride of Femeref", 25, Rarity.UNCOMMON, mage.cards.k.KwendePrideOfFemeref.class)); - cards.add(new SetCardInfo("Lich's Mastery", 98, Rarity.RARE, mage.cards.l.LichsMastery.class)); + cards.add(new SetCardInfo("Lich's Mastery", 98, Rarity.RARE, mage.cards.l.LichsMastery.class)); cards.add(new SetCardInfo("Lingering Phantom", 99, Rarity.UNCOMMON, mage.cards.l.LingeringPhantom.class)); cards.add(new SetCardInfo("Llanowar Elves", 168, Rarity.COMMON, mage.cards.l.LlanowarElves.class)); cards.add(new SetCardInfo("Llanowar Envoy", 169, Rarity.COMMON, mage.cards.l.LlanowarEnvoy.class)); @@ -193,9 +194,9 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Naru Meha, Master Wizard", 59, Rarity.MYTHIC, mage.cards.n.NaruMehaMasterWizard.class)); cards.add(new SetCardInfo("Nature's Spiral", 175, Rarity.UNCOMMON, mage.cards.n.NaturesSpiral.class)); cards.add(new SetCardInfo("Niambi, Faithful Healer", 272, Rarity.RARE, mage.cards.n.NiambiFaithfulHealer.class)); - cards.add(new SetCardInfo("On Serra's Wings", 28, Rarity.UNCOMMON, mage.cards.o.OnSerrasWings.class)); + cards.add(new SetCardInfo("On Serra's Wings", 28, Rarity.UNCOMMON, mage.cards.o.OnSerrasWings.class)); cards.add(new SetCardInfo("Opt", 60, Rarity.COMMON, mage.cards.o.Opt.class)); - cards.add(new SetCardInfo("Orcish Vandal", 137, Rarity.COMMON, mage.cards.o.OrcishVandal.class)); + cards.add(new SetCardInfo("Orcish Vandal", 137, Rarity.COMMON, mage.cards.o.OrcishVandal.class)); cards.add(new SetCardInfo("Pardic Wanderer", 226, Rarity.COMMON, mage.cards.p.PardicWanderer.class)); cards.add(new SetCardInfo("Pegasus Courser", 29, Rarity.COMMON, mage.cards.p.PegasusCourser.class)); cards.add(new SetCardInfo("Pierce the Sky", 176, Rarity.COMMON, mage.cards.p.PierceTheSky.class)); @@ -209,13 +210,13 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Pyromantic Pilgrim", 278, Rarity.COMMON, mage.cards.p.PyromanticPilgrim.class)); cards.add(new SetCardInfo("Raff Capashen, Ship's Mage", 202, Rarity.UNCOMMON, mage.cards.r.RaffCapashenShipsMage.class)); cards.add(new SetCardInfo("Rescue", 63, Rarity.COMMON, mage.cards.r.Rescue.class)); - cards.add(new SetCardInfo("Rite of Belzenlok", 102, Rarity.RARE, mage.cards.r.RiteOfBelzenlok.class)); + cards.add(new SetCardInfo("Rite of Belzenlok", 102, Rarity.RARE, mage.cards.r.RiteOfBelzenlok.class)); cards.add(new SetCardInfo("Run Amok", 140, Rarity.COMMON, mage.cards.r.RunAmok.class)); cards.add(new SetCardInfo("Sage of Lat-Nam", 64, Rarity.UNCOMMON, mage.cards.s.SageOfLatNam.class)); cards.add(new SetCardInfo("Sanctum Spirit", 30, Rarity.UNCOMMON, mage.cards.s.SanctumSpirit.class)); cards.add(new SetCardInfo("Saproling Migration", 178, Rarity.COMMON, mage.cards.s.SaprolingMigration.class)); cards.add(new SetCardInfo("Seal Away", 31, Rarity.UNCOMMON, mage.cards.s.SealAway.class)); - cards.add(new SetCardInfo("Sergeant-at-Arms", 32, Rarity.COMMON, mage.cards.s.SergeantAtArms.class)); + cards.add(new SetCardInfo("Sergeant-at-Arms", 32, Rarity.COMMON, mage.cards.s.SergeantAtArms.class)); cards.add(new SetCardInfo("Serra Angel", 33, Rarity.UNCOMMON, mage.cards.s.SerraAngel.class)); cards.add(new SetCardInfo("Serra Disciple", 34, Rarity.COMMON, mage.cards.s.SerraDisciple.class)); cards.add(new SetCardInfo("Shalai, Voice of Plenty", 35, Rarity.RARE, mage.cards.s.ShalaiVoiceOfPlenty.class)); @@ -260,11 +261,11 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Tragic Poet", 37, Rarity.COMMON, mage.cards.t.TragicPoet.class)); cards.add(new SetCardInfo("Traxos, Scourge of Kroog", 234, Rarity.RARE, mage.cards.t.TraxosScourgeOfKroog.class)); cards.add(new SetCardInfo("Triumph of Gerrard", 38, Rarity.UNCOMMON, mage.cards.t.TriumphOfGerrard.class)); - cards.add(new SetCardInfo("Two-Headed Giant", 147, Rarity.RARE, mage.cards.t.TwoHeadedGiant.class)); + cards.add(new SetCardInfo("Two-Headed Giant", 147, Rarity.RARE, mage.cards.t.TwoHeadedGiant.class)); cards.add(new SetCardInfo("Untamed Kavu", 186, Rarity.UNCOMMON, mage.cards.u.UntamedKavu.class)); cards.add(new SetCardInfo("Unwind", 72, Rarity.COMMON, mage.cards.u.Unwind.class)); cards.add(new SetCardInfo("Urza's Ruinous Blast", 39, Rarity.RARE, mage.cards.u.UrzasRuinousBlast.class)); - cards.add(new SetCardInfo("Urza's Tome", 235, Rarity.UNCOMMON, mage.cards.u.UrzasTome.class)); + cards.add(new SetCardInfo("Urza's Tome", 235, Rarity.UNCOMMON, mage.cards.u.UrzasTome.class)); cards.add(new SetCardInfo("Verdant Force", 187, Rarity.RARE, mage.cards.v.VerdantForce.class)); cards.add(new SetCardInfo("Verix Bladewing", 149, Rarity.MYTHIC, mage.cards.v.VerixBladewing.class)); cards.add(new SetCardInfo("Vicious Offering", 110, Rarity.COMMON, mage.cards.v.ViciousOffering.class)); From c5e9c9236f36d81dc942cb48b95d54f188d687e3 Mon Sep 17 00:00:00 2001 From: jack-the-BOSS <38446944+jack-the-BOSS@users.noreply.github.com> Date: Tue, 17 Apr 2018 09:57:30 -0500 Subject: [PATCH 5/5] Implemented Aryel, Knight of Windgrace --- Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java b/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java index 9f6d52c1b27..cfdee1ff6ce 100644 --- a/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java +++ b/Mage.Sets/src/mage/cards/a/AryelKnightOfWindgrace.java @@ -72,9 +72,9 @@ public class AryelKnightOfWindgrace extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // {2}{W}, {T}: Create a 2/2 white Knight creature token with vigilance. - Ability createAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new KnightToken()), new ManaCostsImpl("{2}{W}")); - createAbility.addCost(new TapSourceCost()); - this.addAbility(createAbility); + Ability tokenAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new KnightToken()), new ManaCostsImpl("{2}{W}")); + tokenAbility.addCost(new TapSourceCost()); + this.addAbility(tokenAbility); // {B}, {T}, Tap X untapped Knights you control: Destroy target creature with power X or less.