Some changes to handling of triggered effects and player response.

This commit is contained in:
LevelX2 2014-05-25 13:53:32 +02:00
parent dbc066c998
commit 2652316421
2 changed files with 7 additions and 1 deletions

View file

@ -451,19 +451,25 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
} else if (response.getString() != null && response.getString().equals("special")) { } else if (response.getString() != null && response.getString().equals("special")) {
specialAction(game); specialAction(game);
} else if (response.getUUID() != null) { } else if (response.getUUID() != null) {
boolean result = false;
MageObject object = game.getObject(response.getUUID()); MageObject object = game.getObject(response.getUUID());
if (object != null) { if (object != null) {
Zone zone = game.getState().getZone(object.getId()); Zone zone = game.getState().getZone(object.getId());
if (zone != null) { if (zone != null) {
if (object instanceof Card && ((Card) object).isFaceDown()) { if (object instanceof Card && ((Card) object).isFaceDown()) {
revealFaceDownCard((Card) object, game); revealFaceDownCard((Card) object, game);
result = true;
} }
LinkedHashMap<UUID, ActivatedAbility> useableAbilities = getUseableActivatedAbilities(object, zone, game); LinkedHashMap<UUID, ActivatedAbility> useableAbilities = getUseableActivatedAbilities(object, zone, game);
if (useableAbilities != null && useableAbilities.size() > 0) { if (useableAbilities != null && useableAbilities.size() > 0) {
activateAbility(useableAbilities, object, game); activateAbility(useableAbilities, object, game);
result = true;
} }
} }
} }
return result;
} else if (response.getManaType() != null) {
return false;
} }
return true; return true;
} }

View file

@ -1060,7 +1060,6 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
state.getPlayers().resetPassed(); state.getPlayers().resetPassed();
fireUpdatePlayersEvent(); fireUpdatePlayersEvent();
state.getRevealed().reset(); state.getRevealed().reset();
//resetLKI();
resetShortLivingLKI(); resetShortLivingLKI();
break; break;
} else { } else {
@ -1102,6 +1101,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
state.getStack().remove(top); state.getStack().remove(top);
while (state.hasSimultaneousEvents()) { while (state.hasSimultaneousEvents()) {
state.handleSimultaneousEvent(this); state.handleSimultaneousEvent(this);
checkStateAndTriggered();
} }
} }
} }