Merge pull request #6590 from 18ths/world_rule_range_of_influence

fixed world rule with range of influence
This commit is contained in:
LevelX2 2020-06-03 22:39:56 +02:00 committed by GitHub
commit bd40d90286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;