From 30f9146aeeeba30b668b41cd0e121586bfd983ef Mon Sep 17 00:00:00 2001 From: "techdragon.nguyen@gmail.com" Date: Fri, 23 Mar 2012 04:34:19 +0000 Subject: [PATCH] updated code to handle flip cards Also handles special character cards. ( ie Call of the Herd (Card of the Herd) ) *** Not sure why the title is repeated in some of these. --- projects/mtg/tools/gatherer/buildCardSkel.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/projects/mtg/tools/gatherer/buildCardSkel.pl b/projects/mtg/tools/gatherer/buildCardSkel.pl index 3b15252e3..334f7bd0d 100644 --- a/projects/mtg/tools/gatherer/buildCardSkel.pl +++ b/projects/mtg/tools/gatherer/buildCardSkel.pl @@ -56,6 +56,23 @@ while (<>) { my $cardName = $1; $cardName =~ s/^\s*|\s*$//g; + if ($cardName =~ /\((.*?)\)/ ) + { + my $m = $1; + my $pre = $`; + $m =~ s/^\s*|\s*$//g; + $pre =~ s/^\s*|\s*$//g; + if ( ($knownCards{$m} == 1) || ($knownCards{$pre} == 1) ) + { + $skip = 1; + print STDERR "*$cardName\n"; + next; + } + else + { + # print STDERR "No Match. $cardName\n"; + } + } if ($knownCards{$cardName} == 1) { $skip = 1; @@ -165,6 +182,7 @@ sub getKnownCards chomp; s/ //g; s/^\s*|\s*$//g; + next if (/Token$/); $m->{$_} = 1; } }