From c35a182bf19bda1d552e68a22c700fa5cd6545a8 Mon Sep 17 00:00:00 2001 From: spjspj Date: Tue, 4 Jul 2017 19:00:17 +1000 Subject: [PATCH 1/2] Implement 2 cards (HOU) Fix for Bontu's Last Reckoning --- .../src/mage/cards/b/BontusLastReckoning.java | 56 ++----------- .../src/mage/cards/r/RhonassLastStand.java | 67 +++++++++++++++ .../src/mage/cards/r/RhonassStalwart.java | 83 +++++++++++++++++++ .../src/mage/sets/HourOfDevastation.java | 2 + 4 files changed, 159 insertions(+), 49 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/r/RhonassLastStand.java create mode 100644 Mage.Sets/src/mage/cards/r/RhonassStalwart.java diff --git a/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java b/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java index b8cbfb46d1..8238fb2197 100644 --- a/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java +++ b/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java @@ -27,24 +27,16 @@ */ package mage.cards.b; -import java.util.ArrayList; -import java.util.List; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyAllEffect; -import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; +import mage.constants.Duration; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterCreaturePermanent; -import mage.filter.common.FilterLandPermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.targetpointer.FixedTargets; /** * @@ -57,7 +49,9 @@ public class BontusLastReckoning extends CardImpl { // Destroy all creatures. Lands you control don't untap during your next untap step. this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent())); - this.getSpellAbility().addEffect(new BontusLastReckoningEffect()); + this.getSpellAbility().addEffect(new DontUntapInControllersUntapStepAllEffect( + Duration.UntilYourNextTurn, TargetController.YOU, new FilterControlledLandPermanent("Lands you control")) + .setText("Lands you control don't untap during your next untap phase")); } public BontusLastReckoning(final BontusLastReckoning card) { @@ -69,39 +63,3 @@ public class BontusLastReckoning extends CardImpl { return new BontusLastReckoning(this); } } - -class BontusLastReckoningEffect extends OneShotEffect { - - BontusLastReckoningEffect() { - super(Outcome.Detriment); - this.staticText = "Lands you control don't untap during your next untap step."; - } - - BontusLastReckoningEffect(final BontusLastReckoningEffect effect) { - super(effect); - } - - @Override - public BontusLastReckoningEffect copy() { - return new BontusLastReckoningEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - List doNotUntapNextUntapStep = new ArrayList<>(); - for (Permanent land : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), controller.getId(), game)) { - doNotUntapNextUntapStep.add(land); - } - if (!doNotUntapNextUntapStep.isEmpty()) { - ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("", controller.getId()); - effect.setText("Lands you control don't untap during your next untap step"); - effect.setTargetPointer(new FixedTargets(doNotUntapNextUntapStep, game)); - game.addEffect(effect, source); - } - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/cards/r/RhonassLastStand.java b/Mage.Sets/src/mage/cards/r/RhonassLastStand.java new file mode 100644 index 0000000000..79a8fbd784 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RhonassLastStand.java @@ -0,0 +1,67 @@ +/* + * 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.r; + +import java.util.UUID; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.permanent.token.RhonassLastStandToken; + +/** + * + * @author spjspj + */ +public class RhonassLastStand extends CardImpl { + + public RhonassLastStand(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}{G}"); + + // Create a 5/4 green Snake creature token. + this.getSpellAbility().addEffect(new CreateTokenEffect(new RhonassLastStandToken())); + + // Lands you control don't untap during your next untap step. + this.getSpellAbility().addEffect(new DontUntapInControllersUntapStepAllEffect( + Duration.UntilYourNextTurn, TargetController.YOU, new FilterControlledLandPermanent("Lands you control")) + .setText("Lands you control don't untap during your next untap phase")); + } + + public RhonassLastStand(final RhonassLastStand card) { + super(card); + } + + @Override + public RhonassLastStand copy() { + return new RhonassLastStand(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RhonassStalwart.java b/Mage.Sets/src/mage/cards/r/RhonassStalwart.java new file mode 100644 index 0000000000..fab326242d --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RhonassStalwart.java @@ -0,0 +1,83 @@ +/* + * 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.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesExertSourceTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedByAllTargetEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.ExertAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +/** + * + * @author spjspj + */ +public class RhonassStalwart extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 2 or less"); + + static { + filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3)); + } + + public RhonassStalwart(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // You may exert Rhonas's Stalwart as it attacks. When you do, it gets +1/+1 until end of turn and can't be blocked by creatures with power 2 or less this turn. + Effect effect = new BoostSourceEffect(1, 1, Duration.EndOfTurn); + effect.setText("it gets +1/+1"); + BecomesExertSourceTriggeredAbility ability = new BecomesExertSourceTriggeredAbility(effect); + effect = new CantBeBlockedByAllTargetEffect(filter, Duration.EndOfTurn); + effect.setText("and can't be blocked by creatures with power 2 or less this turn"); + ability.addEffect(effect); + this.addAbility(new ExertAbility(ability)); + } + + public RhonassStalwart(final RhonassStalwart card) { + super(card); + } + + @Override + public RhonassStalwart copy() { + return new RhonassStalwart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/HourOfDevastation.java b/Mage.Sets/src/mage/sets/HourOfDevastation.java index 0849ebfe22..9e5b7637d8 100644 --- a/Mage.Sets/src/mage/sets/HourOfDevastation.java +++ b/Mage.Sets/src/mage/sets/HourOfDevastation.java @@ -142,6 +142,8 @@ public class HourOfDevastation extends ExpansionSet { cards.add(new SetCardInfo("Razaketh's Rite", 74, Rarity.UNCOMMON, mage.cards.r.RazakethsRite.class)); cards.add(new SetCardInfo("Reason // Believe", 154, Rarity.RARE, mage.cards.r.ReasonBelieve.class)); cards.add(new SetCardInfo("Refuse // Cooperate", 156, Rarity.RARE, mage.cards.r.RefuseCooperate.class)); + cards.add(new SetCardInfo("Rhonas's Last Stand", 132, Rarity.RARE, mage.cards.r.RhonassLastStand.class)); + cards.add(new SetCardInfo("Rhonas's Stalwart", 133, Rarity.COMMON, mage.cards.r.RhonassStalwart.class)); cards.add(new SetCardInfo("Riddleform", 43, Rarity.UNCOMMON, mage.cards.r.Riddleform.class)); cards.add(new SetCardInfo("River Hoopoe", 143, Rarity.UNCOMMON, mage.cards.r.RiverHoopoe.class)); cards.add(new SetCardInfo("Ruin Rat", 75, Rarity.COMMON, mage.cards.r.RuinRat.class)); From 495a84f1f1818d0a29c20d1aaa8731357175b8bc Mon Sep 17 00:00:00 2001 From: spjspj Date: Tue, 4 Jul 2017 19:07:17 +1000 Subject: [PATCH 2/2] Implement 2 cards (HOU) Fix for Bontu's Last Reckoning --- .../src/main/resources/card-pictures-tok.txt | 2 + .../token/RhonassLastStandToken.java | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java diff --git a/Mage.Client/src/main/resources/card-pictures-tok.txt b/Mage.Client/src/main/resources/card-pictures-tok.txt index 4792bd5df1..3485187c7d 100644 --- a/Mage.Client/src/main/resources/card-pictures-tok.txt +++ b/Mage.Client/src/main/resources/card-pictures-tok.txt @@ -596,6 +596,8 @@ |Generate|TOK:HOP|Pest|||PestToken| |Generate|TOK:HOP|Saproling|||SaprolingToken| |Generate|TOK:HOU|Insect|||TheLocustGodInsectToken| +|Generate|TOK:HOU|Snake|||RhonassLastStandToken| +|Generate|TOK:HOU|Zombie|| |Generate|TOK:ICE|Caribou|||CaribouToken| |Generate|TOK:INV|Bird|||OwlToken| |Generate|TOK:INV|Elephant|||ElephantToken| diff --git a/Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java b/Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java new file mode 100644 index 0000000000..0fd73334c9 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/RhonassLastStandToken.java @@ -0,0 +1,49 @@ +/* +* 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.game.permanent.token; +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; + +/** + * + * @author spjspj + */ +public class RhonassLastStandToken extends Token { + + public RhonassLastStandToken() { + super("Snake", "5/4 green Snake creature token"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Snake"); + power = new MageInt(5); + toughness = new MageInt(4); + addAbility(TrampleAbility.getInstance()); + } +}