mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
ChooseCardNameEffect workaround to handle X in "ValidCards"
This commit is contained in:
@@ -146,6 +146,12 @@ public class ChooseCardNameEffect extends SpellAbilityEffect {
|
|||||||
// use CardFace because you might name a alternate names
|
// use CardFace because you might name a alternate names
|
||||||
Predicate<ICardFace> cpp = Predicates.alwaysTrue();
|
Predicate<ICardFace> cpp = Predicates.alwaysTrue();
|
||||||
if (sa.hasParam("ValidCards")) {
|
if (sa.hasParam("ValidCards")) {
|
||||||
|
//Calculating/replacing X must happen before before running valid in CardFacePredicates
|
||||||
|
if (valid.endsWith("X")) { //for now, only works for X and valid must end with X
|
||||||
|
int num = AbilityUtils.calculateAmount(host, "X", sa);
|
||||||
|
String str = Integer.toString(num);
|
||||||
|
valid = valid.replace("X", str);
|
||||||
|
}
|
||||||
cpp = CardFacePredicates.valid(valid);
|
cpp = CardFacePredicates.valid(valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user