mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Add support for tapping the topmost card of a stack to activate the card behind if the card on top has no remaining actions (same as mobile game already supports)
This commit is contained in:
@@ -15,7 +15,7 @@ public interface Input {
|
||||
|
||||
boolean selectCard(Card card, final List<Card> otherCardsToSelect, ITriggerEvent triggerEvent);
|
||||
|
||||
void selectAbility(SpellAbility ab);
|
||||
boolean selectAbility(SpellAbility ab);
|
||||
|
||||
void selectPlayer(Player player, ITriggerEvent triggerEvent);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
setCurrentDefender(selected);
|
||||
}
|
||||
else {
|
||||
flashIncorrectAction(); // cannot attack that player
|
||||
MatchUtil.getController().flashIncorrectAction(); // cannot attack that player
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,6 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
declareAttacker(card);
|
||||
}
|
||||
else {
|
||||
flashIncorrectAction();
|
||||
validAction = false;
|
||||
}
|
||||
}
|
||||
@@ -201,7 +200,6 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
if (activeBand != null && !activeBand.canJoinBand(card)) {
|
||||
activateBand(null);
|
||||
updateMessage();
|
||||
flashIncorrectAction();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -214,7 +212,6 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
return true;
|
||||
}
|
||||
|
||||
flashIncorrectAction();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,9 @@ public abstract class InputBase implements java.io.Serializable, Input {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectAbility(final SpellAbility ab) { }
|
||||
public boolean selectAbility(final SpellAbility ab) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void selectButtonCancel() {
|
||||
@@ -173,10 +175,6 @@ public abstract class InputBase implements java.io.Serializable, Input {
|
||||
MatchUtil.getController().showPromptMessage(getOwner(), message);
|
||||
}
|
||||
|
||||
protected final void flashIncorrectAction() {
|
||||
MatchUtil.getController().flashIncorrectAction();
|
||||
}
|
||||
|
||||
protected String getTurnPhasePriorityMessage(final Game game) {
|
||||
final PhaseHandler ph = game.getPhaseHandler();
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -153,8 +153,6 @@ public class InputBlock extends InputSyncronizedBase {
|
||||
|
||||
if (isCorrectAction) {
|
||||
card.getGame().fireEvent(new GameEventCombatChanged());
|
||||
} else {
|
||||
flashIncorrectAction();
|
||||
}
|
||||
|
||||
showMessage();
|
||||
|
||||
@@ -117,7 +117,6 @@ public class InputConfirmMulligan extends InputSyncronizedBase {
|
||||
boolean isSerumPowder = c0.getName().equals("Serum Powder");
|
||||
boolean isLegalChoice = fromHand && (isCommander || isSerumPowder);
|
||||
if (!isLegalChoice || cardSelectLocked) {
|
||||
flashIncorrectAction();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,8 @@ public class InputLockUI implements Input {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void selectAbility(SpellAbility ab) {
|
||||
public boolean selectAbility(SpellAbility ab) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void selectPlayer(Player player, ITriggerEvent triggerEvent) {
|
||||
|
||||
@@ -128,19 +128,19 @@ public class InputPassPriority extends InputSyncronizedBase {
|
||||
//remove unplayable unless triggerEvent specified, in which case unplayable may be shown as disabled options
|
||||
List<SpellAbility> abilities = card.getAllPossibleAbilities(player, triggerEvent == null);
|
||||
if (abilities.isEmpty()) {
|
||||
flashIncorrectAction();
|
||||
return false;
|
||||
}
|
||||
|
||||
selectAbility(player.getController().getAbilityToPlay(abilities, triggerEvent));
|
||||
return true;
|
||||
return selectAbility(player.getController().getAbilityToPlay(abilities, triggerEvent));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectAbility(final SpellAbility ab) {
|
||||
public boolean selectAbility(final SpellAbility ab) {
|
||||
if (ab != null) {
|
||||
chosenSa = ab;
|
||||
stop();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
||||
@Override
|
||||
protected boolean onCardSelected(final Card card, final List<Card> otherCardsToSelect, final ITriggerEvent triggerEvent) {
|
||||
if (card.getManaAbilities().isEmpty()) {
|
||||
flashIncorrectAction();
|
||||
return false;
|
||||
}
|
||||
// only tap card if the mana is needed
|
||||
@@ -76,10 +75,11 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectAbility(final SpellAbility ab) {
|
||||
public boolean selectAbility(final SpellAbility ab) {
|
||||
if (ab != null && ab.isManaAbility()) {
|
||||
activateManaAbility(ab.getHostCard(), manaCost, ab);
|
||||
return activateManaAbility(ab.getHostCard(), manaCost, ab);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<SpellAbility> getUsefulManaAbilities(Card card) {
|
||||
|
||||
@@ -41,7 +41,6 @@ public final class InputSelectCardsForConvoke extends InputSelectManyBase<Card>
|
||||
protected boolean onCardSelected(final Card card, final List<Card> otherCardsToSelect, final ITriggerEvent triggerEvent) {
|
||||
if (!availableCreatures.contains(card)) {
|
||||
// Not in untapped creatures list provided. Not a legal Convoke selection.
|
||||
flashIncorrectAction();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,7 +51,6 @@ public final class InputSelectCardsForConvoke extends InputSelectManyBase<Card>
|
||||
onSelectStateChanged(card, false);
|
||||
}
|
||||
else {
|
||||
|
||||
byte chosenColor = player.getController().chooseColorAllowColorless("Convoke " + card.toString() + " for which color?", card, CardUtil.getColors(card));
|
||||
|
||||
if (remainingCost.getColorlessManaAmount() > 0 && (chosenColor == 0 || !remainingCost.needsColor(chosenColor, player.getManaPool()))) {
|
||||
@@ -67,7 +65,7 @@ public final class InputSelectCardsForConvoke extends InputSelectManyBase<Card>
|
||||
}
|
||||
}
|
||||
showMessage("The colors provided by " + card.toString() + " you've chosen cannot be used to decrease the manacost of " + remainingCost.toString());
|
||||
flashIncorrectAction();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user