CardFactoryUtil: move part of Unearth into ChangeZone Effect to use registerDelayedTrigger Helper

This commit is contained in:
Hanmac
2016-11-16 16:28:17 +00:00
parent 3af0976cd3
commit b6465a9c6f
2 changed files with 7 additions and 14 deletions

View File

@@ -538,6 +538,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
movedCard = game.getAction().moveTo(tgtC.getController().getZone(destination), tgtC);
if (sa.hasParam("Unearth")) {
movedCard.setUnearthed(true);
movedCard.addExtrinsicKeyword("Haste");
movedCard.addHiddenExtrinsicKeyword("If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else.");
registerDelayedTrigger(sa, "Exile", Lists.newArrayList(movedCard));
movedCard.updateStateForView();
}
if (sa.hasParam("FaceDown")) {
movedCard.setState(CardStateName.FaceDown, true);

View File

@@ -3720,22 +3720,11 @@ public class CardFactoryUtil {
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$ " +
" | Origin$ Graveyard | Destination$ Battlefield | SorcerySpeed$ True" +
" | ActivationZone$ Graveyard | Unearth$ True | " +
" | 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) {