From fce99fa182b3c65efa7817f150d6dfbababcf9fb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 5 Sep 2017 19:39:04 -0400 Subject: [PATCH] Implemented Conqueror's Galleon/Foothold --- .../src/mage/cards/c/ConquerorsFoothold.java | 89 +++++++++++++++++++ .../src/mage/cards/c/ConquerorsGalleon.java | 78 ++++++++++++++++ .../src/mage/cards/j/JaceCunningCastaway.java | 24 ++--- Mage.Sets/src/mage/sets/Ixalan.java | 2 + Mage/src/main/java/mage/abilities/Gender.java | 3 +- ...ExileAndReturnTransformedSourceEffect.java | 5 +- 6 files changed, 186 insertions(+), 15 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/c/ConquerorsFoothold.java create mode 100644 Mage.Sets/src/mage/cards/c/ConquerorsGalleon.java diff --git a/Mage.Sets/src/mage/cards/c/ConquerorsFoothold.java b/Mage.Sets/src/mage/cards/c/ConquerorsFoothold.java new file mode 100644 index 00000000000..0c50dac9194 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConquerorsFoothold.java @@ -0,0 +1,89 @@ +/* + * 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.c; + +import java.util.UUID; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public class ConquerorsFoothold extends CardImpl { + + public ConquerorsFoothold(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.nightCard = true; + + // {T}: Add {C} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {2}, {T}: Draw a card, then discard a card. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DrawDiscardControllerEffect(), + new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {4}, {T}: Draw a card. + SimpleActivatedAbility ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DrawCardSourceControllerEffect(1), + new ManaCostsImpl("{4}")); + ability2.addCost(new TapSourceCost()); + this.addAbility(ability2); + + // {6}, {T}: Return target card from your graveyard to your hand. + SimpleActivatedAbility ability3 = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new ReturnToHandTargetEffect(), + new ManaCostsImpl("{6}")); + ability3.addCost(new TapSourceCost()); + ability3.addTarget(new TargetCardInYourGraveyard()); + this.addAbility(ability3); + } + + public ConquerorsFoothold(final ConquerorsFoothold card) { + super(card); + } + + @Override + public ConquerorsFoothold copy() { + return new ConquerorsFoothold(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/ConquerorsGalleon.java b/Mage.Sets/src/mage/cards/c/ConquerorsGalleon.java new file mode 100644 index 00000000000..beefa13d4d1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConquerorsGalleon.java @@ -0,0 +1,78 @@ +/* + * 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.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect; +import mage.abilities.keyword.CrewAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public class ConquerorsGalleon extends CardImpl { + + public ConquerorsGalleon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + this.subtype.add("Vehicle"); + this.power = new MageInt(2); + this.toughness = new MageInt(10); + + this.transformable = true; + this.secondSideCardClazz = ConquerorsFoothold.class; + + // When Conqueror's Galleon attacks, exile it at the end of combat, then return it to the battlefield transformed under your control. + this.addAbility(new TransformAbility()); + this.addAbility(new AttacksTriggeredAbility( + new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new ExileAndReturnTransformedSourceEffect())), + false, + "When {this} attacks, exile it at the end of combat, then return it to the battlefield transformed under your control.")); + + // Crew 4 + this.addAbility(new CrewAbility(4)); + } + + public ConquerorsGalleon(final ConquerorsGalleon card) { + super(card); + } + + @Override + public ConquerorsGalleon copy() { + return new ConquerorsGalleon(this); + } +} diff --git a/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java b/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java index c41c4329800..30f8dcd7422 100644 --- a/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java +++ b/Mage.Sets/src/mage/cards/j/JaceCunningCastaway.java @@ -66,7 +66,7 @@ public class JaceCunningCastaway extends CardImpl { this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card. - this.addAbility(new LoyaltyAbility(new JaceArchitectOfThouStartEffect1(), 1)); + this.addAbility(new LoyaltyAbility(new JaceCunningCastawayEffect1(), 1)); // -2: Create a 2/2 blue Illusion creature token with "When this creature becomes the target of a spell, sacrifice it." this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new JaceCunningCastawayIllusionToken()), -2)); @@ -85,45 +85,45 @@ public class JaceCunningCastaway extends CardImpl { } } -class JaceArchitectOfThouStartEffect1 extends OneShotEffect { +class JaceCunningCastawayEffect1 extends OneShotEffect { - public JaceArchitectOfThouStartEffect1() { + public JaceCunningCastawayEffect1() { super(Outcome.DrawCard); this.staticText = "Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card"; } - public JaceArchitectOfThouStartEffect1(final JaceArchitectOfThouStartEffect1 effect) { + public JaceCunningCastawayEffect1(final JaceCunningCastawayEffect1 effect) { super(effect); } @Override - public JaceArchitectOfThouStartEffect1 copy() { - return new JaceArchitectOfThouStartEffect1(this); + public JaceCunningCastawayEffect1 copy() { + return new JaceCunningCastawayEffect1(this); } @Override public boolean apply(Game game, Ability source) { - DelayedTriggeredAbility delayedAbility = new ThopterSpyNetwoDamageTriggeredAbility(); + DelayedTriggeredAbility delayedAbility = new JaceCunningCastawayDamageTriggeredAbility(); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } } -class ThopterSpyNetwoDamageTriggeredAbility extends DelayedTriggeredAbility { +class JaceCunningCastawayDamageTriggeredAbility extends DelayedTriggeredAbility { List damagedPlayerIds = new ArrayList<>(); - public ThopterSpyNetwoDamageTriggeredAbility() { + public JaceCunningCastawayDamageTriggeredAbility() { super(new DrawDiscardControllerEffect(1, 1), Duration.EndOfTurn, false); } - public ThopterSpyNetwoDamageTriggeredAbility(final ThopterSpyNetwoDamageTriggeredAbility ability) { + public JaceCunningCastawayDamageTriggeredAbility(final JaceCunningCastawayDamageTriggeredAbility ability) { super(ability); } @Override - public ThopterSpyNetwoDamageTriggeredAbility copy() { - return new ThopterSpyNetwoDamageTriggeredAbility(this); + public JaceCunningCastawayDamageTriggeredAbility copy() { + return new JaceCunningCastawayDamageTriggeredAbility(this); } @Override diff --git a/Mage.Sets/src/mage/sets/Ixalan.java b/Mage.Sets/src/mage/sets/Ixalan.java index 689b97b8cb4..c9b9c881f34 100644 --- a/Mage.Sets/src/mage/sets/Ixalan.java +++ b/Mage.Sets/src/mage/sets/Ixalan.java @@ -42,6 +42,8 @@ public class Ixalan extends ExpansionSet { cards.add(new SetCardInfo("Captain Lannery Storm", 136, Rarity.RARE, mage.cards.c.CaptainLanneryStorm.class)); cards.add(new SetCardInfo("Carnage Tyrant", 179, Rarity.MYTHIC, mage.cards.c.CarnageTyrant.class)); cards.add(new SetCardInfo("Castaway's Despair", 281, Rarity.COMMON, mage.cards.c.CastawaysDespair.class)); + cards.add(new SetCardInfo("Conqueror's Foothold", 234, Rarity.RARE, mage.cards.c.ConquerorsFoothold.class)); + cards.add(new SetCardInfo("Conqueror's Galleon", 234, Rarity.RARE, mage.cards.c.ConquerorsGalleon.class)); cards.add(new SetCardInfo("Daring Saboteur", 49, Rarity.RARE, mage.cards.d.DaringSaboteur.class)); cards.add(new SetCardInfo("Deadeye Plunderers", 220, Rarity.UNCOMMON, mage.cards.d.DeadeyePlunderers.class)); cards.add(new SetCardInfo("Deadeye Quartermaster", 50, Rarity.UNCOMMON, mage.cards.d.DeadeyeQuartermaster.class)); diff --git a/Mage/src/main/java/mage/abilities/Gender.java b/Mage/src/main/java/mage/abilities/Gender.java index d7dd334967d..be6f3980065 100644 --- a/Mage/src/main/java/mage/abilities/Gender.java +++ b/Mage/src/main/java/mage/abilities/Gender.java @@ -4,7 +4,7 @@ package mage.abilities; * Created by IGOUDT on 5-3-2017. */ public enum Gender { - MALE("his", "him"), FEMALE("her", "her"); + MALE("his", "him"), FEMALE("her", "her"), NEUTRAL("its", "it"); String personalPronoun; String possesivePronoun; @@ -22,5 +22,4 @@ public enum Gender { return possesivePronoun; } - } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java index 476ae10141e..3a5d55092ae 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java @@ -23,9 +23,12 @@ import mage.players.Player; */ public class ExileAndReturnTransformedSourceEffect extends OneShotEffect { - protected Effect additionalEffect; + public ExileAndReturnTransformedSourceEffect() { + this(Gender.NEUTRAL); + } + public ExileAndReturnTransformedSourceEffect(Gender gender) { this(gender, null); }