Merge pull request #2597 from spjspj/master

spjspj - Force stop and stop skip for when there's potential attackers
This commit is contained in:
spjspj 2016-11-18 00:16:25 +11:00 committed by GitHub
commit 9a4d5ca15e
3 changed files with 8 additions and 6 deletions

View file

@ -564,7 +564,6 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
artifactCounter,
enchantmentCounter,
instantCounter,
sorceryCounter,
planeswalkerCounter,
sorceryCounter,
tribalCounter

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);

View file

@ -107,7 +107,7 @@ public class ChatManager {
}
private boolean containsSwearing(String message) {
if (message != null && message.toLowerCase().matches("^.*(anal|asshole|balls|bastard|bitch|blowjob|cock|crap|cunt|damn|dick|douche|fag|fuck|idiot|moron|piss|prick|pussy|rape|rapist|sex|screw you|shit|slut|vagina).*$")) {
if (message != null && message.toLowerCase().matches("^.*(anal|asshole|balls|bastard|bitch|blowjob|cock|crap|cunt|cum|damn|dick|dildo|douche|fag|fuck|idiot|moron|piss|prick|pussy|rape|rapist|sex|screw|shit|slut|vagina).*$")) {
return true;
}
return false;