mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
CardFactoryUtil & Card: move Uneath to addSpellAbility
Sedris, the Traitor King: make this card more easier.
This commit is contained in:
@@ -1423,7 +1423,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
sbLong.append(". Mana cost includes color.)");
|
sbLong.append(". Mana cost includes color.)");
|
||||||
} 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 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 ");
|
||||||
|
|||||||
@@ -2221,33 +2221,7 @@ public class CardFactoryUtil {
|
|||||||
card.getCurrentState().addUnparsedAbility(effect);
|
card.getCurrentState().addUnparsedAbility(effect);
|
||||||
}
|
}
|
||||||
else if (keyword.startsWith("Unearth")) {
|
else if (keyword.startsWith("Unearth")) {
|
||||||
card.removeIntrinsicKeyword(keyword);
|
addSpellAbility(keyword, card, null);
|
||||||
|
|
||||||
final String[] k = keyword.split(":");
|
|
||||||
final String manacost = k[1];
|
|
||||||
|
|
||||||
String effect = "AB$ ChangeZone | Cost$ " + manacost + " | Defined$ Self" +
|
|
||||||
" | Origin$ Graveyard | Destination$ Battlefield | SorcerySpeed$" +
|
|
||||||
" True | ActivationZone$ Graveyard | Unearth$ True | SubAbility$" +
|
|
||||||
" UnearthPumpSVar | PrecostDesc$ Unearth | StackDescription$ " +
|
|
||||||
"Unearth: Return CARDNAME to the battlefield. | SpellDescription$" +
|
|
||||||
" (" + ManaCostParser.parse(manacost) + ": Return CARDNAME to the " +
|
|
||||||
"battlefield. It gains haste. Exile it at the beginning of the next" +
|
|
||||||
" end step or if it would leave the battlefield. Unearth only as a sorcery.)";
|
|
||||||
String dbpump = "DB$ Pump | Defined$ Self | KW$ Haste & HIDDEN If CARDNAME" +
|
|
||||||
" would leave the battlefield, exile it instead of putting it " +
|
|
||||||
"anywhere else. | Permanent$ True | SubAbility$ UnearthDelayTrigger";
|
|
||||||
String delTrig = "DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn" +
|
|
||||||
" | Execute$ UnearthTrueDeath | TriggerDescription$ Exile " +
|
|
||||||
"CARDNAME at the beginning of the next end step.";
|
|
||||||
String truedeath = "DB$ ChangeZone | Defined$ Self | Origin$ Battlefield" +
|
|
||||||
" | Destination$ Exile";
|
|
||||||
card.setSVar("UnearthPumpSVar", dbpump);
|
|
||||||
card.setSVar("UnearthDelayTrigger", delTrig);
|
|
||||||
card.setSVar("UnearthTrueDeath", truedeath);
|
|
||||||
card.addSpellAbility(AbilityFactory.getAbility(effect, card));
|
|
||||||
// add ability to instrinic strings so copies/clones create the ability also
|
|
||||||
card.getCurrentState().addUnparsedAbility(effect);
|
|
||||||
}
|
}
|
||||||
else if (keyword.startsWith("Level up")) {
|
else if (keyword.startsWith("Level up")) {
|
||||||
final String strMaxLevel = card.getSVar("maxLevel");
|
final String strMaxLevel = card.getSVar("maxLevel");
|
||||||
@@ -2948,7 +2922,39 @@ 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;
|
||||||
|
|
||||||
|
if (keyword.startsWith("Unearth")) {
|
||||||
|
final String[] k = keyword.split(":");
|
||||||
|
final String manacost = k[1];
|
||||||
|
|
||||||
|
String effect = "AB$ ChangeZone | Cost$ " + manacost + " | Defined$ Self" +
|
||||||
|
" | Origin$ Graveyard | Destination$ Battlefield | SorcerySpeed$" +
|
||||||
|
" True | ActivationZone$ Graveyard | Unearth$ True | SubAbility$" +
|
||||||
|
" UnearthPumpSVar | PrecostDesc$ Unearth | StackDescription$ " +
|
||||||
|
"Unearth: Return CARDNAME to the battlefield. | SpellDescription$" +
|
||||||
|
" (" + Keyword.getInstance(keyword).getReminderText() + ")";
|
||||||
|
String dbpump = "DB$ Pump | Defined$ Self | KW$ Haste & HIDDEN If CARDNAME" +
|
||||||
|
" would leave the battlefield, exile it instead of putting it " +
|
||||||
|
"anywhere else. | Permanent$ True | SubAbility$ UnearthDelayTrigger";
|
||||||
|
String delTrig = "DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn" +
|
||||||
|
" | Execute$ UnearthTrueDeath | TriggerDescription$ Exile " +
|
||||||
|
"CARDNAME at the beginning of the next end step.";
|
||||||
|
String truedeath = "DB$ ChangeZone | Defined$ Self | Origin$ Battlefield" +
|
||||||
|
" | Destination$ Exile";
|
||||||
|
card.setSVar("UnearthPumpSVar", dbpump);
|
||||||
|
card.setSVar("UnearthDelayTrigger", delTrig);
|
||||||
|
card.setSVar("UnearthTrueDeath", truedeath);
|
||||||
|
|
||||||
|
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
|
||||||
|
if (!intrinsic) {
|
||||||
|
sa.setTemporary(true);
|
||||||
|
sa.setIntrinsic(false);
|
||||||
|
//sa.setOriginalHost(hostCard);
|
||||||
|
kws.addSpellAbility(sa);
|
||||||
|
}
|
||||||
|
card.addSpellAbility(sa);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ Name:Sedris, the Traitor King
|
|||||||
ManaCost:3 U B R
|
ManaCost:3 U B R
|
||||||
Types:Legendary Creature Zombie Warrior
|
Types:Legendary Creature Zombie Warrior
|
||||||
PT:5/5
|
PT:5/5
|
||||||
S:Mode$ Continuous | EffectZone$ Battlefield | AffectedZone$ Graveyard | Affected$ Creature.YouCtrl | AddAbility$ Unearth | AddSVar$ SedrisUnearthed & SedrisTrueDeath & SedrisUnavailable | Description$ Each creature card in your graveyard has unearth {2}{B}. ({2}{B}: Return the card to the battlefield. The creature gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
|
S:Mode$ Continuous | EffectZone$ Battlefield | AffectedZone$ Graveyard | Affected$ Creature.YouCtrl | AddKeyword$ Unearth:2 B | Description$ Each creature card in your graveyard has unearth {2}{B}. ({2}{B}: Return the card to the battlefield. The creature gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
|
||||||
SVar:Unearth:AB$ ChangeZone | Cost$ 2 B | Defined$ Self | Origin$ Graveyard | Destination$ Battlefield | SorcerySpeed$ True | ActivationZone$ Graveyard | Unearth$ True | SubAbility$ SedrisUnearthed | PrecostDesc$ Unearth | CostDesc$ {2}{B} | StackDescription$ Unearth: Return CARDNAME to the battlefield. | SpellDescription$ ({2}{B}: Return CARDNAME to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
|
|
||||||
SVar:SedrisUnearthed:DB$ Pump | Defined$ Self | KW$ Haste & HIDDEN If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else. | Permanent$ True | SubAbility$ SedrisTrueDeath | StackDescription$ It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield.
|
|
||||||
SVar:SedrisTrueDeath:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ SedrisUnavailable | TriggerDescription$ Exile CARDNAME at the beginning of the next end step.
|
|
||||||
SVar:SedrisUnavailable:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sedris_the_traitor_king.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/sedris_the_traitor_king.jpg
|
||||||
Oracle:Each creature card in your graveyard has unearth {2}{B}. ({2}{B}: Return the card to the battlefield. The creature gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
|
Oracle:Each creature card in your graveyard has unearth {2}{B}. ({2}{B}: Return the card to the battlefield. The creature gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
|
||||||
|
|||||||
Reference in New Issue
Block a user