def test_is_proficient(self): char = Character(classes=['Wizard']) char.weapon_proficiencies sword = Shortsword() # Check for not-proficient weapon self.assertFalse(char.is_proficient(sword)) # Check if we're proficient in the weapon char.weapon_proficiencies = [Shortsword] self.assertTrue(char.is_proficient(sword)) # Now try it with a racial proficiency char.weapon_proficiencies = tuple() char.race = race.HighElf() self.assertTrue(char.is_proficient(sword))
def test_proficiencies(self): char1 = Character(name='Multiclass', classes=['wizard', 'fighter'], levels=[5, 4]) for svt in ('intelligence', 'wisdom'): self.assertIn(svt, char1.saving_throw_proficiencies) char2 = Character(name='Multiclass', classes=['wizard', 'rogue'], levels=[5, 4]) char3 = Character(name='Multiclass', classes=['rogue', 'wizard'], levels=[4, 5]) sword = Shortsword() self.assertTrue(char1.is_proficient(sword)) # multiclassing into Rogue doesn't give simple weapon proficiency self.assertFalse(char2.is_proficient(sword)) self.assertTrue(char3.is_proficient(sword))
def test_proficiencies(self): char1 = Character(name="Multiclass", classes=["wizard", "fighter"], levels=[5, 4]) for svt in ("intelligence", "wisdom"): self.assertIn(svt, char1.saving_throw_proficiencies) char2 = Character(name="Multiclass", classes=["wizard", "rogue"], levels=[5, 4]) char3 = Character(name="Multiclass", classes=["rogue", "wizard"], levels=[4, 5]) sword = Shortsword() self.assertTrue(char1.is_proficient(sword)) # multiclassing into Rogue doesn't give simple weapon proficiency self.assertFalse(char2.is_proficient(sword)) self.assertTrue(char3.is_proficient(sword))