diff --git a/Mage.Sets/src/mage/sets/bornofthegods/MogisGodOfSlaughter.java b/Mage.Sets/src/mage/sets/bornofthegods/MogisGodOfSlaughter.java new file mode 100644 index 0000000000..45a0d9e011 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/MogisGodOfSlaughter.java @@ -0,0 +1,171 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class MogisGodOfSlaughter extends CardImpl { + + public MogisGodOfSlaughter(UUID ownerId) { + super(ownerId, 151, "Mogis, God of Slaughter", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{B}{R}"); + this.expansionSetCode = "BNG"; + this.supertype.add("Legendary"); + this.subtype.add("God"); + + this.color.setRed(true); + this.color.setBlack(true); + this.power = new MageInt(7); + this.toughness = new MageInt(5); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + // As long as your devotion to black and red is less than seven, Mogis isn't a creature. + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.B, ColoredManaSymbol.R), 7); + effect.setText("As long as your devotion to black and red is less than seven, Mogis isn't a creature"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature. + effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, false, "that player"), new SacrificeTargetCost(new TargetControlledCreaturePermanent()), + "Sacrifice a creature? (Otherwise you get 2 damge.)"); + effect.setText("Mogis deals 2 damage to that player unless he or she sacrifices a creature"); + Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.OPPONENT, false, true); + this.addAbility(ability); + } + + public MogisGodOfSlaughter(final MogisGodOfSlaughter card) { + super(card); + } + + @Override + public MogisGodOfSlaughter copy() { + return new MogisGodOfSlaughter(this); + } +} + +class DoUnlessTargetPaysCost extends OneShotEffect { + private final OneShotEffect executingEffect; + private final Cost cost; + private final String userMessage; + + public DoUnlessTargetPaysCost(OneShotEffect effect, Cost cost) { + this(effect, cost, null); + } + public DoUnlessTargetPaysCost(OneShotEffect effect, Cost cost, String userMessage) { + super(Outcome.Benefit); + this.executingEffect = effect; + this.cost = cost; + this.userMessage = userMessage; + } + + public DoUnlessTargetPaysCost(final DoUnlessTargetPaysCost effect) { + super(effect); + this.executingEffect = (OneShotEffect) effect.executingEffect.copy(); + this.cost = effect.cost.copy(); + this.userMessage = effect.userMessage; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject mageObject = game.getObject(source.getSourceId()); + if (player != null && mageObject != null) { + String message = userMessage; + if (message == null) { + message = new StringBuilder(getCostText()).append(" to prevent ").append(executingEffect.getText(source.getModes().getMode())).append("?").toString(); + } + message = CardUtil.replaceSourceName(message, mageObject.getName()); + cost.clearPaid(); + if (cost.canPay(source.getSourceId(), player.getId(), game) && player.chooseUse(executingEffect.getOutcome(), message, game)) { + cost.pay(source, game, source.getSourceId(), player.getId(), false); + } + if (!cost.isPaid()) { + executingEffect.setTargetPointer(this.targetPointer); + return executingEffect.apply(game, source); + } + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + if (!staticText.isEmpty()) { + return staticText; + } + StringBuilder sb = new StringBuilder(executingEffect.getText(mode)); + sb.append("unless he or she"); + sb.append(getCostText()); + return sb.toString(); + } + + private String getCostText() { + StringBuilder sb = new StringBuilder(); + String costText = cost.getText(); + if (costText != null && + !costText.toLowerCase().startsWith("discard") + && !costText.toLowerCase().startsWith("sacrifice") + && !costText.toLowerCase().startsWith("remove")) { + sb.append("pay "); + } + return sb.append(costText).toString(); + } + + @Override + public DoUnlessTargetPaysCost copy() { + return new DoUnlessTargetPaysCost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/AbhorrentOverlord.java b/Mage.Sets/src/mage/sets/theros/AbhorrentOverlord.java index 9ce3c35541..119502aea6 100644 --- a/Mage.Sets/src/mage/sets/theros/AbhorrentOverlord.java +++ b/Mage.Sets/src/mage/sets/theros/AbhorrentOverlord.java @@ -39,7 +39,7 @@ import mage.abilities.effects.common.SacrificeControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; import mage.constants.TargetController; import mage.filter.common.FilterCreaturePermanent; @@ -63,7 +63,7 @@ public class AbhorrentOverlord extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // When Abhorrent Overlord enters the battlefield, put a number of 1/1 black Harpy creature tokens with flying onto the battlefield equal to your devotion to black. - Effect effect = new CreateTokenEffect(new AbhorrentOverlordHarpyToken(), new DevotionCount(ManaType.BLACK)); + Effect effect = new CreateTokenEffect(new AbhorrentOverlordHarpyToken(), new DevotionCount(ColoredManaSymbol.B)); effect.setText("put a number of 1/1 black Harpy creature tokens with flying onto the battlefield equal to your devotion to black. (Each {B} in the mana costs of permanents you control counts toward your devotion to black.)"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); // At the beginning of your upkeep, sacrifice a creature. diff --git a/Mage.Sets/src/mage/sets/theros/DiscipleOfPhenax.java b/Mage.Sets/src/mage/sets/theros/DiscipleOfPhenax.java index 7411043ed2..450cecee79 100644 --- a/Mage.Sets/src/mage/sets/theros/DiscipleOfPhenax.java +++ b/Mage.Sets/src/mage/sets/theros/DiscipleOfPhenax.java @@ -39,7 +39,7 @@ import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; @@ -102,7 +102,7 @@ class DiscipleOfPhenaxEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int devotion = new DevotionCount(ManaType.BLACK).calculate(game, source); + int devotion = new DevotionCount(ColoredManaSymbol.B).calculate(game, source); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (devotion > 0 && targetPlayer != null) { Cards revealedCards = new CardsImpl(Zone.PICK); diff --git a/Mage.Sets/src/mage/sets/theros/ErebosGodOfTheDead.java b/Mage.Sets/src/mage/sets/theros/ErebosGodOfTheDead.java index cdcd8a7a4a..4f266f9738 100644 --- a/Mage.Sets/src/mage/sets/theros/ErebosGodOfTheDead.java +++ b/Mage.Sets/src/mage/sets/theros/ErebosGodOfTheDead.java @@ -42,9 +42,9 @@ import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; import mage.constants.Duration; import mage.constants.Layer; -import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; @@ -71,7 +71,7 @@ public class ErebosGodOfTheDead extends CardImpl { // Indestructible this.addAbility(IndestructibleAbility.getInstance()); // As long as your devotion to black is less than five, Erebos isn't a creature. - Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ManaType.BLACK), 5); + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.B), 5); effect.setText("As long as your devotion to black is less than five, Erebos isn't a creature.(Each {B} in the mana costs of permanents you control counts towards your devotion to black.)"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java b/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java index 06cab5026a..04f99f01e4 100644 --- a/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java +++ b/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java @@ -35,7 +35,7 @@ import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; import mage.game.permanent.token.Token; @@ -56,7 +56,7 @@ public class EvangelOfHeliod extends CardImpl { this.toughness = new MageInt(3); // When Evangel of Heliod enters the battlefield, put a number of 1/1 white Soldier creature tokens onto the battlefield equal to your devotion to white. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EvangelOfHeliodSoldierToken(), new DevotionCount(ManaType.WHITE)))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EvangelOfHeliodSoldierToken(), new DevotionCount(ColoredManaSymbol.W)))); } public EvangelOfHeliod(final EvangelOfHeliod card) { diff --git a/Mage.Sets/src/mage/sets/theros/FanaticOfMogis.java b/Mage.Sets/src/mage/sets/theros/FanaticOfMogis.java index 6016920ccb..b180c6e3f2 100644 --- a/Mage.Sets/src/mage/sets/theros/FanaticOfMogis.java +++ b/Mage.Sets/src/mage/sets/theros/FanaticOfMogis.java @@ -35,7 +35,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamagePlayersEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; @@ -57,7 +57,7 @@ public class FanaticOfMogis extends CardImpl { this.toughness = new MageInt(2); // When Fanatic of Mogis enters the battlefield, it deals damage to each opponent equal to your devotion to red. - Effect effect = new DamagePlayersEffect(Outcome.Damage, new DevotionCount(ManaType.RED), TargetController.OPPONENT); + Effect effect = new DamagePlayersEffect(Outcome.Damage, new DevotionCount(ColoredManaSymbol.R), TargetController.OPPONENT); effect.setText("it deals damage to each opponent equal to your devotion to red. (Each {R} in the mana costs of permanents you control counts towards your devotion to red.)"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); } diff --git a/Mage.Sets/src/mage/sets/theros/GrayMerchantOfAsphodel.java b/Mage.Sets/src/mage/sets/theros/GrayMerchantOfAsphodel.java index b9c0af14c6..660296ab5b 100644 --- a/Mage.Sets/src/mage/sets/theros/GrayMerchantOfAsphodel.java +++ b/Mage.Sets/src/mage/sets/theros/GrayMerchantOfAsphodel.java @@ -35,7 +35,7 @@ import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; @@ -91,7 +91,7 @@ class GrayMerchantOfAsphodelEffect extends OneShotEffect 0) { for (UUID playerId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/sets/theros/HeliodGodOfTheSun.java b/Mage.Sets/src/mage/sets/theros/HeliodGodOfTheSun.java index 9c390be21b..8e88011311 100644 --- a/Mage.Sets/src/mage/sets/theros/HeliodGodOfTheSun.java +++ b/Mage.Sets/src/mage/sets/theros/HeliodGodOfTheSun.java @@ -41,8 +41,8 @@ import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; import mage.constants.Duration; -import mage.constants.ManaType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; @@ -68,7 +68,7 @@ public class HeliodGodOfTheSun extends CardImpl { this.addAbility(IndestructibleAbility.getInstance()); // As long as your devotion to white is less than five, Heliod isn't a creature.(Each {W} in the mana costs of permanents you control counts towards your devotion to white.) - Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ManaType.WHITE), 5); + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.W), 5); effect.setText("As long as your devotion to white is less than five, Heliod isn't a creature.(Each {W} in the mana costs of permanents you control counts towards your devotion to white.)"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/theros/KarametrasAcolyte.java b/Mage.Sets/src/mage/sets/theros/KarametrasAcolyte.java index 7cc664bfa9..477089ad1e 100644 --- a/Mage.Sets/src/mage/sets/theros/KarametrasAcolyte.java +++ b/Mage.Sets/src/mage/sets/theros/KarametrasAcolyte.java @@ -34,7 +34,7 @@ import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; /** @@ -54,7 +54,7 @@ public class KarametrasAcolyte extends CardImpl { this.toughness = new MageInt(4); // {T}: Add an amount of {G} to your mana pool equal to your devotion to green. - this.addAbility(new DynamicManaAbility(Mana.GreenMana, new DevotionCount(ManaType.GREEN), + this.addAbility(new DynamicManaAbility(Mana.GreenMana, new DevotionCount(ColoredManaSymbol.G), "Add an amount of {G} to your mana pool equal to your devotion to green. (Each {G} in the mana costs of permanents you control counts towards your devotion to green.)")); } diff --git a/Mage.Sets/src/mage/sets/theros/MasterOfWaves.java b/Mage.Sets/src/mage/sets/theros/MasterOfWaves.java index a21c3abcf7..0d46a8134d 100644 --- a/Mage.Sets/src/mage/sets/theros/MasterOfWaves.java +++ b/Mage.Sets/src/mage/sets/theros/MasterOfWaves.java @@ -39,8 +39,8 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; import mage.constants.Duration; -import mage.constants.ManaType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; @@ -78,7 +78,7 @@ public class MasterOfWaves extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterBoost, false))); // When Master of Waves enters the battlefield, put a number of 1/0 blue Elemental creature tokens onto the battlefield equal to your devotion to blue. // (Each {U} in the mana costs of permanents you control counts toward your devotion to blue.) - Effect effect = new CreateTokenEffect(new MasterOfWavesElementalToken(), new DevotionCount(ManaType.BLUE)); + Effect effect = new CreateTokenEffect(new MasterOfWavesElementalToken(), new DevotionCount(ColoredManaSymbol.U)); effect.setText("put a number of 1/0 blue Elemental creature tokens onto the battlefield equal to your devotion to blue. (Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); diff --git a/Mage.Sets/src/mage/sets/theros/MogissMarauder.java b/Mage.Sets/src/mage/sets/theros/MogissMarauder.java index c693c51916..7adfd58345 100644 --- a/Mage.Sets/src/mage/sets/theros/MogissMarauder.java +++ b/Mage.Sets/src/mage/sets/theros/MogissMarauder.java @@ -37,8 +37,8 @@ import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.IntimidateAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; import mage.constants.Duration; -import mage.constants.ManaType; import mage.constants.Rarity; import mage.game.Game; import mage.target.common.TargetCreaturePermanent; @@ -73,7 +73,7 @@ public class MogissMarauder extends CardImpl { public void adjustTargets(Ability ability, Game game) { if (ability instanceof EntersBattlefieldTriggeredAbility) { ability.getTargets().clear(); - int numbTargets = new DevotionCount(ManaType.BLACK).calculate(game, ability); + int numbTargets = new DevotionCount(ColoredManaSymbol.B).calculate(game, ability); if (numbTargets > 0) { ability.addTarget(new TargetCreaturePermanent(0,numbTargets)); } diff --git a/Mage.Sets/src/mage/sets/theros/NykthosShrineToNyx.java b/Mage.Sets/src/mage/sets/theros/NykthosShrineToNyx.java index b3af222204..b0c78987b5 100644 --- a/Mage.Sets/src/mage/sets/theros/NykthosShrineToNyx.java +++ b/Mage.Sets/src/mage/sets/theros/NykthosShrineToNyx.java @@ -40,7 +40,7 @@ import mage.cards.CardImpl; import mage.choices.Choice; import mage.choices.ChoiceColor; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; @@ -104,7 +104,7 @@ class NykthosShrineToNyxManaAbility extends ManaAbility { // Indestructible this.addAbility(IndestructibleAbility.getInstance()); // As long as your devotion to white is less than five, Nylea isn't a creature.(Each {G} in the mana costs of permanents you control counts towards your devotion to green.) - Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ManaType.GREEN), 5); + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.G), 5); effect.setText("As long as your devotion to green is less than five, Nylea isn't a creature.(Each {G} in the mana costs of permanents you control counts towards your devotion to green.)"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // Other creatures you control have trample. diff --git a/Mage.Sets/src/mage/sets/theros/NyleasDisciple.java b/Mage.Sets/src/mage/sets/theros/NyleasDisciple.java index 2eb267c52a..22b590fc3a 100644 --- a/Mage.Sets/src/mage/sets/theros/NyleasDisciple.java +++ b/Mage.Sets/src/mage/sets/theros/NyleasDisciple.java @@ -34,7 +34,7 @@ import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; /** @@ -54,7 +54,7 @@ public class NyleasDisciple extends CardImpl { this.toughness = new MageInt(3); // When Nylea's Disciple enters the battlefield, you gain life equal to your devotion to green. - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(new DevotionCount(ManaType.GREEN)))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(new DevotionCount(ColoredManaSymbol.G)))); } public NyleasDisciple(final NyleasDisciple card) { diff --git a/Mage.Sets/src/mage/sets/theros/PurphorosGodOfTheForge.java b/Mage.Sets/src/mage/sets/theros/PurphorosGodOfTheForge.java index 7bfbba5914..269dc19475 100644 --- a/Mage.Sets/src/mage/sets/theros/PurphorosGodOfTheForge.java +++ b/Mage.Sets/src/mage/sets/theros/PurphorosGodOfTheForge.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; import mage.constants.Duration; -import mage.constants.ManaType; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; @@ -73,7 +73,7 @@ public class PurphorosGodOfTheForge extends CardImpl { // Indestructible this.addAbility(IndestructibleAbility.getInstance()); // As long as your devotion to red is less than five, Purphoros isn't a creature. - Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ManaType.RED), 5); + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.R), 5); effect.setText("As long as your devotion to red is less than five, Purphoros isn't a creature.(Each {R} in the mana costs of permanents you control counts towards your devotion to red.)"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/theros/ReverentHunter.java b/Mage.Sets/src/mage/sets/theros/ReverentHunter.java index 24b3eb9c78..564be94b59 100644 --- a/Mage.Sets/src/mage/sets/theros/ReverentHunter.java +++ b/Mage.Sets/src/mage/sets/theros/ReverentHunter.java @@ -34,7 +34,7 @@ import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; import mage.counters.CounterType; @@ -55,7 +55,7 @@ public class ReverentHunter extends CardImpl { this.toughness = new MageInt(1); // When Reverent Hunter enters the battlefield, put a number of +1/+1 counters on it equal to your devotion to green. - this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new DevotionCount(ManaType.GREEN), true))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new DevotionCount(ColoredManaSymbol.G), true))); } diff --git a/Mage.Sets/src/mage/sets/theros/ThassaGodOfTheSea.java b/Mage.Sets/src/mage/sets/theros/ThassaGodOfTheSea.java index 359a820569..53becca0fd 100644 --- a/Mage.Sets/src/mage/sets/theros/ThassaGodOfTheSea.java +++ b/Mage.Sets/src/mage/sets/theros/ThassaGodOfTheSea.java @@ -43,8 +43,8 @@ import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; import mage.constants.Duration; -import mage.constants.ManaType; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; @@ -71,7 +71,7 @@ public class ThassaGodOfTheSea extends CardImpl { this.addAbility(IndestructibleAbility.getInstance()); // As long as your devotion to white is less than five, Thassa isn't a creature.(Each {U} in the mana costs of permanents you control counts towards your devotion to white.) - Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ManaType.BLUE), 5); + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.U), 5); effect.setText("As long as your devotion to blue is less than five, Thassa isn't a creature.(Each {U} in the mana costs of permanents you control counts towards your devotion to blue.)"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage/src/mage/abilities/TriggeredAbilityImpl.java b/Mage/src/mage/abilities/TriggeredAbilityImpl.java index 2a1776533e..25dc0446e6 100644 --- a/Mage/src/mage/abilities/TriggeredAbilityImpl.java +++ b/Mage/src/mage/abilities/TriggeredAbilityImpl.java @@ -132,8 +132,7 @@ public abstract class TriggeredAbilityImpl> ex } } - sb.append(superRule.substring(0, 1).toLowerCase()); - sb.append(superRule.substring(1)); + sb.append(superRule); } return sb.toString(); diff --git a/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java b/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java index 1ce06a89cd..c097e79fdb 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java @@ -4,9 +4,11 @@ */ package mage.abilities.dynamicvalue.common; +import java.util.ArrayList; +import java.util.Arrays; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; -import mage.constants.ManaType; +import mage.constants.ColoredManaSymbol; import mage.game.Game; import mage.game.permanent.Permanent; @@ -17,37 +19,22 @@ import mage.game.permanent.Permanent; */ public class DevotionCount implements DynamicValue { - private ManaType devotionColor; + private ArrayList devotionColors = new ArrayList(); - - public DevotionCount(ManaType devotionColor) { - this.devotionColor = devotionColor; + public DevotionCount(ColoredManaSymbol... devotionColor) { + this.devotionColors.addAll(Arrays.asList(devotionColor)); } public DevotionCount(final DevotionCount dynamicValue) { - this.devotionColor = dynamicValue.devotionColor; + this.devotionColors = dynamicValue.devotionColors; } @Override public int calculate(Game game, Ability sourceAbility) { int devotion = 0; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(sourceAbility.getControllerId())) { - switch (devotionColor) { - case BLACK: - devotion += permanent.getManaCost().getMana().getBlack(); - break; - case BLUE: - devotion += permanent.getManaCost().getMana().getBlue(); - break; - case GREEN: - devotion += permanent.getManaCost().getMana().getGreen(); - break; - case RED: - devotion += permanent.getManaCost().getMana().getRed(); - break; - case WHITE: - devotion += permanent.getManaCost().getMana().getWhite(); - break; + for(ColoredManaSymbol coloredManaSymbol: devotionColors) { + devotion += permanent.getManaCost().getMana().getColor(coloredManaSymbol); } } return devotion; @@ -65,6 +52,15 @@ public class DevotionCount implements DynamicValue { @Override public String getMessage() { - return new StringBuilder("devotion to ").append(devotionColor.toString()).toString(); + StringBuilder sb = new StringBuilder("devotion to "); + int count = 0; + for (ColoredManaSymbol coloredManaSymbol:devotionColors) { + if (count > 0) { + sb.append(" and "); + } + sb.append(coloredManaSymbol.getColorName()); + count++; + } + return sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java b/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java index 9c34d8cc14..e2ce0ec625 100644 --- a/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/UntapTargetEffect.java @@ -80,7 +80,10 @@ public class UntapTargetEffect extends OneShotEffect { if (target.getMaxNumberOfTargets() > 1 || target.getNumberOfTargets() == 0) { sb.append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName()).append("s"); } else { - sb.append("target ").append(target.getTargetName()); + if (!target.getTargetName().startsWith("another")) { + sb.append("target "); + } + sb.append(target.getTargetName()); } return sb.toString(); diff --git a/Mage/src/mage/abilities/effects/common/continious/LoseCreatureTypeSourceEffect.java b/Mage/src/mage/abilities/effects/common/continious/LoseCreatureTypeSourceEffect.java index d82c8cb647..8ca1b2c8d8 100644 --- a/Mage/src/mage/abilities/effects/common/continious/LoseCreatureTypeSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/LoseCreatureTypeSourceEffect.java @@ -49,6 +49,12 @@ public class LoseCreatureTypeSourceEffect extends ContinuousEffectImpl