mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Player: add OpponentOf to get the Opponents of a defined value
This commit is contained in:
@@ -2043,6 +2043,14 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
if (equals(sourceController) || !isOpponentOf(sourceController)) {
|
||||
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")) {
|
||||
if (equals(sourceController) || isOpponentOf(sourceController)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user