Exemplo n.º 1
0
def test_stat_scale_exp():
    owner = StatsOwner()
    s = Stat("int")
    s.base_value = 10
    s.scale_method = s.lvl_scale_exp
    s.scale_amount = 1
    owner.claim(s)
    owner.set_lvl(1)
    s.update()
    lvl1 = s.get_value()
    owner.set_lvl(20)
    s.update()
    lvl20 = s.get_value()
    assert lvl1 == 10 and lvl20 == 18
Exemplo n.º 2
0
def test_stat_scale_flat():
    owner = StatsOwner()
    s = Stat("int")
    s.base_value = 10
    s.scale_method = s.scale_flat
    s.scale_stat = "lvl"
    s.scale_amount = 1
    owner.claim(s)
    owner.set_lvl(1)
    s.update()
    lvl1 = s.get_value()
    owner.set_lvl(10)
    s.update()
    lvl10 = s.get_value()
    assert lvl1 == 10 and lvl10 == 19