From fd73fd39af3a3bec76379d2929e84ce4c063d629 Mon Sep 17 00:00:00 2001 From: Mark Langen Date: Tue, 4 Apr 2017 17:07:59 -0600 Subject: [PATCH] Addressed Feedback and added cards * Addressed feedback on Pull Request #3053 * Fixed a copy-paste bug in Destined // Lead * Added two new Aftermath Split cards that were revealed today --- .../card/arcane/ModernSplitCardRenderer.java | 14 +-- Mage.Sets/src/mage/cards/d/DestinedLead.java | 17 +-- Mage.Sets/src/mage/cards/o/OnwardVictory.java | 99 ++++++++++++++++ Mage.Sets/src/mage/cards/p/PreparedFight.java | 109 ++++++++++++++++++ Mage.Sets/src/mage/sets/Amonkhet.java | 2 + .../main/java/mage/constants/CardType.java | 12 +- 6 files changed, 218 insertions(+), 35 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/o/OnwardVictory.java create mode 100644 Mage.Sets/src/mage/cards/p/PreparedFight.java diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java b/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java index 5e449b7702..26ed83ca98 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ModernSplitCardRenderer.java @@ -54,18 +54,8 @@ public class ModernSplitCardRenderer extends ModernCardRenderer { rightHalf.name = cardView.getRightSplitName(); leftHalf.name = cardView.getLeftSplitName(); - for (String rule: view.getRules()) { - if (rule.contains("Fuse")) { - isFuse = true; - break; - } - } - for (String rule: view.getRightSplitRules()) { - if (rule.contains("Aftermath")) { - isAftermath = true; - break; - } - } + isFuse = view.getRules().stream().anyMatch(rule -> rule.contains("Fuse")); + isAftermath = view.getRightSplitRules().stream().anyMatch(rule -> rule.contains("Aftermath")); // It's easier for rendering to swap the card halves here because for aftermath cards // they "rotate" in opposite directions making consquence and normal split cards diff --git a/Mage.Sets/src/mage/cards/d/DestinedLead.java b/Mage.Sets/src/mage/cards/d/DestinedLead.java index 44c708b8bc..b780891460 100644 --- a/Mage.Sets/src/mage/cards/d/DestinedLead.java +++ b/Mage.Sets/src/mage/cards/d/DestinedLead.java @@ -28,34 +28,19 @@ package mage.cards.d; -import mage.abilities.Ability; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.*; import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.AftermathAbility; import mage.abilities.keyword.IndestructibleAbility; -import mage.abilities.keyword.LifelinkAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.filter.Filter; -import mage.filter.FilterCard; -import mage.filter.common.FilterCreatureCard; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.PowerPredicate; -import mage.game.Game; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import java.util.Set; import java.util.UUID; /** @@ -76,7 +61,7 @@ public class DestinedLead extends SplitCard { effect.setText("Target creature gets +1/+0"); getLeftHalfCard().getSpellAbility().addEffect(effect); - effect = new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn); + effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn); effect.setText("and gains indestructible until end of turn"); getLeftHalfCard().getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/o/OnwardVictory.java b/Mage.Sets/src/mage/cards/o/OnwardVictory.java new file mode 100644 index 0000000000..3dc2f5b1a1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OnwardVictory.java @@ -0,0 +1,99 @@ +/* + * 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.o; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.*; +import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.AftermathAbility; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.Set; +import java.util.UUID; + +/** + * + * @author stravant + */ + + +public class OnwardVictory extends SplitCard { + + public OnwardVictory(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY},"{2}{R}","{2}{W}",false); + + // Onward + // Target creature gets +X/+0 until end of turn where X is its power. + getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); + getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true)); + + // to + + // Victory + // Target creature gains double strike until end of turn. + ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + Effect effect = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn); + getRightHalfCard().getSpellAbility().addEffect(effect); + getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public OnwardVictory(final OnwardVictory card) { + super(card); + } + + @Override + public OnwardVictory copy() { + return new OnwardVictory(this); + } +} + diff --git a/Mage.Sets/src/mage/cards/p/PreparedFight.java b/Mage.Sets/src/mage/cards/p/PreparedFight.java new file mode 100644 index 0000000000..386fed956c --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PreparedFight.java @@ -0,0 +1,109 @@ +/* + * 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.p; + +import mage.abilities.Ability; +import mage.abilities.condition.common.OpponentControlsPermanentCondition; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.*; +import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.AftermathAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.*; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.Set; +import java.util.UUID; + +/** + * + * @author stravant + */ + + +public class PreparedFight extends SplitCard { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + } + + public PreparedFight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY},"{1}{W}","{3}{G}",false); + + // Prepared + // Untap target creature. It gets +2/+2 and gains lifelink until end of turn. + getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); + Effect effect = new UntapTargetEffect(); + effect.setText("Untap target creature."); + getLeftHalfCard().getSpellAbility().addEffect(effect); + effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); + effect.setText("It gets +2/+2"); + getLeftHalfCard().getSpellAbility().addEffect(effect); + effect = new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains lifelink until end of turn."); + getLeftHalfCard().getSpellAbility().addEffect(effect); + + // to + + // Fight + // Target creature you control fights target creature you don't control. + ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + getRightHalfCard().getSpellAbility().addEffect(new FightTargetsEffect()); + getRightHalfCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + Target target = new TargetCreaturePermanent(filter); + getRightHalfCard().getSpellAbility().addTarget(target); + } + + public PreparedFight(final PreparedFight card) { + super(card); + } + + @Override + public PreparedFight copy() { + return new PreparedFight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Amonkhet.java b/Mage.Sets/src/mage/sets/Amonkhet.java index d449648cde..d485a52634 100644 --- a/Mage.Sets/src/mage/sets/Amonkhet.java +++ b/Mage.Sets/src/mage/sets/Amonkhet.java @@ -54,5 +54,7 @@ public class Amonkhet extends ExpansionSet { this.ratioBoosterMythic = 8; cards.add(new SetCardInfo("Dusk // Dawn", 210, Rarity.RARE, mage.cards.d.DuskDawn.class)); cards.add(new SetCardInfo("Destined // Lead", 217, Rarity.UNCOMMON, mage.cards.d.DestinedLead.class)); + cards.add(new SetCardInfo("Onward // Victory", 218, Rarity.UNCOMMON, mage.cards.o.OnwardVictory.class)); + cards.add(new SetCardInfo("Prepared // Fight", 220, Rarity.RARE, mage.cards.p.PreparedFight.class)); } } diff --git a/Mage/src/main/java/mage/constants/CardType.java b/Mage/src/main/java/mage/constants/CardType.java index 337febbb50..29e19bc8cb 100644 --- a/Mage/src/main/java/mage/constants/CardType.java +++ b/Mage/src/main/java/mage/constants/CardType.java @@ -1,5 +1,7 @@ package mage.constants; +import java.util.Arrays; +import java.util.EnumSet; import java.util.HashSet; /** @@ -33,13 +35,9 @@ public enum CardType { * Duplicates are eliminated. */ public static CardType[] mergeTypes(CardType[] a, CardType[] b) { - HashSet cardTypes = new HashSet<>(); - for (CardType t: a) { - cardTypes.add(t); - } - for (CardType t: b) { - cardTypes.add(t); - } + EnumSet cardTypes = EnumSet.noneOf(CardType.class); + cardTypes.addAll(Arrays.asList(a)); + cardTypes.addAll(Arrays.asList(b)); return cardTypes.toArray(new CardType[0]); }