XPaid can now be used with XMath

Converted Banshee to Script
This commit is contained in:
Sol
2011-09-20 03:27:10 +00:00
parent 7fc425fb0a
commit 578ec40032
3 changed files with 6 additions and 39 deletions

View File

@@ -3,6 +3,11 @@ ManaCost:2 B B
Types:Creature Spirit
Text:no text
PT:0/1
A:AB$ DealDamage | Cost$ X T | Tgt$ TgtCP | NumDmg$ HalfXDown | SubAbility$ DBDamage | SpellDescription$ CARDNAME deals half X damage, rounded down, to target creature or player, and half X damage, rounded up, to you.
SVar:DBDamage:DB$ DealDamage | Defined$ You | NumDmg$ HalfXUp
SVar:X:Count$xPaid
SVar:HalfXDown:Count$xPaid/HalfDown
SVar:HalfXUp:Count$xPaid/HalfUp
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/banshee.jpg

View File

@@ -2909,7 +2909,7 @@ public class CardFactoryUtil {
sq = l[0].split("\\.");
if (sq[0].contains("xPaid")) {
return c.getXManaCostPaid();
return doXMath(c.getXManaCostPaid(), m, c);
}
if (sq[0].contains("xLifePaid")) {

View File

@@ -2341,44 +2341,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Banshee")) {
/*
* X, Tap: Banshee deals half X damage, rounded down, to target creature or
* player, and half X damage, rounded up, to you.
*/
Cost abCost = new Cost("X T", cardName, true);
Target tgt = new Target(card, "TgtCP");
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt) {
private static final long serialVersionUID = 2755743211116192949L;
@Override
public void resolve() {
int x = card.getXManaCostPaid();
if (getTargetPlayer() == null) {
getTargetCard().addDamage((int) Math.floor(x / 2.0), card);
} else {
getTargetPlayer().addDamage((int) Math.floor(x / 2.0), card);
}
card.getController().addDamage((int) Math.ceil(x / 2.0), card);
card.setXManaCostPaid(0);
}//resolve()
@Override
public boolean canPlayAI() {
return false;
}
};//SpellAbility
ability.setDescription("X, tap: " + "Banshee deals half X damage, rounded down, to target creature or player, and half X damage, rounded up, to you.");
ability.setStackDescription(card.getName() + " - Banshee deals half X damage, rounded down, to target creature or player, and half X damage, rounded up, to you.");
card.addSpellAbility(ability);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Shapeshifter")) {
Command intoPlay = new Command() {