Added generation code for the enchant keyword to the script

This commit is contained in:
Styxo 2017-01-09 13:27:02 +01:00
parent 246469ee48
commit 8693b50f4f
2 changed files with 28 additions and 1 deletions

View file

@ -227,11 +227,31 @@ foreach my $ability (@abilities) {
$ability =~ m/({.*})/g;
$vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));';
$vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;";
} elsif ($keywords{$kw} eq 'type') {
$ability =~ m/\s([a-zA-Z\s]*)/g;
if ($1 =~ m/(^.*\s.*)/g) {
$vars{'abilities'} .= "\n TargetPermanent auraTarget = new TargetPermanent(filter);";
} else {
$vars{'abilities'} .= "\n TargetPermanent auraTarget = new Target". toCamelCase($1) . "Permanent();";
$vars{'abilitiesImports'} .= "\nimport mage.target.common.Target". toCamelCase($1) . "Permanent;";
}
$vars{'abilities'} .= "\n this.getSpellAbility().addTarget(auraTarget);";
$vars{'abilities'} .= "\n this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));";
$vars{'abilities'} .= "\n Ability ability = new EnchantAbility(auraTarget.getTargetName());";
$vars{'abilities'} .= "\n this.addAbility(ability);";
$vars{'abilitiesImports'} .= "\nimport mage.abilities.Ability;";
$vars{'abilitiesImports'} .= "\nimport mage.abilities.effects.common.AttachEffect;";
$vars{'abilitiesImports'} .= "\nimport mage.constants.Outcome;";
$vars{'abilitiesImports'} .= "\nimport mage.target.TargetPermanent;";
} elsif ($keywords{$kw} eq 'manaString') {
$ability =~ m/({.*})/g;
$vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability("' . fixCost($1) . '"));';
}
$vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;";
} else {
$vars{'abilities'} .= "\n // $kwUnchanged";
}
$vars{'abilities'} .= "\n";
}
}
}

View file

@ -1,10 +1,13 @@
Annihilator|number|
Basic landcycling|cost|
Battle cry|new|
Bestow|card, manaString|
Bloodthirst|number|
Bushido|number|
Convoke|new|
Buyback|manaString|
Cascade|new|
Changeling|instance|
Convoke|new|
Crew|number|
Cumulative upkeep|cost|
Cycling|cost|
@ -14,10 +17,14 @@ Delve|new|
Dethrone|new|
Devoid|color|
Defender|instance|
Dredge|number|
Double Strike|instance|
Dredge|number|
Echo|manaString|
Enchant|type|
Entwine|manaString|
Evoke|card, manaString|
Evolve|new|
Exalted|new|
Exploit|new|
Extort|new|