- Added the script option "UnlessCost$ CardManaCost".

- Added Pendrell Flux.
This commit is contained in:
Sloth
2013-02-08 20:59:55 +00:00
parent 979ca7dba1
commit 18c48841fc
3 changed files with 27 additions and 12 deletions

1
.gitattributes vendored
View File

@@ -7503,6 +7503,7 @@ res/cardsfolder/p/pemmins_aura.txt svneol=native#text/plain
res/cardsfolder/p/pendelhaven.txt svneol=native#text/plain res/cardsfolder/p/pendelhaven.txt svneol=native#text/plain
res/cardsfolder/p/pendelhaven_elder.txt svneol=native#text/plain res/cardsfolder/p/pendelhaven_elder.txt svneol=native#text/plain
res/cardsfolder/p/pendrell_drake.txt svneol=native#text/plain res/cardsfolder/p/pendrell_drake.txt svneol=native#text/plain
res/cardsfolder/p/pendrell_flux.txt -text
res/cardsfolder/p/pendrell_mists.txt svneol=native#text/plain res/cardsfolder/p/pendrell_mists.txt svneol=native#text/plain
res/cardsfolder/p/pennon_blade.txt svneol=native#text/plain res/cardsfolder/p/pennon_blade.txt svneol=native#text/plain
res/cardsfolder/p/pentad_prism.txt svneol=native#text/plain res/cardsfolder/p/pentad_prism.txt svneol=native#text/plain

View File

@@ -0,0 +1,14 @@
Name:Pendrell Flux
ManaCost:1 U
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Creature | TgtPrompt$ Select target creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.AttachedBy | AddTrigger$ TrigPhase | AddSVar$ TrigPendrellFlux & DBCoralSacrifice & DBCoralCleanup | Description$ Enchanted creature has "At the beginning of your upkeep, sacrifice this creature unless you pay its mana cost."
SVar:TrigPhase:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPendrellFlux | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, sacrifice this creature unless you pay its mana cost.
SVar:TrigPendrellFlux:DB$ Sacrifice | Defined$ Self | UnlessCost$ CardManaCost | UnlessPayer$ You
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/pendrell_flux.jpg
SetInfo:USG|Common|http://magiccards.info/scans/en/us/87.jpg
Oracle:Enchant creature\nEnchanted creature has "At the beginning of your upkeep, sacrifice this creature unless you pay its mana cost."
End

View File

@@ -1389,18 +1389,18 @@ public class AbilityFactory {
// The cost // The cost
String unlessCost = sa.getParam("UnlessCost").trim(); String unlessCost = sa.getParam("UnlessCost").trim();
try { if (unlessCost.equals("CardManaCost")) {
String unlessVar = Integer.toString(AbilityFactory.calculateAmount(source, sa.getParam("UnlessCost").replace(" ", ""), sa)); unlessCost = source.getManaCost().toString();
unlessCost = unlessVar; } else {
} catch (final NumberFormatException n) { try {
} //This try/catch method enables UnlessCost to parse any svar name String unlessVar = Integer.toString(AbilityFactory.calculateAmount(source, sa.getParam("UnlessCost").replace(" ", ""), sa));
//instead of just X for cards like Draco. If there's a better way unlessCost = unlessVar;
//feel free to change it. Old code follows: } catch (final NumberFormatException n) {
} //This try/catch method enables UnlessCost to parse any svar name
/*if (unlessCost.equals("X")) { //instead of just X for cards like Draco.
unlessCost = Integer.toString(AbilityFactory.calculateAmount(source, params.get("UnlessCost"), sa)); }
}*/
final Cost cost = new Cost(source, unlessCost, true); final Cost cost = new Cost(source, unlessCost, true);
final Ability ability = new AbilityStatic(source, cost, null) { final Ability ability = new AbilityStatic(source, cost, null) {