- 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
Text:no text
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:Picture:http://www.wizards.com/global/images/magic/general/obsidian_fireheart.jpg
SetInfo:ZEN|Mythic|http://magiccards.info/scans/en/zen/140.jpg

View File

@@ -2334,64 +2334,6 @@ public class CardFactoryUtil {
}//input_discardRecall()
//****************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) {
return input_targetCreature(spell, Command.Blank);
}

View File

@@ -1657,46 +1657,6 @@ public class CardFactory_Creatures {
}//*************** 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 **************************
else if(cardName.equals("Wild Mongrel")) {
@@ -2084,32 +2044,35 @@ public class CardFactory_Creatures {
//*************** START *********** START **************************
else if(cardName.equals("Memnarch")) {
//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);
final Target target = new Target(card, "Select a permanent", "Permanent".split(","));
final SpellAbility ability1 = new Ability_Activated(card, cost, target) {
private static final long serialVersionUID = -887237000483591242L;
@Override
public void resolve() {
if(AllZoneUtil.isCardInPlay(getTargetCard())
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
Card crd = getTargetCard();
public void resolve(){
Card crd = target.getTargetCards().get(0);
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()
@Override
public boolean canPlayAI() {
CardList list = getCreature();
return list.size() != 0;
}
@Override
public void chooseTargetAI() {
Card target = CardFactoryUtil.AI_getBestCreature(getCreature());
setTargetCard(target);
}//chooseTargetAI()
if (list.size() == 0)
return false;
target.resetTargets();
target.addTarget(CardFactoryUtil.AI_getBestCreature(getCreature()));
return true;
}
CardList getCreature() {
CardList list = new CardList(AllZone.Human_Battlefield.getCards());
@@ -2124,7 +2087,6 @@ public class CardFactory_Creatures {
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.setBeforePayMana(CardFactoryUtil.input_targetType(ability1, "All"));
}//*************** END ************ END **************************

View File

@@ -459,60 +459,39 @@ public class CardFactory_Sorceries {
//*************** START *********** START **************************
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;
@Override
public void resolve() {
if(AllZoneUtil.isCardInPlay(getTargetCard())
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
AllZone.GameAction.destroy(getTargetCard());
CardList Grave = new CardList(AllZone.getZone(Constant.Zone.Graveyard, getTargetCard().getController()).getCards());
int Damage = (Grave.getType("Land")).size();
getTargetCard().getController().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 c = tgt.getTargetCards().get(0);
Card target = null;
Player controller = c.getController();
AllZone.GameAction.destroy(c);
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;
}
int damage = AllZoneUtil.getPlayerTypeInGraveyard(controller, "Land").size();
//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;
controller.addDamage(damage, card);
}
}//if
if(target == null) {
land.shuffle();
target = land.get(0);
}
setTargetCard(target);
}//chooseTargetAI()
@Override
public boolean canPlayAI() {
CardList land = new CardList(AllZone.Human_Battlefield.getCards());
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
spell.setBeforePayMana(CardFactoryUtil.input_targetType(spell, "Land"));
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
card.clearFirstSpellAbility();
card.addSpellAbility(spell);