convert Energy Tap to script

This commit is contained in:
jendave
2011-08-07 00:02:10 +00:00
parent 5d193c6c2b
commit a849f6ebbf
2 changed files with 4 additions and 38 deletions

View File

@@ -1,7 +1,10 @@
Name:Energy Tap
ManaCost:U
Types:Sorcery
Text:Tap target untapped creature you control. If you do, add X Colorless to your mana pool, where X is that creature's converted mana cost.
Text:no text
A:SP$ Tap | Cost$ U | TgtPrompt$ Select target untapped creature you control | ValidTgts$ Creature.untapped+YouCtrl | SubAbility$ SVar=DBMana | SpellDescription$ Tap target untapped creature you control. If you do, add X to your mana pool, where X is that creature's converted mana cost.
SVar:DBMana:DB$Mana | Produced$ X
SVar:X:Targeted$CardManaCost
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/energy_tap.jpg

View File

@@ -3361,43 +3361,6 @@ public class CardFactory_Sorceries {
card.addSpellAbility(spell);
spell.setBeforePayMana(input);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Energy Tap")) {
/*
* Tap target untapped creature you control. If you do, add X to
* your mana pool, where X is that creature's converted mana cost.
*/
Cost cost = new Cost("U", cardName, false);
Target tgt = new Target(card,"Select an untapped creature you control", "Creature.untapped+YouCtrl".split(","));
final SpellAbility spell = new Spell(card, cost, tgt) {
private static final long serialVersionUID = 8883585452278041848L;
@Override
public void resolve() {
Card target = getTargetCard();
if(null != target && target.isUntapped()) {
int cmc = CardUtil.getConvertedManaCost(target);
target.tap();
Ability_Mana abMana = new Ability_Mana(card, "0", "1", cmc) {
private static final long serialVersionUID = -2182129023960978132L;
};
abMana.produceMana();
}
}
@Override
public boolean canPlayAI() {
return false;
}
};
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
card.clearFirstSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************