mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Support using Shift+click to attack with an entire stack of creatures
This commit is contained in:
@@ -156,6 +156,11 @@ public class InputAttack extends InputSyncronizedBase {
|
|||||||
final List<Card> att = combat.getAttackers();
|
final List<Card> att = combat.getAttackers();
|
||||||
if (triggerEvent != null && triggerEvent.getButton() == 3 && att.contains(card)) {
|
if (triggerEvent != null && triggerEvent.getButton() == 3 && att.contains(card)) {
|
||||||
undeclareAttacker(card);
|
undeclareAttacker(card);
|
||||||
|
if (otherCardsToSelect != null) {
|
||||||
|
for (Card c : otherCardsToSelect) {
|
||||||
|
undeclareAttacker(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
updateMessage();
|
updateMessage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -172,8 +177,12 @@ public class InputAttack extends InputSyncronizedBase {
|
|||||||
}
|
}
|
||||||
else { // Join a band by selecting a non-active band member after activating a band
|
else { // Join a band by selecting a non-active band member after activating a band
|
||||||
if (activeBand.canJoinBand(card)) {
|
if (activeBand.canJoinBand(card)) {
|
||||||
combat.removeFromCombat(card);
|
|
||||||
declareAttacker(card);
|
declareAttacker(card);
|
||||||
|
if (otherCardsToSelect != null) {
|
||||||
|
for (Card c : otherCardsToSelect) {
|
||||||
|
declareAttacker(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
validAction = false;
|
validAction = false;
|
||||||
@@ -183,6 +192,11 @@ public class InputAttack extends InputSyncronizedBase {
|
|||||||
else {
|
else {
|
||||||
//if banding not possible, just undeclare attacker
|
//if banding not possible, just undeclare attacker
|
||||||
undeclareAttacker(card);
|
undeclareAttacker(card);
|
||||||
|
if (otherCardsToSelect != null) {
|
||||||
|
for (Card c : otherCardsToSelect) {
|
||||||
|
undeclareAttacker(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMessage();
|
updateMessage();
|
||||||
@@ -203,11 +217,13 @@ public class InputAttack extends InputSyncronizedBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (combat.isAttacking(card)) {
|
declareAttacker(card);
|
||||||
combat.removeFromCombat(card);
|
if (otherCardsToSelect != null) {
|
||||||
|
for (Card c : otherCardsToSelect) {
|
||||||
|
declareAttacker(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declareAttacker(card);
|
|
||||||
updateMessage();
|
updateMessage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -216,6 +232,7 @@ public class InputAttack extends InputSyncronizedBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void declareAttacker(final Card card) {
|
private void declareAttacker(final Card card) {
|
||||||
|
combat.removeFromCombat(card);
|
||||||
combat.addAttacker(card, currentDefender, activeBand);
|
combat.addAttacker(card, currentDefender, activeBand);
|
||||||
activateBand(activeBand);
|
activateBand(activeBand);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user