mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-07 21:23:31 +02:00
Add a field to armor to ignore dexterity
The dexterity modifier, whether it's a bonus or a penalty, should be ignored entirely when computing AC for heavy armor.
This commit is contained in:
@@ -77,6 +77,7 @@ class Armor:
|
|||||||
cost = "0 gp"
|
cost = "0 gp"
|
||||||
base_armor_class = 10
|
base_armor_class = 10
|
||||||
dexterity_mod_max = None
|
dexterity_mod_max = None
|
||||||
|
dexterity_applied = True
|
||||||
strength_required = None
|
strength_required = None
|
||||||
stealth_disadvantage = False
|
stealth_disadvantage = False
|
||||||
weight = 0 # In lbs
|
weight = 0 # In lbs
|
||||||
@@ -112,6 +113,7 @@ class MediumArmor(Armor):
|
|||||||
|
|
||||||
class HeavyArmor(Armor):
|
class HeavyArmor(Armor):
|
||||||
name = "Heavy Armor"
|
name = "Heavy Armor"
|
||||||
|
dexterity_applied = False
|
||||||
|
|
||||||
|
|
||||||
class PaddedArmor(LightArmor):
|
class PaddedArmor(LightArmor):
|
||||||
@@ -182,7 +184,6 @@ class RingMail(HeavyArmor):
|
|||||||
name = "Ring Mail"
|
name = "Ring Mail"
|
||||||
cost = "30 gp"
|
cost = "30 gp"
|
||||||
base_armor_class = 14
|
base_armor_class = 14
|
||||||
dexterity_mod_max = 0
|
|
||||||
stealth_disadvantage = True
|
stealth_disadvantage = True
|
||||||
weight = 40
|
weight = 40
|
||||||
|
|
||||||
@@ -191,7 +192,6 @@ class ChainMail(HeavyArmor):
|
|||||||
name = "Chain Mail"
|
name = "Chain Mail"
|
||||||
cost = "75 gp"
|
cost = "75 gp"
|
||||||
base_armor_class = 16
|
base_armor_class = 16
|
||||||
dexterity_mod_max = 0
|
|
||||||
strength_required = 13
|
strength_required = 13
|
||||||
stealth_disadvantage = True
|
stealth_disadvantage = True
|
||||||
weight = 55
|
weight = 55
|
||||||
@@ -201,7 +201,6 @@ class SplintArmor(HeavyArmor):
|
|||||||
name = "Splint Armor"
|
name = "Splint Armor"
|
||||||
cost = "200 gp"
|
cost = "200 gp"
|
||||||
base_armor_class = 17
|
base_armor_class = 17
|
||||||
dexterity_mod_max = 0
|
|
||||||
strength_required = 15
|
strength_required = 15
|
||||||
stealth_disadvantage = True
|
stealth_disadvantage = True
|
||||||
weight = 60
|
weight = 60
|
||||||
@@ -211,7 +210,6 @@ class PlateMail(HeavyArmor):
|
|||||||
name = "Plate Mail"
|
name = "Plate Mail"
|
||||||
cost = "1,500 gp"
|
cost = "1,500 gp"
|
||||||
base_armor_class = 18
|
base_armor_class = 18
|
||||||
dexterity_mod_max = 0
|
|
||||||
strength_required = 15
|
strength_required = 15
|
||||||
stealth_disadvantage = True
|
stealth_disadvantage = True
|
||||||
weight = 65
|
weight = 65
|
||||||
|
|||||||
@@ -194,10 +194,11 @@ class ArmorClass:
|
|||||||
armor = actor.armor or NoArmor()
|
armor = actor.armor or NoArmor()
|
||||||
ac = armor.base_armor_class
|
ac = armor.base_armor_class
|
||||||
# calculate and apply modifiers
|
# calculate and apply modifiers
|
||||||
if armor.dexterity_mod_max is None:
|
if armor.dexterity_applied:
|
||||||
ac += actor.dexterity.modifier
|
if armor.dexterity_mod_max is None:
|
||||||
else:
|
ac += actor.dexterity.modifier
|
||||||
ac += min(actor.dexterity.modifier, armor.dexterity_mod_max)
|
else:
|
||||||
|
ac += min(actor.dexterity.modifier, armor.dexterity_mod_max)
|
||||||
if actor.has_feature(NaturalArmor):
|
if actor.has_feature(NaturalArmor):
|
||||||
ac = max(ac, 13 + actor.dexterity.modifier)
|
ac = max(ac, 13 + actor.dexterity.modifier)
|
||||||
shield = actor.shield or NoShield()
|
shield = actor.shield or NoShield()
|
||||||
|
|||||||
Reference in New Issue
Block a user