put all triggers on stack in immediate mode, clear stack after simulated combat
fixes issue 235master
parent
805165949b
commit
fcbfadc1ec
|
@ -5,7 +5,6 @@ import magic.model.action.MagicAction;
|
|||
import magic.model.action.MagicActionList;
|
||||
import magic.model.action.MagicAddEventAction;
|
||||
import magic.model.action.MagicExecuteFirstEventAction;
|
||||
import magic.model.action.MagicStackResolveAction;
|
||||
import magic.model.action.MagicLogMarkerAction;
|
||||
import magic.model.action.MagicMarkerAction;
|
||||
import magic.model.action.MagicPutItemOnStackAction;
|
||||
|
@ -1175,12 +1174,12 @@ public class MagicGame {
|
|||
if (!event.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (immediate) {
|
||||
if (event.hasChoice()) {
|
||||
// ignore
|
||||
} else {
|
||||
executeEvent(event, MagicEvent.NO_CHOICE_RESULTS);
|
||||
doAction(new MagicPutItemOnStackAction(new MagicTriggerOnStack(event)));
|
||||
}
|
||||
} else if (trigger.usesStack()) {
|
||||
doAction(new MagicPutItemOnStackAction(new MagicTriggerOnStack(event)));
|
||||
|
|
|
@ -4,6 +4,7 @@ import magic.model.MagicGame;
|
|||
import magic.model.MagicPlayer;
|
||||
import magic.model.action.MagicCombatDamageAction;
|
||||
import magic.model.action.MagicDeclareBlockersAction;
|
||||
import magic.model.action.MagicStackResolveAction;
|
||||
import magic.model.choice.MagicDeclareBlockersResult;
|
||||
|
||||
public class MagicGameCombatScore implements MagicCombatScore {
|
||||
|
@ -24,6 +25,11 @@ public class MagicGameCombatScore implements MagicCombatScore {
|
|||
game.doAction(new MagicDeclareBlockersAction(defendingPlayer,result));
|
||||
game.doAction(new MagicCombatDamageAction(attackingPlayer,defendingPlayer,true));
|
||||
game.doAction(new MagicCombatDamageAction(attackingPlayer,defendingPlayer,false));
|
||||
// resolve triggers
|
||||
while (game.getStack().size() > 0 && !game.isFinished()) {
|
||||
game.doAction(new MagicStackResolveAction());
|
||||
game.checkState();
|
||||
}
|
||||
// Give extra points for extra blocked creatures.
|
||||
final int score=game.getScore()+result.size();
|
||||
game.undoActions();
|
||||
|
|
Loading…
Reference in New Issue