diff --git a/Mage.Client/plugins/mage-card-plugin.jar b/Mage.Client/plugins/mage-card-plugin.jar index 84043998e4..0f8ffcf73b 100644 Binary files a/Mage.Client/plugins/mage-card-plugin.jar and b/Mage.Client/plugins/mage-card-plugin.jar differ diff --git a/Mage.Client/src/main/java/mage/client/components/arcane/ManaSymbols.java b/Mage.Client/src/main/java/mage/client/components/arcane/ManaSymbols.java index 832b95fa79..b9b64d63ee 100644 --- a/Mage.Client/src/main/java/mage/client/components/arcane/ManaSymbols.java +++ b/Mage.Client/src/main/java/mage/client/components/arcane/ManaSymbols.java @@ -28,7 +28,8 @@ public class ManaSymbols { static public void loadImages() { String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG", - "BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU", "X" /*, "Y", "Z", "slash"*/}; + "BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU", + "WP", "UP", "BP", "RP", "GP", "X" /*, "Y", "Z", "slash"*/}; for (String symbol : symbols) { File file = new File(Constants.RESOURCE_PATH_MANA_LARGE + "/" + symbol + ".jpg"); Rectangle r = new Rectangle(11, 11); diff --git a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java index aaf3eef32a..41c7c8ec95 100644 --- a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java @@ -114,6 +114,11 @@ public class FeedbackPanel extends javax.swing.JPanel { break; } this.btnSpecial.setVisible(special); + this.btnSpecial.setText("Special"); + if (message.contains("P}")) { + this.btnSpecial.setVisible(true); + this.btnSpecial.setText("Pay 2 life"); + } handleOptions(options); this.revalidate(); this.repaint(); diff --git a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java index 1bd26d72e1..5958a79bc6 100644 --- a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java +++ b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java @@ -30,9 +30,10 @@ public class ManaSymbols { static public void loadImages() { String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG", - "BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU", "X", "Y", "Z", "slash"}; + "BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU", + "WP", "UP", "BP", "RP", "GP", "X", "Y", "Z", "slash"}; for (String symbol : symbols) { - File file = new File(Constants.RESOURCE_PATH_MANA_LARGE + "/" + symbol + ".jpg"); + File file = new File(Constants.RESOURCE_PATH_MANA_MEDIUM + "/" + symbol + ".jpg"); Rectangle r = new Rectangle(11, 11); try { Image image = UI.getImageIcon(file.getAbsolutePath()).getImage(); diff --git a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java index 4b2c988c47..004f7a899e 100644 --- a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java +++ b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java @@ -39,6 +39,8 @@ public class GathererSymbols implements Iterable { "W/U", "U/B", "B/R", "R/G", "G/W", "W/B", "U/R", "B/G", "R/W", "G/U", "2/W", "2/U", "2/B", "2/R", "2/G", + + "WP", "UP", "BP", "RP", "GP", "X", "S", "T", "Q"}; private static final int minNumeric = 0, maxNumeric = 16; 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 661b968102..584aef5998 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 @@ -30,17 +30,10 @@ package mage.player.human; import java.io.Serializable; import java.util.List; -import mage.abilities.TriggeredAbilities; -import mage.abilities.TriggeredAbility; -import mage.abilities.effects.ReplacementEffect; -import mage.cards.Card; -import mage.cards.Cards; -import mage.choices.Choice; -import mage.game.draft.Draft; -import mage.players.*; import java.util.Map; import java.util.Set; import java.util.UUID; + import mage.Constants.Outcome; import mage.Constants.RangeOfInfluence; import mage.Constants.TargetController; @@ -49,18 +42,28 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.SpecialAction; +import mage.abilities.TriggeredAbilities; +import mage.abilities.TriggeredAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.costs.mana.PhyrexianManaCost; import mage.abilities.costs.mana.VariableManaCost; +import mage.abilities.effects.ReplacementEffect; +import mage.cards.Card; +import mage.cards.Cards; import mage.cards.decks.Deck; +import mage.choices.Choice; import mage.choices.ChoiceImpl; import mage.filter.common.FilterCreatureForCombat; import mage.game.Game; -import mage.game.Table; +import mage.game.draft.Draft; import mage.game.match.Match; import mage.game.permanent.Permanent; import mage.game.tournament.Tournament; +import mage.players.Player; +import mage.players.PlayerImpl; import mage.target.Target; import mage.target.TargetAmount; import mage.target.TargetCard; @@ -351,7 +354,20 @@ public class HumanPlayer extends PlayerImpl { return false; } else if (response.getUUID() != null) { playManaAbilities(game); - } + } else if (response.getString() != null && response.getString().equals("special")) { + if (unpaid instanceof ManaCostsImpl) { + ManaCostsImpl costs = (ManaCostsImpl) unpaid; + for (ManaCost cost : costs.getUnpaid()) { + if (cost instanceof PhyrexianManaCost) { + PhyrexianManaCost ph = (PhyrexianManaCost)cost; + if (ph.canPay(null, playerId, game)) { + ((PhyrexianManaCost)cost).pay(game, null, playerId, false); + } + break; + } + } + } + } return true; } diff --git a/Mage.Server/plugins/mage-player-human.jar b/Mage.Server/plugins/mage-player-human.jar index e2583091cb..2746ea14c0 100644 Binary files a/Mage.Server/plugins/mage-player-human.jar and b/Mage.Server/plugins/mage-player-human.jar differ diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Dismember.java b/Mage.Sets/src/mage/sets/newphyrexia/Dismember.java new file mode 100644 index 0000000000..2c4a3c0e32 --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/Dismember.java @@ -0,0 +1,63 @@ +/* + * 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.newphyrexia; + +import java.util.UUID; + +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author nantuko + */ +public class Dismember extends CardImpl { + + public Dismember (UUID ownerId) { + super(ownerId, 57, "Dismember", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{BP}{BP}"); + this.expansionSetCode = "NPH"; + this.color.setBlack(true); + this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public Dismember (final Dismember card) { + super(card); + } + + @Override + public Dismember copy() { + return new Dismember(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MutagenicGrowth.java b/Mage.Sets/src/mage/sets/newphyrexia/MutagenicGrowth.java new file mode 100644 index 0000000000..ff7e276cb6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/MutagenicGrowth.java @@ -0,0 +1,62 @@ +/* + * 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.newphyrexia; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author nantuko + */ +public class MutagenicGrowth extends CardImpl { + + public MutagenicGrowth (UUID ownerId) { + super(ownerId, 116, "Mutagenic Growth", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{GP}"); + this.expansionSetCode = "NPH"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + } + + public MutagenicGrowth (final MutagenicGrowth card) { + super(card); + } + + @Override + public MutagenicGrowth copy() { + return new MutagenicGrowth(this); + } + +} diff --git a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java index e5c37647da..00fe24c7be 100644 --- a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java +++ b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java @@ -108,6 +108,7 @@ public class ManaCostsImpl extends ArrayList implements M setPaid(); return true; } + Player player = game.getPlayer(controllerId); assignPayment(player.getManaPool()); while (!isPaid()) { @@ -226,8 +227,9 @@ public class ManaCostsImpl extends ArrayList implements M else { if (Character.isDigit(symbol.charAt(0))) { this.add((T)new MonoHybridManaCost(ColoredManaSymbol.lookup(symbol.charAt(2)))); - } - else { + } else if (symbol.contains("P")) { + this.add((T)new PhyrexianManaCost(ColoredManaSymbol.lookup(symbol.charAt(0)))); + } else { this.add((T)new HybridManaCost(ColoredManaSymbol.lookup(symbol.charAt(0)), ColoredManaSymbol.lookup(symbol.charAt(2)))); } } diff --git a/Mage/src/mage/abilities/costs/mana/PhyrexianManaCost.java b/Mage/src/mage/abilities/costs/mana/PhyrexianManaCost.java new file mode 100644 index 0000000000..ecf0422ca0 --- /dev/null +++ b/Mage/src/mage/abilities/costs/mana/PhyrexianManaCost.java @@ -0,0 +1,87 @@ +/* +* 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.abilities.costs.mana; + +import java.util.UUID; + +import mage.Constants.ColoredManaSymbol; +import mage.abilities.SpecialAction; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.RemoveSpecialActionEffect; +import mage.game.Game; +import mage.players.ManaPool; +import mage.players.Player; + +/** + * + * @author nantuko + */ +public class PhyrexianManaCost extends ColoredManaCost { + + public PhyrexianManaCost(ColoredManaSymbol mana) { + super(mana); + } + + public PhyrexianManaCost(PhyrexianManaCost manaCost) { + super(manaCost); + } + + @Override + public void assignPayment(ManaPool pool) { + if (assignColored(pool, this.mana)) + return; + } + + @Override + public String getText() { + return "{" + mana.toString() + "P}"; + } + + @Override + public PhyrexianManaCost getUnpaid() { + return this; + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return game.getPlayer(controllerId).getLife() > 2; + } + + @Override + public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = game.getPlayer(controllerId).loseLife(2, game) == 2; + return paid; + } + + @Override + public PhyrexianManaCost copy() { + return new PhyrexianManaCost(this); + } +} + diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index 354aa4bdbe..35b86dff6d 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -259,6 +259,11 @@ $mana{'Black or Red'} = '{B/R}'; $mana{'Blue or Red'} = '{U/R}'; $mana{'Red or Green'} = '{R/G}'; $mana{'Red or White'} = '{R/W}'; +$mana{'Phyrexian Green'} = '{GP}'; +$mana{'Phyrexian Red'} = '{RP}'; +$mana{'Phyrexian Black'} = '{BP}'; +$mana{'Phyrexian Blue'} = '{UP}'; +$mana{'Phyrexian White'} = '{WP}'; my %manatocolor; $manatocolor{'Black'} = " this.color.setBlack(true);"; @@ -267,6 +272,11 @@ $manatocolor{'Green'} = " this.color.setGreen(true);"; $manatocolor{'Red'} = " this.color.setRed(true);"; $manatocolor{'White'} = " this.color.setWhite(true);"; $manatocolor{'Red or White'} = " this.color.setWhite(true);\n this.color.setRed(true);"; +$manatocolor{'Phyrexian Green'} = " this.color.setGreen(true);"; +$manatocolor{'Phyrexian Red'} = " this.color.setRed(true);"; +$manatocolor{'Phyrexian Black'} = " this.color.setBlack(true);"; +$manatocolor{'Phyrexian Blue'} = " this.color.setBlue(true);"; +$manatocolor{'Phyrexian White'} = " this.color.setWhite(true);"; my %cardtypes; $cardtypes{'Artifact'} = "CardType.ARTIFACT"; @@ -357,7 +367,10 @@ foreach my $div (@divs) { $manacost .= "{" . $m . "}"; } else { die "unknown manacost: " . $m unless defined $mana{$m}; + $manacost .= $mana{$m}; + print "$m"; + print "$manatocolor{$m}"; $findedcolors .= "\n" . $manatocolor{$m}; } }