Skip to content

Commit

Permalink
➕ Pf2e: condition alias + typos; resolves #141
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jan 14, 2024
1 parent 9508a1f commit a13ba1e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/sourceMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ You may see these abbreviations referenced in source material, this is how they
| OoA1 | Outlaws of Alkenstar #1: Punks in a Powder Keg |
| OoA2 | Outlaws of Alkenstar #2: Cradle of Quartz |
| OoA3 | Outlaws of Alkenstar #3: The Smoking Gun |
| PC1 | Player Core |
| PFUM | PATHFINDER: FUMBUS! |
| QFF0 | Quest for the Frozen Flame Player's Guide |
| QFF1 | Quest for the Frozen Flame #1: Broken Tusk Moon |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import java.util.stream.Collectors;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

import dev.ebullient.convert.tools.JsonNodeReader;
import dev.ebullient.convert.tools.Tags;
import dev.ebullient.convert.tools.ToolsIndex.TtrpgValue;
import dev.ebullient.convert.tools.pf2e.qute.Pf2eQuteNote;
Expand All @@ -26,6 +28,19 @@ public Json2QuteCompose(Pf2eIndexType type, Pf2eIndex index, String title) {

public void add(JsonNode node) {
nodes.add(node);
if (ComposeFields.alias.existsIn(node)) {
String name = SourceField.name.getTextOrEmpty(node);
JsonNode entries = ((ObjectNode) node).arrayNode()
.add(String.format("See [%s](#%s)", name, toAnchorTag(name)));

for (String alias : ComposeFields.alias.getListOfStrings(node, tui())) {
ObjectNode copy = (ObjectNode) copyNode(node);
copy.put("name", alias);
copy.remove("alias");
copy.set("entries", entries);
nodes.add(copy);
}
}
}

@Override
Expand Down Expand Up @@ -92,4 +107,8 @@ void addDomainSpells(String name, List<String> text) {
.map(s -> linkify(Pf2eIndexType.spell, s.getName() + "|" + s.primarySource()))
.collect(Collectors.joining(", ")));
}

enum ComposeFields implements JsonNodeReader {
alias
}
}
12 changes: 12 additions & 0 deletions src/main/resources/convertData.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,12 @@
"replace": "\\{@class Cleric}"
}
],
"deities.json": [
{
"match": "immobilizied",
"replace": "immobilized"
}
],
"feats/feats-apg.json": [
{
"match": "\\{@note \\{@sup 1}Mwangi Expanse, p.76}",
Expand Down Expand Up @@ -655,6 +661,12 @@
"match": "the target can't recover from the condition until they are cured}",
"replace": "the target can't recover from the condition until they are cured."
}
],
"rituals.json": [
{
"match": "@skill Religion \\(legendary\\)",
"replace": "@skill Religion} (legendary),"
}
]
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/sourceMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@
"OoA1": "Outlaws of Alkenstar #1: Punks in a Powder Keg",
"OoA2": "Outlaws of Alkenstar #2: Cradle of Quartz",
"OoA3": "Outlaws of Alkenstar #3: The Smoking Gun",
"PC1": "Player Core",
"PFUM": "PATHFINDER: FUMBUS!",
"QFF0": "Quest for the Frozen Flame Player's Guide",
"QFF1": "Quest for the Frozen Flame #1: Broken Tusk Moon",
Expand Down

0 comments on commit a13ba1e

Please sign in to comment.