mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Fixed spells cast by AF Play effects (like Isochron Scepter) not triggering cast spell triggers (like storm).
This commit is contained in:
@@ -22,6 +22,7 @@ import forge.game.player.Player;
|
|||||||
import forge.game.spellability.Spell;
|
import forge.game.spellability.Spell;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.spellability.SpellAbilityRestriction;
|
import forge.game.spellability.SpellAbilityRestriction;
|
||||||
|
import forge.game.zone.Zone;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
@@ -154,10 +155,14 @@ public class PlayEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
Card original = tgtCard;
|
Card original = tgtCard;
|
||||||
if (sa.hasParam("CopyCard")) {
|
if (sa.hasParam("CopyCard")) {
|
||||||
|
Zone zone = tgtCard.getZone();
|
||||||
tgtCard = Card.fromPaperCard(tgtCard.getPaperCard(), sa.getActivatingPlayer());
|
tgtCard = Card.fromPaperCard(tgtCard.getPaperCard(), sa.getActivatingPlayer());
|
||||||
|
|
||||||
tgtCard.setToken(true);
|
tgtCard.setToken(true);
|
||||||
tgtCard.setCopiedSpell(true);
|
tgtCard.setZone(zone);
|
||||||
|
if (zone != null) {
|
||||||
|
zone.add(tgtCard);
|
||||||
|
}
|
||||||
|
|
||||||
if (useEncoded) {
|
if (useEncoded) {
|
||||||
tgtCard.setSVar("IsEncoded", "Number$1");
|
tgtCard.setSVar("IsEncoded", "Number$1");
|
||||||
@@ -200,9 +205,9 @@ public class PlayEffect extends SpellAbilityEffect {
|
|||||||
if (sa.hasParam("CopyOnce")) {
|
if (sa.hasParam("CopyOnce")) {
|
||||||
tgtCards.remove(original);
|
tgtCards.remove(original);
|
||||||
}
|
}
|
||||||
SpellAbility tgtSA = null;
|
|
||||||
// only one mode can be used
|
// only one mode can be used
|
||||||
tgtSA = sa.getActivatingPlayer().getController().getAbilityToPlay(sas);
|
SpellAbility tgtSA = sa.getActivatingPlayer().getController().getAbilityToPlay(sas);
|
||||||
boolean noManaCost = sa.hasParam("WithoutManaCost");
|
boolean noManaCost = sa.hasParam("WithoutManaCost");
|
||||||
if (noManaCost) {
|
if (noManaCost) {
|
||||||
tgtSA = tgtSA.copyWithNoManaCost();
|
tgtSA = tgtSA.copyWithNoManaCost();
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ public class HumanPlaySpellAbility {
|
|||||||
final Card c = this.ability.getSourceCard();
|
final Card c = this.ability.getSourceCard();
|
||||||
if (this.ability instanceof Spell && !c.isCopiedSpell()) {
|
if (this.ability instanceof Spell && !c.isCopiedSpell()) {
|
||||||
fromZone = game.getZoneOf(c);
|
fromZone = game.getZoneOf(c);
|
||||||
|
if (fromZone != null) {
|
||||||
zonePosition = fromZone.getCards().indexOf(c);
|
zonePosition = fromZone.getCards().indexOf(c);
|
||||||
|
}
|
||||||
this.ability.setSourceCard(game.getAction().moveToStack(c));
|
this.ability.setSourceCard(game.getAction().moveToStack(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user