mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 19:59:54 -08:00
Merge pull request #1631 from okuRaku/master
fix for Exhaustion on things that entered after resolution
This commit is contained in:
commit
d6b32a42e3
2 changed files with 151 additions and 11 deletions
|
|
@ -33,7 +33,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
|
||||
import mage.abilities.effects.common.DontUntapInOpponentsNextUntapStepAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -42,7 +42,6 @@ import mage.filter.FilterPermanent;
|
|||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
|
@ -97,16 +96,11 @@ class ExhaustionEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
|
||||
if (player != null) {
|
||||
List<Permanent> doNotUntapNextUntapStep = new ArrayList<>();
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
doNotUntapNextUntapStep.add(permanent);
|
||||
}
|
||||
if (!doNotUntapNextUntapStep.isEmpty()) {
|
||||
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("This creature");
|
||||
effect.setTargetPointer(new FixedTargets(doNotUntapNextUntapStep, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
ContinuousEffect effect = new DontUntapInOpponentsNextUntapStepAllEffect(filter);
|
||||
effect.setTargetPointer(new FixedTarget(player.getId()));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue