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