mirror of
https://github.com/correl/mage.git
synced 2025-01-12 03:00:13 +00:00
* Free for all - Fixed a bug that controller of a spell was sometimes affected by effects that should only be applied to opponents (e.g. Mogis, God of Slaughter's triggered ability).
This commit is contained in:
parent
6993d7f725
commit
de12dce50c
3 changed files with 7 additions and 4 deletions
|
@ -74,7 +74,7 @@ public class FreeForAll extends GameImpl<FreeForAll> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<UUID> getOpponents(UUID playerId) {
|
public Set<UUID> getOpponents(UUID playerId) {
|
||||||
Set<UUID> opponents = new HashSet<UUID>();
|
Set<UUID> opponents = new HashSet<>();
|
||||||
for (UUID opponentId: this.getPlayer(playerId).getInRange()) {
|
for (UUID opponentId: this.getPlayer(playerId).getInRange()) {
|
||||||
if (!opponentId.equals(playerId)) {
|
if (!opponentId.equals(playerId)) {
|
||||||
opponents.add(opponentId);
|
opponents.add(opponentId);
|
||||||
|
@ -85,7 +85,7 @@ public class FreeForAll extends GameImpl<FreeForAll> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpponent(Player player, UUID playerToCheck) {
|
public boolean isOpponent(Player player, UUID playerToCheck) {
|
||||||
return player.getInRange().contains(playerToCheck);
|
return !player.getId().equals(playerToCheck) && player.getInRange().contains(playerToCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -115,6 +115,9 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl<Begi
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new UnsupportedOperationException("Value for targetController not supported: " + targetController.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -2170,7 +2170,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOpponent(UUID playerToCheckId, Game game) {
|
public boolean hasOpponent(UUID playerToCheckId, Game game) {
|
||||||
return game.isOpponent(this, playerToCheckId);
|
return !this.getId().equals(playerToCheckId) && game.isOpponent(this, playerToCheckId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue