Skip to content

Commit

Permalink
refactor: improved usage of getOpponents to ignore leaved players in …
Browse files Browse the repository at this point in the history
…one short effects
  • Loading branch information
JayDi85 committed Feb 3, 2025
1 parent 81f802f commit 58fbfdd
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/a/AuthorOfShadows.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Cards cards = new CardsImpl();
game.getOpponents(source.getControllerId())
game.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/b/BrainstealerDragon.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Cards cards = new CardsImpl();
game.getOpponents(source.getControllerId())
game.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/c/CutADeal.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public CutADealEffect copy() {
@Override
public boolean apply(Game game, Ability source) {
int count = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/f/FlotsamJetsam.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public JetsamEffect copy() {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Set<Player> opponents = game.getOpponents(source.getControllerId())
Set<Player> opponents = game.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/h/HighcliffFelidar.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Set<UUID> toDestroy = new HashSet();
game.getOpponents(source.getControllerId())
game.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/k/KroxaTitanOfDeathsHunger.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public KroxaTitanOfDeathsHungerDiscardEffect copy() {
@Override
public boolean apply(Game game, Ability source) {
Cards cards = new CardsImpl();
game.getOpponents(source.getControllerId())
game.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand All @@ -133,7 +133,7 @@ public boolean apply(Game game, Ability source) {
}
playerSet.add(player.getId());
});
game.getOpponents(source.getControllerId())
game.getOpponents(source.getControllerId(), true)
.stream()
.filter(uuid -> !playerSet.contains(uuid))
.map(game::getPlayer)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/l/LukkaCoppercoatOutcast.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public boolean apply(Game game, Ability source) {
StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game
);
List<Player> opponentList = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/m/MezzioMugger.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Set<Card> cards = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/m/MnemonicBetrayal.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Cards cards = new CardsImpl();
game.getOpponents(source.getControllerId())
game.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/s/SzatsWill.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Cards cards = new CardsImpl(game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/t/TeachingsOfTheArchaics.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
int diff = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/u/UvildaDeanOfPerfection.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Cards cards = new CardsImpl();
game.getOpponents(source.getControllerId())
game.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/v/VoiceOfMany.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public boolean apply(Game game, Ability source) {
StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game
).size();
int toDraw = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.mapToInt(uuid -> game.getBattlefield().getAllActivePermanents(
StaticFilters.FILTER_PERMANENT_CREATURE, uuid, game
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/x/XandersPact.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Set<Card> cards = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public boolean apply(Game game, Ability source) {
return true;
}
int totalLifeLost = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public boolean apply(Game game, Ability source) {
return false;
}
Set<Card> cards = game
.getOpponents(source.getControllerId())
.getOpponents(source.getControllerId(), true)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
Expand Down

0 comments on commit 58fbfdd

Please sign in to comment.