mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- [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:
@@ -604,6 +604,20 @@ public class GameAction {
|
||||
c.setTurnInZone(tiz);
|
||||
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();
|
||||
runParams.put("Card", c);
|
||||
runParams.put("OriginalController", original);
|
||||
|
||||
@@ -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());
|
||||
} else if (mapParams.containsKey("SpellDescription")) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -112,6 +112,14 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
|
||||
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
|
||||
if (effectSVars != null) {
|
||||
for (final String s : effectSVars) {
|
||||
|
||||
Reference in New Issue
Block a user