mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Fixed ChangeZone triggers not working on cards moving to hand or library themselves.
This commit is contained in:
@@ -605,7 +605,9 @@ public class GameAction {
|
|||||||
AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed);
|
AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Card lastKnownInfo = c;
|
||||||
if ((p != null) && p.is(ZoneType.Battlefield)) {
|
if ((p != null) && p.is(ZoneType.Battlefield)) {
|
||||||
|
lastKnownInfo = CardUtil.getLKICopy(c);
|
||||||
c = AllZone.getCardFactory().copyCard(c);
|
c = AllZone.getCardFactory().copyCard(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,13 +620,13 @@ public class GameAction {
|
|||||||
library.add(c, libPosition);
|
library.add(c, libPosition);
|
||||||
|
|
||||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||||
runParams.put("Card", c);
|
runParams.put("Card", lastKnownInfo);
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
runParams.put("Origin", p.getZoneType().name());
|
runParams.put("Origin", p.getZoneType().name());
|
||||||
} else {
|
} else {
|
||||||
runParams.put("Origin", null);
|
runParams.put("Origin", null);
|
||||||
}
|
}
|
||||||
runParams.put("Destination", ZoneType.Library);
|
runParams.put("Destination", ZoneType.Library.name());
|
||||||
AllZone.getTriggerHandler().runTrigger(TriggerType.ChangesZone, runParams);
|
AllZone.getTriggerHandler().runTrigger(TriggerType.ChangesZone, runParams);
|
||||||
|
|
||||||
Player owner = p.getPlayer();
|
Player owner = p.getPlayer();
|
||||||
|
|||||||
@@ -307,6 +307,12 @@ public class TriggerHandler {
|
|||||||
// AP
|
// AP
|
||||||
allCards = playerAP.getCardsIn(ZoneType.StaticAbilitiesSourceZones);
|
allCards = playerAP.getCardsIn(ZoneType.StaticAbilitiesSourceZones);
|
||||||
allCards.addAll(AllZoneUtil.getCardsIn(ZoneType.Stack).getController(playerAP));
|
allCards.addAll(AllZoneUtil.getCardsIn(ZoneType.Stack).getController(playerAP));
|
||||||
|
if (runParams.containsKey("Card")) {
|
||||||
|
Card card = (Card) runParams.get("Card");
|
||||||
|
if (!allCards.contains(card)) {
|
||||||
|
allCards.add(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
for (final Card c : allCards) {
|
for (final Card c : allCards) {
|
||||||
for (final Trigger t : c.getTriggers()) {
|
for (final Trigger t : c.getTriggers()) {
|
||||||
if (!t.isStatic()) {
|
if (!t.isStatic()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user