Skip to content

Commit

Permalink
handle ActiveStatPercent items
Browse files Browse the repository at this point in the history
  • Loading branch information
egocarib committed Jan 19, 2024
1 parent ae17779 commit a1e2e27
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hagadias/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@
"Hitpoints": "hit points",
"MoveSpeed": "move speed",
"Speed": "quickness",
"AP": "attribute points",
"MP": "mutation points",
"SP": "skill points",
"XP": "experience points",
}
# The following includes all parts descending from IActivePart, which defines the IsEMPSensitive and
# PowerLoadSensitive fields. This holds the hard-coded defaults. These can be overridden in the XML.
Expand Down
9 changes: 9 additions & 0 deletions hagadias/qudobject_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,15 @@ def desc(self) -> str | None:
if amt is not None:
symbol = "+" if amt > 0 else ""
desc_extra.append("{{" + f"rules|{symbol}{amt} {stat}" + "}}")
# ActiveStatPercent (percentage-based boost)
if self.part_ActiveStatPercent is not None:
for boostinfo in self.part_ActiveStatPercent_Boosts.split(";"):
stat, amt = boostinfo.split(":")
stat = stat if stat not in STAT_DISPLAY_NAMES else STAT_DISPLAY_NAMES[stat]
amt = int_or_none(amt)
if amt is not None:
symbol = "+" if amt > 0 else ""
desc_extra.append("{{" + f"rules|{symbol}{amt}% {stat}" + "}}")
# carrybonus
carry_bonus = self.carrybonus
if carry_bonus:
Expand Down

0 comments on commit a1e2e27

Please sign in to comment.