mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Fix the AI logic for Expansion // Explosion (casting for 0, underdrawing).
This commit is contained in:
@@ -365,6 +365,10 @@ public class DrawAi extends SpellAbilityAi {
|
|||||||
if (numCards >= computerLibrarySize) {
|
if (numCards >= computerLibrarySize) {
|
||||||
if (xPaid) {
|
if (xPaid) {
|
||||||
numCards = computerLibrarySize - 1;
|
numCards = computerLibrarySize - 1;
|
||||||
|
if (numCards <= 0 && !mandatory) {
|
||||||
|
// not drawing anything, so don't do it
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (!ai.isCardInPlay("Laboratory Maniac")) {
|
} else if (!ai.isCardInPlay("Laboratory Maniac")) {
|
||||||
aiTarget = false;
|
aiTarget = false;
|
||||||
}
|
}
|
||||||
@@ -398,6 +402,9 @@ public class DrawAi extends SpellAbilityAi {
|
|||||||
if (computerHandSize + numCards > computerMaxHandSize && game.getPhaseHandler().isPlayerTurn(ai)) {
|
if (computerHandSize + numCards > computerMaxHandSize && game.getPhaseHandler().isPlayerTurn(ai)) {
|
||||||
if (xPaid) {
|
if (xPaid) {
|
||||||
numCards = computerMaxHandSize - computerHandSize;
|
numCards = computerMaxHandSize - computerHandSize;
|
||||||
|
if (sa.getHostCard().getZone().is(ZoneType.Hand)) {
|
||||||
|
numCards++; // the card will be spent
|
||||||
|
}
|
||||||
source.setSVar("PayX", Integer.toString(numCards));
|
source.setSVar("PayX", Integer.toString(numCards));
|
||||||
} else {
|
} else {
|
||||||
// Don't draw too many cards and then risk discarding
|
// Don't draw too many cards and then risk discarding
|
||||||
|
|||||||
Reference in New Issue
Block a user