mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Some changes to handling of triggered effects and player response.
This commit is contained in:
parent
dbc066c998
commit
2652316421
2 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue