mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
CardFactoryUtil: move part of Unearth into ChangeZone Effect to use registerDelayedTrigger Helper
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user