-
Notifications
You must be signed in to change notification settings - Fork 824
Description
Related to #9418
Hexproof from uses Hexproof:<Valid>:<Desc>
Currently, there is:
Hexproof:Card.Red:redto makeHexproof from redHexproof:Card.Instant:instantsto makeHexproof from instants
In case of ColorWords, CardTypes (and SubTypes?), i want to simplify the logic so that it can work from Quality, and generate the Valid and Desc from there.
There is some logic already in KeywordWithType:
| } else { | |
| descType = type = details; | |
| boolean multiple = switch(getKeyword()) { | |
| case AFFINITY -> true; | |
| default -> false; | |
| }; | |
| descType = Lang.getInstance().buildValidDesc(Arrays.asList(type.split(",")), multiple); | |
| } | |
| if (descType.equalsIgnoreCase("Outlaw")) { | |
| reminderType = "Assassin, Mercenary, Pirate, Rogue, and/or Warlock"; | |
| } else if (type.equalsIgnoreCase("historic permanent")) { | |
| reminderType = "artifact, legendary, and/or Saga permanent"; | |
| } else { | |
| reminderType = descType; | |
| } |
What stuff i need:
- the part for the new
getTitlefunction returningHexproof from <>that is currently created in Card: (this might be plural for CardTypes)
forge/forge-game/src/main/java/forge/game/card/Card.java
Lines 2551 to 2562 in bdb3dd1
} else if (keyword.startsWith("Hexproof:")) { final String[] k = keyword.split(":"); if(!k[2].equals("Secondary")) { sbLong.append("Hexproof from "); sbLong.append(k[2]); // skip reminder text for more complicated Hexproofs if (!k[2].contains(" and ") && !k[2].contains("each")) { sbLong.append(" (").append(inst.getReminderText()); sbLong.append(")"); } sbLong.append("\r\n"); } - the part of Valid and ValidDesc, currently only used for Enchant stuff, but might be used for KeywordFactory
forge/forge-game/src/main/java/forge/game/card/Card.java
Lines 7143 to 7144 in 58f56db
String v = kwt.getValidType(); String desc = kwt.getTypeDescription(); - the part used in reminder text, might be different from the ValidDesc (see Outlaw)
The Valid:Desc variant should still work for more complex ones, but Hexproof:red and Hexproof:Artifact should be enough for simple versions.
This might help other Keywords, too like Protection.
In later work, we might use this to differ if a keyword is affected by TextChanges instead of creating a new one.