- Convert a few cards to Modern Cost/Targeting

This commit is contained in:
jendave
2011-08-07 00:10:17 +00:00
parent 4347a0312b
commit 2cde9e0f48
4 changed files with 46 additions and 162 deletions

View File

@@ -3,6 +3,7 @@ ManaCost:1 R R R
Types:Creature Elemental Types:Creature Elemental
Text:no text Text:no text
PT:4/4 PT:4/4
A:AB$ PutCounter | Cost$ 1 R R | IsCurse$ True | ValidTgts$ Land.countersEQ0BLAZE | TgtPrompt$ Select target Land without a Blaze Counter | CounterType$ BLAZE | CounterNum$ 1 | SpellDescription$ Put a blaze counter on target land without a blaze counter on it. For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." (The land continues to burn after Obsidian Fireheart has left the battlefield.)
SVar:Rarity:Mythic SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/obsidian_fireheart.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/obsidian_fireheart.jpg
SetInfo:ZEN|Mythic|http://magiccards.info/scans/en/zen/140.jpg SetInfo:ZEN|Mythic|http://magiccards.info/scans/en/zen/140.jpg

View File

@@ -2334,64 +2334,6 @@ public class CardFactoryUtil {
}//input_discardRecall() }//input_discardRecall()
//****************copied from input_targetType***************** //****************copied from input_targetType*****************
//cardType is like "Creature", "Land", "Artifact", "Goblin", "Legendary", ";"-delimited
//cardType can also be "All", which will allow any permanent to be selected
public static Input input_targetType(final SpellAbility spell, final String cardTypeList) {
Input target = new Input() {
private static final long serialVersionUID = 6443658187985259709L;
public void showMessage() {
StringTokenizer st = new StringTokenizer(cardTypeList, ";");
if(cardTypeList.equals("All")) {
AllZone.Display.showMessage(spell.getSourceCard()+" - Select target permanent");
}
else {
StringBuffer toDisplay = new StringBuffer();
toDisplay.append(spell.getSourceCard()+" - Select target ");
while( st.hasMoreTokens() ) {
toDisplay.append(st.nextToken());
if( st.hasMoreTokens() ) {
toDisplay.append(" or ");
}
}
AllZone.Display.showMessage( toDisplay.toString() );
}
ButtonUtil.enableOnlyCancel();
}
public void selectButtonCancel() {stop();}
public void selectCard(Card card, PlayerZone zone) {
boolean foundCardType = false;
StringTokenizer st = new StringTokenizer(cardTypeList, ";");
if( cardTypeList.equals("All") ) {
foundCardType = true;
} else {
while( st.hasMoreTokens() ) {
if( card.getType().contains( st.nextToken() )) {
foundCardType = true;
}
}
}
if(!canTarget(spell, card)) {
AllZone.Display.showMessage("Cannot target this card (Shroud? Protection?).");
}
else if( foundCardType && zone.is(Constant.Zone.Battlefield)) {
spell.setTargetCard(card);
if(spell.getManaCost().equals("0") || this.isFree())//for "sacrifice this card" abilities
{
this.setFree(false);
AllZone.Stack.add(spell, spell.getSourceCard().getManaCost().contains("X"));
stop();
}
else
stopSetNext(new Input_PayManaCost(spell));
}
}
};
return target;
}//input_targetType()
//***************end copy******************
public static Input input_targetCreature(final SpellAbility spell) { public static Input input_targetCreature(final SpellAbility spell) {
return input_targetCreature(spell, Command.Blank); return input_targetCreature(spell, Command.Blank);
} }

View File

@@ -1655,47 +1655,7 @@ public class CardFactory_Creatures {
card.addSpellAbility(ability); card.addSpellAbility(ability);
ability.setDescription(abCost+"Destroy target land. If that land was nonbasic, untap Helldozer."); ability.setDescription(abCost+"Destroy target land. If that land was nonbasic, untap Helldozer.");
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Obsidian Fireheart")) {
final Ability ability = new Ability(card, "1 R R") {
@Override
public void resolve() {
Card c = getTargetCard();
if(AllZoneUtil.isCardInPlay(c) && c.isLand() && (c.getCounters(Counters.BLAZE) == 0)) c.addCounter(
Counters.BLAZE, 1);
}
@Override
public boolean canPlayAI() {
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
CardList land = new CardList(play.getCards());
land = land.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isLand() && c.getCounters(Counters.BLAZE) < 1;
}
});
if(land.size() > 0) setTargetCard(land.get(0));
return land.size() > 0;
}
};
StringBuilder sb = new StringBuilder();
sb.append("1 R R: Put a blaze counter on target land without a blaze counter on it. ");
sb.append("For as long as that land has a blaze counter on it, it has \"At the beginning of your upkeep, ");
sb.append("this land deals 1 damage to you.\" (The land continues to burn after Obsidian Fireheart has left the battlefield.)");
ability.setDescription(sb.toString());
ability.setBeforePayMana(CardFactoryUtil.input_targetType(ability, "Land"));
card.addSpellAbility(ability);
}// *************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************
else if(cardName.equals("Wild Mongrel")) { else if(cardName.equals("Wild Mongrel")) {
@@ -2084,33 +2044,36 @@ public class CardFactory_Creatures {
//*************** START *********** START ************************** //*************** START *********** START **************************
else if(cardName.equals("Memnarch")) { else if(cardName.equals("Memnarch")) {
//has 2 non-tap abilities that affect itself //has 2 non-tap abilities that affect itself
final SpellAbility ability1 = new Ability(card, "1 U U") { Cost cost = new Cost("1 U U", cardName, true);
@Override final Target target = new Target(card, "Select a permanent", "Permanent".split(","));
public void resolve() {
if(AllZoneUtil.isCardInPlay(getTargetCard()) final SpellAbility ability1 = new Ability_Activated(card, cost, target) {
&& CardFactoryUtil.canTarget(card, getTargetCard())) { private static final long serialVersionUID = -887237000483591242L;
Card crd = getTargetCard();
ArrayList<String> types = crd.getType(); @Override
crd.setType(new ArrayList<String>()); //clear public void resolve(){
getTargetCard().addType("Artifact"); //make sure artifact is at the beginning Card crd = target.getTargetCards().get(0);
for(String type:types)
crd.addType(type); ArrayList<String> types = crd.getType();
crd.setType(new ArrayList<String>()); //clear
} getTargetCard().addType("Artifact"); //make sure artifact is at the beginning
for(String type:types)
crd.addType(type);
}//resolve() }//resolve()
@Override @Override
public boolean canPlayAI() { public boolean canPlayAI() {
CardList list = getCreature(); CardList list = getCreature();
return list.size() != 0;
if (list.size() == 0)
return false;
target.resetTargets();
target.addTarget(CardFactoryUtil.AI_getBestCreature(getCreature()));
return true;
} }
@Override
public void chooseTargetAI() {
Card target = CardFactoryUtil.AI_getBestCreature(getCreature());
setTargetCard(target);
}//chooseTargetAI()
CardList getCreature() { CardList getCreature() {
CardList list = new CardList(AllZone.Human_Battlefield.getCards()); CardList list = new CardList(AllZone.Human_Battlefield.getCards());
list = list.filter(new CardListFilter() { list = list.filter(new CardListFilter() {
@@ -2124,7 +2087,6 @@ public class CardFactory_Creatures {
card.addSpellAbility(ability1); card.addSpellAbility(ability1);
ability1.setDescription("1 U U: Target permanent becomes an artifact in addition to its other types. (This effect doesn't end at end of turn.)"); ability1.setDescription("1 U U: Target permanent becomes an artifact in addition to its other types. (This effect doesn't end at end of turn.)");
ability1.setBeforePayMana(CardFactoryUtil.input_targetType(ability1, "All"));
}//*************** END ************ END ************************** }//*************** END ************ END **************************

View File

@@ -459,60 +459,39 @@ public class CardFactory_Sorceries {
//*************** START *********** START ************************** //*************** START *********** START **************************
else if(cardName.equals("Roiling Terrain")) { else if(cardName.equals("Roiling Terrain")) {
SpellAbility spell = new Spell(card) { //SpellAbility spell = new Spell(card) {
Cost cost = new Cost("2 R R", cardName, false);
final Target tgt = new Target(card, "Select a Land", "Land".split(","));
SpellAbility spell = new Spell(card, cost, tgt) {
private static final long serialVersionUID = -65124658746L; private static final long serialVersionUID = -65124658746L;
@Override @Override
public void resolve() { public void resolve() {
if(AllZoneUtil.isCardInPlay(getTargetCard()) Card c = tgt.getTargetCards().get(0);
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
AllZone.GameAction.destroy(getTargetCard()); Player controller = c.getController();
CardList Grave = new CardList(AllZone.getZone(Constant.Zone.Graveyard, getTargetCard().getController()).getCards()); AllZone.GameAction.destroy(c);
int Damage = (Grave.getType("Land")).size();
getTargetCard().getController().addDamage(Damage, card); int damage = AllZoneUtil.getPlayerTypeInGraveyard(controller, "Land").size();
}
controller.addDamage(damage, card);
} }
@Override
public void chooseTargetAI() {
//target basic land that Human only has 1 or 2 in play
CardList land = new CardList(AllZone.Human_Battlefield.getCards());
land = land.getType("Land");
Card target = null;
String[] name = {"Forest", "Swamp", "Plains", "Mountain", "Island"};
for(int i = 0; i < name.length; i++)
if(land.getName(name[i]).size() == 1) {
target = land.getName(name[i]).get(0);
break;
}
//see if there are only 2 lands of the same type
if(target == null) {
for(int i = 0; i < name.length; i++)
if(land.getName(name[i]).size() == 2) {
target = land.getName(name[i]).get(0);
break;
}
}//if
if(target == null) {
land.shuffle();
target = land.get(0);
}
setTargetCard(target);
}//chooseTargetAI()
@Override @Override
public boolean canPlayAI() { public boolean canPlayAI() {
CardList land = new CardList(AllZone.Human_Battlefield.getCards()); CardList land = new CardList(AllZone.Human_Battlefield.getCards());
land = land.getType("Land"); land = land.getType("Land");
return land.size() != 0;
if (land.size() != 0)
return false;
tgt.resetTargets();
tgt.addTarget(CardFactoryUtil.AI_getBestLand(land));
return true;
} }
};//SpellAbility };//SpellAbility
spell.setBeforePayMana(CardFactoryUtil.input_targetType(spell, "Land"));
// Do not remove SpellAbilities created by AbilityFactory or Keywords. // Do not remove SpellAbilities created by AbilityFactory or Keywords.
card.clearFirstSpellAbility(); card.clearFirstSpellAbility();
card.addSpellAbility(spell); card.addSpellAbility(spell);