mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Merge branch 'costs' into 'master'
Some cost fixes See merge request core-developers/forge!5135
This commit is contained in:
@@ -269,8 +269,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
final CardCollection enoughType = CardLists.filter(list, CardPredicates.isOwner(p));
|
||||
if (enoughType.size() < c) {
|
||||
list.removeAll((CardCollectionView)enoughType);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
payableZone.add(p);
|
||||
}
|
||||
}
|
||||
@@ -437,9 +436,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
if (source.getController() == ability.getActivatingPlayer() && source.isInPlay()) {
|
||||
return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblExertCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Integer c = cost.convertAmount();
|
||||
@@ -782,8 +779,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
};
|
||||
inp.setMessage(Localizer.getInstance().getMessage("lblSelectNCardOfSameColorToReveal", String.valueOf(num)));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Integer num = cost.convertAmount();
|
||||
|
||||
CardCollectionView hand = player.getCardsIn(cost.getRevealFrom());
|
||||
@@ -1027,11 +1023,9 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
if (cost.payCostFromSource()) {
|
||||
if (source.getController() == ability.getActivatingPlayer() && source.isInPlay()) {
|
||||
return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
return ability.hasParam("CostMandatory") || player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(source.getName())), ability) ? PaymentDecision.card(source) : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (type.equals("OriginalHost")) {
|
||||
@@ -1039,9 +1033,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
if (host.getController() == ability.getActivatingPlayer() && host.isInPlay()) {
|
||||
return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblSacrificeCardConfirm", CardTranslation.getTranslatedName(host.getName())), ability) ? PaymentDecision.card(host) : null;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (amount.equals("All")) {
|
||||
@@ -1209,8 +1201,6 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
|
||||
@Override
|
||||
public PaymentDecision visit(final CostUnattach cost) {
|
||||
final Card source = ability.getHostCard();
|
||||
|
||||
final Card cardToUnattach = cost.findCardToUnattach(source, player, ability);
|
||||
if (cardToUnattach != null && player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblUnattachCardConfirm", CardTranslation.getTranslatedName(cardToUnattach.getName())), ability)) {
|
||||
return PaymentDecision.card(cardToUnattach);
|
||||
|
||||
@@ -44,6 +44,7 @@ import forge.gamemodes.match.input.InputPayManaOfCostPayment;
|
||||
import forge.gamemodes.match.input.InputSelectCardsFromList;
|
||||
import forge.gui.FThreads;
|
||||
import forge.gui.util.SGuiChoose;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.collect.FCollectionView;
|
||||
@@ -565,15 +566,21 @@ public class HumanPlay {
|
||||
if (!hasPaid) { return false; }
|
||||
}
|
||||
else if (part instanceof CostDiscard) {
|
||||
int amount = getAmountFromPartX(part, source, sourceAbility);
|
||||
if ("Hand".equals(part.getType())) {
|
||||
if (!p.getController().confirmPayment(part, Localizer.getInstance().getMessage("lblDoYouWantDiscardYourHand"), sourceAbility)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
((CostDiscard)part).payAsDecided(p, PaymentDecision.card(p.getCardsIn(ZoneType.Hand)), sourceAbility);
|
||||
} else if ("Random".equals(part.getType())) {
|
||||
if (!part.canPay(sourceAbility, p) || !p.getController().confirmPayment(part, Localizer.getInstance().getMessage("lblWouldYouLikeRandomDiscardTargetCard", amount), sourceAbility)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
((CostDiscard)part).payAsDecided(p, (PaymentDecision.card(Aggregates.random(p.getCardsIn(ZoneType.Hand), amount, new CardCollection()))), sourceAbility);
|
||||
} else {
|
||||
CardCollectionView list = CardLists.getValidCards(p.getCardsIn(ZoneType.Hand), part.getType(), p, source, sourceAbility);
|
||||
int amount = getAmountFromPartX(part, source, sourceAbility);
|
||||
boolean hasPaid = payCostPart(controller, p, sourceAbility, (CostPartWithList)part, amount, list, Localizer.getInstance().getMessage("lbldiscard") + orString);
|
||||
if (!hasPaid) { return false; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user