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.
This commit is contained in:
techdragon.nguyen@gmail.com
2012-03-23 04:34:19 +00:00
parent 58b532f0d6
commit 30f9146aee

View File

@@ -56,6 +56,23 @@ while (<>)
elsif (/^Name=(.*)/)
{
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)
{
@@ -165,6 +182,7 @@ sub getKnownCards
{
chomp;
s/
//g;
s/^\s*|\s*$//g;
next if (/Token$/);
$m->{$_} = 1;