mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fixed AI using Discordant Dirge.
This commit is contained in:
@@ -74,12 +74,16 @@ public class DiscardAi extends SpellAiLogic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sa.getParam("Mode").equals("Hand") && !sa.getParam("Mode").equals("RevealDiscardAll")) {
|
if (sa.hasParam("NumCards")) {
|
||||||
if (sa.hasParam("NumCards") && sa.getParam("NumCards").equals("X") && source.getSVar("X").equals("Count$xPaid")) {
|
if (sa.getParam("NumCards").equals("X") && source.getSVar("X").equals("Count$xPaid")) {
|
||||||
// Set PayX here to maximum value.
|
// Set PayX here to maximum value.
|
||||||
final int cardsToDiscard = Math.min(ComputerUtil.determineLeftoverMana(sa, ai), ai.getOpponent()
|
final int cardsToDiscard = Math.min(ComputerUtil.determineLeftoverMana(sa, ai), ai.getOpponent()
|
||||||
.getCardsIn(ZoneType.Hand).size());
|
.getCardsIn(ZoneType.Hand).size());
|
||||||
source.setSVar("PayX", Integer.toString(cardsToDiscard));
|
source.setSVar("PayX", Integer.toString(cardsToDiscard));
|
||||||
|
} else {
|
||||||
|
if (AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa) < 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user