def build_character(): "Test data builder for a simple fighter." fighter = Character() fighter.name = "Cpl. Tomm Colworn" fighter.languages.append("Draconic") # set some abilities so that we get interesting output in XHTML fighter.abilities.dexterity = 12 fighter.abilities.wisdom = 14 fighter.abilities.constitution = 14 fighter.abilities.strength = 16 # add a few weapons sword = fighter.weapons.add(Longsword()) bow = fighter.weapons.add(Longbow()) fighter.melee.append(MeleeAttackCombination(sword)) fighter.ranged.append(RangedAttackCombination(bow)) # and some armor fighter.armor = ChainMail() # set some feats fighter.feats.add(PowerAttack()) fighter.feats.add(WeaponFocus(sword)) return fighter
def test_constitution_affected(): guard = Character() guard.constitution = 13 assert guard.hit_points.value == 9 assert guard.fortitude.value == 1 guard.constitution = 5 assert guard.hit_points.value == 5
def test_wisdom_affected(): guard = Character() guard.wisdom = 14 assert guard.will.value == +2