MH3: nethergoyf.txt + support (#5311)

This commit is contained in:
Northmoc
2024-05-29 06:58:50 -04:00
committed by GitHub
parent 9fa35cb90e
commit 895b7b54c5
14 changed files with 73 additions and 12 deletions

View File

@@ -202,12 +202,23 @@ public class CostExile extends CostPartWithList {
type = TextUtil.fastReplace(type, "+withSharedCardType", "");
}
int nTypes = -1;
if (type.contains("+withTypesGE")) {
String num = type.split("withTypesGE")[1];
type = TextUtil.fastReplace(type, TextUtil.concatNoSpace("+withTypesGE", num), "");
nTypes = Integer.parseInt(num);
}
if (!type.contains("X") || ability.getXManaCostPaid() != null) {
list = CardLists.getValidCards(list, type.split(";"), payer, source, ability);
}
int amount = this.getAbilityAmount(ability);
if (nTypes > -1) {
if (CardFactoryUtil.getCardTypesFromList(list) < nTypes) return false;
}
if (sharedType) { // will need more logic if cost ever wants more than 2 that share a type
if (list.size() < amount) return false;
for (int i = 0; i < list.size(); i++) {