From ed341528d99949688eb26e441858fe3ff9cb7deb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 16 Apr 2017 22:57:08 +0200 Subject: [PATCH] [AKH] Fixed that Aftermath card images were shown wrongly rotated. --- .../dl/sources/MythicspoilerComSource.java | 12 +--- Mage.Common/src/mage/view/CardView.java | 71 ++++++++++--------- .../java/mage/player/ai/ComputerPlayer.java | 10 +-- .../src/mage/player/human/HumanPlayer.java | 53 +++++++------- Mage.Sets/src/mage/cards/a/AliveWell.java | 6 +- .../src/mage/cards/a/ArmedDangerous.java | 15 ++-- .../src/mage/cards/a/AssaultBattery.java | 13 +--- Mage.Sets/src/mage/cards/b/BeckCall.java | 6 +- Mage.Sets/src/mage/cards/b/BoomBust.java | 6 +- .../src/mage/cards/b/BoundDetermined.java | 6 +- .../src/mage/cards/b/BreakingEntering.java | 6 +- Mage.Sets/src/mage/cards/c/CatchRelease.java | 10 +-- Mage.Sets/src/mage/cards/c/CommitMemory.java | 5 +- .../src/mage/cards/c/CrimePunishment.java | 26 ++++--- Mage.Sets/src/mage/cards/c/CutRibbons.java | 7 +- Mage.Sets/src/mage/cards/d/DeadGone.java | 7 +- Mage.Sets/src/mage/cards/d/DestinedLead.java | 17 ++--- Mage.Sets/src/mage/cards/d/DownDirty.java | 13 +--- Mage.Sets/src/mage/cards/d/DuskDawn.java | 22 +++--- Mage.Sets/src/mage/cards/f/FailureComply.java | 18 ++--- Mage.Sets/src/mage/cards/f/FarAway.java | 13 +--- Mage.Sets/src/mage/cards/f/FireIce.java | 13 +--- Mage.Sets/src/mage/cards/f/FleshBlood.java | 17 ++--- Mage.Sets/src/mage/cards/g/GiveTake.java | 6 +- Mage.Sets/src/mage/cards/h/HeavenEarth.java | 3 +- Mage.Sets/src/mage/cards/h/HideSeek.java | 4 +- Mage.Sets/src/mage/cards/h/HitRun.java | 3 +- .../src/mage/cards/i/IllusionReality.java | 4 +- Mage.Sets/src/mage/cards/i/InsultInjury.java | 17 ++--- Mage.Sets/src/mage/cards/l/LifeDeath.java | 3 +- Mage.Sets/src/mage/cards/m/MouthFeed.java | 15 ++-- Mage.Sets/src/mage/cards/n/NeverReturn.java | 5 +- Mage.Sets/src/mage/cards/n/NightDay.java | 9 ++- Mage.Sets/src/mage/cards/o/OddsEnds.java | 15 ++-- Mage.Sets/src/mage/cards/o/OnwardVictory.java | 17 ++--- Mage.Sets/src/mage/cards/o/OrderChaos.java | 12 +--- Mage.Sets/src/mage/cards/p/PainSuffering.java | 7 +- .../{PreparedFight.java => PrepareFight.java} | 36 +++------- Mage.Sets/src/mage/cards/p/ProfitLoss.java | 18 ++--- Mage.Sets/src/mage/cards/p/ProtectServe.java | 18 ++--- Mage.Sets/src/mage/cards/p/PureSimple.java | 3 +- Mage.Sets/src/mage/cards/r/RagsRiches.java | 14 ++-- Mage.Sets/src/mage/cards/r/ReadyWilling.java | 12 ++-- Mage.Sets/src/mage/cards/r/ReduceRubble.java | 5 +- .../src/mage/cards/r/ResearchDevelopment.java | 12 ++-- Mage.Sets/src/mage/cards/r/RiseFall.java | 5 +- Mage.Sets/src/mage/cards/r/RoughTumble.java | 4 +- Mage.Sets/src/mage/cards/s/SpiteMalice.java | 15 ++-- Mage.Sets/src/mage/cards/s/SpringMind.java | 5 +- Mage.Sets/src/mage/cards/s/StandDeliver.java | 3 +- Mage.Sets/src/mage/cards/s/StartFinish.java | 5 +- Mage.Sets/src/mage/cards/s/SupplyDemand.java | 3 +- Mage.Sets/src/mage/cards/t/ToilTrouble.java | 13 +--- Mage.Sets/src/mage/cards/t/TrialError.java | 3 +- Mage.Sets/src/mage/cards/t/TurnBurn.java | 6 +- Mage.Sets/src/mage/cards/w/WaxWane.java | 3 +- Mage.Sets/src/mage/cards/w/WearTear.java | 5 +- Mage.Sets/src/mage/sets/Amonkhet.java | 2 +- .../java/mage/abilities/SpellAbility.java | 21 +++--- .../abilities/keyword/AftermathAbility.java | 20 +++--- Mage/src/main/java/mage/cards/SplitCard.java | 18 +++-- .../java/mage/cards/mock/MockSplitCard.java | 13 +++- .../java/mage/cards/repository/CardInfo.java | 16 ++++- .../mage/cards/repository/CardRepository.java | 6 +- .../java/mage/constants/SpellAbilityType.java | 1 + .../main/java/mage/players/PlayerImpl.java | 5 +- 66 files changed, 356 insertions(+), 426 deletions(-) rename Mage.Sets/src/mage/cards/p/{PreparedFight.java => PrepareFight.java} (79%) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java index 385189a2fb5..47661ee8d41 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java @@ -93,7 +93,6 @@ public class MythicspoilerComSource implements CardImageSource { cardNameAliases.put("AKH-illusorywrappins", "illusorywrappings"); cardNameAliases.put("AKH-reducerumble", "reducerubble"); cardNameAliases.put("AKH-forsakethewordly", "forsaketheworldly"); - cardNameAliases.put("AKH-preparefight", "preparedfight"); cardNameAliases.put("AKH-kefnatsmonument", "kefnetsmonument"); cardNameAliasesStart = new HashMap<>(); @@ -184,14 +183,9 @@ public class MythicspoilerComSource implements CardImageSource { if (cardNameAliases.containsKey(cardSet + '-' + cardName)) { cardName = cardNameAliases.get(cardSet + '-' + cardName); } else if (cardName.endsWith("1") || cardName.endsWith("2") || cardName.endsWith("3") || cardName.endsWith("4") || cardName.endsWith("5")) { - if (!cardName.startsWith("forest") - && !cardName.startsWith("swamp") - && !cardName.startsWith("mountain") - && !cardName.startsWith("island") - && !cardName.startsWith("plains")) { - - cardName = cardName.substring(0, cardName.length() - 1); - } + cardName = cardName.substring(0, cardName.length() - 1); + } else if (cardName.endsWith("promo")) { + cardName = cardName.substring(0, cardName.length() - 5); } pageLinks.put(cardName, baseUrl + cardLink); } diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index 56ff4a213eb..8b567d89da8 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -27,6 +27,7 @@ */ package mage.view; +import java.util.*; import mage.MageObject; import mage.ObjectColor; import mage.abilities.Abilities; @@ -50,8 +51,6 @@ import mage.game.stack.StackAbility; import mage.target.Target; import mage.target.Targets; -import java.util.*; - /** * @author BetaSteward_at_googlemail.com */ @@ -219,8 +218,8 @@ public class CardView extends SimpleCardView { * @param card * @param game * @param controlled is the card view created for the card controller - used - * for morph / face down cards to know which player may see information for - * the card + * for morph / face down cards to know which player may see information for + * the card */ public CardView(Card card, Game game, boolean controlled) { this(card, game, controlled, false, false); @@ -246,12 +245,12 @@ public class CardView extends SimpleCardView { /** * @param card * @param game - * @param controlled is the card view created for the card controller - used - * for morph / face down cards to know which player may see information for - * the card + * @param controlled is the card view created for the card controller - used + * for morph / face down cards to know which player may see information for + * the card * @param showFaceDownCard if true and the card is not on the battlefield, - * also a face down card is shown in the view, face down cards will be shown - * @param storeZone if true the card zone will be set in the zone attribute. + * also a face down card is shown in the view, face down cards will be shown + * @param storeZone if true the card zone will be set in the zone attribute. */ public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard, boolean storeZone) { super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.getTokenSetCode(), game != null, card.getTokenDescriptor()); @@ -303,13 +302,17 @@ public class CardView extends SimpleCardView { SplitCard splitCard = null; if (card.isSplitCard()) { splitCard = (SplitCard) card; - rotate = true; + rotate = (((SplitCard) card).getSpellAbility().getSpellAbilityType()) != SpellAbilityType.SPLIT_AFTERMATH; } else if (card instanceof Spell) { switch (((Spell) card).getSpellAbility().getSpellAbilityType()) { case SPLIT_FUSED: splitCard = (SplitCard) ((Spell) card).getCard(); rotate = true; break; + case SPLIT_AFTERMATH: + splitCard = (SplitCard) ((Spell) card).getCard(); + rotate = false; + break; case SPLIT_LEFT: case SPLIT_RIGHT: rotate = true; @@ -430,23 +433,19 @@ public class CardView extends SimpleCardView { // Needs a special art rect if (ty == SpellAbilityType.SPLIT_FUSED) { artRect = ArtRect.SPLIT_FUSED; - } else { - if (spell.getCard() != null) { - SplitCard wholeCard = ((SplitCardHalf) spell.getCard()).getParentCard(); - Abilities aftermathHalfAbilities = wholeCard.getRightHalfCard().getAbilities(); - if (aftermathHalfAbilities.stream().anyMatch(ability -> ability instanceof AftermathAbility)) { - if (ty == SpellAbilityType.SPLIT_RIGHT) { - artRect = ArtRect.AFTERMATH_BOTTOM; - } else { - artRect = ArtRect.AFTERMATH_TOP; - } + } else if (spell.getCard() != null) { + SplitCard wholeCard = ((SplitCardHalf) spell.getCard()).getParentCard(); + Abilities aftermathHalfAbilities = wholeCard.getRightHalfCard().getAbilities(); + if (aftermathHalfAbilities.stream().anyMatch(ability -> ability instanceof AftermathAbility)) { + if (ty == SpellAbilityType.SPLIT_RIGHT) { + artRect = ArtRect.AFTERMATH_BOTTOM; } else { - if (ty == SpellAbilityType.SPLIT_RIGHT) { - artRect = ArtRect.SPLIT_RIGHT; - } else { - artRect = ArtRect.SPLIT_LEFT; - } + artRect = ArtRect.AFTERMATH_TOP; } + } else if (ty == SpellAbilityType.SPLIT_RIGHT) { + artRect = ArtRect.SPLIT_RIGHT; + } else { + artRect = ArtRect.SPLIT_LEFT; } } } @@ -964,13 +963,21 @@ public class CardView extends SimpleCardView { } public String getColorText() { - if (getColor().getColorCount() == 0) return "Colorless"; - else if (getColor().getColorCount() > 1) return "Gold"; - else if (getColor().isBlack()) return "Black"; - else if (getColor().isBlue()) return "Blue"; - else if (getColor().isWhite()) return "White"; - else if (getColor().isGreen()) return "Green"; - else if (getColor().isRed()) return "Red"; + if (getColor().getColorCount() == 0) { + return "Colorless"; + } else if (getColor().getColorCount() > 1) { + return "Gold"; + } else if (getColor().isBlack()) { + return "Black"; + } else if (getColor().isBlue()) { + return "Blue"; + } else if (getColor().isWhite()) { + return "White"; + } else if (getColor().isGreen()) { + return "Green"; + } else if (getColor().isRed()) { + return "Red"; + } return ""; } diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 96bcfa274e0..4fe28205543 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -27,6 +27,10 @@ */ package mage.player.ai; +import java.io.IOException; +import java.io.Serializable; +import java.util.*; +import java.util.Map.Entry; import mage.MageObject; import mage.Mana; import mage.abilities.*; @@ -77,11 +81,6 @@ import mage.util.TournamentUtil; import mage.util.TreeNode; import org.apache.log4j.Logger; -import java.io.IOException; -import java.io.Serializable; -import java.util.*; -import java.util.Map.Entry; - /** * * suitable for two player games and some multiplayer games @@ -1480,6 +1479,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { switch (ability.getSpellAbilityType()) { case SPLIT: case SPLIT_FUSED: + case SPLIT_AFTERMATH: MageObject object = game.getObject(ability.getSourceId()); if (object != null) { LinkedHashMap useableAbilities = getSpellAbilities(object, game.getState().getZone(object.getId()), game); diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 20447819971..38b239cb6e8 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -27,6 +27,8 @@ */ package mage.player.human; +import java.io.Serializable; +import java.util.*; import mage.MageObject; import mage.abilities.*; import mage.abilities.costs.VariableCost; @@ -42,6 +44,8 @@ import mage.cards.decks.Deck; import mage.choices.Choice; import mage.choices.ChoiceImpl; import mage.constants.*; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterBlockingCreature; import mage.filter.common.FilterCreatureForCombat; @@ -70,12 +74,6 @@ import mage.util.ManaUtil; import mage.util.MessageToClient; import org.apache.log4j.Logger; -import java.io.Serializable; -import java.util.*; - -import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; -import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; - /** * * @author BetaSteward_at_googlemail.com @@ -300,7 +298,7 @@ public class HumanPlayer extends PlayerImpl { public boolean choose(Outcome outcome, Target target, UUID sourceId, Game game, Map options) { updateGameStatePriority("choose(5)", game); UUID abilityControllerId = playerId; - if (target.getTargetController() != null + if (target.getTargetController() != null && target.getAbilityController() != null) { abilityControllerId = target.getAbilityController(); } @@ -309,7 +307,7 @@ public class HumanPlayer extends PlayerImpl { } while (!abort) { Set targetIds = target.possibleTargets(sourceId, abilityControllerId, game); - if (targetIds == null + if (targetIds == null || targetIds.isEmpty()) { return target.getTargets().size() >= target.getNumberOfTargets(); } @@ -381,7 +379,7 @@ public class HumanPlayer extends PlayerImpl { while (!abort) { Set possibleTargets = target.possibleTargets(source == null ? null : source.getSourceId(), abilityControllerId, game); boolean required = target.isRequired(source != null ? source.getSourceId() : null, game); - if (possibleTargets.isEmpty() + if (possibleTargets.isEmpty() || target.getTargets().size() >= target.getNumberOfTargets()) { required = false; } @@ -417,7 +415,7 @@ public class HumanPlayer extends PlayerImpl { if (options == null) { options = new HashMap<>(); } - if (target.getTargets().size() >= target.getNumberOfTargets() + if (target.getTargets().size() >= target.getNumberOfTargets() && !options.containsKey("UI.right.btn.text")) { options.put("UI.right.btn.text", "Done"); } @@ -571,13 +569,13 @@ public class HumanPlayer extends PlayerImpl { } } if (getJustActivatedType() != null && !holdingPriority) { - if (controllingPlayer.getUserData().isPassPriorityCast() + if (controllingPlayer.getUserData().isPassPriorityCast() && getJustActivatedType() == AbilityType.SPELL) { setJustActivatedType(null); pass(game); return false; } - if (controllingPlayer.getUserData().isPassPriorityActivation() + if (controllingPlayer.getUserData().isPassPriorityActivation() && getJustActivatedType() == AbilityType.ACTIVATED) { setJustActivatedType(null); pass(game); @@ -585,7 +583,7 @@ public class HumanPlayer extends PlayerImpl { } } if (isGameUnderControl()) { // Use the skip actions only if the player itself controls its turn - if (passedAllTurns + if (passedAllTurns || passedTurnSkipStack) { if (passWithManaPoolCheck(game)) { return false; @@ -609,18 +607,18 @@ public class HumanPlayer extends PlayerImpl { if (game.getStack().isEmpty()) { passedUntilStackResolved = false; boolean dontCheckPassStep = false; - if (passedTurn + if (passedTurn || passedTurnSkipStack) { if (passWithManaPoolCheck(game)) { return false; } } if (passedUntilNextMain) { - if (game.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN + if (game.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN || game.getTurn().getStepType() == PhaseStep.PRECOMBAT_MAIN) { // it's a main phase - if (!skippedAtLeastOnce - || (!playerId.equals(game.getActivePlayerId()) + if (!skippedAtLeastOnce + || (!playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllMainPhases())) { skippedAtLeastOnce = true; if (passWithManaPoolCheck(game)) { @@ -640,8 +638,8 @@ public class HumanPlayer extends PlayerImpl { if (passedUntilEndOfTurn) { if (game.getTurn().getStepType() == PhaseStep.END_TURN) { // It's end of turn phase - if (!skippedAtLeastOnce - || (playerId.equals(game.getActivePlayerId()) + if (!skippedAtLeastOnce + || (playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllEndPhases())) { skippedAtLeastOnce = true; if (passWithManaPoolCheck(game)) { @@ -658,7 +656,7 @@ public class HumanPlayer extends PlayerImpl { } } } - if (!dontCheckPassStep + if (!dontCheckPassStep && checkPassStep(game, controllingPlayer)) { if (passWithManaPoolCheck(game)) { return false; @@ -683,7 +681,7 @@ public class HumanPlayer extends PlayerImpl { if (game.executingRollback()) { return true; } - if (response.getBoolean() != null + if (response.getBoolean() != null || response.getInteger() != null) { if (passWithManaPoolCheck(game)) { return false; @@ -694,7 +692,7 @@ public class HumanPlayer extends PlayerImpl { break; } - if (response.getString() != null + if (response.getString() != null && response.getString().equals("special")) { specialAction(game); } else if (response.getUUID() != null) { @@ -716,7 +714,7 @@ public class HumanPlayer extends PlayerImpl { } if (actingPlayer != null) { LinkedHashMap useableAbilities = actingPlayer.getUseableActivatedAbilities(object, zone, game); - if (useableAbilities != null + if (useableAbilities != null && !useableAbilities.isEmpty()) { activateAbility(useableAbilities, object, game); result = true; @@ -786,7 +784,7 @@ public class HumanPlayer extends PlayerImpl { if (abilitiesWithNoOrderSet.isEmpty()) { return abilityOrderLast; } - if (abilitiesWithNoOrderSet.size() == 1 + if (abilitiesWithNoOrderSet.size() == 1 || autoOrderUse) { return abilitiesWithNoOrderSet.iterator().next(); } @@ -824,7 +822,7 @@ public class HumanPlayer extends PlayerImpl { return false; } else if (response.getUUID() != null) { playManaAbilities(abilityToCast, unpaid, game); - } else if (response.getString() != null + } else if (response.getString() != null && response.getString().equals("special")) { if (unpaid instanceof ManaCostsImpl) { specialManaAction(unpaid, game); @@ -856,9 +854,9 @@ public class HumanPlayer extends PlayerImpl { do { game.fireGetAmountEvent(playerId, message, min, max); waitForResponse(game); - } while (response.getInteger() == null + } while (response.getInteger() == null && !abort); - if (response != null + if (response != null && response.getInteger() != null) { xValue = response.getInteger(); } @@ -1322,6 +1320,7 @@ public class HumanPlayer extends PlayerImpl { switch (ability.getSpellAbilityType()) { case SPLIT: case SPLIT_FUSED: + case SPLIT_AFTERMATH: MageObject object = game.getObject(ability.getSourceId()); if (object != null) { LinkedHashMap useableAbilities = getSpellAbilities(object, game.getState().getZone(object.getId()), game); diff --git a/Mage.Sets/src/mage/cards/a/AliveWell.java b/Mage.Sets/src/mage/cards/a/AliveWell.java index 5a68720e036..4021b15315a 100644 --- a/Mage.Sets/src/mage/cards/a/AliveWell.java +++ b/Mage.Sets/src/mage/cards/a/AliveWell.java @@ -27,6 +27,7 @@ */ package mage.cards.a; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -34,13 +35,12 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.permanent.token.CentaurToken; import mage.players.Player; -import java.util.UUID; - /** * * @author LevelX2 @@ -48,7 +48,7 @@ import java.util.UUID; public class AliveWell extends SplitCard { public AliveWell(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}", "{W}", true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}", "{W}", SpellAbilityType.SPLIT_FUSED); // Alive // Create a 3/3 green Centaur creature token. diff --git a/Mage.Sets/src/mage/cards/a/ArmedDangerous.java b/Mage.Sets/src/mage/cards/a/ArmedDangerous.java index 7b6dcf3af85..d7097779df2 100644 --- a/Mage.Sets/src/mage/cards/a/ArmedDangerous.java +++ b/Mage.Sets/src/mage/cards/a/ArmedDangerous.java @@ -25,9 +25,9 @@ * 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.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; @@ -36,24 +36,17 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - -/** - * - * @author LevelX2 - */ - - public class ArmedDangerous extends SplitCard { public ArmedDangerous(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}","{3}{G}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}", "{3}{G}", SpellAbilityType.SPLIT_FUSED); // Armed // Target creature gets +1/+1 and gains double strike until end of turn. - getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(1,1, Duration.EndOfTurn)); + getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn)); getLeftHalfCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn)); getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/a/AssaultBattery.java b/Mage.Sets/src/mage/cards/a/AssaultBattery.java index 09adaa9431c..edc35131005 100644 --- a/Mage.Sets/src/mage/cards/a/AssaultBattery.java +++ b/Mage.Sets/src/mage/cards/a/AssaultBattery.java @@ -25,30 +25,23 @@ * 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.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.game.permanent.token.ElephantToken; import mage.target.common.TargetCreatureOrPlayer; -import java.util.UUID; - -/** - * - * @author LevelX2 - */ - - public class AssaultBattery extends SplitCard { public AssaultBattery(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}","{3}{G}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}", "{3}{G}", SpellAbilityType.SPLIT); // Assault // Assault deals 2 damage to target creature or player. diff --git a/Mage.Sets/src/mage/cards/b/BeckCall.java b/Mage.Sets/src/mage/cards/b/BeckCall.java index 23c405148de..b0e823795c4 100644 --- a/Mage.Sets/src/mage/cards/b/BeckCall.java +++ b/Mage.Sets/src/mage/cards/b/BeckCall.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -35,6 +36,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -42,12 +44,10 @@ import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.BirdToken; -import java.util.UUID; - public class BeckCall extends SplitCard { public BeckCall(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}{U}","{4}{W}{U}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}{U}", "{4}{W}{U}", SpellAbilityType.SPLIT_FUSED); // Beck // Whenever a creature enters the battlefield this turn, you may draw a card. diff --git a/Mage.Sets/src/mage/cards/b/BoomBust.java b/Mage.Sets/src/mage/cards/b/BoomBust.java index d34e28e3563..7edf763ed8d 100644 --- a/Mage.Sets/src/mage/cards/b/BoomBust.java +++ b/Mage.Sets/src/mage/cards/b/BoomBust.java @@ -27,19 +27,19 @@ */ package mage.cards.b; +import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.constants.TargetController; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; -import java.util.UUID; - public class BoomBust extends SplitCard { private static final FilterLandPermanent filter1 = new FilterLandPermanent("land you control"); @@ -51,7 +51,7 @@ public class BoomBust extends SplitCard { } public BoomBust(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}","{5}{R}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}", "{5}{R}", SpellAbilityType.SPLIT); // Boom // Destroy target land you control and target land you don't control. diff --git a/Mage.Sets/src/mage/cards/b/BoundDetermined.java b/Mage.Sets/src/mage/cards/b/BoundDetermined.java index 10964581fec..f70f4127ac0 100644 --- a/Mage.Sets/src/mage/cards/b/BoundDetermined.java +++ b/Mage.Sets/src/mage/cards/b/BoundDetermined.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; @@ -40,6 +41,7 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.FilterSpell; @@ -53,8 +55,6 @@ import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledPermanent; -import java.util.UUID; - /** * * @author LevelX2 @@ -68,7 +68,7 @@ public class BoundDetermined extends SplitCard { } public BoundDetermined(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{B}{G}","{G}{U}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}{G}", "{G}{U}", SpellAbilityType.SPLIT); // Bound // Sacrifice a creature. Return up to X cards from your graveyard to your hand, where X is the number of colors that creature was. Exile this card. diff --git a/Mage.Sets/src/mage/cards/b/BreakingEntering.java b/Mage.Sets/src/mage/cards/b/BreakingEntering.java index 5d0e70353e8..3f2cb0e954e 100644 --- a/Mage.Sets/src/mage/cards/b/BreakingEntering.java +++ b/Mage.Sets/src/mage/cards/b/BreakingEntering.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; @@ -39,6 +40,7 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; @@ -48,12 +50,10 @@ import mage.target.TargetPlayer; import mage.target.common.TargetCardInGraveyard; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - public class BreakingEntering extends SplitCard { public BreakingEntering(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{U}{B}","{4}{B}{R}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{B}", "{4}{B}{R}", SpellAbilityType.SPLIT_FUSED); // Breaking // Target player puts the top eight cards of his or her library into his or her graveyard. diff --git a/Mage.Sets/src/mage/cards/c/CatchRelease.java b/Mage.Sets/src/mage/cards/c/CatchRelease.java index 2fba82fa900..6b7f771e430 100644 --- a/Mage.Sets/src/mage/cards/c/CatchRelease.java +++ b/Mage.Sets/src/mage/cards/c/CatchRelease.java @@ -27,6 +27,9 @@ */ package mage.cards.c; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -39,6 +42,7 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.filter.FilterPermanent; import mage.filter.common.*; import mage.game.Game; @@ -48,14 +52,10 @@ import mage.target.Target; import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - public class CatchRelease extends SplitCard { public CatchRelease(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}{R}","{4}{R}{W}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{R}", "{4}{R}{W}", SpellAbilityType.SPLIT_FUSED); // Catch // Gain control of target permanent until end of turn. Untap it. It gains haste until end of turn. diff --git a/Mage.Sets/src/mage/cards/c/CommitMemory.java b/Mage.Sets/src/mage/cards/c/CommitMemory.java index 44dd82778b0..dcd63f6ed8e 100644 --- a/Mage.Sets/src/mage/cards/c/CommitMemory.java +++ b/Mage.Sets/src/mage/cards/c/CommitMemory.java @@ -39,6 +39,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.common.FilterSpellOrPermanent; import mage.filter.predicate.Predicates; @@ -62,7 +63,7 @@ public class CommitMemory extends SplitCard { } public CommitMemory(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{3}{U}", "{4}{U}{U}", false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{3}{U}", "{4}{U}{U}", SpellAbilityType.SPLIT_AFTERMATH); // Commit // Put target spell or nonland permanent into its owner's library second from the top. @@ -72,7 +73,7 @@ public class CommitMemory extends SplitCard { // Memory // Aftermath // Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); getRightHalfCard().getSpellAbility().addEffect(new MemoryEffect()); Effect effect = new DrawCardAllEffect(7); effect.setText(", then draws seven cards"); diff --git a/Mage.Sets/src/mage/cards/c/CrimePunishment.java b/Mage.Sets/src/mage/cards/c/CrimePunishment.java index d301d9426de..39788d32728 100644 --- a/Mage.Sets/src/mage/cards/c/CrimePunishment.java +++ b/Mage.Sets/src/mage/cards/c/CrimePunishment.java @@ -25,9 +25,9 @@ * 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.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; @@ -35,6 +35,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -42,20 +43,17 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCardInOpponentsGraveyard; -import java.util.UUID; - - - public class CrimePunishment extends SplitCard { - + private static final FilterCard filter = new FilterCard("creature or enchantment card from an opponent's graveyard"); + static { filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), - new CardTypePredicate(CardType.ENCHANTMENT))); + new CardTypePredicate(CardType.ENCHANTMENT))); } public CrimePunishment(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{W}{B}","{X}{B}{G}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{B}", "{X}{B}{G}", SpellAbilityType.SPLIT); // Crime // Put target creature or enchantment card from an opponent's graveyard onto the battlefield under your control. @@ -79,29 +77,29 @@ public class CrimePunishment extends SplitCard { } class PunishmentEffect extends OneShotEffect { - + PunishmentEffect() { super(Outcome.DestroyPermanent); this.staticText = "Destroy each artifact, creature, and enchantment with converted mana cost X"; } - + PunishmentEffect(final PunishmentEffect effect) { super(effect); } - + @Override public PunishmentEffect copy() { return new PunishmentEffect(this); } - + @Override public boolean apply(Game game, Ability source) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (permanent != null && permanent.getConvertedManaCost() == source.getManaCostsToPay().getX() && (permanent.isArtifact() - || permanent.isCreature() - || permanent.isEnchantment())) { + || permanent.isCreature() + || permanent.isEnchantment())) { permanent.destroy(source.getSourceId(), game, false); } } diff --git a/Mage.Sets/src/mage/cards/c/CutRibbons.java b/Mage.Sets/src/mage/cards/c/CutRibbons.java index 551324b99be..30abdaf1aaa 100644 --- a/Mage.Sets/src/mage/cards/c/CutRibbons.java +++ b/Mage.Sets/src/mage/cards/c/CutRibbons.java @@ -1,5 +1,6 @@ package mage.cards.c; +import java.util.UUID; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.LoseLifeOpponentsEffect; @@ -8,17 +9,16 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * @author Stravant */ public class CutRibbons extends SplitCard { public CutRibbons(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}", "{X}{B}{B}", false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.SORCERY}, "{1}{R}", "{X}{B}{B}", SpellAbilityType.SPLIT_AFTERMATH); // Cut // Cut deals 4 damage to target creature. @@ -26,7 +26,6 @@ public class CutRibbons extends SplitCard { getLeftHalfCard().getSpellAbility().addEffect(new DamageTargetEffect(4)); // to - // Ribbons // Each opponent loses X life. ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); diff --git a/Mage.Sets/src/mage/cards/d/DeadGone.java b/Mage.Sets/src/mage/cards/d/DeadGone.java index 560348b79bf..22eabe88201 100644 --- a/Mage.Sets/src/mage/cards/d/DeadGone.java +++ b/Mage.Sets/src/mage/cards/d/DeadGone.java @@ -1,30 +1,31 @@ package mage.cards.d; +import java.util.UUID; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.Card; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.constants.TargetController; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * @author dustinconrad */ public class DeadGone extends SplitCard { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); + static { filter.add(new ControllerPredicate(TargetController.NOT_YOU)); } public DeadGone(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}","{2}{R}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}", "{2}{R}", SpellAbilityType.SPLIT); // Dead // Dead deals 2 damage to target creature. diff --git a/Mage.Sets/src/mage/cards/d/DestinedLead.java b/Mage.Sets/src/mage/cards/d/DestinedLead.java index b7808914601..18824517760 100644 --- a/Mage.Sets/src/mage/cards/d/DestinedLead.java +++ b/Mage.Sets/src/mage/cards/d/DestinedLead.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.d; +import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; @@ -39,20 +39,13 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - -/** - * - * @author stravant - */ - - public class DestinedLead extends SplitCard { public DestinedLead(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY},"{1}{B}","{3}{G}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{1}{B}", "{3}{G}", SpellAbilityType.SPLIT_AFTERMATH); // Destined // Target creature gets +1/+0 and gains indestructible until end of turn. @@ -66,10 +59,9 @@ public class DestinedLead extends SplitCard { getLeftHalfCard().getSpellAbility().addEffect(effect); // to - // Lead // All creatures able to block target creature this turn must do so. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); getRightHalfCard().getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn)); } @@ -83,4 +75,3 @@ public class DestinedLead extends SplitCard { return new DestinedLead(this); } } - diff --git a/Mage.Sets/src/mage/cards/d/DownDirty.java b/Mage.Sets/src/mage/cards/d/DownDirty.java index 1aedbb3d31f..fe4c76ced15 100644 --- a/Mage.Sets/src/mage/cards/d/DownDirty.java +++ b/Mage.Sets/src/mage/cards/d/DownDirty.java @@ -25,29 +25,22 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.d; +import java.util.UUID; import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.target.TargetPlayer; import mage.target.common.TargetCardInYourGraveyard; -import java.util.UUID; - -/** - * - * @author LevelX2 - */ - - public class DownDirty extends SplitCard { public DownDirty(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}","{2}{G}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}", "{2}{G}", SpellAbilityType.SPLIT_FUSED); // Down // Target player discards two cards. diff --git a/Mage.Sets/src/mage/cards/d/DuskDawn.java b/Mage.Sets/src/mage/cards/d/DuskDawn.java index e0b6d002333..247f8a50a0d 100644 --- a/Mage.Sets/src/mage/cards/d/DuskDawn.java +++ b/Mage.Sets/src/mage/cards/d/DuskDawn.java @@ -25,11 +25,11 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.d; +import java.util.Set; +import java.util.UUID; import mage.abilities.Ability; -import mage.constants.ComparisonType; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyAllEffect; @@ -39,7 +39,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; @@ -48,23 +50,16 @@ import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; import mage.players.Player; -import java.util.Set; -import java.util.UUID; - -/** - * - * @author stravant - */ - - public class DuskDawn extends SplitCard { + private static final FilterCreaturePermanent filterCreatures3orGreater = new FilterCreaturePermanent("creatures with power greater than or equal to 3"); + static { filterCreatures3orGreater.add(new PowerPredicate(ComparisonType.MORE_THAN, 2)); } public DuskDawn(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{W}{W}","{3}{W}{W}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.SORCERY}, "{2}{W}{W}", "{3}{W}{W}", SpellAbilityType.SPLIT_AFTERMATH); // Dusk // Destroy all creatures with power 3 or greater. @@ -74,7 +69,7 @@ public class DuskDawn extends SplitCard { // Dawn // Return all creature cards with power less than or equal to 2 from your graveyard to your hand. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); getRightHalfCard().getSpellAbility().addEffect(new DawnEffect()); } @@ -92,6 +87,7 @@ public class DuskDawn extends SplitCard { class DawnEffect extends OneShotEffect { private static final FilterCard filter2orLess = new FilterCreatureCard("creatures with power less than or equal to 2"); + static { filter2orLess.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3)); } diff --git a/Mage.Sets/src/mage/cards/f/FailureComply.java b/Mage.Sets/src/mage/cards/f/FailureComply.java index eee7b16283c..8ed7542bf46 100644 --- a/Mage.Sets/src/mage/cards/f/FailureComply.java +++ b/Mage.Sets/src/mage/cards/f/FailureComply.java @@ -27,7 +27,13 @@ */ package mage.cards.f; +import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.AftermathAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -35,17 +41,11 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.target.TargetSpell; -import mage.abilities.effects.common.ReturnToHandTargetEffect; -import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.MageObject; import mage.game.events.GameEvent.EventType; -import mage.abilities.effects.common.NameACardEffect; - -import java.util.UUID; -import mage.abilities.effects.Effect; +import mage.target.TargetSpell; /** * @author spjspj @@ -53,7 +53,7 @@ import mage.abilities.effects.Effect; public class FailureComply extends SplitCard { public FailureComply(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{1}{U}", "{W}", false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{1}{U}", "{W}", SpellAbilityType.SPLIT_AFTERMATH); // Failure // Return target spell to it's owner's hand diff --git a/Mage.Sets/src/mage/cards/f/FarAway.java b/Mage.Sets/src/mage/cards/f/FarAway.java index bbfea62e1df..a37a00b7d5f 100644 --- a/Mage.Sets/src/mage/cards/f/FarAway.java +++ b/Mage.Sets/src/mage/cards/f/FarAway.java @@ -25,30 +25,23 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.f; +import java.util.UUID; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.SacrificeEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterCreaturePermanent; import mage.target.TargetPlayer; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - -/** - * - * @author LevelX2 - */ - - public class FarAway extends SplitCard { public FarAway(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}","{2}{B}",true); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}", "{2}{B}", SpellAbilityType.SPLIT_FUSED); // Far // Return target creature to its owner's hand. diff --git a/Mage.Sets/src/mage/cards/f/FireIce.java b/Mage.Sets/src/mage/cards/f/FireIce.java index 44caebc9b2e..a704fa2cfc3 100644 --- a/Mage.Sets/src/mage/cards/f/FireIce.java +++ b/Mage.Sets/src/mage/cards/f/FireIce.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.f; +import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageMultiEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -35,21 +35,14 @@ import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.target.TargetPermanent; import mage.target.common.TargetCreatureOrPlayerAmount; -import java.util.UUID; - -/** - * - * @author LevelX2 - */ - - public class FireIce extends SplitCard { public FireIce(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}","{1}{U}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}", "{1}{U}", SpellAbilityType.SPLIT); // Fire // Fire deals 2 damage divided as you choose among one or two target creatures and/or players. diff --git a/Mage.Sets/src/mage/cards/f/FleshBlood.java b/Mage.Sets/src/mage/cards/f/FleshBlood.java index d3bc9bc9503..14b6b98df3f 100644 --- a/Mage.Sets/src/mage/cards/f/FleshBlood.java +++ b/Mage.Sets/src/mage/cards/f/FleshBlood.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.f; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; @@ -35,6 +35,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterCreatureCard; @@ -47,18 +48,10 @@ import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - -/** - * - * @author LevelX2 - */ - - public class FleshBlood extends SplitCard { public FleshBlood(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}{G}","{R}{G}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{G}", "{R}{G}", SpellAbilityType.SPLIT_FUSED); // Flesh // Exile target creature card from a graveyard. Put X +1/+1 counters on target creature, where X is the power of the card you exiled. @@ -90,7 +83,7 @@ class FleshEffect extends OneShotEffect { public FleshEffect() { super(Outcome.BoostCreature); staticText = "Exile target creature card from a graveyard. Put X +1/+1 counters on target creature, where X is the power of the card you exiled"; - } + } public FleshEffect(final FleshEffect effect) { super(effect); @@ -125,7 +118,7 @@ class BloodEffect extends OneShotEffect { public BloodEffect() { super(Outcome.Damage); staticText = "Target creature you control deals damage equal to its power to target creature or player"; - } + } public BloodEffect(final BloodEffect effect) { super(effect); diff --git a/Mage.Sets/src/mage/cards/g/GiveTake.java b/Mage.Sets/src/mage/cards/g/GiveTake.java index 39caae9cfa7..cb96d355b9a 100644 --- a/Mage.Sets/src/mage/cards/g/GiveTake.java +++ b/Mage.Sets/src/mage/cards/g/GiveTake.java @@ -27,6 +27,7 @@ */ package mage.cards.g; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; @@ -34,6 +35,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; @@ -41,8 +43,6 @@ import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author LevelX2 @@ -50,7 +50,7 @@ import java.util.UUID; public class GiveTake extends SplitCard { public GiveTake(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}","{2}{U}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}", "{2}{U}", SpellAbilityType.SPLIT_FUSED); // Give // Put three +1/+1 counters on target creature. diff --git a/Mage.Sets/src/mage/cards/h/HeavenEarth.java b/Mage.Sets/src/mage/cards/h/HeavenEarth.java index 2dc83692710..0dff7803efb 100644 --- a/Mage.Sets/src/mage/cards/h/HeavenEarth.java +++ b/Mage.Sets/src/mage/cards/h/HeavenEarth.java @@ -9,6 +9,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.AbilityPredicate; @@ -28,7 +29,7 @@ public class HeavenEarth extends SplitCard { } public HeavenEarth(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{X}{G}", "{X}{R}{R}", false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{X}{G}", "{X}{R}{R}", SpellAbilityType.SPLIT_AFTERMATH); // Falling // Falling deals X damage to each creature with flying. diff --git a/Mage.Sets/src/mage/cards/h/HideSeek.java b/Mage.Sets/src/mage/cards/h/HideSeek.java index 169f4f5c98a..5a7a79386ea 100644 --- a/Mage.Sets/src/mage/cards/h/HideSeek.java +++ b/Mage.Sets/src/mage/cards/h/HideSeek.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.h; import java.util.UUID; @@ -37,6 +36,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.common.FilterArtifactOrEnchantmentPermanent; import mage.game.Game; @@ -52,7 +52,7 @@ import mage.target.common.TargetOpponent; public class HideSeek extends SplitCard { public HideSeek(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}{W}","{W}{B}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{W}", "{W}{B}", SpellAbilityType.SPLIT); // Hide // Put target artifact or enchantment on the bottom of its owner's library. diff --git a/Mage.Sets/src/mage/cards/h/HitRun.java b/Mage.Sets/src/mage/cards/h/HitRun.java index b0c0db9cbbe..a0b2f3c12d9 100644 --- a/Mage.Sets/src/mage/cards/h/HitRun.java +++ b/Mage.Sets/src/mage/cards/h/HitRun.java @@ -37,6 +37,7 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; @@ -55,7 +56,7 @@ import mage.target.targetpointer.FixedTarget; public class HitRun extends SplitCard { public HitRun(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}{R}","{3}{R}{G}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{R}", "{3}{R}{G}", SpellAbilityType.SPLIT); // Hit // Target player sacrifices an artifact or creature. Hit deals damage to that player equal to that permanent's converted mana cost. diff --git a/Mage.Sets/src/mage/cards/i/IllusionReality.java b/Mage.Sets/src/mage/cards/i/IllusionReality.java index b203fb8b3d7..2b6b4d6138d 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionReality.java +++ b/Mage.Sets/src/mage/cards/i/IllusionReality.java @@ -34,6 +34,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.target.Target; import mage.target.common.TargetArtifactPermanent; import mage.target.common.TargetSpellOrPermanent; @@ -42,11 +43,10 @@ import mage.target.common.TargetSpellOrPermanent; * * @author LevelX2 */ - public class IllusionReality extends SplitCard { public IllusionReality(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}","{2}{G}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}", "{2}{G}", SpellAbilityType.SPLIT); // Illusion // Target spell or permanent becomes the color of your choice until end of turn. diff --git a/Mage.Sets/src/mage/cards/i/InsultInjury.java b/Mage.Sets/src/mage/cards/i/InsultInjury.java index d859b1344d9..b4721e71740 100644 --- a/Mage.Sets/src/mage/cards/i/InsultInjury.java +++ b/Mage.Sets/src/mage/cards/i/InsultInjury.java @@ -1,10 +1,9 @@ package mage.cards.i; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.LoseLifeOpponentsEffect; import mage.abilities.effects.common.continuous.DamageCantBePreventedEffect; import mage.abilities.keyword.AftermathAbility; import mage.cards.CardImpl; @@ -13,9 +12,7 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.filter.Filter; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.PowerPredicate; +import mage.constants.SpellAbilityType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -23,14 +20,13 @@ import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * @author Stravant */ public class InsultInjury extends SplitCard { + public InsultInjury(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}","{2}{R}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.SORCERY}, "{2}{R}", "{2}{R}", SpellAbilityType.SPLIT_AFTERMATH); // Insult // Damage can't be prevented this turn. If a source you control would deal damage this turn it deals @@ -39,7 +35,6 @@ public class InsultInjury extends SplitCard { getLeftHalfCard().getSpellAbility().addEffect(new InsultDoubleDamageEffect()); // to - // Injury // Injury deals 2 damage to target creature and 2 damage to target player. ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); @@ -59,6 +54,7 @@ public class InsultInjury extends SplitCard { } class InsultDoubleDamageEffect extends ReplacementEffectImpl { + public InsultDoubleDamageEffect() { super(Duration.EndOfTurn, Outcome.Damage); staticText = "If a source you control would deal damage this turn, it deals double that damage to that creature or player instead."; @@ -98,6 +94,7 @@ class InsultDoubleDamageEffect extends ReplacementEffectImpl { } class InjuryEffect extends OneShotEffect { + InjuryEffect() { super(Outcome.Damage); this.staticText = "{this} deals 2 damage to target creature and 2 damage to target player"; @@ -127,4 +124,4 @@ class InjuryEffect extends OneShotEffect { public InjuryEffect copy() { return new InjuryEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/l/LifeDeath.java b/Mage.Sets/src/mage/cards/l/LifeDeath.java index 28f858db072..8506ce86324 100644 --- a/Mage.Sets/src/mage/cards/l/LifeDeath.java +++ b/Mage.Sets/src/mage/cards/l/LifeDeath.java @@ -38,6 +38,7 @@ import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterCreatureCard; @@ -54,7 +55,7 @@ import mage.target.common.TargetCardInYourGraveyard; public class LifeDeath extends SplitCard { public LifeDeath(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}","{1}{B}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}", "{1}{B}", SpellAbilityType.SPLIT); // Life // All lands you control become 1/1 creatures until end of turn. They're still lands. diff --git a/Mage.Sets/src/mage/cards/m/MouthFeed.java b/Mage.Sets/src/mage/cards/m/MouthFeed.java index cf53da5c5a1..5231431900e 100644 --- a/Mage.Sets/src/mage/cards/m/MouthFeed.java +++ b/Mage.Sets/src/mage/cards/m/MouthFeed.java @@ -1,6 +1,6 @@ package mage.cards.m; -import mage.constants.ComparisonType; +import java.util.UUID; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; @@ -10,35 +10,36 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.permanent.token.HippoToken2; -import java.util.UUID; - /** * @author Stravant */ public class MouthFeed extends SplitCard { + private static final FilterControlledCreaturePermanent filterCreaturesYouControlPower3orGreater = new FilterControlledCreaturePermanent("creature you control with power 3 or greater."); + static { filterCreaturesYouControlPower3orGreater.add(new PowerPredicate(ComparisonType.MORE_THAN, 2)); } public MouthFeed(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}","{3}{G}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.SORCERY}, "{2}{G}", "{3}{G}", SpellAbilityType.SPLIT_AFTERMATH); // Mouth // Create a 3/3 green Hippo creature token getLeftHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new HippoToken2())); // to - // Feed // Draw a card for each creature you control with power 3 or greater ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); - Effect draw = new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filterCreaturesYouControlPower3orGreater)); + Effect draw = new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filterCreaturesYouControlPower3orGreater)); getRightHalfCard().getSpellAbility().addEffect(draw); } @@ -51,4 +52,4 @@ public class MouthFeed extends SplitCard { public MouthFeed copy() { return new MouthFeed(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/n/NeverReturn.java b/Mage.Sets/src/mage/cards/n/NeverReturn.java index 5e58ac303d4..3fa5d9af014 100644 --- a/Mage.Sets/src/mage/cards/n/NeverReturn.java +++ b/Mage.Sets/src/mage/cards/n/NeverReturn.java @@ -36,6 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.game.permanent.token.ZombieToken; import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCreatureOrPlaneswalker; @@ -47,7 +48,7 @@ import mage.target.common.TargetCreatureOrPlaneswalker; public class NeverReturn extends SplitCard { public NeverReturn(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}", "{3}{B}", false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.SORCERY}, "{1}{B}{B}", "{3}{B}", SpellAbilityType.SPLIT_AFTERMATH); // Never // Destroy target creature or planeswalker. @@ -56,7 +57,7 @@ public class NeverReturn extends SplitCard { // Return // Exile target card from a graveyard. Create a 2/2 black Zombie creature token. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); getRightHalfCard().getSpellAbility().addEffect(new ExileTargetEffect()); getRightHalfCard().getSpellAbility().addTarget(new TargetCardInGraveyard()); getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken())); diff --git a/Mage.Sets/src/mage/cards/n/NightDay.java b/Mage.Sets/src/mage/cards/n/NightDay.java index 47d9ba373b2..19d3f0da575 100644 --- a/Mage.Sets/src/mage/cards/n/NightDay.java +++ b/Mage.Sets/src/mage/cards/n/NightDay.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.n; import java.util.Iterator; @@ -35,12 +34,13 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.continuous.BoostTargetEffect; -import mage.constants.CardType; import mage.cards.CardSetInfo; import mage.cards.SplitCard; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.SubLayer; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; @@ -52,15 +52,14 @@ import mage.target.common.TargetCreaturePermanent; * * @author LevelX2 */ - public class NightDay extends SplitCard { public NightDay(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}","{2}{W}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}", "{2}{W}", SpellAbilityType.SPLIT); // Night // Target creature gets -1/-1 until end of turn. - getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(-1,-1,Duration.EndOfTurn)); + getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(-1, -1, Duration.EndOfTurn)); getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); // Day diff --git a/Mage.Sets/src/mage/cards/o/OddsEnds.java b/Mage.Sets/src/mage/cards/o/OddsEnds.java index bdbfc26aad8..e7e0fd23916 100644 --- a/Mage.Sets/src/mage/cards/o/OddsEnds.java +++ b/Mage.Sets/src/mage/cards/o/OddsEnds.java @@ -25,18 +25,18 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.o; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.effects.common.SacrificeEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.filter.FilterSpell; import mage.filter.common.FilterAttackingCreature; import mage.filter.predicate.Predicates; @@ -46,15 +46,10 @@ import mage.players.Player; import mage.target.TargetPlayer; import mage.target.TargetSpell; -/** - * - * @author LevelX2 - */ - - public class OddsEnds extends SplitCard { private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); + static { filter.add(Predicates.or( new CardTypePredicate(CardType.INSTANT), @@ -62,7 +57,7 @@ public class OddsEnds extends SplitCard { } public OddsEnds(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{R}","{3}{R}{W}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{R}", "{3}{R}{W}", SpellAbilityType.SPLIT); // Odds // Flip a coin. If it comes up heads, counter target instant or sorcery spell. If it comes up tails, copy that spell and you may choose new targets for the copy. diff --git a/Mage.Sets/src/mage/cards/o/OnwardVictory.java b/Mage.Sets/src/mage/cards/o/OnwardVictory.java index 552a41b10cc..4b260fb53e1 100644 --- a/Mage.Sets/src/mage/cards/o/OnwardVictory.java +++ b/Mage.Sets/src/mage/cards/o/OnwardVictory.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.o; +import java.util.UUID; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount; import mage.abilities.effects.Effect; @@ -40,20 +40,13 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.target.common.TargetCreaturePermanent; -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); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{2}{R}", "{2}{W}", SpellAbilityType.SPLIT_AFTERMATH); // Onward // Target creature gets +X/+0 until end of turn where X is its power. @@ -61,10 +54,9 @@ public class OnwardVictory extends SplitCard { 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()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); Effect effect = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn); getRightHalfCard().getSpellAbility().addEffect(effect); getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); @@ -79,4 +71,3 @@ public class OnwardVictory extends SplitCard { return new OnwardVictory(this); } } - diff --git a/Mage.Sets/src/mage/cards/o/OrderChaos.java b/Mage.Sets/src/mage/cards/o/OrderChaos.java index 4335d11af8f..6edc36300c9 100644 --- a/Mage.Sets/src/mage/cards/o/OrderChaos.java +++ b/Mage.Sets/src/mage/cards/o/OrderChaos.java @@ -25,30 +25,24 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.o; import java.util.UUID; -import mage.constants.CardType; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.combat.CantBlockAllEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterCreaturePermanent; import mage.target.Target; import mage.target.common.TargetAttackingCreature; -/** - * - * @author LevelX2 - */ - - public class OrderChaos extends SplitCard { public OrderChaos(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{W}","{2}{R}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}", "{2}{R}", SpellAbilityType.SPLIT); // Order // Exile target attacking creature. diff --git a/Mage.Sets/src/mage/cards/p/PainSuffering.java b/Mage.Sets/src/mage/cards/p/PainSuffering.java index 21d7ad4c703..389e5e15f15 100644 --- a/Mage.Sets/src/mage/cards/p/PainSuffering.java +++ b/Mage.Sets/src/mage/cards/p/PainSuffering.java @@ -33,6 +33,7 @@ import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.target.TargetPlayer; import mage.target.common.TargetLandPermanent; @@ -43,13 +44,13 @@ import mage.target.common.TargetLandPermanent; public class PainSuffering extends SplitCard { public PainSuffering(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}","{3}{R}",false); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}", "{3}{R}", SpellAbilityType.SPLIT); + // Pain // Target player discards a card. this.getLeftHalfCard().getSpellAbility().addEffect(new DiscardTargetEffect(1)); this.getLeftHalfCard().getSpellAbility().addTarget(new TargetPlayer()); - + // Suffering // Destroy target land. this.getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect()); diff --git a/Mage.Sets/src/mage/cards/p/PreparedFight.java b/Mage.Sets/src/mage/cards/p/PrepareFight.java similarity index 79% rename from Mage.Sets/src/mage/cards/p/PreparedFight.java rename to Mage.Sets/src/mage/cards/p/PrepareFight.java index 386fed956cc..d6bc3413405 100644 --- a/Mage.Sets/src/mage/cards/p/PreparedFight.java +++ b/Mage.Sets/src/mage/cards/p/PrepareFight.java @@ -25,56 +25,41 @@ * 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 java.util.UUID; 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 PrepareFight extends SplitCard { - -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); + public PrepareFight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{1}{W}", "{3}{G}", SpellAbilityType.SPLIT_AFTERMATH); - // Prepared + // Prepare // Untap target creature. It gets +2/+2 and gains lifelink until end of turn. getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); Effect effect = new UntapTargetEffect(); @@ -88,22 +73,21 @@ public class PreparedFight extends SplitCard { getLeftHalfCard().getSpellAbility().addEffect(effect); // to - // Fight // Target creature you control fights target creature you don't control. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((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) { + public PrepareFight(final PrepareFight card) { super(card); } @Override - public PreparedFight copy() { - return new PreparedFight(this); + public PrepareFight copy() { + return new PrepareFight(this); } } diff --git a/Mage.Sets/src/mage/cards/p/ProfitLoss.java b/Mage.Sets/src/mage/cards/p/ProfitLoss.java index 55ac7582286..b0cc82fdef0 100644 --- a/Mage.Sets/src/mage/cards/p/ProfitLoss.java +++ b/Mage.Sets/src/mage/cards/p/ProfitLoss.java @@ -25,40 +25,34 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.p; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.constants.TargetController; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; -/** - * - * @author LevelX2 - */ - - public class ProfitLoss extends SplitCard { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); + static { filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public ProfitLoss(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}","{2}{B}",true); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}", "{2}{B}", SpellAbilityType.SPLIT_FUSED); // Profit // Creatures you control get +1/+1 until end of turn. - getLeftHalfCard().getSpellAbility().addEffect(new BoostControlledEffect(1,1, Duration.EndOfTurn, new FilterCreaturePermanent())); + getLeftHalfCard().getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent())); // Loss // Creatures your opponents control get -1/-1 until end of turn. diff --git a/Mage.Sets/src/mage/cards/p/ProtectServe.java b/Mage.Sets/src/mage/cards/p/ProtectServe.java index 457fa384cf3..715919587e7 100644 --- a/Mage.Sets/src/mage/cards/p/ProtectServe.java +++ b/Mage.Sets/src/mage/cards/p/ProtectServe.java @@ -25,36 +25,30 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.p; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.target.common.TargetCreaturePermanent; -/** - * - * @author LevelX2 - */ - - public class ProtectServe extends SplitCard { public ProtectServe(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}","{1}{U}",true); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}", "{1}{U}", SpellAbilityType.SPLIT_FUSED); // Protect // Target creature gets +2/+4 until end of turn. - getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(2,4, Duration.EndOfTurn)); + getLeftHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(2, 4, Duration.EndOfTurn)); getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); // Serve // Target creature gets -6/-0 until end of turn. - getRightHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(-6,0, Duration.EndOfTurn)); + getRightHalfCard().getSpellAbility().addEffect(new BoostTargetEffect(-6, 0, Duration.EndOfTurn)); getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/p/PureSimple.java b/Mage.Sets/src/mage/cards/p/PureSimple.java index 191c8cf6bc9..b1ef05c5b20 100644 --- a/Mage.Sets/src/mage/cards/p/PureSimple.java +++ b/Mage.Sets/src/mage/cards/p/PureSimple.java @@ -33,6 +33,7 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.MulticoloredPredicate; @@ -54,7 +55,7 @@ public class PureSimple extends SplitCard { } public PureSimple(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}{G}","{1}{G}{W}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{G}", "{1}{G}{W}", SpellAbilityType.SPLIT_FUSED); // Pure // Destroy target multicolored permanent. diff --git a/Mage.Sets/src/mage/cards/r/RagsRiches.java b/Mage.Sets/src/mage/cards/r/RagsRiches.java index 347d3b8515f..d14601815eb 100644 --- a/Mage.Sets/src/mage/cards/r/RagsRiches.java +++ b/Mage.Sets/src/mage/cards/r/RagsRiches.java @@ -1,5 +1,6 @@ package mage.cards.r; +import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -10,28 +11,25 @@ import mage.cards.*; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.filter.StaticFilters; +import mage.constants.SpellAbilityType; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; -import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * @author Stravant */ public class RagsRiches extends SplitCard { + public RagsRiches(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}","{5}{U}{U}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.SORCERY}, "{2}{B}{B}", "{5}{U}{U}", SpellAbilityType.SPLIT_AFTERMATH); // Rags // All creatures get -2/-2 until end of turn. getLeftHalfCard().getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn)); // to - // Riches // Each opponent chooses a creature he or she controls. You gain control of each of those creatures. ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); @@ -86,7 +84,7 @@ class RichesEffect extends OneShotEffect { // Has to be done as a separate loop in case there's a situation where one creature's // controller depends on another creatures controller. - for (UUID target: creaturesToSteal) { + for (UUID target : creaturesToSteal) { GainControlTargetEffect eff = new GainControlTargetEffect(Duration.EndOfGame, true); eff.setTargetPointer(new FixedTarget(target)); game.addEffect(eff, source); @@ -96,4 +94,4 @@ class RichesEffect extends OneShotEffect { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/r/ReadyWilling.java b/Mage.Sets/src/mage/cards/r/ReadyWilling.java index 5fb6fc611b0..19771ff54ec 100644 --- a/Mage.Sets/src/mage/cards/r/ReadyWilling.java +++ b/Mage.Sets/src/mage/cards/r/ReadyWilling.java @@ -28,9 +28,6 @@ package mage.cards.r; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; import mage.abilities.effects.Effect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; @@ -40,6 +37,9 @@ import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardSetInfo; import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; @@ -50,18 +50,18 @@ import mage.filter.common.FilterCreaturePermanent; public class ReadyWilling extends SplitCard { public ReadyWilling(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}{W}","{1}{W}{B}",true); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}{W}", "{1}{W}{B}", SpellAbilityType.SPLIT_FUSED); // Ready // Creatures you control are indestructible this turn. Untap each creature you control. Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("Creatures you controll"), false); effect.setText("Creatures you control are indestructible this turn"); getLeftHalfCard().getSpellAbility().addEffect(effect); - getLeftHalfCard().getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(),"Untap each creature you control")); + getLeftHalfCard().getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "Untap each creature you control")); // Willing // Creatures you control gain deathtouch and lifelink until end of turn. - getRightHalfCard().getSpellAbility().addEffect(new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("Creatures")) ); + getRightHalfCard().getSpellAbility().addEffect(new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("Creatures"))); effect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("Creatures")); effect.setText("Creatures you control gain lifelink until end of turn"); getRightHalfCard().getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/r/ReduceRubble.java b/Mage.Sets/src/mage/cards/r/ReduceRubble.java index 299c1ca41fa..59541ce56c4 100644 --- a/Mage.Sets/src/mage/cards/r/ReduceRubble.java +++ b/Mage.Sets/src/mage/cards/r/ReduceRubble.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterLandPermanent; import mage.target.TargetPermanent; import mage.target.TargetSpell; @@ -48,7 +49,7 @@ import mage.target.TargetSpell; public class ReduceRubble extends SplitCard { public ReduceRubble(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{2}{U}", "{2}{R}", false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{2}{U}", "{2}{R}", SpellAbilityType.SPLIT_AFTERMATH); // Reduce // Counter target spell unless its controller pays {3}. @@ -57,7 +58,7 @@ public class ReduceRubble extends SplitCard { // Rubble // Up to three target lands don't untap during their controller's next untap step. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); Effect effect = new DontUntapInControllersNextUntapStepTargetEffect(); effect.setText("Up to three target lands don't untap during their controller's next untap step"); getRightHalfCard().getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java b/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java index 1646982006a..8582f459ae5 100644 --- a/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java +++ b/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java @@ -33,12 +33,13 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.Card; +import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.cards.CardsImpl; -import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; @@ -53,7 +54,7 @@ import mage.target.TargetCard; public class ResearchDevelopment extends SplitCard { public ResearchDevelopment(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}{U}","{3}{U}{R}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}{U}", "{3}{U}{R}", SpellAbilityType.SPLIT); // Choose up to four cards you own from outside the game and shuffle them into your library. getLeftHalfCard().getSpellAbility().addEffect(new ResearchEffect()); @@ -78,7 +79,6 @@ class ResearchEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard("card"); - public ResearchEffect() { super(Outcome.Benefit); this.staticText = "Choose up to four cards you own from outside the game and shuffle them into your library"; @@ -102,7 +102,7 @@ class ResearchEffect extends OneShotEffect { int count = 0; while (player.chooseUse(Outcome.Benefit, textToAsk.toString(), source, game)) { Cards cards = player.getSideboard(); - if(cards.isEmpty()) { + if (cards.isEmpty()) { game.informPlayer(player, "You have no cards outside the game."); break; } @@ -170,7 +170,7 @@ class DevelopmentEffect extends OneShotEffect { for (UUID opponentUuid : opponents) { Player opponent = game.getPlayer(opponentUuid); if (opponent != null && opponent.chooseUse(Outcome.Detriment, - "Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ')', source, game)) { + "Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i + 1) + ')', source, game)) { game.informPlayers(opponent.getLogName() + " had chosen to let " + player.getLogName() + " draw a card."); player.drawCards(1, game); putToken = false; @@ -192,4 +192,4 @@ class DevelopmentEffect extends OneShotEffect { return new DevelopmentEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/r/RiseFall.java b/Mage.Sets/src/mage/cards/r/RiseFall.java index 2f92cfdde7f..a8f403015e9 100644 --- a/Mage.Sets/src/mage/cards/r/RiseFall.java +++ b/Mage.Sets/src/mage/cards/r/RiseFall.java @@ -32,12 +32,13 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.cards.CardsImpl; -import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; @@ -54,7 +55,7 @@ import mage.target.common.TargetCreaturePermanent; public class RiseFall extends SplitCard { public RiseFall(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{U}{B}","{B}{R}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{B}", "{B}{R}", SpellAbilityType.SPLIT); // Rise // Return target creature card from a graveyard and target creature on the battlefield to their owners' hands. diff --git a/Mage.Sets/src/mage/cards/r/RoughTumble.java b/Mage.Sets/src/mage/cards/r/RoughTumble.java index e6a9d90472f..81ceab90bc0 100644 --- a/Mage.Sets/src/mage/cards/r/RoughTumble.java +++ b/Mage.Sets/src/mage/cards/r/RoughTumble.java @@ -34,6 +34,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.AbilityPredicate; @@ -46,13 +47,14 @@ public class RoughTumble extends SplitCard { private static final FilterCreaturePermanent filterFlying = new FilterCreaturePermanent("creature with flying"); private static final FilterCreaturePermanent filterWithoutFlying = new FilterCreaturePermanent("creature without flying"); + static { filterFlying.add(new AbilityPredicate(FlyingAbility.class)); filterWithoutFlying.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); } public RoughTumble(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}","{5}{R}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}", "{5}{R}", SpellAbilityType.SPLIT); // Rough // Rough deals 2 damage to each creature without flying. diff --git a/Mage.Sets/src/mage/cards/s/SpiteMalice.java b/Mage.Sets/src/mage/cards/s/SpiteMalice.java index 5d108f25fa8..6f1f957a4fb 100644 --- a/Mage.Sets/src/mage/cards/s/SpiteMalice.java +++ b/Mage.Sets/src/mage/cards/s/SpiteMalice.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; @@ -47,25 +48,27 @@ import mage.target.common.TargetCreaturePermanent; * @author FenrisulfrX */ public class SpiteMalice extends SplitCard { - - private static final FilterSpell filterNonCreatureSpell = new FilterSpell("noncreature spell"); + + private static final FilterSpell filterNonCreatureSpell = new FilterSpell("noncreature spell"); + static { filterNonCreatureSpell.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } - + private static final FilterCreaturePermanent filterNonBlackCreature = new FilterCreaturePermanent("nonblack creature"); + static { filterNonBlackCreature.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public SpiteMalice(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}","{3}{B}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}", "{3}{B}", SpellAbilityType.SPLIT); // Spite // Counter target noncreature spell. this.getLeftHalfCard().getSpellAbility().addEffect(new CounterTargetEffect()); - this.getLeftHalfCard().getSpellAbility().addTarget(new TargetSpell(filterNonCreatureSpell)); - + this.getLeftHalfCard().getSpellAbility().addTarget(new TargetSpell(filterNonCreatureSpell)); + // Malice // Destroy target nonblack creature. It can't be regenerated. this.getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect(true)); diff --git a/Mage.Sets/src/mage/cards/s/SpringMind.java b/Mage.Sets/src/mage/cards/s/SpringMind.java index 1632e303100..ae79efa8907 100644 --- a/Mage.Sets/src/mage/cards/s/SpringMind.java +++ b/Mage.Sets/src/mage/cards/s/SpringMind.java @@ -35,6 +35,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -45,7 +46,7 @@ import mage.target.common.TargetCardInLibrary; public class SpringMind extends SplitCard { public SpringMind(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.INSTANT}, "{2}{G}", "{4}{U}{U}", false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.INSTANT}, "{2}{G}", "{4}{U}{U}", SpellAbilityType.SPLIT_AFTERMATH); // Spring // Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. @@ -54,7 +55,7 @@ public class SpringMind extends SplitCard { // Mind // Aftermath // Draw two cards. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); getRightHalfCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); } diff --git a/Mage.Sets/src/mage/cards/s/StandDeliver.java b/Mage.Sets/src/mage/cards/s/StandDeliver.java index 3e1f1a2ac00..b4b2bd4238d 100644 --- a/Mage.Sets/src/mage/cards/s/StandDeliver.java +++ b/Mage.Sets/src/mage/cards/s/StandDeliver.java @@ -34,6 +34,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -44,7 +45,7 @@ import mage.target.common.TargetCreaturePermanent; public class StandDeliver extends SplitCard { public StandDeliver(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}","{2}{U}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}", "{2}{U}", SpellAbilityType.SPLIT); // Stand // Prevent the next 2 damage that would be dealt to target creature this turn. diff --git a/Mage.Sets/src/mage/cards/s/StartFinish.java b/Mage.Sets/src/mage/cards/s/StartFinish.java index 0f01f6310bc..1f467425ca3 100644 --- a/Mage.Sets/src/mage/cards/s/StartFinish.java +++ b/Mage.Sets/src/mage/cards/s/StartFinish.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; import mage.game.permanent.token.WarriorVigilantToken; @@ -50,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; public class StartFinish extends SplitCard { public StartFinish(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{2}{W}", "{2}{B}", false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{2}{W}", "{2}{B}", SpellAbilityType.SPLIT_AFTERMATH); // Start // Create two 1/1 white Warrior creature tokens with vigilance. @@ -61,7 +62,7 @@ public class StartFinish extends SplitCard { // Finish // Aftermath // As an additional cost to cast Finish, sacrifice a creature. Destroy target creature. - ((CardImpl)(getRightHalfCard())).addAbility(new AftermathAbility()); + ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility()); getRightHalfCard().getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)"))); getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature")); diff --git a/Mage.Sets/src/mage/cards/s/SupplyDemand.java b/Mage.Sets/src/mage/cards/s/SupplyDemand.java index f1e4faeae37..4df895a5415 100644 --- a/Mage.Sets/src/mage/cards/s/SupplyDemand.java +++ b/Mage.Sets/src/mage/cards/s/SupplyDemand.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.MulticoloredPredicate; import mage.game.permanent.token.SaprolingToken; @@ -52,7 +53,7 @@ public class SupplyDemand extends SplitCard { } public SupplyDemand(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{G}{W}","{1}{W}{U}",false); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{G}{W}", "{1}{W}{U}", SpellAbilityType.SPLIT); // Supply // create X 1/1 green Saproling creature tokens. diff --git a/Mage.Sets/src/mage/cards/t/ToilTrouble.java b/Mage.Sets/src/mage/cards/t/ToilTrouble.java index 73613fa694a..a6906f7d5c4 100644 --- a/Mage.Sets/src/mage/cards/t/ToilTrouble.java +++ b/Mage.Sets/src/mage/cards/t/ToilTrouble.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.t; +import java.util.UUID; import mage.abilities.dynamicvalue.common.CardsInTargetHandCount; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; @@ -36,20 +36,13 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.target.TargetPlayer; -import java.util.UUID; - -/** - * - * @author LevelX2 - */ - - public class ToilTrouble extends SplitCard { public ToilTrouble(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}","{2}{R}",true); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}", "{2}{R}", SpellAbilityType.SPLIT_FUSED); // Toil // Target player draws two cards and loses 2 life. diff --git a/Mage.Sets/src/mage/cards/t/TrialError.java b/Mage.Sets/src/mage/cards/t/TrialError.java index ffff531c496..949cc57e9cc 100644 --- a/Mage.Sets/src/mage/cards/t/TrialError.java +++ b/Mage.Sets/src/mage/cards/t/TrialError.java @@ -38,6 +38,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.MulticoloredPredicate; @@ -61,7 +62,7 @@ public class TrialError extends SplitCard { } public TrialError(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}{U}","{U}{B}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}{U}", "{U}{B}", SpellAbilityType.SPLIT); // Trial // Return all creatures blocking or blocked by target creature to their owner's hand. diff --git a/Mage.Sets/src/mage/cards/t/TurnBurn.java b/Mage.Sets/src/mage/cards/t/TurnBurn.java index 11eb1690de1..e90dec11338 100644 --- a/Mage.Sets/src/mage/cards/t/TurnBurn.java +++ b/Mage.Sets/src/mage/cards/t/TurnBurn.java @@ -27,6 +27,7 @@ */ package mage.cards.t; +import java.util.UUID; import mage.MageInt; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; @@ -35,12 +36,11 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.game.permanent.token.Token; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author LevelX2 @@ -48,7 +48,7 @@ import java.util.UUID; public class TurnBurn extends SplitCard { public TurnBurn(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}","{1}{R}",true); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}", "{1}{R}", SpellAbilityType.SPLIT_FUSED); // Turn // Until end of turn, target creature loses all abilities and becomes a red Weird with base power and toughness 0/1. diff --git a/Mage.Sets/src/mage/cards/w/WaxWane.java b/Mage.Sets/src/mage/cards/w/WaxWane.java index 766c5462661..5b0aa63310e 100644 --- a/Mage.Sets/src/mage/cards/w/WaxWane.java +++ b/Mage.Sets/src/mage/cards/w/WaxWane.java @@ -34,6 +34,7 @@ import mage.cards.CardSetInfo; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.SpellAbilityType; import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetEnchantmentPermanent; @@ -44,7 +45,7 @@ import mage.target.common.TargetEnchantmentPermanent; public class WaxWane extends SplitCard { public WaxWane(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}","{W}",false); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}", "{W}", SpellAbilityType.SPLIT); // Wax // Target creature gets +2/+2 until end of turn. diff --git a/Mage.Sets/src/mage/cards/w/WearTear.java b/Mage.Sets/src/mage/cards/w/WearTear.java index 4e7fa9aac17..4a803ac26e2 100644 --- a/Mage.Sets/src/mage/cards/w/WearTear.java +++ b/Mage.Sets/src/mage/cards/w/WearTear.java @@ -28,10 +28,11 @@ package mage.cards.w; import java.util.UUID; -import mage.constants.CardType; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardSetInfo; import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.SpellAbilityType; import mage.target.Target; import mage.target.common.TargetArtifactPermanent; import mage.target.common.TargetEnchantmentPermanent; @@ -43,7 +44,7 @@ import mage.target.common.TargetEnchantmentPermanent; public class WearTear extends SplitCard { public WearTear(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}","{W}",true); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}", "{W}", SpellAbilityType.SPLIT_FUSED); // Wear // Destroy target artifact. diff --git a/Mage.Sets/src/mage/sets/Amonkhet.java b/Mage.Sets/src/mage/sets/Amonkhet.java index 8546b433b3d..db84579bc45 100644 --- a/Mage.Sets/src/mage/sets/Amonkhet.java +++ b/Mage.Sets/src/mage/sets/Amonkhet.java @@ -256,7 +256,7 @@ public class Amonkhet extends ExpansionSet { cards.add(new SetCardInfo("Plains", 256, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Plains", 257, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Pouncing Cheetah", 179, Rarity.COMMON, mage.cards.p.PouncingCheetah.class)); - cards.add(new SetCardInfo("Prepared // Fight", 220, Rarity.RARE, mage.cards.p.PreparedFight.class)); + cards.add(new SetCardInfo("Prepare // Fight", 220, Rarity.RARE, mage.cards.p.PrepareFight.class)); cards.add(new SetCardInfo("Protection of the Hekma", 23, Rarity.UNCOMMON, mage.cards.p.ProtectionOfTheHekma.class)); cards.add(new SetCardInfo("Prowling Serpopard", 180, Rarity.RARE, mage.cards.p.ProwlingSerpopard.class)); cards.add(new SetCardInfo("Pull from Tomorrow", 65, Rarity.RARE, mage.cards.p.PullFromTomorrow.class)); diff --git a/Mage/src/main/java/mage/abilities/SpellAbility.java b/Mage/src/main/java/mage/abilities/SpellAbility.java index 8cdac0c8fb4..37bc8917a5e 100644 --- a/Mage/src/main/java/mage/abilities/SpellAbility.java +++ b/Mage/src/main/java/mage/abilities/SpellAbility.java @@ -27,6 +27,7 @@ */ package mage.abilities; +import java.util.UUID; import mage.MageObject; import mage.abilities.costs.Cost; import mage.abilities.costs.VariableCost; @@ -44,8 +45,6 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; -import java.util.UUID; - /** * @author BetaSteward_at_googlemail.com */ @@ -94,7 +93,7 @@ public class SpellAbility extends ActivatedAbilityImpl { public boolean canActivate(UUID playerId, Game game) { if (game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.CAST_AS_INSTANT, this, playerId, game) // check this first to allow Offering in main phase || this.spellCanBeActivatedRegularlyNow(playerId, game)) { - if (spellAbilityType == SpellAbilityType.SPLIT) { + if (spellAbilityType == SpellAbilityType.SPLIT || spellAbilityType == SpellAbilityType.SPLIT_AFTERMATH) { return false; } // fix for Gitaxian Probe and casting opponent's spells @@ -110,7 +109,7 @@ public class SpellAbility extends ActivatedAbilityImpl { } } // Alternate spell abilities (Flashback, Overload) can't be cast with no mana to pay option - if (getSpellAbilityType()== SpellAbilityType.BASE_ALTERNATE) { + if (getSpellAbilityType() == SpellAbilityType.BASE_ALTERNATE) { Player player = game.getPlayer(playerId); if (player != null && getSourceId().equals(player.getCastSourceIdWithAlternateMana())) { return false; @@ -183,27 +182,27 @@ public class SpellAbility extends ActivatedAbilityImpl { public int getConvertedXManaCost(Card card) { int xMultiplier = 0; int amount = 0; - if(card == null) { + if (card == null) { return 0; } - for(ManaCost manaCost : card.getManaCost()) { - if(manaCost instanceof VariableManaCost) { - xMultiplier = ((VariableManaCost)manaCost).getMultiplier(); + for (ManaCost manaCost : card.getManaCost()) { + if (manaCost instanceof VariableManaCost) { + xMultiplier = ((VariableManaCost) manaCost).getMultiplier(); break; } } boolean hasNonManaXCost = false; - for(Cost cost : getCosts()) { - if(cost instanceof VariableCost) { + for (Cost cost : getCosts()) { + if (cost instanceof VariableCost) { hasNonManaXCost = true; amount = ((VariableCost) cost).getAmount(); break; } } - if(!hasNonManaXCost) { + if (!hasNonManaXCost) { amount = getManaCostsToPay().getX(); } return amount * xMultiplier; diff --git a/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java b/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java index c704939285a..e0517a0e0d2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AftermathAbility.java @@ -27,31 +27,31 @@ */ package mage.abilities.keyword; -import mage.MageObject; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.*; import mage.cards.Card; import mage.cards.SplitCardHalf; -import mage.cards.SplitCardHalfImpl; import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.game.stack.Spell; import mage.players.Player; -import java.util.UUID; /** * Aftermath * - * TODO: Implement once we get details on the comprehensive rules meaning of the ability + * TODO: Implement once we get details on the comprehensive rules meaning of the + * ability * * Current text is a shell copied from Flashback * * @author stravant */ public class AftermathAbility extends SimpleStaticAbility { + public AftermathAbility() { super(Zone.ALL, new AftermathCastFromGraveyard()); addEffect(new AftermathCantCastFromHand()); @@ -99,13 +99,13 @@ class AftermathCastFromGraveyard extends AsThoughEffectImpl { } private static String msb(UUID id) { - return Integer.toUnsignedString((int)id.getMostSignificantBits(), 16); + return Integer.toUnsignedString((int) id.getMostSignificantBits(), 16); } @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - if (objectId.equals(source.getSourceId()) & - affectedControllerId.equals(source.getControllerId())) { + if (objectId.equals(source.getSourceId()) + & affectedControllerId.equals(source.getControllerId())) { Card card = game.getCard(source.getSourceId()); if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { return true; @@ -122,7 +122,7 @@ class AftermathCantCastFromHand extends ContinuousRuleModifyingEffectImpl { staticText = ", but not from anywhere else"; } - public AftermathCantCastFromHand (final AftermathCantCastFromHand effect) { + public AftermathCantCastFromHand(final AftermathCantCastFromHand effect) { super(effect); } @@ -213,7 +213,7 @@ class AftermathExileAsResolvesFromGraveyard extends ReplacementEffectImpl { if (sourceCard != null) { Player player = game.getPlayer(sourceCard.getOwnerId()); if (player != null) { - return player.moveCardToExileWithInfo(sourceCard, null, "", sourceId, game, ((ZoneChangeEvent)event).getFromZone(), true); + return player.moveCardToExileWithInfo(sourceCard, null, "", sourceId, game, ((ZoneChangeEvent) event).getFromZone(), true); } } return false; @@ -224,4 +224,4 @@ class AftermathExileAsResolvesFromGraveyard extends ReplacementEffectImpl { return new AftermathExileAsResolvesFromGraveyard(this); } -} \ No newline at end of file +} diff --git a/Mage/src/main/java/mage/cards/SplitCard.java b/Mage/src/main/java/mage/cards/SplitCard.java index e3e005275a7..d608390039d 100644 --- a/Mage/src/main/java/mage/cards/SplitCard.java +++ b/Mage/src/main/java/mage/cards/SplitCard.java @@ -30,7 +30,6 @@ package mage.cards; import java.util.ArrayList; import java.util.List; import java.util.UUID; - import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; @@ -49,12 +48,12 @@ public abstract class SplitCard extends CardImpl { protected Card leftHalfCard; protected Card rightHalfCard; - public SplitCard(UUID ownerId, CardSetInfo setInfo, CardType[] cardTypes, String costsLeft, String costsRight, boolean fused) { - this(ownerId, setInfo, cardTypes, cardTypes, costsLeft, costsRight, fused); + public SplitCard(UUID ownerId, CardSetInfo setInfo, CardType[] cardTypes, String costsLeft, String costsRight, SpellAbilityType spellAbilityType) { + this(ownerId, setInfo, cardTypes, cardTypes, costsLeft, costsRight, spellAbilityType); } - public SplitCard(UUID ownerId, CardSetInfo setInfo, CardType[] typesLeft, CardType[] typesRight, String costsLeft, String costsRight, boolean fused) { - super(ownerId, setInfo, CardType.mergeTypes(typesLeft, typesRight), costsLeft + costsRight, (fused ? SpellAbilityType.SPLIT_FUSED : SpellAbilityType.SPLIT)); + public SplitCard(UUID ownerId, CardSetInfo setInfo, CardType[] typesLeft, CardType[] typesRight, String costsLeft, String costsRight, SpellAbilityType spellAbilityType) { + super(ownerId, setInfo, CardType.mergeTypes(typesLeft, typesRight), costsLeft + costsRight, spellAbilityType); String[] names = setInfo.getName().split(" // "); leftHalfCard = new SplitCardHalfImpl(this.getOwnerId(), new CardSetInfo(names[0], setInfo.getExpansionSetCode(), setInfo.getCardNumber(), setInfo.getRarity(), setInfo.getGraphicInfo()), typesLeft, costsLeft, this, SpellAbilityType.SPLIT_LEFT); rightHalfCard = new SplitCardHalfImpl(this.getOwnerId(), new CardSetInfo(names[1], setInfo.getExpansionSetCode(), setInfo.getCardNumber(), setInfo.getRarity(), setInfo.getGraphicInfo()), typesRight, costsRight, this, SpellAbilityType.SPLIT_RIGHT); @@ -135,7 +134,9 @@ public abstract class SplitCard extends CardImpl { public Abilities getAbilities() { Abilities allAbilites = new AbilitiesImpl<>(); for (Ability ability : super.getAbilities()) { - if (ability instanceof SpellAbility && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT) { + if (ability instanceof SpellAbility + && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT + && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT_AFTERMATH) { allAbilites.add(ability); } } @@ -149,6 +150,7 @@ public abstract class SplitCard extends CardImpl { * gets any abilities on a split card as a whole, and not on either half * individually. * + * @return */ public Abilities getSharedAbilities() { return super.getAbilities(); @@ -158,7 +160,9 @@ public abstract class SplitCard extends CardImpl { public Abilities getAbilities(Game game) { Abilities allAbilites = new AbilitiesImpl<>(); for (Ability ability : super.getAbilities(game)) { - if (ability instanceof SpellAbility && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT) { + if (ability instanceof SpellAbility + && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT + && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT_AFTERMATH) { allAbilites.add(ability); } } diff --git a/Mage/src/main/java/mage/cards/mock/MockSplitCard.java b/Mage/src/main/java/mage/cards/mock/MockSplitCard.java index 97fc4eb52af..73a4e895535 100644 --- a/Mage/src/main/java/mage/cards/mock/MockSplitCard.java +++ b/Mage/src/main/java/mage/cards/mock/MockSplitCard.java @@ -8,6 +8,7 @@ import mage.cards.SplitCard; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; import mage.constants.CardType; +import mage.constants.SpellAbilityType; /** * @@ -20,7 +21,7 @@ public class MockSplitCard extends SplitCard { card.getTypes().toArray(new CardType[0]), join(card.getManaCosts()), "", - join(card.getRules()).contains("Fuse")); + getSpellAbilityType(card)); this.expansionSetCode = card.getSetCode(); this.power = mageIntFromString(card.getPower()); this.toughness = mageIntFromString(card.getToughness()); @@ -77,6 +78,16 @@ public class MockSplitCard extends SplitCard { } } + private static SpellAbilityType getSpellAbilityType(CardInfo cardInfo) { + if (cardInfo.isSplitFuseCard()) { + return SpellAbilityType.SPLIT_FUSED; + } + if (cardInfo.isSplitAftermathCard()) { + return SpellAbilityType.SPLIT_AFTERMATH; + } + return SpellAbilityType.SPLIT; + } + private static String join(List strings) { StringBuilder sb = new StringBuilder(); for (String string : strings) { diff --git a/Mage/src/main/java/mage/cards/repository/CardInfo.java b/Mage/src/main/java/mage/cards/repository/CardInfo.java index e63c7d5b1b4..9e685324c20 100644 --- a/Mage/src/main/java/mage/cards/repository/CardInfo.java +++ b/Mage/src/main/java/mage/cards/repository/CardInfo.java @@ -30,9 +30,7 @@ package mage.cards.repository; import com.j256.ormlite.field.DataType; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; - import java.util.*; - import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.SpellAbility; @@ -106,6 +104,10 @@ public class CardInfo { @DatabaseField protected boolean splitCard; @DatabaseField + protected boolean splitCardFuse; + @DatabaseField + protected boolean splitCardAftermath; + @DatabaseField protected boolean splitCardHalf; @DatabaseField protected boolean flipCard; @@ -131,6 +133,8 @@ public class CardInfo { this.convertedManaCost = card.getConvertedManaCost(); this.rarity = card.getRarity(); this.splitCard = card.isSplitCard(); + this.splitCardFuse = card.getSpellAbility() != null && card.getSpellAbility().getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED; + this.splitCardAftermath = card.getSpellAbility() != null && card.getSpellAbility().getSpellAbilityType() == SpellAbilityType.SPLIT_AFTERMATH; this.flipCard = card.isFlipCard(); this.flipCardName = card.getFlipCardName(); @@ -355,6 +359,14 @@ public class CardInfo { return splitCard; } + public boolean isSplitFuseCard() { + return splitCardFuse; + } + + public boolean isSplitAftermathCard() { + return splitCardAftermath; + } + public boolean isSplitCardHalf() { return splitCardHalf; } diff --git a/Mage/src/main/java/mage/cards/repository/CardRepository.java b/Mage/src/main/java/mage/cards/repository/CardRepository.java index 6269341446d..2d0a285198d 100644 --- a/Mage/src/main/java/mage/cards/repository/CardRepository.java +++ b/Mage/src/main/java/mage/cards/repository/CardRepository.java @@ -37,11 +37,9 @@ import com.j256.ormlite.stmt.Where; import com.j256.ormlite.support.ConnectionSource; import com.j256.ormlite.support.DatabaseConnection; import com.j256.ormlite.table.TableUtils; - import java.io.File; import java.sql.SQLException; import java.util.*; - import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SetType; @@ -58,9 +56,9 @@ public enum CardRepository { private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; private static final String VERSION_ENTITY_NAME = "card"; // raise this if db structure was changed - private static final long CARD_DB_VERSION = 50; + private static final long CARD_DB_VERSION = 51; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 74; + private static final long CARD_CONTENT_VERSION = 75; private final TreeSet landTypes = new TreeSet<>(); private Dao cardDao; private Set classNames; diff --git a/Mage/src/main/java/mage/constants/SpellAbilityType.java b/Mage/src/main/java/mage/constants/SpellAbilityType.java index 9f535b4e448..448b3c95c04 100644 --- a/Mage/src/main/java/mage/constants/SpellAbilityType.java +++ b/Mage/src/main/java/mage/constants/SpellAbilityType.java @@ -9,6 +9,7 @@ public enum SpellAbilityType { BASE_ALTERNATE("Basic SpellAbility Alternate"), // used for Overload, Flashback to know they must be handled as Alternate casting costs FACE_DOWN_CREATURE("Face down creature"), // used for Lands with Morph to cast as Face Down creature SPLIT("Split SpellAbility"), + SPLIT_AFTERMATH("AftermathSplit SpellAbility"), SPLIT_FUSED("Split SpellAbility"), SPLIT_LEFT("LeftSplit SpellAbility"), SPLIT_RIGHT("RightSplit SpellAbility"), diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index a346270c3a4..305b71e170e 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -1237,7 +1237,8 @@ public abstract class PlayerImpl implements Player, Serializable { continue; } } - if (((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.SPLIT) { + if (((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.SPLIT + || ((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.SPLIT_AFTERMATH) { continue; } useable.put(ability.getId(), (SpellAbility) ability); @@ -2447,7 +2448,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (!copy.canActivate(playerId, game)) { return false; } - if(available != null) { + if (available != null) { game.getContinuousEffects().costModification(copy, game); }