From 759d66db5f3fd3daf016dd81d4e08b8c194d2b7a Mon Sep 17 00:00:00 2001 From: spjspj Date: Mon, 20 Nov 2017 08:39:31 +1100 Subject: [PATCH 1/4] Slight update --- Utils/get_modo_artids.pl | 96 ++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 14 deletions(-) diff --git a/Utils/get_modo_artids.pl b/Utils/get_modo_artids.pl index b55a732b3c..287ce363dd 100644 --- a/Utils/get_modo_artids.pl +++ b/Utils/get_modo_artids.pl @@ -84,7 +84,7 @@ $fix_set_codes {"WL"} = "WTH"; print ("Finished reading $count names\n"); - #$vals = `find /I "<" *lient*`; + #$vals = `find /I "<" *client*`; $vals = `findstr /I "CARDNAME_STRING DIGITALOBJECT ARTID CLONE FRAMESTYLE " *lient* | find /I /V "_DO.xml"`; my $current_artid = ""; @@ -177,12 +177,67 @@ $fix_set_codes {"WL"} = "WTH"; my $current_framestyle = ""; my %framestyles; - $framestyles {1} = "001"; - $framestyles {3} = "010"; - $framestyles {31} = "010"; - $framestyles {11} = "010"; - $framestyles {14} = "010"; - $framestyles {15} = "010"; + $framestyles {1} = "001"; # Pre-modern cards + $framestyles {2} = "010"; + $framestyles {3} = "010"; # M15 cards + $framestyles {4} = "013"; + $framestyles {5} = "020"; + $framestyles {6} = "010"; + $framestyles {7} = "020"; + $framestyles {8} = "010"; + $framestyles {9} = "010"; + $framestyles {10} = "030"; # "040"; + $framestyles {11} = "010"; # Avatars + $framestyles {12} = "010"; + $framestyles {13} = "050"; + $framestyles {14} = "010"; # Tokens + $framestyles {15} = "010"; # Tokens as well + $framestyles {18} = "010"; + $framestyles {19} = "030"; # "040"; + $framestyles {19} = "010"; + $framestyles {20} = "030"; + $framestyles {22} = "010"; + $framestyles {23} = "010"; + $framestyles {24} = "010"; + $framestyles {25} = "050"; + $framestyles {26} = "010"; + $framestyles {27} = "010"; + $framestyles {28} = "010"; + $framestyles {30} = "050"; + $framestyles {31} = "010"; # New cards + $framestyles {34} = "030"; # "040"; + $framestyles {35} = "030"; # "040"; + $framestyles {36} = "050"; + $framestyles {37} = "010"; + $framestyles {38} = "010"; + $framestyles {39} = "050"; + $framestyles {42} = "010"; + $framestyles {43} = "010"; + $framestyles {45} = "030"; + $framestyles {45} = "030"; # "040"; + $framestyles {46} = "050"; + $framestyles {47} = "020"; # Expedition lands + $framestyles {48} = "020"; + $framestyles {49} = "030"; # "040"; + $framestyles {50} = "030"; + $framestyles {51} = "050"; + $framestyles {52} = "010"; + $framestyles {53} = "050"; + $framestyles {54} = "010"; + + + my %types; + my $current_type = "reg"; + $types {4} = "flip"; + $types {10} = "planeswk"; + $types {19} = "planeswk"; + $types {20} = "planeswk"; + $types {34} = "planeswk"; + $types {35} = "planeswk"; + $types {45} = "planeswk"; + $types {49} = "planeswk"; + $types {50} = "planeswk"; + while ($vals =~ s/^(.*)\n//im) { @@ -217,8 +272,19 @@ $fix_set_codes {"WL"} = "WTH"; } if ($line =~ m/FRAMESTYLE value='([^']+)'/) { - $current_framestyle = "$1"; - $current_framestyle = $framestyles {$current_framestyle}; + my $val = $1; + $current_framestyle = $framestyles {$val}; + $current_type = $types {$val}; + + if ($current_framestyle =~ m/^$/) + { + print (" ERROR: $current_framestyle not known: ($line) --- "); + print (" http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/0000$current_artid" . "_typ_$current_type" . "_sty_$current_framestyle.jpg\n"); + } + if ($current_type =~ m/^$/) + { + $current_type = "reg"; + } } if ($line =~ m/<\/DigitalObject/) @@ -246,23 +312,23 @@ $fix_set_codes {"WL"} = "WTH"; $seen_artids {$current_artid} = "$current_set\\$current_name.jpg"; if ($current_artid < 10) { - print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/0000$current_artid" . "_typ_reg_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); + print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/0000$current_artid" . "_typ_$current_type" . "_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); } if ($current_artid < 100) { - print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/000$current_artid" . "_typ_reg_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); + print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/000$current_artid" . "_typ_$current_type" . "_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); } elsif ($current_artid < 1000) { - print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/00$current_artid" . "_typ_reg_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); + print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/00$current_artid" . "_typ_$current_type" . "_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); } elsif ($current_artid < 10000) { - print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/0$current_artid" . "_typ_reg_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); + print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/0$current_artid" . "_typ_$current_type" . "_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); } else { - print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/$current_artid" . "_typ_reg_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); + print (" echo \"1\" | cut.pl stdin \"http://mtgoclientdepot.onlinegaming.wizards.com/Graphics/Cards/Pics/$current_artid" . "_typ_$current_type" . "_sty_$current_framestyle.jpg\" \"$current_set\\$current_name.jpg\" wget_image\n"); } } else @@ -276,6 +342,8 @@ $fix_set_codes {"WL"} = "WTH"; $current_doc_id = ""; $current_line = ""; $current_name = ""; + $current_type = ""; + $current_framestyle = ""; } } } From 6164a631ba3995bcdfd6c069c0cf0b5bc8d8612e Mon Sep 17 00:00:00 2001 From: Zzooouhh Date: Mon, 20 Nov 2017 19:17:14 +0100 Subject: [PATCH 2/4] Fix for Umbra Mystic --- ...ttachedToControlledPermanentPredicate.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java new file mode 100644 index 0000000000..897118e11c --- /dev/null +++ b/Mage/src/main/java/mage/filter/predicate/permanent/AttachedToControlledPermanentPredicate.java @@ -0,0 +1,58 @@ +/* + * 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.filter.predicate.permanent; + +import mage.filter.predicate.ObjectPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North & L_J + */ +public class AttachedToControlledPermanentPredicate implements ObjectPlayerPredicate> { + + @Override + public boolean apply(ObjectPlayer input, Game game) { + Permanent attachement = input.getObject(); + if (attachement != null) { + Permanent permanent = game.getPermanent(attachement.getAttachedTo()); + if (permanent != null && permanent.getControllerId().equals(input.getPlayerId())) { + return true; + } + } + + return false; + } + + @Override + public String toString() { + return "Attached to permanents you control"; + } +} From 2dcaf1d8b9af90f68e57ed7b12b7d7aaa9eb7658 Mon Sep 17 00:00:00 2001 From: Zzooouhh Date: Mon, 20 Nov 2017 19:18:43 +0100 Subject: [PATCH 3/4] Fixed Umbra Mystic's ability being symmetrical + moved Mystic's predicate to common --- Mage.Sets/src/mage/cards/u/UmbraMystic.java | 29 +++------------------ 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/Mage.Sets/src/mage/cards/u/UmbraMystic.java b/Mage.Sets/src/mage/cards/u/UmbraMystic.java index 69f8b71562..406702ef13 100644 --- a/Mage.Sets/src/mage/cards/u/UmbraMystic.java +++ b/Mage.Sets/src/mage/cards/u/UmbraMystic.java @@ -39,15 +39,12 @@ import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterEnchantmentPermanent; -import mage.filter.predicate.ObjectPlayer; -import mage.filter.predicate.ObjectPlayerPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.predicate.permanent.AttachedToControlledPermanentPredicate; /** * - * @author North + * @author North & L_J */ public class UmbraMystic extends CardImpl { @@ -55,6 +52,7 @@ public class UmbraMystic extends CardImpl { static { filter.add(new SubtypePredicate(SubType.AURA)); + filter.add(new AttachedToControlledPermanentPredicate()); } public UmbraMystic(UUID ownerId, CardSetInfo setInfo) { @@ -78,24 +76,3 @@ public class UmbraMystic extends CardImpl { return new UmbraMystic(this); } } - -class UmbraMysticPredicate implements ObjectPlayerPredicate> { - - @Override - public boolean apply(ObjectPlayer input, Game game) { - Permanent attachement = input.getObject(); - if (attachement != null) { - Permanent permanent = game.getPermanent(attachement.getAttachedTo()); - if (permanent != null && permanent.getControllerId().equals(input.getPlayerId())) { - return true; - } - } - - return false; - } - - @Override - public String toString() { - return "Attached to permanents you control"; - } -} From 3b18494054b1d2243c79b0491fdcb0d708e320c9 Mon Sep 17 00:00:00 2001 From: Zzooouhh Date: Mon, 20 Nov 2017 19:28:23 +0100 Subject: [PATCH 4/4] Fixed Miracle Worker's targetting (fixes #4185) --- Mage.Sets/src/mage/cards/m/MiracleWorker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/m/MiracleWorker.java b/Mage.Sets/src/mage/cards/m/MiracleWorker.java index 260ea0cb90..9c336e1c8c 100644 --- a/Mage.Sets/src/mage/cards/m/MiracleWorker.java +++ b/Mage.Sets/src/mage/cards/m/MiracleWorker.java @@ -38,8 +38,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.FilterPermanent; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AttachedToControlledPermanentPredicate; import mage.filter.predicate.permanent.AttachedToPredicate; import mage.target.TargetPermanent; @@ -52,7 +53,8 @@ public class MiracleWorker extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Aura attached to a creature you control"); static { - filter.add(new AttachedToPredicate(new FilterControlledCreaturePermanent())); + filter.add(new AttachedToControlledPermanentPredicate()); + filter.add(new AttachedToPredicate(new FilterCreaturePermanent())); filter.add(new SubtypePredicate(SubType.AURA)); }