mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixed cost generation for multicolored mana.
This commit is contained in:
parent
5f51e75d12
commit
8be7a1c582
1 changed files with 9 additions and 3 deletions
|
@ -25,6 +25,12 @@ sub toCamelCase {
|
||||||
$string;
|
$string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub fixCost {
|
||||||
|
my $string = $_[0];
|
||||||
|
$string =~ s/{([BUGRW])([BUGRW])}/{$1\/$2}/g;
|
||||||
|
$string;
|
||||||
|
}
|
||||||
|
|
||||||
my $author;
|
my $author;
|
||||||
if (-e $authorFile) {
|
if (-e $authorFile) {
|
||||||
open (DATA, $authorFile);
|
open (DATA, $authorFile);
|
||||||
|
@ -133,7 +139,7 @@ foreach my $setName (keys %{$cards{$cardName}}) {
|
||||||
if (!$baseRarity) {
|
if (!$baseRarity) {
|
||||||
$baseRarity = $cards{$cardName}{$setName}[3];
|
$baseRarity = $cards{$cardName}{$setName}[3];
|
||||||
|
|
||||||
$vars{'manaCost'} = $cards{$cardName}{$setName}[4];
|
$vars{'manaCost'} = fixCost($cards{$cardName}{$setName}[4]);
|
||||||
$vars{'power'} = $cards{$cardName}{$setName}[6];
|
$vars{'power'} = $cards{$cardName}{$setName}[6];
|
||||||
$vars{'toughness'} = $cards{$cardName}{$setName}[7];
|
$vars{'toughness'} = $cards{$cardName}{$setName}[7];
|
||||||
|
|
||||||
|
@ -195,7 +201,7 @@ foreach my $setName (keys %{$cards{$cardName}}) {
|
||||||
$vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));';
|
$vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));';
|
||||||
} elsif ($keywords{$kw} eq 'cost') {
|
} elsif ($keywords{$kw} eq 'cost') {
|
||||||
$ability =~ m/({.*})/g;
|
$ability =~ m/({.*})/g;
|
||||||
$vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . $1 . '")));';
|
$vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . fixCost($1) . '")));';
|
||||||
$vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;";
|
$vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +240,7 @@ foreach my $setName (keys %{$cards{$cardName}}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
open CARD, "> $fileName";
|
open CARD, "> $fileName";
|
||||||
print CARD $result;
|
print CARD $result;
|
||||||
close CARD;
|
close CARD;
|
||||||
|
|
||||||
print "$vars{'set'}.$vars{'className'}\n";
|
print "$vars{'set'}.$vars{'className'}\n";
|
||||||
|
|
Loading…
Reference in a new issue