From b59ed5e3b708cd4658fdc7d626e831e5a85b08d8 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 16 Apr 2017 17:28:09 +1000 Subject: [PATCH 1/5] Pyramid of the Pantheon --- Utils/mtg-cards-data.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index b340977e4f7..5fed727f65c 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -31078,7 +31078,7 @@ Kefnet's Monument|Amonkhet|231|U|{3}|Legendary Artifact|||Blue creature spells y Luxa River Shrine|Amonkhet|232|C|{3}|Artifact|||{1}, {T}: You gain 1 life. Put a brick counter on Luxa River Shrine.${T}: You gain 2 life. Activate this ability only if there are three or more brick counters on Luxa River Shrine.| Oketra's Monument|Amonkhet|233|U|{3}|Legendary Artifact|||White creature spells you cast cost {1} less to cast.$Whenever you cast a creature spell, create 1/1 a white Warrior creature token with vigilance.| Oracle's Vault|Amonkhet|234|R|{4}|Artifact|||{2}, {T}: Exile the top card of your library. Until end of turn, you may play that card. Put a brick counter on Oracle's Vault.${T}: Exile the top card of your library. Until end of turn, you may play that card without paying its mana cost. Activate this ability only if there are three or more brick counters on Oracle's Vault.| -Pyramid of the Pantheon|235|R|{1}|Artifact|||{2}, {T}: Add one mana of any color to your mana pool. Put a brick counter on Pyramid of the Pantheon.${T}: Add three mana of any one color to your mana pool. Activate this ability only of there are three or more brick counters on Pyramid of the Pantheon.| +Pyramid of the Pantheon|Amonkhet|235|R|{1}|Artifact|||{2}, {T}: Add one mana of any color to your mana pool. Put a brick counter on Pyramid of the Pantheon.${T}: Add three mana of any one color to your mana pool. Activate this ability only of there are three or more brick counters on Pyramid of the Pantheon.| Rhonas's Monument|Amonkhet|236|U|{3}|Legendary Artifact|||Green creature spells you cast cost {1} less to cast.$Whenever you cast a creature spell, target creature you control gets +2/+2 and gains trample until end of turn.| Throne of the God-Pharaoh|Amonkhet|237|R|{2}|Legendary Artifact|||At the beginning of your end step, each opponent loses life equal to the number of tapped creatures you control.| Watchers of the Dead|Amonkhet|238|U|{2}|Artifact Creature - Cat|2|2|Exile Watchers of the Dead: Each opponent chooses two cards in his or her graveyard and exiles the rest.| From be106091ed9197ec4eea239b3993ab924646e6f2 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 16 Apr 2017 17:29:11 +1000 Subject: [PATCH 2/5] Pyramid of the Pantheon --- Utils/mtg-cards-data.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 5fed727f65c..5f44f31aca6 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -31078,7 +31078,7 @@ Kefnet's Monument|Amonkhet|231|U|{3}|Legendary Artifact|||Blue creature spells y Luxa River Shrine|Amonkhet|232|C|{3}|Artifact|||{1}, {T}: You gain 1 life. Put a brick counter on Luxa River Shrine.${T}: You gain 2 life. Activate this ability only if there are three or more brick counters on Luxa River Shrine.| Oketra's Monument|Amonkhet|233|U|{3}|Legendary Artifact|||White creature spells you cast cost {1} less to cast.$Whenever you cast a creature spell, create 1/1 a white Warrior creature token with vigilance.| Oracle's Vault|Amonkhet|234|R|{4}|Artifact|||{2}, {T}: Exile the top card of your library. Until end of turn, you may play that card. Put a brick counter on Oracle's Vault.${T}: Exile the top card of your library. Until end of turn, you may play that card without paying its mana cost. Activate this ability only if there are three or more brick counters on Oracle's Vault.| -Pyramid of the Pantheon|Amonkhet|235|R|{1}|Artifact|||{2}, {T}: Add one mana of any color to your mana pool. Put a brick counter on Pyramid of the Pantheon.${T}: Add three mana of any one color to your mana pool. Activate this ability only of there are three or more brick counters on Pyramid of the Pantheon.| +Pyramid of the Pantheon|Amonkhet|235|R|{1}|Artifact|||{2}, {T}: Add one mana of any color to your mana pool. Put a brick counter on Pyramid of the Pantheon.$ {T}: Add three mana of any one color to your mana pool. Activate this ability only of there are three or more brick counters on Pyramid of the Pantheon.| Rhonas's Monument|Amonkhet|236|U|{3}|Legendary Artifact|||Green creature spells you cast cost {1} less to cast.$Whenever you cast a creature spell, target creature you control gets +2/+2 and gains trample until end of turn.| Throne of the God-Pharaoh|Amonkhet|237|R|{2}|Legendary Artifact|||At the beginning of your end step, each opponent loses life equal to the number of tapped creatures you control.| Watchers of the Dead|Amonkhet|238|U|{2}|Artifact Creature - Cat|2|2|Exile Watchers of the Dead: Each opponent chooses two cards in his or her graveyard and exiles the rest.| From fc1d1a996d5af5382d823ad929d6ad707347dac0 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 16 Apr 2017 18:07:40 +1000 Subject: [PATCH 3/5] spjspj - Implement Pyramid of the Pantheon (AKH) --- .../mage/cards/p/PyramidOfThePantheon.java | 111 ++++++++++++++++++ Mage.Sets/src/mage/sets/Amonkhet.java | 1 + 2 files changed, 112 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java diff --git a/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java b/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java new file mode 100644 index 00000000000..e411f574a1c --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.p; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.AddManaOfAnyColorEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; + +/** + * + * @author spjspj + */ +public class PyramidOfThePantheon extends CardImpl { + + public PyramidOfThePantheon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); + + // {2}, {T}: Add one mana of any color to your mana pool. Put a brick counter on Pyramid of the Pantheon. + Ability ability = new AnyColorManaAbility(new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addEffect(new AddCountersSourceEffect(CounterType.BRICK.createInstance())); + this.addAbility(ability); + + // {T}: Add three mana of any one color to your mana pool. Activate this ability only of there are three or more brick counters on Pyramid of the Pantheon. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new TapSourceCost()); + ability2.addCost(new SourceHasCountersCost(3, CounterType.BRICK)); + this.addAbility(ability2); + } + + public PyramidOfThePantheon(final PyramidOfThePantheon card) { + super(card); + } + + @Override + public PyramidOfThePantheon copy() { + return new PyramidOfThePantheon(this); + } +} + +class SourceHasCountersCost extends CostImpl { + + private final int counters; + private final CounterType counterType; + + public SourceHasCountersCost(int counters, CounterType counterType) { + this.counters = counters; + this.counterType = counterType; + this.text = "Activate this ability only if {this} has " + counters + " or more " + counterType.getName() + " counters on it"; + } + + public SourceHasCountersCost(final SourceHasCountersCost cost) { + super(cost); + this.counters = cost.counters; + this.counterType = cost.counterType; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + return (game.getPermanent(sourceId).getCounters(game).getCount(counterType) >= counters); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { + this.paid = true; + return paid; + } + + @Override + public SourceHasCountersCost copy() { + return new SourceHasCountersCost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Amonkhet.java b/Mage.Sets/src/mage/sets/Amonkhet.java index 58030e11132..595624d53f7 100644 --- a/Mage.Sets/src/mage/sets/Amonkhet.java +++ b/Mage.Sets/src/mage/sets/Amonkhet.java @@ -250,6 +250,7 @@ public class Amonkhet extends ExpansionSet { cards.add(new SetCardInfo("Pathmaker Initiate", 146, Rarity.COMMON, mage.cards.p.PathmakerInitiate.class)); cards.add(new SetCardInfo("Pitiless Vizier", 103, Rarity.COMMON, mage.cards.p.PitilessVizier.class)); cards.add(new SetCardInfo("Plague Belcher", 104, Rarity.RARE, mage.cards.p.PlagueBelcher.class)); + cards.add(new SetCardInfo("Pyramid of the Pantheon", 235, Rarity.RARE, mage.cards.p.PyramidOfThePantheon.class)); cards.add(new SetCardInfo("Plains", 250, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Plains", 255, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Plains", 256, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true))); From 4abb1072cc9051aa7a836603e3d9df3199e33877 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 16 Apr 2017 18:14:14 +1000 Subject: [PATCH 4/5] Minor fix --- Utils/mtg-cards-data.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index a49b5f11a8f..a81880571de 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -30928,7 +30928,7 @@ Lay Bare the Heart|Amonkhet|96|U|{1}{B}|Sorcery|||Target opponent reveals his or Liliana, Death's Majesty|Amonkhet|97|M|{3}{B}{B}|Planeswalker - Liliana|||+1: Create a 2/2 black Zombie creature token. Put the top two cards of your library into your graveyard.$-3: Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types.$-7: Destroy all non-Zombie creatures.| Liliana's Mastery|Amonkhet|98|R|{3}{B}{B}|Enchantment|||Zombies you control get +1/+1.When Liliana's Mastery enters the battlefield, create two 2/2 black Zombie creature tokens.| Lord of the Accursed|Amonkhet|99|U|{2}{B}|Creature - Zombie|2|3|Other Zombies you control get +1/+1.${1}{B}, {T}: All Zombies gain menace until end of turn.| -Miasma Mummy|Amonkhet|100|C|{1}{B}|Creature - Zombie Jackal|2|2|When Miasma Mummy enters the battlefield, each player discards a card.| +Miasmic Mummy|Amonkhet|100|C|{1}{B}|Creature - Zombie Jackal|2|2|When Miasmic Mummy enters the battlefield, each player discards a card.| Nest of Scarabs|Amonkhet|101|U|{2}{B}|Enchantment|||Whenever you put one or more -1/-1 counters on a creature, create that many 1/1 black Insect tokens.| Painful Lesson|Amonkhet|102|C|{2}{B}|Sorcery|||Target player draws two cards and loses 2 life.| Pitiless Vizier|Amonkhet|103|C|{3}{B}|Creature - Minotaur Cleric|4|2|Whenever you cycle or discard a card, Pitiless Vizier gains indestructible until end of turn.| From 7937bcda9ea84bb9601a02ca0996bb06e18357fa Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 16 Apr 2017 20:06:27 +1000 Subject: [PATCH 5/5] Revert --- .../mage/client/dialog/ConnectDialog.java | 7 +++++++ Mage.Common/src/mage/remote/Connection.java | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java index aecb45d15f6..843d1b518dd 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java @@ -45,6 +45,7 @@ import java.io.InputStreamReader; import java.io.Writer; import java.net.InetSocketAddress; import java.net.Proxy; +import java.net.SocketException; import java.net.SocketTimeoutException; import java.net.URL; import java.net.UnknownHostException; @@ -391,6 +392,12 @@ public class ConnectDialog extends MageDialog { connection.setUsername(this.txtUserName.getText().trim()); connection.setPassword(this.txtPassword.getText().trim()); connection.setForceDBComparison(this.chkForceUpdateDB.isSelected()); + String allMAC = ""; + try { + allMAC = connection.getMAC(); + } catch (SocketException ex) { + } + connection.setUserIdStr(System.getProperty("user.name") + ":" + System.getProperty("os.name") + ":" + MagePreferences.getUserNames() + ":" + allMAC); connection.setUserIdStr(System.getProperty("user.name") + ':' + MagePreferences.getUserNames()); MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem()); PreferencesDialog.setProxyInformation(connection); diff --git a/Mage.Common/src/mage/remote/Connection.java b/Mage.Common/src/mage/remote/Connection.java index a5cac723360..3dca8ebdfdd 100644 --- a/Mage.Common/src/mage/remote/Connection.java +++ b/Mage.Common/src/mage/remote/Connection.java @@ -258,6 +258,25 @@ public class Connection { return null; } + public static String getMAC() throws SocketException { + StringBuilder allMACs = new StringBuilder(); + for (Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); interfaces.hasMoreElements();) { + NetworkInterface iface = interfaces.nextElement(); + byte[] mac = iface.getHardwareAddress(); + + if (mac != null) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < mac.length; i++) { + sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); + } + sb.append(';'); + allMACs.append(sb.toString()); + } + } + return allMACs.toString(); + } + + public void setUserData(UserData userData) { this.userData = userData; }