mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Skip prompting player with no blockers to select blockers (#13496)
* Don't prompt creatureless player to select blockers * Move getting possible blockers back to while loop * Several preferences text improvements, always skip select blockers prompt if no blockers
This commit is contained in:
parent
35b0ae8abd
commit
dfb6896453
3 changed files with 9 additions and 8 deletions
|
|
@ -2621,19 +2621,19 @@
|
||||||
<Component class="javax.swing.JCheckBox" name="cbStopBlockWithAny">
|
<Component class="javax.swing.JCheckBox" name="cbStopBlockWithAny">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="selected" type="boolean" value="true"/>
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
<Property name="text" type="java.lang.String" value="STOP skips on declare blockers if ANY blockers are available"/>
|
<Property name="text" type="java.lang.String" value="STOP skips when attacked and on declare blockers if ANY blockers are available"/>
|
||||||
<Property name="actionCommand" type="java.lang.String" value=""/>
|
<Property name="actionCommand" type="java.lang.String" value=""/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JCheckBox" name="cbStopBlockWithZero">
|
<Component class="javax.swing.JCheckBox" name="cbStopBlockWithZero">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="STOP skips on declare blockers if ZERO blockers are available"/>
|
<Property name="text" type="java.lang.String" value="STOP skips when attacked if ZERO blockers are available"/>
|
||||||
<Property name="actionCommand" type="java.lang.String" value=""/>
|
<Property name="actionCommand" type="java.lang.String" value=""/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JCheckBox" name="cbStopOnNewStackObjects">
|
<Component class="javax.swing.JCheckBox" name="cbStopOnNewStackObjects">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Skip to STACK resolved (F10): stop on new objects added (on) or stop until empty (off)"/>
|
<Property name="text" type="java.lang.String" value="Skip to STACK resolved (F10): stop on new objects added (on) or stop when stack empty (off)"/>
|
||||||
<Property name="actionCommand" type="java.lang.String" value=""/>
|
<Property name="actionCommand" type="java.lang.String" value=""/>
|
||||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
<Dimension value="[300, 25]"/>
|
<Dimension value="[300, 25]"/>
|
||||||
|
|
|
||||||
|
|
@ -2396,15 +2396,15 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
phases_stopSettings.add(cbStopAttack);
|
phases_stopSettings.add(cbStopAttack);
|
||||||
|
|
||||||
cbStopBlockWithAny.setSelected(true);
|
cbStopBlockWithAny.setSelected(true);
|
||||||
cbStopBlockWithAny.setText("STOP skips on declare blockers if ANY blockers are available");
|
cbStopBlockWithAny.setText("STOP skips when attacked and on declare blockers if ANY blockers are available");
|
||||||
cbStopBlockWithAny.setActionCommand("");
|
cbStopBlockWithAny.setActionCommand("");
|
||||||
phases_stopSettings.add(cbStopBlockWithAny);
|
phases_stopSettings.add(cbStopBlockWithAny);
|
||||||
|
|
||||||
cbStopBlockWithZero.setText("STOP skips on declare blockers if ZERO blockers are available");
|
cbStopBlockWithZero.setText("STOP skips when attacked if ZERO blockers are available");
|
||||||
cbStopBlockWithZero.setActionCommand("");
|
cbStopBlockWithZero.setActionCommand("");
|
||||||
phases_stopSettings.add(cbStopBlockWithZero);
|
phases_stopSettings.add(cbStopBlockWithZero);
|
||||||
|
|
||||||
cbStopOnNewStackObjects.setText("Skip to STACK resolved (F10): stop on new objects added (on) or stop until empty (off)");
|
cbStopOnNewStackObjects.setText("Skip to STACK resolved (F10): stop on new objects added (on) or stop when stack empty (off)");
|
||||||
cbStopOnNewStackObjects.setActionCommand("");
|
cbStopOnNewStackObjects.setActionCommand("");
|
||||||
cbStopOnNewStackObjects.setPreferredSize(new java.awt.Dimension(300, 25));
|
cbStopOnNewStackObjects.setPreferredSize(new java.awt.Dimension(300, 25));
|
||||||
phases_stopSettings.add(cbStopOnNewStackObjects);
|
phases_stopSettings.add(cbStopOnNewStackObjects);
|
||||||
|
|
|
||||||
|
|
@ -2072,7 +2072,6 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
// stop skip on any/zero permanents available
|
// stop skip on any/zero permanents available
|
||||||
int possibleBlockersCount = game.getBattlefield().count(filter, playerId, source, game);
|
int possibleBlockersCount = game.getBattlefield().count(filter, playerId, source, game);
|
||||||
boolean canStopOnAny = possibleBlockersCount != 0 && getControllingPlayersUserData(game).getUserSkipPrioritySteps().isStopOnDeclareBlockersWithAnyPermanents();
|
boolean canStopOnAny = possibleBlockersCount != 0 && getControllingPlayersUserData(game).getUserSkipPrioritySteps().isStopOnDeclareBlockersWithAnyPermanents();
|
||||||
boolean canStopOnZero = possibleBlockersCount == 0 && getControllingPlayersUserData(game).getUserSkipPrioritySteps().isStopOnDeclareBlockersWithZeroPermanents();
|
|
||||||
|
|
||||||
// skip declare blocker step
|
// skip declare blocker step
|
||||||
// as opposed to declare attacker - it can be skipped by ANY skip button TODO: make same for declare attackers and rework skip buttons (normal and forced)
|
// as opposed to declare attacker - it can be skipped by ANY skip button TODO: make same for declare attackers and rework skip buttons (normal and forced)
|
||||||
|
|
@ -2081,9 +2080,11 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
|| passedTurn
|
|| passedTurn
|
||||||
|| passedUntilEndOfTurn
|
|| passedUntilEndOfTurn
|
||||||
|| passedUntilNextMain;
|
|| passedUntilNextMain;
|
||||||
if (skipButtonActivated && !canStopOnAny && !canStopOnZero) {
|
if (skipButtonActivated && !canStopOnAny) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Skip prompt to select blockers if player has none
|
||||||
|
if (possibleBlockersCount == 0) return;
|
||||||
|
|
||||||
while (canRespond()) {
|
while (canRespond()) {
|
||||||
prepareForResponse(game);
|
prepareForResponse(game);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue