fixed world rule with range of influence

This commit is contained in:
18ths 2020-05-30 21:52:22 +02:00
parent 3333cf3287
commit d5c46816be
2 changed files with 38 additions and 9 deletions

View file

@ -2235,13 +2235,19 @@ public abstract class GameImpl implements Game, Serializable {
newestPermanent = null;
}
}
PlayerList newestPermanentControllerRange = state.getPlayersInRange(newestPermanent.getControllerId(), this);
// 801.12 The "world rule" applies to a permanent only if other world permanents are within its controller's range of influence.
for (Permanent permanent : worldEnchantment) {
if (!Objects.equals(newestPermanent, permanent)) {
if (newestPermanentControllerRange.contains(permanent.getControllerId())
&& !Objects.equals(newestPermanent, permanent)) {
movePermanentToGraveyardWithInfo(permanent);
somethingHappened = true;
}
}
}
//TODO: implement the rest
return somethingHappened;