Fix being able to pay mana for Hogaak

This commit is contained in:
tool4EvEr
2022-11-15 21:36:32 +01:00
parent e88b8735b9
commit 5e1af59453
25 changed files with 49 additions and 39 deletions

View File

@@ -2,6 +2,7 @@ package forge.game.ability;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
@@ -2381,7 +2382,14 @@ public class AbilityUtils {
if (sq[0].contains("CombatDamage")) {
isCombat = true;
}
return doXMath(game.getDamageDoneThisTurn(isCombat, false, props[1], props[2], c, player, ctb).size(), expr, c, ctb);
int num;
List<Integer> dmgInstances = game.getDamageDoneThisTurn(isCombat, false, props[1], props[2], c, player, ctb);
if (sq[0].contains("Max")) {
num = Collections.max(dmgInstances);
} else {
num = dmgInstances.size();
}
return doXMath(num, expr, c, ctb);
}
if (sq[0].equals("YourTurns")) {

View File

@@ -923,7 +923,7 @@ public class CardFactoryUtil {
StringBuilder trigReturn = new StringBuilder();
trigReturn.append("Mode$ ChangesZone | Origin$ Battlefield | ValidCard$ Card.Self");
trigReturn.append(" | Secondary$ True | TriggerDescription$ When this permanent leaves the battlefield, return the exiled card to the battlefield under its owners control.");
trigReturn.append(" | Secondary$ True | TriggerDescription$ When this permanent leaves the battlefield, return the exiled card to the battlefield under its owner's control.");
StringBuilder ab = new StringBuilder();
ab.append("DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True ");

View File

@@ -313,7 +313,7 @@ public class CostPayment extends ManaConversionMatrix {
continue;
}
if (StringUtils.isNotBlank(restriction) && !thisMana.getSourceCard().getType().hasStringType(restriction)) {
if (StringUtils.isNotBlank(restriction) && !thisMana.getSourceCard().isValid(restriction, null, null, null)) {
continue;
}

View File

@@ -218,7 +218,7 @@ public class ManaPool extends ManaConversionMatrix implements Iterable<Mana> {
continue;
}
if (StringUtils.isNotBlank(restriction) && !mana.getSourceCard().getType().hasStringType(restriction)) {
if (StringUtils.isNotBlank(restriction) && !mana.getSourceCard().isValid(restriction, null, null, null)) {
continue;
}