Fixed some handling problems of triggered abilities.

This commit is contained in:
LevelX2 2014-05-24 21:10:56 +02:00
parent e02b3377b3
commit 0443311f0e
8 changed files with 30 additions and 28 deletions

View file

@ -1100,7 +1100,9 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
} finally {
if (top != null) {
state.getStack().remove(top);
state.handleSimultaneousEvent(this);
while (state.hasSimultaneousEvents()) {
state.handleSimultaneousEvent(this);
}
}
}
}

View file

@ -11,7 +11,7 @@ import mage.constants.PhaseStep;
*/
public class GameOptions implements Serializable {
private static GameOptions defInstance = new GameOptions();
private static final GameOptions defInstance = new GameOptions();
public static GameOptions getDefault() {
return defInstance;

View file

@ -235,7 +235,6 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
if (this.getSpellAbility() instanceof BestowAbility) {
updateOptionalCosts(0);
result = card.putOntoBattlefield(game, fromZone, ability.getId(), controllerId);
game.getState().handleSimultaneousEvent(game);
return result;
} else {
//20091005 - 608.2b
@ -246,7 +245,6 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
} else {
updateOptionalCosts(0);
result = card.putOntoBattlefield(game, fromZone, ability.getId(), controllerId);
game.getState().handleSimultaneousEvent(game);
return result;
}
}

View file

@ -28,13 +28,12 @@
package mage.game.stack;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.game.Controllable;
import mage.game.Game;
import java.util.UUID;
public interface StackObject extends MageObject, Controllable {
boolean resolve(Game game);

View file

@ -108,12 +108,13 @@ public abstract class Phase<T extends Phase<T>> implements Serializable {
return false;
}
currentStep = step;
if (!game.isSimulation() && checkStopOnStepOption(game)) {
return false;
}
if (!game.getState().getTurnMods().skipStep(activePlayerId, getStep().getType())) {
playStep(game);
}
if (!game.isSimulation() && checkStopOnStepOption(game)) {
return false;
}
}
if (game.isPaused() || game.gameOver(null)) {
return false;