mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Fixed triggers on clones leaving the battlefield not firing.
This commit is contained in:
@@ -120,6 +120,9 @@ public final class CardUtil {
|
|||||||
newCopy.setOwner(in.getOwner());
|
newCopy.setOwner(in.getOwner());
|
||||||
newCopy.setController(in.getController(), 0);
|
newCopy.setController(in.getController(), 0);
|
||||||
newCopy.getCharacteristics().copyFrom(in.getState(in.getCurState()));
|
newCopy.getCharacteristics().copyFrom(in.getState(in.getCurState()));
|
||||||
|
if (in.isCloned()) {
|
||||||
|
newCopy.addAlternateState(CardCharacteristicName.Cloner);
|
||||||
|
}
|
||||||
newCopy.setType(new ArrayList<String>(in.getType()));
|
newCopy.setType(new ArrayList<String>(in.getType()));
|
||||||
newCopy.setTriggers(in.getTriggers(), false);
|
newCopy.setTriggers(in.getTriggers(), false);
|
||||||
for (SpellAbility sa : in.getManaAbility()) {
|
for (SpellAbility sa : in.getManaAbility()) {
|
||||||
|
|||||||
@@ -249,7 +249,8 @@ public class TriggerHandler {
|
|||||||
Card card = (Card) runParams.get("Card");
|
Card card = (Card) runParams.get("Card");
|
||||||
if (card.getController() == player) {
|
if (card.getController() == player) {
|
||||||
for (final Trigger t : card.getTriggers()) {
|
for (final Trigger t : card.getTriggers()) {
|
||||||
if (!t.isStatic() && (card.isToken() || !t.isIntrinsic()) && canRunTrigger(t, mode, runParams)) {
|
if (!t.isStatic() && (card.isCloned() || card.isToken() || !t.isIntrinsic())
|
||||||
|
&& canRunTrigger(t, mode, runParams)) {
|
||||||
this.runSingleTrigger(t, runParams);
|
this.runSingleTrigger(t, runParams);
|
||||||
checkStatics = true;
|
checkStatics = true;
|
||||||
}
|
}
|
||||||
@@ -348,11 +349,7 @@ public class TriggerHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SpellAbility sa = null;
|
SpellAbility sa = null;
|
||||||
Card host = game.getCardState(regtrig.getHostCard());
|
Card host = regtrig.getHostCard();
|
||||||
|
|
||||||
if (host == null) {
|
|
||||||
host = regtrig.getHostCard();
|
|
||||||
}
|
|
||||||
|
|
||||||
sa = regtrig.getOverridingAbility();
|
sa = regtrig.getOverridingAbility();
|
||||||
if (sa == null) {
|
if (sa == null) {
|
||||||
@@ -366,6 +363,8 @@ public class TriggerHandler {
|
|||||||
sa = AbilityFactory.getAbility(host.getSVar(triggerParams.get("Execute")), host);
|
sa = AbilityFactory.getAbility(host.getSVar(triggerParams.get("Execute")), host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
host = game.getCardState(regtrig.getHostCard());
|
||||||
|
sa.setSourceCard(host);
|
||||||
sa.setTrigger(true);
|
sa.setTrigger(true);
|
||||||
sa.setSourceTrigger(regtrig.getId());
|
sa.setSourceTrigger(regtrig.getId());
|
||||||
regtrig.setTriggeringObjects(sa);
|
regtrig.setTriggeringObjects(sa);
|
||||||
|
|||||||
Reference in New Issue
Block a user