From b0245b26f35e29787e81dde5ad926ad581981d07 Mon Sep 17 00:00:00 2001 From: Erin Schnabel Date: Mon, 15 Jul 2024 15:07:50 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Pf2e:=20some=20immunities=20are?= =?UTF-8?q?=20traits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../convert/tools/pf2e/Json2QuteDeity.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/ebullient/convert/tools/pf2e/Json2QuteDeity.java b/src/main/java/dev/ebullient/convert/tools/pf2e/Json2QuteDeity.java index 8d5bf9da..d234d33a 100644 --- a/src/main/java/dev/ebullient/convert/tools/pf2e/Json2QuteDeity.java +++ b/src/main/java/dev/ebullient/convert/tools/pf2e/Json2QuteDeity.java @@ -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 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); }