Player: add OpponentOf to get the Opponents of a defined value

This commit is contained in:
Hanmac
2016-10-07 08:31:35 +00:00
parent 737fae947d
commit 561e656c44

View File

@@ -2043,6 +2043,14 @@ public class Player extends GameEntity implements Comparable<Player> {
if (equals(sourceController) || !isOpponentOf(sourceController)) { if (equals(sourceController) || !isOpponentOf(sourceController)) {
return false; return false;
} }
} else if (property.startsWith("OpponentOf ")) {
final String v = property.split(" ")[1];
final List<Player> players = AbilityUtils.getDefinedPlayers(source, v, spellAbility);
for (final Player p : players) {
if (equals(p) || !isOpponentOf(p)) {
return false;
}
}
} else if (property.equals("Allies")) { } else if (property.equals("Allies")) {
if (equals(sourceController) || isOpponentOf(sourceController)) { if (equals(sourceController) || isOpponentOf(sourceController)) {
return false; return false;