- Converted Tarmogoyf

This commit is contained in:
swordshine
2013-05-13 00:50:21 +00:00
parent 77fa660693
commit 529ec27359
4 changed files with 68 additions and 80 deletions

View File

@@ -1,8 +1,10 @@
Name:Tarmogoyf Name:Tarmogoyf
ManaCost:1 G ManaCost:1 G
Types:Creature Lhurgoyf Types:Creature Lhurgoyf
Text:Tarmogoyf's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1. PT:*/1+*
PT:0/1 S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ Y | Description$ CARDNAME's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1.
SVar:X:Count$CardTypes.Graveyard
SVar:Y:SVar$X/Plus.1
SVar:Picture:http://www.wizards.com/global/images/magic/general/tarmogoyf.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/tarmogoyf.jpg
Oracle:Tarmogoyf's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1. (Artifact, creature, enchantment, instant, land, planeswalker, sorcery, and tribal are card types.) Oracle:Tarmogoyf's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1. (Artifact, creature, enchantment, instant, land, planeswalker, sorcery, and tribal are card types.)
SetInfo:FUT Rare SetInfo:FUT Rare

View File

@@ -296,7 +296,6 @@ public class StaticEffects {
StaticEffects.cardToEffectsList.put("Liu Bei, Lord of Shu", new String[] { "Liu_Bei" }); StaticEffects.cardToEffectsList.put("Liu Bei, Lord of Shu", new String[] { "Liu_Bei" });
StaticEffects.cardToEffectsList.put("Old Man of the Sea", new String[] { "Old_Man_of_the_Sea" }); StaticEffects.cardToEffectsList.put("Old Man of the Sea", new String[] { "Old_Man_of_the_Sea" });
StaticEffects.cardToEffectsList.put("Tarmogoyf", new String[] { "Tarmogoyf" });
StaticEffects.cardToEffectsList.put("Umbra Stalker", new String[] { "Umbra_Stalker" }); StaticEffects.cardToEffectsList.put("Umbra Stalker", new String[] { "Umbra_Stalker" });
} }

View File

@@ -1436,6 +1436,7 @@ public class CardFactoryUtil {
return doXMath(cCount, m, c); return doXMath(cCount, m, c);
} }
if (sq[0].contains("CardTypes")) return doXMath(getCardTypesFromList(game.getCardsIn(ZoneType.smartValueOf(sq[1]))), m, c);
if (sq[0].contains("BushidoPoint")) return doXMath(c.getKeywordMagnitude("Bushido"), m, c); if (sq[0].contains("BushidoPoint")) return doXMath(c.getKeywordMagnitude("Bushido"), m, c);
if (sq[0].contains("TimesKicked")) return doXMath(c.getKickerMagnitude(), m, c); if (sq[0].contains("TimesKicked")) return doXMath(c.getKickerMagnitude(), m, c);
@@ -1967,6 +1968,68 @@ public class CardFactoryUtil {
return filteredkw; return filteredkw;
} }
/**
* <p>
* getCardTypesFromList.
* </p>
*
* @param list
* a {@link forge.CardList} object.
* @return a int.
*/
public static int getCardTypesFromList(final List<Card> list) {
int count = 0;
for (Card c1 : list) {
if (c1.isCreature()) {
count++;
break;
}
}
for (Card c1 : list) {
if (c1.isSorcery()) {
count++;
break;
}
}
for (Card c1 : list) {
if (c1.isInstant()) {
count++;
break;
}
}
for (Card c1 : list) {
if (c1.isArtifact()) {
count++;
break;
}
}
for (Card c1 : list) {
if (c1.isEnchantment()) {
count++;
break;
}
}
for (Card c1 : list) {
if (c1.isLand()) {
count++;
break;
}
}
for (Card c1 : list) {
if (c1.isPlaneswalker()) {
count++;
break;
}
}
for (Card c1 : list) {
if (c1.isTribal()) {
count++;
break;
}
}
return count;
}
/** /**
* <p> * <p>
* getBushidoEffects. * getBushidoEffects.

View File

@@ -999,81 +999,6 @@ public final class GameActionUtil {
}; // Liu_Bei }; // Liu_Bei
/** Constant <code>Tarmogoyf</code>. */
private static Function<GameState, ?> tarmogoyf = new Function<GameState, Object>() {
@Override
public Object apply(GameState game) {
// get all creatures
final List<Card> list = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Tarmogoyf"));
for (int i = 0; i < list.size(); i++) {
final Card c = list.get(i);
c.setBaseAttack(this.countDiffTypes(game));
c.setBaseDefense(c.getBaseAttack() + 1);
}
return null;
} // execute()
private int countDiffTypes(GameState game) {
final List<Card> list = game.getCardsIn(ZoneType.Graveyard);
int count = 0;
for (Card c : list) {
if (c.isCreature()) {
count++;
break;
}
}
for (Card c : list) {
if (c.isSorcery()) {
count++;
break;
}
}
for (Card c : list) {
if (c.isInstant()) {
count++;
break;
}
}
for (Card c : list) {
if (c.isArtifact()) {
count++;
break;
}
}
for (Card c : list) {
if (c.isEnchantment()) {
count++;
break;
}
}
for (Card c : list) {
if (c.isLand()) {
count++;
break;
}
}
for (Card c : list) {
if (c.isPlaneswalker()) {
count++;
break;
}
}
for (Card c : list) {
if (c.isTribal()) {
count++;
break;
}
}
return count;
}
};
/** Constant <code>commands</code>. */ /** Constant <code>commands</code>. */
private final static HashMap<String, Function<GameState, ?>> commands = new HashMap<String, Function<GameState, ?>>(); private final static HashMap<String, Function<GameState, ?>> commands = new HashMap<String, Function<GameState, ?>>();
@@ -1082,7 +1007,6 @@ public final class GameActionUtil {
GameActionUtil.getCommands().put("Liu_Bei", GameActionUtil.liuBei); GameActionUtil.getCommands().put("Liu_Bei", GameActionUtil.liuBei);
GameActionUtil.getCommands().put("Old_Man_of_the_Sea", GameActionUtil.oldManOfTheSea); GameActionUtil.getCommands().put("Old_Man_of_the_Sea", GameActionUtil.oldManOfTheSea);
GameActionUtil.getCommands().put("Tarmogoyf", GameActionUtil.tarmogoyf);
GameActionUtil.getCommands().put("Umbra_Stalker", GameActionUtil.umbraStalker); GameActionUtil.getCommands().put("Umbra_Stalker", GameActionUtil.umbraStalker);
// The commands above are in alphabetical order by cardname. // The commands above are in alphabetical order by cardname.