Skip to content

Commit

Permalink
fix #118
Browse files Browse the repository at this point in the history
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
  • Loading branch information
egocarib committed Jul 2, 2024
1 parent 083e50a commit 26852e8
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions hagadias/qudobject_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 26852e8

Please sign in to comment.