Merge pull request #2908 from Northmoc/i+e

MOM: inga_and_esika.txt + support
This commit is contained in:
Northmoc
2023-04-13 10:10:50 -04:00
committed by GitHub
2 changed files with 22 additions and 5 deletions

View File

@@ -254,18 +254,26 @@ public class ForgeScript {
int y = AbilityUtils.calculateAmount(source, k[1].substring(2), spellAbility);
return Expressions.compare(sa.getTotalManaSpent(), comparator, y);
} else if (property.startsWith("ManaFrom")) {
final String fromWhat = property.substring(8);
boolean found = false;
String fromWhat = property.substring(8);
String[] parts = null;
if (fromWhat.contains("_")) {
parts = fromWhat.split("_");
fromWhat = parts[0];
}
int toFind = parts != null ? AbilityUtils.calculateAmount(source, parts[1], spellAbility) : 1;
int found = 0;
for (Mana m : sa.getPayingMana()) {
final Card manaSource = m.getSourceCard();
if (manaSource != null) {
if (manaSource.isValid(fromWhat, sourceController, source, spellAbility)) {
found = true;
break;
found++;
if (found == toFind) {
break;
}
}
}
}
return found;
return (found == toFind);
} else if (property.equals("MayPlaySource")) {
StaticAbility m = sa.getMayPlay();
if (m == null) {