- [C17] Added Shifting Shadow.

- One of the hackier/more complicated scripts, so may not be perfect, though was tested in most situations, including stealing the enchanted creature.
This commit is contained in:
Agetian
2017-08-15 06:35:08 +00:00
parent 716ba3eea8
commit d2a30ea049
5 changed files with 43 additions and 1 deletions

1
.gitattributes vendored
View File

@@ -17193,6 +17193,7 @@ forge-gui/res/cardsfolder/upcoming/patron_of_the_vein.txt -text
forge-gui/res/cardsfolder/upcoming/qasali_slingers.txt -text forge-gui/res/cardsfolder/upcoming/qasali_slingers.txt -text
forge-gui/res/cardsfolder/upcoming/ramos_dragon_engine.txt -text forge-gui/res/cardsfolder/upcoming/ramos_dragon_engine.txt -text
forge-gui/res/cardsfolder/upcoming/scalelord_reckoner.txt -text forge-gui/res/cardsfolder/upcoming/scalelord_reckoner.txt -text
forge-gui/res/cardsfolder/upcoming/shifting_shadow.txt -text
forge-gui/res/cardsfolder/upcoming/taigam_ojutai_master.txt -text forge-gui/res/cardsfolder/upcoming/taigam_ojutai_master.txt -text
forge-gui/res/cardsfolder/upcoming/taigam_sidisis_hand.txt -text forge-gui/res/cardsfolder/upcoming/taigam_sidisis_hand.txt -text
forge-gui/res/cardsfolder/upcoming/teferis_protection.txt -text forge-gui/res/cardsfolder/upcoming/teferis_protection.txt -text

View File

@@ -604,6 +604,20 @@ public class GameAction {
c.setTurnInZone(tiz); c.setTurnInZone(tiz);
c.setCameUnderControlSinceLastUpkeep(true); c.setCameUnderControlSinceLastUpkeep(true);
// check for related effects and correct their controller and zone if necessary
for (Card eff : game.getCardsIn(ZoneType.Command)) {
if (eff.getType().hasSubtype("Effect")) {
boolean moveWithImprinted = eff.hasSVar("MoveWithImprinted") && eff.getImprintedCards().contains(c);
boolean moveWithRemembered = eff.hasSVar("MoveWithRemembered") && (Iterables.contains(eff.getRemembered(), c));
if (moveWithImprinted || moveWithRemembered) {
eff.setController(c.getController(), game.getNextTimestamp());
eff.getZone().remove(eff);
c.getController().getZone(ZoneType.Command).add(eff);
}
}
}
final Map<String, Object> runParams = Maps.newHashMap(); final Map<String, Object> runParams = Maps.newHashMap();
runParams.put("Card", c); runParams.put("Card", c);
runParams.put("OriginalController", original); runParams.put("OriginalController", original);

View File

@@ -252,7 +252,12 @@ public final class AbilityFactory {
} }
} }
if (spellAbility instanceof SpellApiBased && hostCard.isPermanent()) { // OverrideSpellDescription can be set in case a permanent spell with subs explicitly specifies
// SpellDescription for all its components, potentially in subabilities, which allows to avoid artifacts
// such as splashing the card name in the beginning of the description (e.g. Shifting Shadow)
if (spellAbility instanceof SpellApiBased && hostCard.isPermanent()
&& !mapParams.containsKey("OverrideSpellDescription")) {
spellAbility.setDescription(spellAbility.getHostCard().getName()); spellAbility.setDescription(spellAbility.getHostCard().getName());
} else if (mapParams.containsKey("SpellDescription")) { } else if (mapParams.containsKey("SpellDescription")) {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();

View File

@@ -112,6 +112,14 @@ public class EffectEffect extends SpellAbilityEffect {
final Card eff = createEffect(hostCard, controller, name, image); final Card eff = createEffect(hostCard, controller, name, image);
// For effects that need to change their controller and zone together with the card remembered/imprinted on them
if (sa.hasParam("MoveWithRemembered")) {
eff.setSVar("MoveWithRemembered", "True");
}
if (sa.hasParam("MoveWithImprinted")) {
eff.setSVar("MoveWithImprinted", "True");
}
// Grant SVars first in order to give references to granted abilities // Grant SVars first in order to give references to granted abilities
if (effectSVars != null) { if (effectSVars != null) {
for (final String s : effectSVars) { for (final String s : effectSVars) {

View File

@@ -0,0 +1,14 @@
Name:Shifting Shadow
ManaCost:2 R
Types:Enchantment Aura
K:Enchant creature
A:SP$ Attach | Cost$ 2 R | ValidTgts$ Creature | AILogic$ Pump | SubAbility$ DBEffect | OverrideSpellDescription$ True
SVar:DBEffect:DB$ Effect | Triggers$ ShadowUpkeepTrig | RememberObjects$ Enchanted | ImprintCards$ Self | SVars$ ShadowRevealCards,ShadowReattach,ShadowDestroyEnchanted,ShadowForgetDestroyed | ConditionPresent$ Card.Self | Duration$ UntilHostLeavesPlay | ExileOnMoved$ Exile | Name$ Shifting Shadow Effect | MoveWithRemembered$ True | SpellDescription$ Enchanted creature has haste and "At the beginning of your upkeep, destroy this creature. Reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and attach CARDNAME to it, then put all other cards revealed this way on the bottom of your library in a random order."
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Haste
SVar:ShadowUpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | TriggerController$ RememberedController | Execute$ ShadowDestroyEnchanted | TriggerDescription$ At the beginning of your upkeep, destroy this creature. Reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and attach EFFECTSOURCE to it, then put all other cards revealed this way on the bottom of your library in a random order.
SVar:ShadowDestroyEnchanted:DB$ Destroy | Defined$ Remembered | SubAbility$ ShadowForgetDestroyed
SVar:ShadowForgetDestroyed:DB$ Pump | ForgetObjects$ Remembered | SubAbility$ ShadowRevealCards
SVar:ShadowRevealCards:DB$ DigUntil | Valid$ Creature | ValidDescription$ creature | FoundDestination$ Battlefield | RevealedDestination$ Library | RevealedLibraryPosition$ -1 | RevealRandomOrder$ True | RememberFound$ True | SubAbility$ ShadowReattach
SVar:ShadowReattach:DB$ Attach | Defined$ Remembered | Object$ Imprinted
SVar:Picture:http://www.wizards.com/global/images/magic/general/shifting_shadow.jpg
Oracle:Enchant creature\nEnchanted creature has haste and "At the beginning of your upkeep, destroy this creature. Reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and attach Shifting Shadow to it, then put all other cards revealed this way on the bottom of your library in a random order."