diff --git a/Utils/extract_in_wiki_format.pl b/Utils/extract_in_wiki_format.pl index 506cab727d..e6d8421c17 100644 --- a/Utils/extract_in_wiki_format.pl +++ b/Utils/extract_in_wiki_format.pl @@ -2,12 +2,22 @@ use strict; -open CARDS, "< added_cards.txt" or die; +my $knownSetsFile = 'known-sets.txt'; my $cards_count = 0; +my %knownSets; my %cards; +open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $knownSets{$data[1]}= $data[2]; +} +close(DATA); + +open CARDS, "< added_cards.txt" or die; + while () { my $line = $_; if ( $line =~/A Mage.Sets\\src\\mage\\sets\\(\w.*)\\(\w.*)\.java/ ) { @@ -23,9 +33,13 @@ while () { } open REPORT, "> added_cards_in_wiki_format.txt"; -print REPORT "Added cards ($cards_count):\n"; +print REPORT " * Added cards ($cards_count):\n"; foreach my $set (keys(%cards)) { - print REPORT " $set: "; + if (exists $knownSets{$set}) { + print REPORT " * $knownSets{$set}: "; + } else { + print REPORT " $set: "; + } foreach my $card (@{$cards{$set}}) { print REPORT $card . ", "; } diff --git a/Utils/known-sets.txt b/Utils/known-sets.txt index a3dd896bbd..125ba6cd0f 100644 --- a/Utils/known-sets.txt +++ b/Utils/known-sets.txt @@ -1,30 +1,32 @@ -Tenth Edition|tenth| -Magic 2010|magic2010| -Magic 2011|magic2011| -Magic 2012|magic2012| -Planechase|planechase| -Duel Decks: Elspeth vs. Tezzeret|elspethvstezzeret| -Tempest|tempest| -Invasion|invasion| -Planeshift|planeshift| -Apocalypse|apocalypse| -Mirrodin|mirrodin| -Darksteel|darksteel| -Fifth Dawn|fifthdawn| -Champions of Kamigawa|championsofkamigawa| -Ravnica: City of Guilds|ravnika| -Guildpact|guildpact| -Dissension|dissension| -Lorwyn|lorwyn| -Morningtide|morningtide| -Shadowmoor|shadowmoor| -Eventide|eventide| -Shards of Alara|shardsofalara| -Conflux|conflux| -Alara Reborn|alarareborn| -Zendikar|zendikar| -Worldwake|worldwake| -Rise of the Eldrazi|riseoftheeldrazi| -Scars of Mirrodin|scarsofmirrodin| -Mirrodin Besieged|mirrodinbesieged| -New Phyrexia|newphyrexia| \ No newline at end of file +Tenth Edition|tenth|10E| +Magic 2010|magic2010|M10| +Magic 2011|magic2011|M11| +Magic 2012|magic2012|M12| +Planechase|planechase|HOP| +Duel Decks: Elspeth vs. Tezzeret|elspethvstezzeret|DDF| +Tempest|tempest|TMP| +Invasion|invasion|INV| +Planeshift|planeshift|PLS| +Apocalypse|apocalypse|APC| +Mirrodin|mirrodin|MRD| +Darksteel|darksteel|DST| +Fifth Dawn|fifthdawn|5DN| +Champions of Kamigawa|championsofkamigawa|CHK| +Ravnica: City of Guilds|ravnika|RAV| +Guildpact|guildpact|GPT| +Dissension|dissension|DIS| +Lorwyn|lorwyn|LRW| +Morningtide|morningtide|MOR| +Shadowmoor|shadowmoor|SHM| +Eventide|eventide|EVE| +Shards of Alara|shardsofalara|ALA| +Conflux|conflux|CON| +Alara Reborn|alarareborn|ARB| +Zendikar|zendikar|ZEN| +Worldwake|worldwake|WWK| +Rise of the Eldrazi|riseoftheeldrazi|ROE| +Scars of Mirrodin|scarsofmirrodin|SOM| +Mirrodin Besieged|mirrodinbesieged|MBS| +New Phyrexia|newphyrexia|NPH| +Innistrad|innistrad|ISD| +Dark Ascension|darkascension|DKA| \ No newline at end of file