fixing modifier bugs, fixing traits, adding speed attrs

This commit is contained in:
evilchili
2024-04-23 00:15:13 -07:00
parent 5db6e40eae
commit 1ff0e5ca7d
5 changed files with 96 additions and 213 deletions
+6 -2
View File
@@ -97,7 +97,7 @@ def test_ancestries(db):
porc = schema.Ancestry(
name="Pygmy Orc",
size="Small",
speed=25,
walk_speed=25,
)
db.add_or_update(porc)
assert porc.name == "Pygmy Orc"
@@ -141,7 +141,8 @@ def test_modifiers(db, classes_factory, ancestries_factory):
# no modifiers; speed is ancestry speed
carl = schema.Character(name="Carl", ancestry=ancestries["elf"])
db.add_or_update(carl)
marx = schema.Character(name="Marx", ancestry=ancestries["human"])
db.add_or_update([carl, marx])
assert carl.speed == carl.ancestry.speed == 30
cold = schema.Modifier(target="speed", relative_value=-10, name="Cold")
@@ -154,6 +155,9 @@ def test_modifiers(db, classes_factory, ancestries_factory):
assert carl.add_modifier(cold)
assert carl.speed == 20
# make sure modifiers only apply to carl. Carl is having a bad day.
assert marx.speed == 30
# speed is doubled
assert carl.remove_modifier(cold)
assert carl.add_modifier(hasted)