Prettify Any TgtPrompt

This commit is contained in:
TRT
2023-04-21 11:11:30 +02:00
parent 69ba6168f8
commit 72a0730560
29 changed files with 44 additions and 38 deletions

View File

@@ -332,15 +332,21 @@ public final class AbilityFactory {
// TgtPrompt should only be needed for more complicated ValidTgts
String tgtWhat = mapParams.get("ValidTgts");
final String[] commonStuff = new String[] {
//list of common one word non-core type ValidTgts that should be lowercase in the target prompt
"Player", "Opponent", "Card", "Spell", "Permanent"
};
if (Arrays.asList(commonStuff).contains(tgtWhat) || CardType.CoreType.isValidEnum(tgtWhat)) {
tgtWhat = tgtWhat.toLowerCase();
final String prompt;
if (mapParams.containsKey("TgtPrompt")) {
prompt = mapParams.get("TgtPrompt");
} else if (tgtWhat.equals("Any")) {
prompt = "Select any target";
} else {
final String[] commonStuff = new String[] {
//list of common one word non-core type ValidTgts that should be lowercase in the target prompt
"Player", "Opponent", "Card", "Spell", "Permanent"
};
if (Arrays.asList(commonStuff).contains(tgtWhat) || CardType.CoreType.isValidEnum(tgtWhat)) {
tgtWhat = tgtWhat.toLowerCase();
}
prompt = "Select target " + tgtWhat;
}
final String prompt = mapParams.containsKey("TgtPrompt") ? mapParams.get("TgtPrompt") :
"Select target " + tgtWhat;
TargetRestrictions abTgt = new TargetRestrictions(prompt, mapParams.get("ValidTgts").split(","), min, max);

View File

@@ -203,7 +203,7 @@ public final class CardUtil {
newCopy.getCurrentState().copyFrom(in.getState(in.getFaceupCardStateName()), true);
if (in.isFaceDown()) {
newCopy.turnFaceDownNoUpdate();
newCopy.setType(new CardType(in.getType()));
newCopy.setType(new CardType(in.getCurrentState().getType()));
// prevent StackDescription from revealing face
newCopy.updateStateForView();
}