From cc9bda92afd5ce077076efc8f7b35fd854a2683c Mon Sep 17 00:00:00 2001 From: benjamin Date: Mon, 27 Jul 2015 21:40:22 -0400 Subject: [PATCH 1/3] Updated Historical Standard validators Made both actually test for having Stoneforge Mystic XOR Batterskull. Updated Super Standard Banlist. --- .../src/mage/deck/HistoricalStandard.java | 16 ++++++++++++---- .../src/mage/deck/SuperStandard.java | 17 +++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java index 1c8ba55341..ceb699b124 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java @@ -18,7 +18,7 @@ import java.util.Map; * * This class was originally made to work with the historical standard ruleset. * Data taken from http://thattournament.website/historic-tournament.php - * (site changed, originally thtp://mtgt.nfshost.com/historic-tournament.php) + * (site changed, originally http://mtgt.nfshost.com/historic-tournament.php) * * If there are any questions or corrections, feel free to contact me. * @@ -111,9 +111,6 @@ public class HistoricalStandard extends Constructed { // banned cards banned.add("Balance"); - // Not banned in the format, but it is either this or Misty, and most - // people choose Misty. - banned.add("Batterskull"); banned.add("Memory Jar"); banned.add("Mind Over Matter"); banned.add("Mind Twist"); @@ -134,6 +131,17 @@ public class HistoricalStandard extends Constructed { Map leastInvalid = null; boolean valid = false; + + // first, check whether misty and batterskull are in the same deck. + Map counts = new HashMap<>(); + countCards(counts, deck.getCards()); + countCards(counts, deck.getSideboard()); + if( counts.containsKey("Stoneforge Mystic") + && counts.containsKey("Batterskull")){ + + // if both, then skip all following tests by returning + return false; + } // up to Lorwyn/Alara, standards will have to be hard-coded. // iterate through the array of standards. diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java index be6caf7dc1..9b6a91dba0 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java @@ -76,10 +76,8 @@ public class SuperStandard extends Constructed { super("Constructed - All Standards"); banned.add("Ancient Den"); - banned.add("Arcbound Ravager"); banned.add("Disciple of the Vault"); banned.add("Great Furnace"); - banned.add("Jace, the Mind Sculptor"); banned.add("Seat of the Synod"); banned.add("Skullclamp"); banned.add("Tree of Tales"); @@ -98,6 +96,17 @@ public class SuperStandard extends Constructed { Map leastInvalid = null; boolean valid = false; + + // first, check whether misty and batterskull are in the same deck. + Map counts = new HashMap<>(); + countCards(counts, deck.getCards()); + countCards(counts, deck.getSideboard()); + if( counts.containsKey("Stoneforge Mystic") + && counts.containsKey("Batterskull")){ + + // if both, then skip all following tests by returning + return false; + } // up to Lorwyn/Alara, standards will have to be hard-coded. // iterate through the array of standards. @@ -113,10 +122,8 @@ public class SuperStandard extends Constructed { // misty and darksteel citadel if( setCodes.contains("MRD") || setCodes.contains("SOM")){ banned.add("Darksteel Citadel"); - banned.add("Stoneforge Mystic"); }else{ banned.remove("Darksteel Citadel"); - banned.remove("Stoneforge Mystic"); } // validate it. If it validates, clear the invalid cards and break. @@ -174,10 +181,8 @@ public class SuperStandard extends Constructed { // misty and darksteel citadel if( setCodes.contains("MRD") || setCodes.contains("SOM")){ banned.add("Darksteel Citadel"); - banned.add("Stoneforge Mystic"); }else{ banned.remove("Darksteel Citadel"); - banned.remove("Stoneforge Mystic"); } // validate it. If it validates, clear the invalid cards and break. From 409edab4eca424f2034fa504b058d2115d657155 Mon Sep 17 00:00:00 2001 From: benjamin Date: Mon, 27 Jul 2015 21:41:07 -0400 Subject: [PATCH 2/3] Added Historical and Super Standard Validators to default configs --- Mage.Server/config/config.xml | 2 ++ Mage.Server/release/config/config.xml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Mage.Server/config/config.xml b/Mage.Server/config/config.xml index 453ddaffeb..e28563936e 100644 --- a/Mage.Server/config/config.xml +++ b/Mage.Server/config/config.xml @@ -87,7 +87,9 @@ + + diff --git a/Mage.Server/release/config/config.xml b/Mage.Server/release/config/config.xml index c18cbdeb3a..93ccc1a86a 100644 --- a/Mage.Server/release/config/config.xml +++ b/Mage.Server/release/config/config.xml @@ -66,7 +66,9 @@ + + From 1f24b569c73758ff18e997fc2b676fc1e6a328d9 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 28 Jul 2015 15:04:37 +0200 Subject: [PATCH 3/3] * Fixed a bug of adding abilities to non permanentes if the an effect added an ability to multiple objects. --- Mage/src/mage/game/GameState.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java index b7b9c1850b..21824f7a41 100644 --- a/Mage/src/mage/game/GameState.java +++ b/Mage/src/mage/game/GameState.java @@ -41,6 +41,7 @@ import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.DelayedTriggeredAbilities; import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.MageSingleton; import mage.abilities.Mode; import mage.abilities.SpecialActions; import mage.abilities.StaticAbility; @@ -856,13 +857,19 @@ public class GameState implements Serializable, Copyable { * @param ability */ public void addOtherAbility(Card attachedTo, Ability ability) { - ability.setSourceId(attachedTo.getId()); - ability.setControllerId(attachedTo.getOwnerId()); + Ability newAbility; + if (ability instanceof MageSingleton) { + newAbility = ability; + } else { + newAbility = ability.copy(); + } + newAbility.setSourceId(attachedTo.getId()); + newAbility.setControllerId(attachedTo.getOwnerId()); if (!cardState.containsKey(attachedTo.getId())) { cardState.put(attachedTo.getId(), new CardState()); } - cardState.get(attachedTo.getId()).addAbility(ability); - addAbility(ability, attachedTo.getId(), attachedTo); + cardState.get(attachedTo.getId()).addAbility(newAbility); + addAbility(newAbility, attachedTo.getId(), attachedTo); } /**