mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Experimental: determineLeftoverMana should use the root ability (with the actual mana cost), otherwise it's not always possible to determine the correct mana cost (e.g. for Banefire) and PayX gets set to the wrong (usually too high) value, making the AI unable to play the card.
This commit is contained in:
@@ -1309,7 +1309,7 @@ public class ComputerUtilMana {
|
||||
*/
|
||||
public static int determineLeftoverMana(final SpellAbility sa, final Player player) {
|
||||
for (int i = 1; i < 100; i++) {
|
||||
if (!canPayManaCost(sa, player, i)) {
|
||||
if (!canPayManaCost(sa.getRootAbility(), player, i)) {
|
||||
return i - 1;
|
||||
}
|
||||
}
|
||||
@@ -1331,7 +1331,7 @@ public class ComputerUtilMana {
|
||||
* @since 1.5.59
|
||||
*/
|
||||
public static int determineLeftoverMana(final SpellAbility sa, final Player player, final String shardColor) {
|
||||
ManaCost origCost = sa.getPayCosts().getTotalMana();
|
||||
ManaCost origCost = sa.getRootAbility().getPayCosts().getTotalMana();
|
||||
|
||||
String shardSurplus = shardColor;
|
||||
for (int i = 1; i < 100; i++) {
|
||||
|
||||
Reference in New Issue
Block a user