CardFactoryUtil: add Scavenge as Keyword

This commit is contained in:
Hanmac
2016-07-20 14:37:31 +00:00
parent dab0a28931
commit 805e6a718c
15 changed files with 45 additions and 28 deletions

View File

@@ -1419,7 +1419,7 @@ public class Card extends GameEntity implements Comparable<Card> {
} else if (keyword.startsWith("Soulbond")) { } else if (keyword.startsWith("Soulbond")) {
sbLong.append(keyword + " (" + Keyword.getInstance(keyword).getReminderText() + ")"); sbLong.append(keyword + " (" + Keyword.getInstance(keyword).getReminderText() + ")");
} else if (keyword.startsWith("Equip") || keyword.startsWith("Fortify") || keyword.startsWith("Outlast") } else if (keyword.startsWith("Equip") || keyword.startsWith("Fortify") || keyword.startsWith("Outlast")
|| keyword.startsWith("Unearth")) { || keyword.startsWith("Unearth") || keyword.startsWith("Scavenge")) {
// keyword parsing takes care of adding a proper description // keyword parsing takes care of adding a proper description
} else if (keyword.startsWith("CantBeBlockedBy")) { } else if (keyword.startsWith("CantBeBlockedBy")) {
sbLong.append(getName()).append(" can't be blocked "); sbLong.append(getName()).append(" can't be blocked ");

View File

@@ -2220,6 +2220,9 @@ public class CardFactoryUtil {
// add ability to instrinic strings so copies/clones create the ability also // add ability to instrinic strings so copies/clones create the ability also
card.getCurrentState().addUnparsedAbility(effect); card.getCurrentState().addUnparsedAbility(effect);
} }
else if (keyword.startsWith("Scavenge")) {
addSpellAbility(keyword, card, null);
}
else if (keyword.startsWith("Unearth")) { else if (keyword.startsWith("Unearth")) {
addSpellAbility(keyword, card, null); addSpellAbility(keyword, card, null);
} }
@@ -2667,7 +2670,7 @@ public class CardFactoryUtil {
abilityStr.append("- "); abilityStr.append("- ");
} }
abilityStr.append("| CostDesc$ " + cost.toSimpleString() + " "); abilityStr.append("| CostDesc$ " + cost.toSimpleString() + " ");
abilityStr.append("| SpellDescription$ (" + cost.toSimpleString() + ", {T}: Put a +1/+1 counter on this creature. Outlast only as a sorcery.)"); abilityStr.append("| SpellDescription$ (" + Keyword.getInstance(keyword).getReminderText() + ")");
final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card); final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card);
card.addSpellAbility(sa); card.addSpellAbility(sa);
// add ability to instrinic strings so copies/clones create the ability also // add ability to instrinic strings so copies/clones create the ability also
@@ -3018,7 +3021,30 @@ public class CardFactoryUtil {
public static void addSpellAbility(final String keyword, final Card card, final KeywordsChange kws) { public static void addSpellAbility(final String keyword, final Card card, final KeywordsChange kws) {
final boolean intrinsic = kws == null; final boolean intrinsic = kws == null;
if (keyword.startsWith("Unearth")) { if (keyword.startsWith("Scavenge")) {
final String[] k = keyword.split(":");
final String manacost = k[1];
String effect = "AB$ PutCounter | Cost$ " + manacost + " ExileFromGrave<1/CARDNAME> " +
"| ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 " +
"| CounterNum$ ScavengeX | SorcerySpeed$ True | References$ ScavengeX " +
"| PrecostDesc$ Scavenge | | CostDesc$ " + ManaCostParser.parse(manacost) +
"| SpellDescription$ (" + Keyword.getInstance("Scavenge:" + manacost).getReminderText() + ")";
card.setSVar("ScavengeX", "Count$CardPower");
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
if (!intrinsic) {
sa.setTemporary(true);
sa.setIntrinsic(false);
//sa.setOriginalHost(hostCard);
kws.addSpellAbility(sa);
} else {
// add ability to instrinic strings so copies/clones create the ability also
card.getCurrentState().addUnparsedAbility(effect);
}
card.addSpellAbility(sa);
} else if (keyword.startsWith("Unearth")) {
final String[] k = keyword.split(":"); final String[] k = keyword.split(":");
final String manacost = k[1]; final String manacost = k[1];
@@ -3046,6 +3072,9 @@ public class CardFactoryUtil {
sa.setIntrinsic(false); sa.setIntrinsic(false);
//sa.setOriginalHost(hostCard); //sa.setOriginalHost(hostCard);
kws.addSpellAbility(sa); kws.addSpellAbility(sa);
} else {
// add ability to instrinic strings so copies/clones create the ability also
card.getCurrentState().addUnparsedAbility(effect);
} }
card.addSpellAbility(sa); card.addSpellAbility(sa);
} }

View File

@@ -99,6 +99,7 @@ public enum Keyword {
SHADOW(SimpleKeyword.class, true, "This creature can block or be blocked by only creatures with shadow."), SHADOW(SimpleKeyword.class, true, "This creature can block or be blocked by only creatures with shadow."),
SHROUD(SimpleKeyword.class, true, "This can't be the target of spells or abilities."), SHROUD(SimpleKeyword.class, true, "This can't be the target of spells or abilities."),
SKULK(SimpleKeyword.class, true, "This creature can't be blocked by creatures with greater power."), SKULK(SimpleKeyword.class, true, "This creature can't be blocked by creatures with greater power."),
SCAVENGE(KeywordWithCost.class, false, "%s, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery."),
SOULBOND(SimpleKeyword.class, true, "You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them"), SOULBOND(SimpleKeyword.class, true, "You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them"),
SOULSHIFT(KeywordWithAmount.class, false, "When this creature dies, you may return target Spirit card with converted mana cost %d or less from your graveyard to your hand."), SOULSHIFT(KeywordWithAmount.class, false, "When this creature dies, you may return target Spirit card with converted mana cost %d or less from your graveyard to your hand."),
SPLICE(KeywordWithCostAndType.class, false, "You may reveal this card from your hand as you cast a %s spell. If you do, copy this card's text box onto that spell and pay %s as an additional cost to cast that spell."), SPLICE(KeywordWithCostAndType.class, false, "You may reveal this card from your hand as you cast a %s spell. If you do, copy this card's text box onto that spell and pay %s as an additional cost to cast that spell."),

View File

@@ -2,7 +2,6 @@ Name:Deadbridge Goliath
ManaCost:2 G G ManaCost:2 G G
Types:Creature Insect Types:Creature Insect
PT:5/5 PT:5/5
A:AB$ PutCounter | Cost$ 4 G G ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:4 G G
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/deadbridge_goliath.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/deadbridge_goliath.jpg
Oracle:Scavenge {4}{G}{G} ({4}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Scavenge {4}{G}{G} ({4}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -3,7 +3,6 @@ ManaCost:1 B G
Types:Creature Plant Zombie Types:Creature Plant Zombie
PT:3/3 PT:3/3
K:Haste K:Haste
A:AB$ PutCounter | Cost$ 3 B G ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:3 B G
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/dreg_mangler.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/dreg_mangler.jpg
Oracle:Haste\nScavenge {3}{B}{G} ({3}{B}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Haste\nScavenge {3}{B}{G} ({3}{B}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -2,7 +2,6 @@ Name:Drudge Beetle
ManaCost:1 G ManaCost:1 G
Types:Creature Insect Types:Creature Insect
PT:2/2 PT:2/2
A:AB$ PutCounter | Cost$ 5 G ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:5 G
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/drudge_beetle.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/drudge_beetle.jpg
Oracle:Scavenge {5}{G} ({5}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Scavenge {5}{G} ({5}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -3,7 +3,6 @@ ManaCost:3 G
Types:Creature Elf Rogue Types:Creature Elf Rogue
PT:2/2 PT:2/2
K:All creatures able to block CARDNAME do so. K:All creatures able to block CARDNAME do so.
A:AB$ PutCounter | Cost$ 3 G G ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:3 G G
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/golgari_decoy.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/golgari_decoy.jpg
Oracle:All creatures able to block Golgari Decoy do so.\nScavenge {3}{G}{G} ({3}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:All creatures able to block Golgari Decoy do so.\nScavenge {3}{G}{G} ({3}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -3,7 +3,6 @@ ManaCost:2 G G
Types:Creature Lizard Types:Creature Lizard
PT:3/3 PT:3/3
K:Trample K:Trample
A:AB$ PutCounter | Cost$ 5 G G ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:5 G G
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/korozda_monitor.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/korozda_monitor.jpg
Oracle:Trample\nScavenge {5}{G}{G} ({5}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Trample\nScavenge {5}{G}{G} ({5}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -3,7 +3,6 @@ ManaCost:2 B
Types:Creature Zombie Types:Creature Zombie
PT:2/1 PT:2/1
K:Swampwalk K:Swampwalk
A:AB$ PutCounter | Cost$ 2 B ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:2 B
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/sewer_shambler.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/sewer_shambler.jpg
Oracle:Swampwalk (This creature can't be blocked as long as defending player controls a Swamp.)\nScavenge {2}{B} ({2}{B}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Swampwalk (This creature can't be blocked as long as defending player controls a Swamp.)\nScavenge {2}{B} ({2}{B}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -2,8 +2,7 @@ Name:Slitherhead
ManaCost:BG ManaCost:BG
Types:Creature Plant Zombie Types:Creature Plant Zombie
PT:1/1 PT:1/1
A:AB$ PutCounter | Cost$ 0 ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:0
SVar:X:Count$CardPower
SVar:SacMe:1 SVar:SacMe:1
SVar:DiscardMe:1 SVar:DiscardMe:1
SVar:Picture:http://www.wizards.com/global/images/magic/general/slitherhead.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/slitherhead.jpg

View File

@@ -3,7 +3,6 @@ ManaCost:2 B G
Types:Creature Scorpion Types:Creature Scorpion
PT:2/2 PT:2/2
K:Deathtouch K:Deathtouch
A:AB$ PutCounter | Cost$ 1 B G ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:1 B G
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/sluiceway_scorpion.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/sluiceway_scorpion.jpg
Oracle:Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)\nScavenge {1}{B}{G} ({1}{B}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)\nScavenge {1}{B}{G} ({1}{B}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -2,7 +2,6 @@ Name:Terrus Wurm
ManaCost:6 B ManaCost:6 B
Types:Creature Zombie Wurm Types:Creature Zombie Wurm
PT:5/5 PT:5/5
A:AB$ PutCounter | Cost$ 6 B ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:6 B
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/terrus_wurm.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/terrus_wurm.jpg
Oracle:Scavenge {6}{B} ({6}{B}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Scavenge {6}{B} ({6}{B}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -3,7 +3,6 @@ ManaCost:3 G
Types:Creature Plant Hound Types:Creature Plant Hound
PT:3/3 PT:3/3
K:Reach K:Reach
A:AB$ PutCounter | Cost$ 4 G G ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:4 G G
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/thrashing_mossdog.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/thrashing_mossdog.jpg
Oracle:Reach (This creature can block creatures with flying.)\nScavenge {4}{G}{G} ({4}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Reach (This creature can block creatures with flying.)\nScavenge {4}{G}{G} ({4}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)

View File

@@ -2,9 +2,7 @@ Name:Varolz, the Scar-Striped
ManaCost:1 B G ManaCost:1 B G
Types:Legendary Creature Troll Warrior Types:Legendary Creature Troll Warrior
PT:2/2 PT:2/2
S:Mode$ Continuous | Affected$ Creature.YouOwn | AffectedZone$ Graveyard | AddAbility$ VarolzScavenge | AddSVar$ VarolzX | Description$ Each creature card in your graveyard has scavenge. The scavenge cost is equal to its mana cost. S:Mode$ Continuous | Affected$ Creature.YouOwn | AffectedZone$ Graveyard | AddKeyword$ Scavenge:CardManaCost | Description$ Each creature card in your graveyard has scavenge. The scavenge cost is equal to its mana cost.
SVar:VarolzScavenge:AB$ PutCounter | Cost$ CardManaCost ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ VarolzX | SorcerySpeed$ True | References$ VarolzX | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery.
SVar:VarolzX:Count$CardPower
A:AB$ Regenerate | Cost$ Sac<1/Creature.Other/another creature> | SpellDescription$ Regenerate CARDNAME. A:AB$ Regenerate | Cost$ Sac<1/Creature.Other/another creature> | SpellDescription$ Regenerate CARDNAME.
SVar:Picture:http://www.wizards.com/global/images/magic/general/varolz_the_scar_striped.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/varolz_the_scar_striped.jpg
Oracle:Each creature card in your graveyard has scavenge. The scavenge cost is equal to its mana cost. (Exile a creature card from your graveyard and pay its mana cost: Put a number of +1/+1 counters equal to that card's power on target creature. Scavenge only as a sorcery.)\nSacrifice another creature: Regenerate Varolz, the Scar-Striped. Oracle:Each creature card in your graveyard has scavenge. The scavenge cost is equal to its mana cost. (Exile a creature card from your graveyard and pay its mana cost: Put a number of +1/+1 counters equal to that card's power on target creature. Scavenge only as a sorcery.)\nSacrifice another creature: Regenerate Varolz, the Scar-Striped.

View File

@@ -3,7 +3,6 @@ ManaCost:5 B
Types:Creature Insect Types:Creature Insect
PT:3/3 PT:3/3
K:Flying K:Flying
A:AB$ PutCounter | Cost$ 2 B B ExileFromGrave<1/CARDNAME> | ActivationZone$ Graveyard | ValidTgts$ Creature | CounterType$ P1P1 | CounterNum$ X | SorcerySpeed$ True | References$ X | PrecostDesc$ Scavenge | SpellDescription$ Put a number of +1/+1 counter's equal to this card's power on target creature. Scavenge only as a sorcery. K:Scavenge:2 B B
SVar:X:Count$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/zanikev_locust.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/zanikev_locust.jpg
Oracle:Flying\nScavenge {2}{B}{B} ({2}{B}{B}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.) Oracle:Flying\nScavenge {2}{B}{B} ({2}{B}{B}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)