Skip to content

Commit

Permalink
🐛 Pf2e: some immunities are traits
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jul 15, 2024
1 parent ace66a0 commit b0245b2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/dev/ebullient/convert/tools/pf2e/Json2QuteDeity.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,18 @@ QuteDeity.QuteDivineAvatar buildAvatar(Tags tags) {
if (Pf2eDeity.airWalk.booleanOrDefault(avatarNode, false)) {
avatar.speed.addAbility(linkify(Pf2eIndexType.spell, "air walk"));
}
String immunities = joinConjunct(" and ",
Pf2eDeity.immune.linkifyListFrom(avatarNode, Pf2eIndexType.condition, this));

List<String> immunityLinks = Pf2eDeity.immune.getListOfStrings(avatarNode, tui())
.stream()
.map(s -> {
// some immunities are actually traits
return (index.traitToSource(s) != null)
? linkify(Pf2eIndexType.trait, s)
: linkify(Pf2eIndexType.condition, s);
})
.toList();

String immunities = joinConjunct(" and ", immunityLinks);
if (!immunities.isEmpty()) {
avatar.speed.addAbility("immune to " + immunities);
}
Expand Down

0 comments on commit b0245b2

Please sign in to comment.