mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Rework ceaseToExist
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user