diff options
| author | Supremist <sergkarv@gmail.com> | 2025-10-30 01:16:56 +0200 |
|---|---|---|
| committer | Supremist <sergkarv@gmail.com> | 2025-10-30 01:16:56 +0200 |
| commit | 9cc423f1e3b0a1d9e498c522cb550709e348eed7 (patch) | |
| tree | 9cf54a7b7d77cc6f905f091c7bff972430dfdc40 /character.py | |
| parent | 9fa4cfbe2f948f4067ca1572bbc5dbfab678e7da (diff) | |
| download | pf2e_calc-9cc423f1e3b0a1d9e498c522cb550709e348eed7.tar.xz pf2e_calc-9cc423f1e3b0a1d9e498c522cb550709e348eed7.zip | |
Add weapon damage comparison graph
Diffstat (limited to 'character.py')
| -rw-r--r-- | character.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/character.py b/character.py index 14a7e42..9cc2498 100644 --- a/character.py +++ b/character.py @@ -159,6 +159,14 @@ class Character: weapon.striking = self.features["striking"] except KeyError: pass + + def weapon_proficiency_bonus(self, weapon): + return max(self.features.get(weapon.category, 0), + self.features.get(weapon.name, 0)) + + def weapon_specialization_bonus(self, weapon): + factor = self.features.get("weapon specialization", 0) + return self.weapon_proficiency_bonus(weapon) * factor // 2 def attack_bonus(self, weapon: Weapon, strike_type="melee"): dex = self.ability_modifier("dex").total() @@ -168,13 +176,13 @@ class Character: mod = max(mod, dex) elif strike_type == "ranged": mod = dex - prof = max(self.features.get(weapon.category, 0), - self.features.get(weapon.name, 0)) - return mod + prof + weapon.potency + prof = self.weapon_proficiency_bonus(weapon) + return mod + prof + self.level + weapon.potency def attack_damage_bonus(self, weapon: Weapon, strike_type="melee"): str_mod = self.ability_modifier("str") dmg_mod = self.conditions.modifier("damage") + dmg_mod += self.weapon_specialization_bonus(weapon) if strike_type == "melee": if "thief" in self.features and weapon.finesse: @@ -221,6 +229,7 @@ class CharacterPlan(LevelingPlan): blacklist = duplicates blacklist.extend(spells) blacklist.extend(equipment) + blacklist.append("feats") for key in blacklist: del data[key] |
