Beispiel #1
0
 def test_changing_spells_modd(self):
     attr = Attributes()
     sdc = SpellsDc(attr_cls=attr, mod='int')
     attr.cha = 14
     assert sdc.sdc == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
     sdc.mod = 'cha'
     assert sdc.sdc == [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
 def test_all_at_once(self):
     attr = Attributes({"dex": 14})
     attack = RangedAttack(attributes=attr,
                           base_mod=3,
                           misc_bonus=2,
                           size_bonus=1)
     assert attack.complete == 8
Beispiel #3
0
 def test_change_rank(self):
     attr = Attributes({"str": 14})
     sk = Skill(name='', attr_cls=attr, related_attribute='str', rank=4, misc_rank=0)
     assert sk.rank == 6
     sk.rank = 5
     assert sk.rank == 7
     sk.rank = 1
     assert sk.rank == 3
 def test_modify_spells_per_day(self):
     attr = Attributes()
     spd = SpellsPerDay(attr_cls=attr, mod='int')
     spd.max_spells_per_day[0] = 2
     assert spd.max_spells_per_day == [2, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     spd.max_spells_per_day[2] = 3
     assert spd.max_spells_per_day == [2, 0, 3, 0, 0, 0, 0, 0, 0, 0]
     spd.max_spells_per_day = [2, 0, 3, 0, 0, 0, 0, 2, 2, 0]
     assert spd.max_spells_per_day == [2, 0, 3, 0, 0, 0, 0, 2, 2, 0]
    def test_fortitude_from_attribute(self):
        attr = Attributes({"con": 16})
        base_mods = BasicSavingThrow()
        misc_mods = MiscSavingThrow()
        magic_mods = MagicSavingThrow()
        temp_mods = TempSavingThrow()

        st = SavingThrows(attr_cls=attr, base_mods=base_mods, misc_mods=misc_mods, magic_mods=magic_mods, temp_mods=temp_mods)
        assert st.fortitude == 3
    def test_reflex_from_temp_and_misc(self):
        attr = Attributes()
        base_mods = BasicSavingThrow()
        misc_mods = MiscSavingThrow()
        magic_mods = MagicSavingThrow()
        temp_mods = TempSavingThrow()
        temp_mods.fortitude = 3
        misc_mods.fortitude = 7

        st = SavingThrows(attr_cls=attr, base_mods=base_mods, misc_mods=misc_mods, magic_mods=magic_mods,
                          temp_mods=temp_mods)
        assert st.fortitude == 10
    def test_with_attributes(self):
        attr = Attributes({"str": 14})
        attack = MeleeAttack(attributes=attr)

        assert attack.complete == 2
 def test_max_spells_per_day(self):
     attr = Attributes()
     spd = SpellsPerDay(attr_cls=attr, mod='int')
     assert spd.max_spells_per_day == [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    def test_with_attributes(self):
        attr = Attributes({"dex": 14})
        attack = RangedAttack(attributes=attr)

        assert attack.complete == 2
Beispiel #10
0
 def test_output_skill_rank(self):
     attr = Attributes({"str": 14})
     sk = Skill(name='', attr_cls=attr, related_attribute='str', rank=4, misc_rank=0)
     assert sk.rank == 6
     attr.str = 16
     assert sk.rank == 7
 def test_attributes_changes(self):
     attr = Attributes({"str": 14})
     attack = MeleeAttack(attributes=attr, base_mod=3)
     assert attack.complete == 5
     attack.attack_attribute = 'dex'
     assert attack.complete == 3
 def test_with_attributes_and_base_mod(self):
     attr = Attributes({"dex": 14})
     attack = RangedAttack(attributes=attr, base_mod=3)
     assert attack.complete == 5
Beispiel #13
0
 def test_name(self):
     attr = Attributes({"str": 14})
     sk = Skill(name="DUMMY NAME", attr_cls=attr)
     assert sk.name == "DUMMY NAME"
Beispiel #14
0
 def test_description(self):
     attr = Attributes({"str": 14})
     sk = Skill(name='', attr_cls=attr, related_attribute='str', rank=4, misc_rank=0, description="DUMMY DESCRIPTION")
     assert sk.description == "DUMMY DESCRIPTION"
Beispiel #15
0
 def test_change_related_attribute(self):
     attr = Attributes({"str": 12, "int": 16})
     sk = Skill(name='', attr_cls=attr, related_attribute='str', rank=3, misc_rank=0)
     assert sk.rank == 4
     sk.related_attribute = 'int'
     assert sk.rank == 6
 def test_with_attributes_and_base_mod(self):
     attr = Attributes({"str": 14})
     attack = MeleeAttack(attributes=attr, base_mod=3)
     assert attack.complete == 5
 def test_attributes_value_changes(self):
     attr = Attributes({"str": 14})
     attack = MeleeAttack(attributes=attr, base_mod=3)
     assert attack.complete == 5
     attr.str = 12
     assert attack.complete == 4
 def test_attributes_value_changes(self):
     attr = Attributes({"dex": 14})
     attack = RangedAttack(attributes=attr, base_mod=3)
     assert attack.complete == 5
     attr.dex = 12
     assert attack.complete == 4
Beispiel #19
0
 def test_changing_spells_dc(self):
     attr = Attributes()
     sdc = SpellsDc(attr_cls=attr, mod='int')
     attr.int = 14
     assert sdc.sdc == [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
 def test_attributes_changes(self):
     attr = Attributes({"dex": 14})
     attack = RangedAttack(attributes=attr, base_mod=3)
     assert attack.complete == 5
     attack.attack_attribute = 'str'
     assert attack.complete == 3
Beispiel #21
0
 def test_init_spells_dc(self):
     attr = Attributes()
     sdc = SpellsDc(attr_cls=attr, mod='int')
     assert sdc.sdc == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 def provide_attributes(self, attributes):
     self.attributes = Attributes(attributes)