1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 17:00:08 -09:00

* Tragic Arrogance - Fixed a problem that under some circumstances permanents of the wrong player were sacrificed.

This commit is contained in:
LevelX2 2019-12-29 14:20:24 +01:00
parent 9b685cf14b
commit 42a9aed977
2 changed files with 27 additions and 28 deletions
Mage.Sets/src/mage/cards/t
Mage/src/main/java/mage/game/permanent

View file

@ -1,4 +1,3 @@
package mage.cards.t;
import java.util.HashSet;
@ -10,10 +9,10 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.common.FilterPlaneswalkerPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
@ -127,7 +126,7 @@ class TragicArroganceffect extends OneShotEffect {
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterNonlandPermanent(), game)) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENTS_NON_LAND, playerId, game)) {
if (!choosenPermanent.contains(permanent)) {
permanent.sacrifice(playerId, game);
}

View file

@ -1,15 +1,14 @@
package mage.game.permanent;
import mage.abilities.keyword.PhasingAbility;
import mage.constants.CardType;
import mage.constants.RangeOfInfluence;
import mage.filter.FilterPermanent;
import mage.game.Game;
import java.io.Serializable;
import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;
import mage.abilities.keyword.PhasingAbility;
import mage.constants.CardType;
import mage.constants.RangeOfInfluence;
import mage.filter.FilterPermanent;
import mage.game.Game;
/**
* @author BetaSteward_at_googlemail.com
@ -233,7 +232,8 @@ public class Battlefield implements Serializable {
/**
* Returns all {@link Permanent} on the battlefield that match the supplied
* filter. This method ignores the range of influence. It's ignore controllers preficate
* filter. This method ignores the range of influence. It ignores controller
* predicates
*
* @param filter
* @param game
@ -331,8 +331,8 @@ public class Battlefield implements Serializable {
return field.values()
.stream()
.filter(perm -> perm.getAbilities().containsKey(PhasingAbility.getInstance().getId())
&& perm.isPhasedIn() &&
perm.isControlledBy(controllerId))
&& perm.isPhasedIn()
&& perm.isControlledBy(controllerId))
.collect(Collectors.toList());
}