Rework ceaseToExist

This commit is contained in:
tool4EvEr
2021-04-20 18:28:01 +02:00
parent 2843ca9b49
commit 284db016a0
2 changed files with 3 additions and 6 deletions

View File

@@ -789,6 +789,7 @@ public class Game {
cc.removeImprintedCard(c);
cc.removeEncodedCard(c);
cc.removeRemembered(c);
cc.removeAttachedTo(c);
}
getAction().ceaseToExist(c, false);
// CR 603.2f owner of trigger source lost game

View File

@@ -920,17 +920,14 @@ public class GameAction {
}
public void ceaseToExist(Card c, boolean skipTrig) {
final String origin = c.getZone().getZoneType().name();
c.getZone().remove(c);
c.setZone(null);
// CR 603.6c other players LTB triggers should work
if (!skipTrig) {
game.addChangeZoneLKIInfo(c);
Card lki = null;
CardCollectionView lastBattlefield = game.getLastStateBattlefield();
int idx = lastBattlefield.indexOf(c);
Card lki = null;
if (idx != -1) {
lki = lastBattlefield.get(idx);
}
@@ -942,10 +939,9 @@ public class GameAction {
game.getCombat().saveLKI(lki);
}
game.getTriggerHandler().registerActiveLTBTrigger(lki);
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(c);
runParams.put(AbilityKey.CardLKI, lki);
runParams.put(AbilityKey.Origin, origin);
runParams.put(AbilityKey.Origin, c.getZone().getZoneType().name());
game.getTriggerHandler().runTrigger(TriggerType.ChangesZone, runParams, false);
game.getTriggerHandler().runWaitingTriggers();
}