mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- The AI can now use Delve.
This commit is contained in:
@@ -128,7 +128,7 @@ public class CostPartMana extends CostPart {
|
||||
}
|
||||
|
||||
InputPayMana inpPayment;
|
||||
toPay.applySpellCostChange(ability);
|
||||
toPay.applySpellCostChange(ability, false);
|
||||
if (ability.isOffering() && ability.getSacrificedAsOffering() == null) {
|
||||
System.out.println("Sacrifice input for Offering cancelled");
|
||||
return false;
|
||||
|
||||
@@ -506,7 +506,7 @@ public class ManaCostBeingPaid {
|
||||
unpaidShards.remove(ManaCostShard.COLORLESS);
|
||||
}
|
||||
|
||||
public final void applySpellCostChange(final SpellAbility sa) {
|
||||
public final void applySpellCostChange(final SpellAbility sa, boolean test) {
|
||||
final Game game = sa.getActivatingPlayer().getGame();
|
||||
// Beached
|
||||
final Card originalCard = sa.getSourceCard();
|
||||
@@ -524,11 +524,13 @@ public class ManaCostBeingPaid {
|
||||
if (spell.isSpell()) {
|
||||
if (spell.isDelve()) {
|
||||
final Player pc = originalCard.getController();
|
||||
final List<Card> mutableGrave = Lists.newArrayList(pc.getZone(ZoneType.Graveyard).getCards());
|
||||
final List<Card> mutableGrave = new ArrayList<Card>(pc.getCardsIn(ZoneType.Graveyard));
|
||||
final List<Card> toExile = pc.getController().chooseCardsToDelve(this.getColorlessManaAmount(), mutableGrave);
|
||||
for (final Card c : toExile) {
|
||||
pc.getGame().getAction().exile(c);
|
||||
decreaseColorlessMana(1);
|
||||
if (!test) {
|
||||
pc.getGame().getAction().exile(c);
|
||||
}
|
||||
}
|
||||
} else if (spell.getSourceCard().hasKeyword("Convoke")) {
|
||||
adjustCostByConvoke(sa, spell);
|
||||
|
||||
@@ -474,7 +474,7 @@ public class ComputerUtilMana {
|
||||
restriction = payCosts.getCostMana().getRestiction();
|
||||
}
|
||||
ManaCostBeingPaid cost = new ManaCostBeingPaid(mana, restriction);
|
||||
cost.applySpellCostChange(sa);
|
||||
cost.applySpellCostChange(sa, test);
|
||||
|
||||
final Card card = sa.getSourceCard();
|
||||
// Tack xMana Payments into mana here if X is a set value
|
||||
|
||||
@@ -157,7 +157,7 @@ public class HumanPlay {
|
||||
manaCost = new ManaCostBeingPaid(ManaCost.ZERO);
|
||||
} else {
|
||||
manaCost = new ManaCostBeingPaid(sa.getPayCosts().getTotalMana());
|
||||
manaCost.applySpellCostChange(sa);
|
||||
manaCost.applySpellCostChange(sa, false);
|
||||
}
|
||||
|
||||
boolean isPaid = manaCost.isPaid();
|
||||
|
||||
Reference in New Issue
Block a user