mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Minor logic tweak (Buyback)
- hasXInAnyCostPart doesn't need a SA parameter now that it's in Cost. - Fixed a minor mistype on mobile Forge.
This commit is contained in:
@@ -671,7 +671,7 @@ public class AiController {
|
|||||||
|
|
||||||
// This is for playing spells regularly (no Cascade/Ripple etc.)
|
// This is for playing spells regularly (no Cascade/Ripple etc.)
|
||||||
private AiPlayDecision canPlayAndPayFor(final SpellAbility sa) {
|
private AiPlayDecision canPlayAndPayFor(final SpellAbility sa) {
|
||||||
boolean xCost = sa.getPayCosts().hasXInAnyCostPart(sa);
|
boolean xCost = sa.getPayCosts().hasXInAnyCostPart();
|
||||||
|
|
||||||
if (!xCost && !ComputerUtilCost.canPayCost(sa, player)) {
|
if (!xCost && !ComputerUtilCost.canPayCost(sa, player)) {
|
||||||
// for most costs, it's OK to check if they can be paid early in order to avoid running a heavy API check
|
// for most costs, it's OK to check if they can be paid early in order to avoid running a heavy API check
|
||||||
@@ -708,7 +708,7 @@ public class AiController {
|
|||||||
return canPlaySa(((WrappedAbility) sa).getWrappedAbility());
|
return canPlaySa(((WrappedAbility) sa).getWrappedAbility());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trying to play a card that has Buyback without a Buyback cost
|
// Trying to play a card that has Buyback without a Buyback cost, look for possible additional considerations
|
||||||
if (card.hasKeyword(Keyword.BUYBACK) && !sa.isBuyBackAbility() && !canPlaySpellWithoutBuyback(card, sa)) {
|
if (card.hasKeyword(Keyword.BUYBACK) && !sa.isBuyBackAbility() && !canPlaySpellWithoutBuyback(card, sa)) {
|
||||||
return AiPlayDecision.NeedsToPlayCriteriaNotMet;
|
return AiPlayDecision.NeedsToPlayCriteriaNotMet;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -935,19 +935,17 @@ public class Cost implements Serializable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasXInAnyCostPart(SpellAbility sa) {
|
public boolean hasXInAnyCostPart() {
|
||||||
boolean xCost = false;
|
boolean xCost = false;
|
||||||
if (sa.getPayCosts() != null) {
|
for (CostPart p : this.getCostParts()) {
|
||||||
for (CostPart p : sa.getPayCosts().getCostParts()) {
|
if (p instanceof CostPartMana) {
|
||||||
if (p instanceof CostPartMana) {
|
if (((CostPartMana) p).getAmountOfX() > 0) {
|
||||||
if (((CostPartMana) p).getAmountOfX() > 0) {
|
|
||||||
xCost = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (p.getAmount().equals("X")) {
|
|
||||||
xCost = true;
|
xCost = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (p.getAmount().equals("X")) {
|
||||||
|
xCost = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return xCost;
|
return xCost;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class InputAttack extends InputSyncronizedBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updatePrompt() {
|
private void updatePrompt() {
|
||||||
String alphaLabel = canCallBackAttackers() ? "Call Back" : "AlphaStrike";
|
String alphaLabel = canCallBackAttackers() ? "Call Back" : "Alpha Strike";
|
||||||
getController().getGui().updateButtons(getOwner(), "OK", alphaLabel, true, true, true);
|
getController().getGui().updateButtons(getOwner(), "OK", alphaLabel, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user