Skip to content

Keyword texts generated by Type #9453

@Hanmac

Description

@Hanmac

Related to #9418

Hexproof from uses Hexproof:<Valid>:<Desc>
Currently, there is:

  • Hexproof:Card.Red:red to make Hexproof from red
  • Hexproof:Card.Instant:instants to make Hexproof 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 getTitle function returning Hexproof from <> that is currently created in Card: (this might be plural for CardTypes)
    } 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
    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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions