UNF Embiggen - take four (#5156)

* - UNF Embiggen by tehdiplomat

* - Undo some obsolete changes.

---------

Co-authored-by: Chris H <zenchristo@gmail.com>
This commit is contained in:
Agetian
2024-04-25 10:19:07 +03:00
committed by GitHub
parent 56d9c88919
commit c20c214b9c
2 changed files with 37 additions and 3 deletions

View File

@@ -2634,6 +2634,16 @@ public class AbilityUtils {
return game.getPhaseHandler().getPlanarDiceSpecialActionThisTurn(); return game.getPhaseHandler().getPlanarDiceSpecialActionThisTurn();
} }
if (sq[0].equals("AllTypes")) {
List<Card> cards = getDefinedCards(c, sq[1], ctb);
int amount = countCardTypesFromList(cards, false) +
countSuperTypesFromList(cards) +
countSubTypesFromList(cards);
return doXMath(amount, expr, c, ctb);
}
if (sq[0].equals("TotalTurns")) { if (sq[0].equals("TotalTurns")) {
return doXMath(game.getPhaseHandler().getTurn(), expr, c, ctb); return doXMath(game.getPhaseHandler().getTurn(), expr, c, ctb);
} }
@@ -3364,7 +3374,7 @@ public class AbilityUtils {
//SacrificedPermanentTypesThisTurn //SacrificedPermanentTypesThisTurn
if (l[0].startsWith("SacrificedPermanentTypesThisTurn")) { if (l[0].startsWith("SacrificedPermanentTypesThisTurn")) {
return doXMath(getCardTypesFromList(player.getSacrificedThisTurn(), true), m, source, ctb); return doXMath(countCardTypesFromList(player.getSacrificedThisTurn(), true), m, source, ctb);
} }
final String[] sq = l[0].split("\\."); final String[] sq = l[0].split("\\.");
@@ -3647,7 +3657,7 @@ public class AbilityUtils {
} }
if (string.startsWith("CardTypes")) { if (string.startsWith("CardTypes")) {
return doXMath(getCardTypesFromList(paidList, string.startsWith("CardTypesPermanent")), CardFactoryUtil.extractOperators(string), source, ctb); return doXMath(countCardTypesFromList(paidList, string.startsWith("CardTypesPermanent")), CardFactoryUtil.extractOperators(string), source, ctb);
} }
String filteredString = string; String filteredString = string;
@@ -3865,7 +3875,7 @@ public class AbilityUtils {
return list; return list;
} }
public static int getCardTypesFromList(final Iterable<Card> list, boolean permanentTypes) { public static int countCardTypesFromList(final Iterable<Card> list, boolean permanentTypes) {
EnumSet<CardType.CoreType> types = EnumSet.noneOf(CardType.CoreType.class); EnumSet<CardType.CoreType> types = EnumSet.noneOf(CardType.CoreType.class);
for (Card c1 : list) { for (Card c1 : list) {
Iterables.addAll(types, c1.getType().getCoreTypes()); Iterables.addAll(types, c1.getType().getCoreTypes());
@@ -3875,6 +3885,24 @@ public class AbilityUtils {
return types.size(); return types.size();
} }
public static int countSuperTypesFromList(final Iterable<Card> list) {
EnumSet<CardType.Supertype> types = EnumSet.noneOf(CardType.Supertype.class);
for (Card c1 : list) {
Iterables.addAll(types, c1.getType().getSupertypes());
}
return types.size();
}
public static int countSubTypesFromList(final Iterable<Card> list) {
Set<String> types = new HashSet<>();
for (Card c1 : list) {
Iterables.addAll(types, c1.getType().getSubtypes());
}
return types.size();
}
/** /**
* Checks if an ability source can be considered a "broken link" on a specific host * Checks if an ability source can be considered a "broken link" on a specific host
* (which usually means it won't have its normal effect). * (which usually means it won't have its normal effect).

View File

@@ -0,0 +1,6 @@
Name:Embiggen
ManaCost:G
Types:Instant
A:SP$ Pump | Cost$ G | ValidTgts$ Creature.nonBrushwagg | TgtPrompt$ Select target non Brushwagg creature | NumAtt$ +X | NumDef$ +X | SpellDescription$ Until end of turn, target non-Brushwagg creature gets +1/+1 for each supertype, card type, and subtype it has.
SVar:X:Count$AllTypes.Targeted
Oracle:Until end of turn, target non-Brushwagg creature gets +1/+1 for each supertype, card type, and subtype it has.