Esempio n. 1
0
def test_wounds_penalty():
    ch = CharacterModel()
    assert ch.get_value('wounds.healthy.penalty') == 0
    assert ch.get_value('wounds.nicked.penalty') == 3
    assert ch.get_value('wounds.grazed.penalty') == 5
    assert ch.get_value('wounds.hurt.penalty') == 10
    assert ch.get_value('wounds.crippled.penalty') == 20
    assert ch.get_value('wounds.down.penalty') == 40
Esempio n. 2
0
def test_rings():
    ch = CharacterModel()
    assert ch.get_value('rings.earth') == 2

    ch.set_value('traits.stamina', 3)
    assert ch.get_value('rings.earth') == 2

    ch.set_value('traits.willpower', 3)
    assert ch.get_value('rings.earth') == 3
Esempio n. 3
0
def test_wounds():
    ch = CharacterModel()
    assert ch.get_value('wounds.healthy') == 10
    assert ch.get_value('wounds.injured') == 26

    ch.set_value('traits.stamina', 3)
    ch.set_value('traits.willpower', 3)
    assert ch.get_value('wounds.healthy') == 15
    assert ch.get_value('wounds.injured') == 39
Esempio n. 4
0
def test_add_merit():
    '''
    The usual merit price.
    '''
    ch = CharacterModel()
    builder = CharacterBuilder(ch)

    assert ch.get_value('xp') == 0
    builder.add_merit('large', 1, 'test merit', buy=True)
    assert ch.get_value('xp') == 4
Esempio n. 5
0
def test_add_merit_special_cost():
    '''
    Crabs pay less for "large" merit.
    '''
    ch = CharacterModel()
    builder = CharacterBuilder(ch)
    builder.set_advancement_value('clan', 'crab')
    builder.set_advancement_value('family', 'crab_hida')
    builder.set_advancement_value('school', 'crab_hida_bushi_school')

    assert ch.get_value('xp') == 0
    builder.add_merit('large', 1, 'test merit', buy=True)
    assert ch.get_value('xp') == 3
Esempio n. 6
0
def test_modifiers():
    ch = CharacterModel()
    assert ch.get_value('traits.stamina') == 2
    assert ch.get_value('traits.willpower') == 2
    assert ch.get_value('rings.earth') == 2

    ch.add_modifier('traits.stamina', 1, 'test_modifier')
    assert ch.get_value('traits.stamina') == 3
    assert ch.get_value('traits.willpower') == 2
    assert ch.get_value('rings.earth') == 2

    ch.add_modifier('traits.willpower', 1, 'test_modifier')
    assert ch.get_value('traits.stamina') == 3
    assert ch.get_value('traits.willpower') == 3
    assert ch.get_value('rings.earth') == 3
Esempio n. 7
0
def test_armor_tn():
    ch = CharacterModel()
    ch.add_modifier('traits.reflexes', 1, source='test_armor_tn')
    assert ch.get_value('armor_tn.base') == 20
    assert ch.get_value('armor_tn.reduction') == 20
    assert ch.get_value('armor_tn.current') == 20
Esempio n. 8
0
def test_initiative():
    ch = CharacterModel()
    assert ch.get_value('initiative.base') == '3k2'
    assert ch.get_value('initiative.modifiers') == '0k0'
    assert ch.get_value('initiative.current') == '3k2'