From 26852e8967f99a591e0ca70451b52da5a9455347 Mon Sep 17 00:00:00 2001 From: egocarib Date: Mon, 1 Jul 2024 20:17:43 -0500 Subject: [PATCH] fix #118 Rather than add a specific exception for Chimes, I added an exception for things with the "GivesRep" part, which captures them and hopefully any other future similar objects --- hagadias/qudobject_props.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hagadias/qudobject_props.py b/hagadias/qudobject_props.py index 253a452..c611347 100644 --- a/hagadias/qudobject_props.py +++ b/hagadias/qudobject_props.py @@ -738,11 +738,12 @@ def damage(self) -> str | None: @cached_property def demeanor(self) -> str | None: """The demeanor of the creature.""" - if self.active_or_inactive_character() == ACTIVE_CHAR: - if self.part_Brain_Calm is not None: - return "docile" if self.part_Brain_Calm.lower() == "true" else "neutral" - if self.part_Brain_Hostile is not None: - return "aggressive" if self.part_Brain_Hostile.lower() == "true" else "neutral" + if self.active_or_inactive_character() == ACTIVE_CHAR or self.part_GivesRep is not None: + if self.part_Brain_Calm is not None and self.part_Brain_Calm.lower() == "true": + return "docile" + if self.part_Brain_Hostile is not None and self.part_Brain_Hostile.lower() == "true": + return "aggressive" + return "neutral" @cached_property def desc(self) -> str | None: @@ -1581,7 +1582,9 @@ def gender(self) -> str | None: if ( self.tag_Gender_Value is not None or (self.tag_RandomGender_Value is not None and "," not in self.tag_RandomGender_Value) - ) and self.active_or_inactive_character() == ACTIVE_CHAR: + ) and ( + self.active_or_inactive_character() == ACTIVE_CHAR or self.part_GivesRep is not None + ): gender = self.tag_Gender_Value if gender is None: gender = self.tag_RandomGender_Value @@ -2140,7 +2143,9 @@ def primarydamageelement(self) -> str | None: @cached_property def pronouns(self) -> str | None: """Return the pronounset of a creature, if [they] have any.""" - if self.tag_PronounSet_Value is not None and self.inherits_from("Creature"): + if self.tag_PronounSet_Value is None: + return None + if self.active_or_inactive_character() == ACTIVE_CHAR or self.part_GivesRep is not None: return self.tag_PronounSet_Value @cached_property