mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
update remaining confirm action for human decision
- to show relevant card and fix message title (removing "\n").
This commit is contained in:
@@ -87,7 +87,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
if (discardType.equals("Hand")) {
|
||||
if (!mandatory && !confirmAction(Localizer.getInstance().getMessage("lblDoYouWantDiscardYourHand"))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantDiscardYourHand"), ability)*/) {
|
||||
if (!mandatory && !confirmAction(Localizer.getInstance().getMessage("lblDoYouWantDiscardYourHand"))) {
|
||||
return null;
|
||||
}
|
||||
if (hand.size() > 1 && ability.getActivatingPlayer() != null) {
|
||||
@@ -131,16 +131,13 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
final String type = TextUtil.fastReplace(discardType, "+WithSameName", "");
|
||||
hand = CardLists.getValidCards(hand, type.split(";"), player, source, ability);
|
||||
final CardCollectionView landList2 = hand;
|
||||
hand = CardLists.filter(hand, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
hand = CardLists.filter(hand, c1 -> {
|
||||
for (final Card card : landList2) {
|
||||
if (!card.equals(c) && card.getName().equals(c.getName())) {
|
||||
if (!card.equals(c1) && card.getName().equals(c1.getName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (c == 0) {
|
||||
return PaymentDecision.card(new CardCollection());
|
||||
@@ -182,7 +179,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
public PaymentDecision visit(final CostDamage cost) {
|
||||
int c = cost.getAbilityAmount(ability);
|
||||
|
||||
if (confirmAction(Localizer.getInstance().getMessage("lblDoYouWantCardDealNDamageToYou", CardTranslation.getTranslatedName(source.getName()), String.valueOf(c)))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantCardDealNDamageToYou", CardTranslation.getTranslatedName(source.getName()), String.valueOf(c)), ability)*/) {
|
||||
if (confirmAction(Localizer.getInstance().getMessage("lblDoYouWantCardDealNDamageToYou", CardTranslation.getTranslatedName(source.getName()), String.valueOf(c)))) {
|
||||
return PaymentDecision.number(c);
|
||||
}
|
||||
return null;
|
||||
@@ -209,7 +206,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
message = Localizer.getInstance().getMessage("lblDrawNCardsConfirm", String.valueOf(c));
|
||||
}
|
||||
|
||||
if (!confirmAction(message)/*controller.confirmPayment(cost, message, ability)*/) {
|
||||
if (!confirmAction(message)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -244,7 +241,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
return source.getZone() == player.getZone(cost.from) && confirmAction(Localizer.getInstance().getMessage("lblExileConfirm", CardTranslation.getTranslatedName(source.getName())))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblExileConfirm", CardTranslation.getTranslatedName(source.getName())), ability)*/ ? PaymentDecision.card(source) : null;
|
||||
return source.getZone() == player.getZone(cost.from) && confirmAction(Localizer.getInstance().getMessage("lblExileConfirm", CardTranslation.getTranslatedName(source.getName()))) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
|
||||
if (type.equals("All")) {
|
||||
@@ -373,7 +370,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
private PaymentDecision exileFromTop(final CostExile cost, final SpellAbility sa, final Player player, final int nNeeded) {
|
||||
final CardCollectionView list = player.getCardsIn(ZoneType.Library, nNeeded);
|
||||
|
||||
if (list.size() > nNeeded || !confirmAction(Localizer.getInstance().getMessage("lblExileNCardFromYourTopLibraryConfirm"))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblExileNCardFromYourTopLibraryConfirm"), ability)*/) {
|
||||
if (list.size() > nNeeded || !confirmAction(Localizer.getInstance().getMessage("lblExileNCardFromYourTopLibraryConfirm"))) {
|
||||
return null;
|
||||
}
|
||||
return PaymentDecision.card(list);
|
||||
@@ -439,7 +436,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
if (source.getController() == ability.getActivatingPlayer() && source.isInPlay()) {
|
||||
return confirmAction(Localizer.getInstance().getMessage("lblExertCardConfirm", CardTranslation.getTranslatedName(source.getName())))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblExertCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability)*/ ? PaymentDecision.card(source) : null;
|
||||
return confirmAction(Localizer.getInstance().getMessage("lblExertCardConfirm", CardTranslation.getTranslatedName(source.getName()))) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -467,7 +464,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
public PaymentDecision visit(final CostFlipCoin cost) {
|
||||
Integer c = cost.getAbilityAmount(ability);
|
||||
|
||||
if (!confirmAction(Localizer.getInstance().getMessage("lblDoYouWantFlipNCoinAction", String.valueOf(c)))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantFlipNCoinAction", String.valueOf(c)), ability)*/) {
|
||||
if (!confirmAction(Localizer.getInstance().getMessage("lblDoYouWantFlipNCoinAction", String.valueOf(c)))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -478,7 +475,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
public PaymentDecision visit(final CostRollDice cost) {
|
||||
int c = cost.getAbilityAmount(ability);
|
||||
|
||||
if (!confirmAction(Localizer.getInstance().getMessage("lblDoYouWantRollNDiceAction", String.valueOf(c), "d" + cost.getType()))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblDoYouWantRollNDiceAction", String.valueOf(c), "d" + cost.getType()), ability)*/) {
|
||||
if (!confirmAction(Localizer.getInstance().getMessage("lblDoYouWantRollNDiceAction", String.valueOf(c), "d" + cost.getType()))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -536,7 +533,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
message = Localizer.getInstance().getMessage("lblMillNCardsFromYourLibraryConfirm", String.valueOf(c));
|
||||
}
|
||||
|
||||
if (!confirmAction(message)/*controller.confirmPayment(cost, message, ability)*/) {
|
||||
if (!confirmAction(message)) {
|
||||
return null;
|
||||
}
|
||||
return PaymentDecision.number(c);
|
||||
@@ -558,7 +555,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
// for costs declared mandatory, this is only reachable with a valid amount
|
||||
if (player.canPayLife(c, isEffect(), ability) && confirmAction(message)/*controller.confirmPayment(cost, message, ability)*/) {
|
||||
if (player.canPayLife(c, isEffect(), ability) && confirmAction(message)) {
|
||||
//force mandatory if paylife is paid.. todo add check if all can be paid
|
||||
mandatory = true;
|
||||
return PaymentDecision.number(c);
|
||||
@@ -571,7 +568,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
Integer c = cost.getAbilityAmount(ability);
|
||||
|
||||
if (player.canPayEnergy(c) &&
|
||||
confirmAction(Localizer.getInstance().getMessage("lblPayEnergyConfirm", cost.toString(), String.valueOf(player.getCounters(CounterEnumType.ENERGY)), "{E}"))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblPayEnergyConfirm", cost.toString(), String.valueOf(player.getCounters(CounterEnumType.ENERGY)), "{E}"), ability)*/) {
|
||||
confirmAction(Localizer.getInstance().getMessage("lblPayEnergyConfirm", cost.toString(), String.valueOf(player.getCounters(CounterEnumType.ENERGY)), "{E}"))) {
|
||||
return PaymentDecision.number(c);
|
||||
}
|
||||
return null;
|
||||
@@ -591,7 +588,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
player.getCardsIn(cost.getFrom()), cost.getType().split(";"), player, source, ability);
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
return source.getZone() == player.getZone(cost.from) && confirmAction(Localizer.getInstance().getMessage("lblPutCardToLibraryConfirm", CardTranslation.getTranslatedName(source.getName())))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblPutCardToLibraryConfirm", CardTranslation.getTranslatedName(source.getName())), ability)*/ ? PaymentDecision.card(source) : null;
|
||||
return source.getZone() == player.getZone(cost.from) && confirmAction(Localizer.getInstance().getMessage("lblPutCardToLibraryConfirm", CardTranslation.getTranslatedName(source.getName()))) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
|
||||
if (cost.from == ZoneType.Hand) {
|
||||
@@ -671,7 +668,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
// UnlessCost so player might not want to pay (Fabricate)
|
||||
if (ability.hasParam("UnlessCost") && !confirmAction(Localizer.getInstance().getMessage("lblPutNTypeCounterOnTarget", String.valueOf(c), cost.getCounter().getName(), ability.getHostCard().getName()))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblPutNTypeCounterOnTarget", String.valueOf(c), cost.getCounter().getName(), ability.getHostCard().getName()), ability)*/) {
|
||||
if (ability.hasParam("UnlessCost") && !confirmAction(Localizer.getInstance().getMessage("lblPutNTypeCounterOnTarget", String.valueOf(c), cost.getCounter().getName(), ability.getHostCard().getName()))) {
|
||||
return null;
|
||||
}
|
||||
cost.setLastPaidAmount(c);
|
||||
@@ -701,7 +698,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
final Card card = ability.getHostCard();
|
||||
if (card.getController() == player && card.isInPlay()) {
|
||||
final CardView view = CardView.get(card);
|
||||
return confirmAction(Localizer.getInstance().getMessage("lblReturnCardToHandConfirm", CardTranslation.getTranslatedName(view.getName())))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblReturnCardToHandConfirm", CardTranslation.getTranslatedName(view.getName())), ability)*/ ? PaymentDecision.card(card) : null;
|
||||
return confirmAction(Localizer.getInstance().getMessage("lblReturnCardToHandConfirm", CardTranslation.getTranslatedName(view.getName()))) ? PaymentDecision.card(card) : null;
|
||||
}
|
||||
} else {
|
||||
final CardCollectionView validCards = CardLists.getValidCards(ability.getActivatingPlayer().getCardsIn(ZoneType.Battlefield),
|
||||
@@ -732,16 +729,13 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
final Integer num = cost.getAbilityAmount(ability);
|
||||
CardCollectionView hand = player.getCardsIn(cost.getRevealFrom());
|
||||
final CardCollectionView hand2 = hand;
|
||||
hand = CardLists.filter(hand, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
hand = CardLists.filter(hand, c -> {
|
||||
for (final Card card : hand2) {
|
||||
if (!card.equals(c) && card.sharesColorWith(c)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (num == 0) {
|
||||
return PaymentDecision.number(0);
|
||||
@@ -944,7 +938,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
if (maxCounters < cntRemoved) {
|
||||
return null;
|
||||
}
|
||||
if (!confirmAction(Localizer.getInstance().getMessage("lblRemoveNTargetCounterFromCardPayCostConfirm", amount, cost.counter.getName().toLowerCase(), CardTranslation.getTranslatedName(source.getName())))/*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblRemoveNTargetCounterFromCardPayCostConfirm", amount, cost.counter.getName().toLowerCase(), CardTranslation.getTranslatedName(source.getName())), ability)*/) {
|
||||
if (!confirmAction(Localizer.getInstance().getMessage("lblRemoveNTargetCounterFromCardPayCostConfirm", amount, cost.counter.getName().toLowerCase(), CardTranslation.getTranslatedName(source.getName())))) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1000,7 +994,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
if (source.getController() == ability.getActivatingPlayer() && source.isInPlay()) {
|
||||
return mandatory || confirmAction(Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(source.getName()))) /*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability)*/ ? PaymentDecision.card(source) : null;
|
||||
return mandatory || confirmAction(Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(source.getName()))) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1008,7 +1002,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
if (type.equals("OriginalHost")) {
|
||||
Card host = ability.getOriginalHost();
|
||||
if (host.getController() == ability.getActivatingPlayer() && host.isInPlay()) {
|
||||
return confirmAction(Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(host.getName()))) /*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(host.getName())), ability)*/ ? PaymentDecision.card(host) : null;
|
||||
return confirmAction(Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(host.getName()))) ? PaymentDecision.card(host) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1081,16 +1075,13 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
if (sameType) {
|
||||
final CardCollection list2 = typeList;
|
||||
typeList = CardLists.filter(typeList, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
typeList = CardLists.filter(typeList, c12 -> {
|
||||
for (final Card card : list2) {
|
||||
if (!card.equals(c) && card.sharesCreatureTypeWith(c)) {
|
||||
if (!card.equals(c12) && card.sharesCreatureTypeWith(c12)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
final CardCollection tapped = new CardCollection();
|
||||
@@ -1104,12 +1095,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
final Card first = inp.getFirstSelected();
|
||||
tapped.add(first);
|
||||
typeList = CardLists.filter(typeList, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
return c.sharesCreatureTypeWith(first);
|
||||
}
|
||||
});
|
||||
typeList = CardLists.filter(typeList, c1 -> c1.sharesCreatureTypeWith(first));
|
||||
typeList.remove(first);
|
||||
c--;
|
||||
}
|
||||
@@ -1171,7 +1157,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
@Override
|
||||
public PaymentDecision visit(final CostUnattach cost) {
|
||||
final Card cardToUnattach = cost.findCardToUnattach(source, player, ability);
|
||||
if (cardToUnattach != null && confirmAction(Localizer.getInstance().getMessage("lblUnattachCardConfirm", CardTranslation.getTranslatedName(cardToUnattach.getName()))) /*controller.confirmPayment(cost, Localizer.getInstance().getMessage("lblUnattachCardConfirm", CardTranslation.getTranslatedName(cardToUnattach.getName())), ability)*/) {
|
||||
if (cardToUnattach != null && confirmAction(Localizer.getInstance().getMessage("lblUnattachCardConfirm", CardTranslation.getTranslatedName(cardToUnattach.getName())))) {
|
||||
return PaymentDecision.card(cardToUnattach);
|
||||
}
|
||||
return null;
|
||||
@@ -1188,6 +1174,6 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
cardView = CardView.getCardForUi(ImageUtil.getPaperCardFromImageKey(cardView.getImprintedCards().get(0).getCurrentState().getImageKey()));
|
||||
else if (ability.getTargets() != null && ability.getTargets().isTargetingAnyCard() && ability.getTargets().size() == 1)
|
||||
cardView = CardView.get(ability.getTargetCard());
|
||||
return controller.getGui().confirm(cardView, message);
|
||||
return controller.getGui().confirm(cardView, message.replaceAll("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,10 +810,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
buildQuestion.append("\n").append(localizer.getMessage("lblTriggeredby")).append(": ").append(tos.get(AbilityKey.Card));
|
||||
}
|
||||
}
|
||||
|
||||
final InputConfirm inp = new InputConfirm(this, buildQuestion.toString(), wrapper);
|
||||
inp.showAndWait();
|
||||
return inp.getResult();
|
||||
return this.getGui().confirm(wrapper.getView().getHostCard(), buildQuestion.toString().replaceAll("\n", " "));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1344,11 +1341,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
|
||||
// create sorted list from map from least to most frequent
|
||||
List<Entry<String, Integer>> sortedList = Lists.newArrayList(typesInDeck.entrySet());
|
||||
Collections.sort(sortedList, new Comparator<Entry<String, Integer>>() {
|
||||
public int compare(Entry<String, Integer> o1, Entry<String, Integer> o2) {
|
||||
return o1.getValue().compareTo(o2.getValue());
|
||||
}
|
||||
});
|
||||
Collections.sort(sortedList, (o1, o2) -> o1.getValue().compareTo(o2.getValue()));
|
||||
|
||||
// loop through sorted list and move each type to the front of the
|
||||
// validTypes collection
|
||||
@@ -1377,9 +1370,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
@Override
|
||||
public boolean confirmReplacementEffect(final ReplacementEffect replacementEffect, final SpellAbility effectSA,
|
||||
GameEntity affected, final String question) {
|
||||
final InputConfirm inp = new InputConfirm(this, question, effectSA);
|
||||
inp.showAndWait();
|
||||
return inp.getResult();
|
||||
return this.getGui().confirm(effectSA.getView().getHostCard(), question.replaceAll("\n", " "));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1781,9 +1772,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
|
||||
@Override
|
||||
public boolean confirmPayment(final CostPart costPart, final String question, SpellAbility sa) {
|
||||
final InputConfirm inp = new InputConfirm(this, question, sa);
|
||||
inp.showAndWait();
|
||||
return inp.getResult();
|
||||
return this.getGui().confirm(sa.getView().getHostCard(), question.replaceAll("\n", " "));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2229,11 +2218,8 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
}
|
||||
inp.selectButtonOK();
|
||||
} else {
|
||||
FThreads.invokeInEdtNowOrLater(new Runnable() {
|
||||
@Override
|
||||
public final void run() {
|
||||
FThreads.invokeInEdtNowOrLater(() -> {
|
||||
// getGui().message("Cannot pass priority at this time.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2352,12 +2338,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
final Map<String, String> produced = Maps.newHashMap();
|
||||
produced.put("Produced", "W W W W W W W U U U U U U U B B B B B B B G G G G G G G R R R R R R R 7");
|
||||
final AbilityManaPart abMana = new AbilityManaPart(dummy, produced);
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
abMana.produceMana(null);
|
||||
}
|
||||
});
|
||||
getGame().getAction().invoke(() -> abMana.produceMana(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2470,12 +2451,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
return;
|
||||
}
|
||||
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getGame().getAction().moveToHand(card, null);
|
||||
}
|
||||
});
|
||||
getGame().getAction().invoke(() -> getGame().getAction().moveToHand(card, null));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2510,12 +2486,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
final Card card = gameCacheCounters.get(cv);
|
||||
|
||||
final ImmutableList<CounterType> counters = subtract ? ImmutableList.copyOf(card.getCounters().keySet())
|
||||
: ImmutableList.copyOf(Collections2.transform(CounterEnumType.values, new Function<CounterEnumType, CounterType>() {
|
||||
@Override
|
||||
public CounterType apply(CounterEnumType input) {
|
||||
return CounterType.get(input);
|
||||
}
|
||||
}));
|
||||
: ImmutableList.copyOf(Collections2.transform(CounterEnumType.values, input -> CounterType.get(input)));
|
||||
|
||||
final CounterType counter = getGui().oneOrNone(localizer.getMessage("lblWhichTypeofCounter"), counters);
|
||||
if (counter == null) {
|
||||
@@ -2541,9 +2512,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
*/
|
||||
@Override
|
||||
public void tapPermanents() {
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getGame().getAction().invoke(() -> {
|
||||
final CardCollectionView untapped = CardLists.filter(getGame().getCardsIn(ZoneType.Battlefield),
|
||||
Predicates.not(CardPredicates.Presets.TAPPED));
|
||||
final InputSelectCardsFromList inp = new InputSelectCardsFromList(PlayerControllerHuman.this, 0,
|
||||
@@ -2556,7 +2525,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
c.tap(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2567,9 +2535,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
*/
|
||||
@Override
|
||||
public void untapPermanents() {
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getGame().getAction().invoke(() -> {
|
||||
final CardCollectionView tapped = CardLists.filter(getGame().getCardsIn(ZoneType.Battlefield),
|
||||
CardPredicates.Presets.TAPPED);
|
||||
final InputSelectCardsFromList inp = new InputSelectCardsFromList(PlayerControllerHuman.this, 0,
|
||||
@@ -2582,7 +2548,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
c.untap(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2759,9 +2724,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
forgeCard.setTimestamp(getGame().getNextTimestamp());
|
||||
|
||||
PaperCard finalC = c;
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getGame().getAction().invoke(() -> {
|
||||
if (targetZone == ZoneType.Battlefield) {
|
||||
if (!forgeCard.getName().equals(f.getName())) {
|
||||
forgeCard.changeToState(CardStateName.Flipped);
|
||||
@@ -2797,16 +2760,16 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
// ensure triggered abilities fire
|
||||
getGame().getTriggerHandler().runWaitingTriggers();
|
||||
} else {
|
||||
final FCollectionView<SpellAbility> choices = forgeCard.getBasicSpells();
|
||||
if (choices.isEmpty()) {
|
||||
final FCollectionView<SpellAbility> choices1 = forgeCard.getBasicSpells();
|
||||
if (choices1.isEmpty()) {
|
||||
return; // when would it happen?
|
||||
}
|
||||
|
||||
final SpellAbility sa;
|
||||
if (choices.size() == 1) {
|
||||
sa = choices.iterator().next();
|
||||
if (choices1.size() == 1) {
|
||||
sa = choices1.iterator().next();
|
||||
} else {
|
||||
sa = repeatLast ? lastAddedSA : getGui().oneOrNone(localizer.getMessage("lblChoose"), (FCollection<SpellAbility>) choices);
|
||||
sa = repeatLast ? lastAddedSA : getGui().oneOrNone(localizer.getMessage("lblChoose"), (FCollection<SpellAbility>) choices1);
|
||||
}
|
||||
if (sa == null) {
|
||||
return; // happens if cancelled
|
||||
@@ -2843,7 +2806,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
lastAddedZone = targetZone;
|
||||
lastAddedPlayer = p;
|
||||
lastTrigs = noTriggers;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2986,12 +2948,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
|
||||
System.out.println("Rigging planar dice roll: " + res.toString());
|
||||
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PlanarDice.roll(player, res);
|
||||
}
|
||||
});
|
||||
getGame().getAction().invoke(() -> PlanarDice.roll(player, res));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3022,24 +2979,18 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
final Card forgeCard = Card.fromPaperCard(c, p);
|
||||
|
||||
forgeCard.setOwner(p);
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getGame().getAction().invoke(() -> {
|
||||
getGame().getAction().changeZone(null, p.getZone(ZoneType.PlanarDeck), forgeCard, 0, null);
|
||||
PlanarDice.roll(p, PlanarDice.Planeswalk);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void askAI() {
|
||||
PlayerControllerAi ai = new PlayerControllerAi(player.getGame(), player, player.getOriginalLobbyPlayer());
|
||||
player.runWithController(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.runWithController(() -> {
|
||||
List<SpellAbility> sas = ai.chooseSpellAbilityToPlay();
|
||||
SpellAbility chosen = sas == null ? null : sas.get(0);
|
||||
getGui().message(chosen == null ? "AI doesn't want to play anything right now" : chosen.getHostCard().toString(), "AI Play Suggestion");
|
||||
}
|
||||
}, ai);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user