mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Clean up
This commit is contained in:
@@ -827,8 +827,7 @@ public class ComputerUtilMana {
|
|||||||
|
|
||||||
// remove from available lists
|
// remove from available lists
|
||||||
Iterables.removeIf(sourcesForShards.values(), CardTraitPredicates.isHostCard(saPayment.getHostCard()));
|
Iterables.removeIf(sourcesForShards.values(), CardTraitPredicates.isHostCard(saPayment.getHostCard()));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
final CostPayment pay = new CostPayment(saPayment.getPayCosts(), saPayment);
|
final CostPayment pay = new CostPayment(saPayment.getPayCosts(), saPayment);
|
||||||
if (!pay.payComputerCosts(new AiCostDecision(ai, saPayment))) {
|
if (!pay.payComputerCosts(new AiCostDecision(ai, saPayment))) {
|
||||||
saList.remove(saPayment);
|
saList.remove(saPayment);
|
||||||
@@ -863,8 +862,7 @@ public class ComputerUtilMana {
|
|||||||
if (test) {
|
if (test) {
|
||||||
resetPayment(paymentList);
|
resetPayment(paymentList);
|
||||||
return false;
|
return false;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
System.out.println("ComputerUtil : payManaCost() cost was not paid for " + sa.getHostCard().getName() + ". Didn't find what to pay for " + toPay);
|
System.out.println("ComputerUtil : payManaCost() cost was not paid for " + sa.getHostCard().getName() + ". Didn't find what to pay for " + toPay);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1233,8 +1231,7 @@ public class ComputerUtilMana {
|
|||||||
if (!(ai.getGame().getPhaseHandler().isPlayerTurn(ai))) {
|
if (!(ai.getGame().getPhaseHandler().isPlayerTurn(ai))) {
|
||||||
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_ENEMY_DECLBLK);
|
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_ENEMY_DECLBLK);
|
||||||
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.CHOSEN_FOG_EFFECT);
|
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.CHOSEN_FOG_EFFECT);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_DECLBLK);
|
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_DECLBLK);
|
||||||
} else {
|
} else {
|
||||||
if ((AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_DECLBLK)) ||
|
if ((AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_DECLBLK)) ||
|
||||||
@@ -1255,8 +1252,7 @@ public class ComputerUtilMana {
|
|||||||
|
|
||||||
if (curPhase == PhaseType.MAIN2 || curPhase == PhaseType.CLEANUP) {
|
if (curPhase == PhaseType.MAIN2 || curPhase == PhaseType.CLEANUP) {
|
||||||
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_MAIN2);
|
AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_MAIN2);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_MAIN2)) {
|
if (AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_MAIN2)) {
|
||||||
// This mana source is held elsewhere for a Main Phase 2 spell.
|
// This mana source is held elsewhere for a Main Phase 2 spell.
|
||||||
return true;
|
return true;
|
||||||
@@ -1266,7 +1262,6 @@ public class ComputerUtilMana {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static ManaCostShard getNextShardToPay(ManaCostBeingPaid cost) {
|
private static ManaCostShard getNextShardToPay(ManaCostBeingPaid cost) {
|
||||||
// mind the priorities
|
// mind the priorities
|
||||||
// * Pay mono-colored first,curPhase == PhaseType.CLEANUP
|
// * Pay mono-colored first,curPhase == PhaseType.CLEANUP
|
||||||
@@ -1352,8 +1347,7 @@ public class ComputerUtilMana {
|
|||||||
String commonColor = ComputerUtilCard.getMostProminentColor(ai.getCardsIn(ZoneType.Hand));
|
String commonColor = ComputerUtilCard.getMostProminentColor(ai.getCardsIn(ZoneType.Hand));
|
||||||
if (!commonColor.isEmpty() && satisfiesColorChoice(abMana, choiceString, MagicColor.toShortString(commonColor)) && abMana.getComboColors().contains(MagicColor.toShortString(commonColor))) {
|
if (!commonColor.isEmpty() && satisfiesColorChoice(abMana, choiceString, MagicColor.toShortString(commonColor)) && abMana.getComboColors().contains(MagicColor.toShortString(commonColor))) {
|
||||||
choice = MagicColor.toShortString(commonColor);
|
choice = MagicColor.toShortString(commonColor);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// default to first available color
|
// default to first available color
|
||||||
for (String c : comboColors) {
|
for (String c : comboColors) {
|
||||||
if (satisfiesColorChoice(abMana, choiceString, c)) {
|
if (satisfiesColorChoice(abMana, choiceString, c)) {
|
||||||
@@ -1398,8 +1392,7 @@ public class ComputerUtilMana {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
String color = MagicColor.toShortString(manaPart);
|
String color = MagicColor.toShortString(manaPart);
|
||||||
boolean wasNeeded = testCost.ai_payMana(color, p.getManaPool());
|
boolean wasNeeded = testCost.ai_payMana(color, p.getManaPool());
|
||||||
if (!wasNeeded) {
|
if (!wasNeeded) {
|
||||||
|
|||||||
Reference in New Issue
Block a user