fixed a test failure

This commit is contained in:
Evan Kranzler 2021-02-24 16:32:30 -05:00
parent 27b85bca88
commit 5f23ccf24c
3 changed files with 7 additions and 3 deletions

View file

@ -84,7 +84,7 @@ class FaithsRewardWatcher extends Watcher {
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game));
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game, 1));
}
}

View file

@ -100,7 +100,7 @@ class FellShepherdWatcher extends Watcher {
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game));
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game, 1));
}
}

View file

@ -26,13 +26,17 @@ public class MageObjectReference implements Comparable<MageObjectReference>, Ser
private final int zoneChangeCounter;
public MageObjectReference(MageObject mageObject, Game game) {
this(mageObject, game, 0);
}
public MageObjectReference(MageObject mageObject, Game game, int offset) {
if (mageObject == null) {
this.sourceId = null;
this.zoneChangeCounter = -1;
return;
}
this.sourceId = mageObject.getId();
this.zoneChangeCounter = mageObject.getZoneChangeCounter(game);
this.zoneChangeCounter = mageObject.getZoneChangeCounter(game) + offset;
}
/**