Esempio n. 1
0
def test_adding_all_armor_types():
    guard = ActorBuilder().build()
    guard.dexterity.value = 13
    guard.natural_armor.value = 2 # got really thick skin
    guard.add_component(ChainMail())
    guard.add_component(LightSteelShield())
    assert guard.armor_class.value == 19
Esempio n. 2
0
def test_grapple_attack():
    guard = ActorBuilder().build()
    guard.attack.base.value += 3
    guard.strength = 16
    guard.configure("size", Size.LARGE)
    assert guard.size == Size.LARGE
    assert guard.attack.grapple.value == 10
Esempio n. 3
0
def test_size_effects():
    guard = ActorBuilder().build()
    guard.size = Size.LARGE
    assert guard.attack.base.value == -1
    assert guard.armor_class.value == 9

    guard.size = Size.MEDIUM
    assert guard.attack.base.value == 0
    assert guard.armor_class.value == 10
Esempio n. 4
0
def test_base_attack():
    guard = ActorBuilder().build()
    guard.attack.base.value += 1
    assert guard.attack.melee.value == 1
    
    guard.strength = 15
    guard.dexterity = 12
    
    assert guard.attack.melee.value == 3
    assert guard.attack.ranged.value == 2
Esempio n. 5
0
def test_strength_affected():
    guard = ActorBuilder().build()
    
    guard.configure("strength", 16)
    assert guard.strength.value == 16
    assert guard.attack.melee.value == 3
    
    guard.configure("strength", 12)
    assert guard.strength.value == 12
    assert guard.attack.melee.value == 1
Esempio n. 6
0
def test_only_armor_low_touch_armor_class():
    guard = ActorBuilder().build()
    guard.add_component(ChainMail())
    
    assert guard.armor_class.value == 15
    assert guard.touch.value == 10
    
    guard.dexterity.value = 14
    assert guard.armor_class.value == 17
    assert guard.touch.value == 12
Esempio n. 7
0
def test_that_old_armor_bonus_gets_removed():
    guard = ActorBuilder().build()

    heavy_shield = HeavySteelShield()
    guard.add_equipment(heavy_shield)
    assert guard.activate_equipment(heavy_shield.id)
    assert guard.armor_class.value == 12

    light_shield = LightSteelShield()
    guard.add_equipment(light_shield)
    
    guard.deactivate_equipment(heavy_shield.id)
    assert guard.activate_equipment(light_shield.id)
    assert guard.armor_class.value == 11
Esempio n. 8
0
def test_that_vital_objects_like_dexterity_can_not_be_destroyed():
    guard = ActorBuilder().build()
    guard.dexterity = 12
    assert guard.armor_class.value == 11
    
    guard.remove_component("dexterity")
    assert guard.armor_class.value == 11

    guard.registry.get("skill/jump").value = 5
    guard.configure("skill/tumble", 5)
    guard.remove_component("skill/jump")
    
    assert guard.registry.get("skill/tumble").value == 8
    assert guard.registry.has("skill/jump")
Esempio n. 9
0
def test_wiring_skills():
    tumble = Tumble(6)
    balance = Balance(0)
    
    character = ActorBuilder().build()
    character.add_component(balance)
    character.strength.value = 8
    character.dexterity.value = 14
    character.add_component(Jump(0))
    character.add_component(tumble)
    
    assert tumble.bonus.value == 8
    assert balance.value == 4
Esempio n. 10
0
def test_adding_a_weapon():
    guard = ActorBuilder().build()
    guard.strength.value = 16
    guard.dexterity.value = 13
    
    sword = Longsword()
    dagger = Dagger()
    guard.add_component(sword)
    guard.add_component(dagger)
    guard.add_component(WeaponFocus(sword))
    
    assert sword.melee.attack.value == 4
    assert sword.melee.damage.default == d8
    assert sword.melee.damage.value == d8+3
    
    assert dagger.melee.attack.value == 3
    assert dagger.ranged.attack.value == 1
    assert dagger.ranged.damage.value == d4 
Esempio n. 11
0
def test_dexterity_affected():
    guard = ActorBuilder().build()
    guard.dexterity = 8
    assert guard.armor_class.value == 9
    assert guard.attack.ranged.value == -1
    assert guard.reflex.value == -1
Esempio n. 12
0
def test_adding_chainmail():
    guard = ActorBuilder().build()
    guard.dexterity.value = 12
    guard.add_component(ChainMail())
    assert guard.armor_class.value == 16
Esempio n. 13
0
def test_adding_shield():
    guard = ActorBuilder().build()
    guard.add_component(LightSteelShield())
    assert guard.armor_class.value == 11