stormcat wrote::r32688
I reported same problem ago.
When
Kalitas, Traitor of Ghet and other non token creatures dies same time, the creatures should be exiled and created zombie tokens.
Ok, so let's talk a bit more about this bug.

I started looking at the relevant code and came to a conclusion that this issue ensues because the game thinks that Kalitas is already in the graveyard by the time the replacement effect fires, which *looks* like it may be calling for some LKI utilization.
Now, there *is* actually a way to get this to work using the last known information. Here's an example of an experimental tweak that works for this case.
First we need the LKI to actually preserve information about the last zone the card was known to be in (it currently doesn't, and LKI zone is always set to "null", not sure if it's intentional or not):
CardUtil.java around line 322 in getLKICopy()- Code: Select all
newCopy.setZone(in.getZone());
And then we need to make the replacement event handler actually use that information to detect where the card was last known to be:
ReplacementHandler.java at line 118 in run()- Code: Select all
for (final ReplacementEffect replacementEffect : crd.getReplacementEffects()) {
if (!replacementEffect.hasRun()
&& replacementEffect.getLayer() == layer
&& replacementEffect.requirementsCheck(game)
&& replacementEffect.canReplace(runParams)
&& !possibleReplacers.contains(replacementEffect)
&& replacementEffect.zonesCheck(game.getZoneOf(game.getChangeZoneLKIInfo(crd)))) {
possibleReplacers.add(replacementEffect);
}
}
(note using game.getChangeZoneLKIInfo(crd) instead of just crd)
With these changes,
Kalitas, Traitor of Ghet will correctly fire even on a mass removal event such as
Wrath of God, and it works correctly in the standard "creatures dying one by one" event. However, this has a really big potential for, you know, breaking all sorts of things, which is why I don't yet want to go for it (and it looks too simple to be true).
Please let me know what you think about this change. If it's not viable to do it this way, am I at least on to something here, is it possible to somehow expand/change this idea to get this to work correctly without potentially breaking half the game?

- Agetian