spjspj - Force stop and stop skip for when there's potential attackers

This commit is contained in:
spjspj 2016-11-15 23:20:51 +11:00
parent 4210796281
commit 47874a7f03

View file

@ -912,10 +912,7 @@ public class HumanPlayer extends PlayerImpl {
FilterCreatureForCombat filter = filterCreatureForCombat.copy();
filter.add(new ControllerIdPredicate(attackingPlayerId));
while (!abort) {
if (passedAllTurns || passedUntilEndStepBeforeMyTurn
|| (!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedTurnSkipStack || passedUntilEndOfTurn || passedUntilNextMain))) {
return;
}
Map<String, Serializable> options = new HashMap<>();
List<UUID> possibleAttackers = new ArrayList<>();
@ -927,6 +924,12 @@ public class HumanPlayer extends PlayerImpl {
options.put(Constants.Option.POSSIBLE_ATTACKERS, (Serializable) possibleAttackers);
if (possibleAttackers.size() > 0) {
options.put(Constants.Option.SPECIAL_BUTTON, (Serializable) "All attack");
if (getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction()) {
resetPlayerPassedActions();
}
} else if (passedAllTurns || passedUntilEndStepBeforeMyTurn
|| (!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedTurnSkipStack || passedUntilEndOfTurn || passedUntilNextMain))) {
return;
}
game.fireSelectEvent(playerId, "Select attackers", options);