- Convert Overwhelming Intellect to AF_Counter

This commit is contained in:
jendave
2011-08-06 23:55:59 +00:00
parent 1d8f8d1abd
commit a08a71c553
3 changed files with 18 additions and 42 deletions

View File

@@ -1,7 +1,10 @@
Name:Overwhelming Intellect Name:Overwhelming Intellect
ManaCost:4 U U ManaCost:4 U U
Types:Instant Types:Instant
Text:Counter target creature spell. Draw cards equal to that spell's converted mana cost. Text:no text
A:SP$ Counter | Cost$ 4 U U | TargetType$ Spell | TgtPrompt$ Select target Creature spell | ValidTgts$ Creature | SubAbility$ SVar=DBDraw | SpellDescription$ Counter target creature spell. Draw cards equal to that spell's converted mana cost.
SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ X
SVar:X:Targeted$CardManaCost
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/overwhelming_intellect.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/overwhelming_intellect.jpg
SetInfo:SOK|Uncommon|http://magiccards.info/scans/en/sok/51.jpg SetInfo:SOK|Uncommon|http://magiccards.info/scans/en/sok/51.jpg

View File

@@ -878,8 +878,20 @@ public class AbilityFactory {
} }
} }
else { else {
//TODO - this may needs edits to handle SpellAbility defineds? SpellAbility parent = findParentsTargetedCard(ability);
list = new CardList(findParentsTargetedCard(ability).getTarget().getTargetCards().toArray());
ArrayList<Object> all = parent.getTarget().getTargets();
if(!all.isEmpty() && all.get(0) instanceof SpellAbility) {
list = new CardList();
ArrayList<SpellAbility> sas = parent.getTarget().getTargetSAs();
for(SpellAbility sa : sas) {
list.add(sa.getSourceCard());
}
}
else {
SpellAbility saTargeting = findParentsTargetedCard(ability);
list = new CardList(saTargeting.getTarget().getTargetCards().toArray());
}
} }
} }
else if (calcX[0].startsWith("Triggered")) { else if (calcX[0].startsWith("Triggered")) {

View File

@@ -860,45 +860,6 @@ public class CardFactory_Instants {
card.setSVar("PlayMain1", "TRUE"); card.setSVar("PlayMain1", "TRUE");
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Overwhelming Intellect")) {
SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -8825219868732813877L;
@Override
public void resolve() {
SpellAbility sa = AllZone.Stack.pop();
AllZone.GameAction.moveToGraveyard(sa.getSourceCard());
int convertedManaCost = CardUtil.getConvertedManaCost(sa.getSourceCard().getManaCost());
for(int i = 0; i < convertedManaCost; i++) {
card.getController().drawCard();
}
}
@Override
public boolean canPlay() {
if(AllZone.Stack.size() == 0) return false;
//see if spell is on stack and that opponent played it
Player opponent = card.getController().getOpponent();
SpellAbility sa = AllZone.Stack.peek();
return sa.isSpell() && opponent.equals(sa.getSourceCard().getController())
&& sa.getSourceCard().getType().contains("Creature")
&& CardFactoryUtil.isCounterable(sa.getSourceCard());
}
};
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
card.clearFirstSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************
else if(cardName.equals("Banishing Knack")) { else if(cardName.equals("Banishing Knack")) {
SpellAbility spell = new Spell(card) { SpellAbility spell = new Spell(card) {