forked from External/mage
* Fixed cards with skip untap optional ability that cause game freezes (#5606)
This commit is contained in:
parent
4a14940414
commit
6846db75f4
169 changed files with 754 additions and 1172 deletions
|
|
@ -1,20 +1,14 @@
|
|||
|
||||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class UntapAllDuringEachOtherPlayersUntapStepEffect extends ContinuousEffectImpl {
|
||||
|
|
@ -49,7 +43,7 @@ public class UntapAllDuringEachOtherPlayersUntapStepEffect extends ContinuousEff
|
|||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||
boolean untap = true;
|
||||
for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game).keySet()) {
|
||||
untap &= effect.canBeUntapped(permanent, source, game);
|
||||
untap &= effect.canBeUntapped(permanent, source, game, true);
|
||||
}
|
||||
if (untap) {
|
||||
permanent.untap(game);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,13 @@
|
|||
|
||||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public class UntapSourceDuringEachOtherPlayersUntapStepEffect extends ContinuousEffectImpl {
|
||||
|
|
@ -43,11 +37,11 @@ public class UntapSourceDuringEachOtherPlayersUntapStepEffect extends Continuous
|
|||
&& game.getStep() != null
|
||||
&& game.getStep().getType() == PhaseStep.UNTAP) {
|
||||
game.getState().setValue(source.getSourceId() + "applied", true);
|
||||
Permanent permanent = (Permanent) game.getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
boolean untap = true;
|
||||
for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game).keySet()) {
|
||||
untap &= effect.canBeUntapped(permanent, source, game);
|
||||
untap &= effect.canBeUntapped(permanent, source, game, true);
|
||||
}
|
||||
if (untap) {
|
||||
permanent.untap(game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue