Ejemplo n.º 1
0
def test_speed_paralyze():
    """
    Test paralysis speed drop.

    Paralyzed speed = 1/2 * normal speed
    """
    exploud = Pokemon(name="exploud", moves=["tackle"])
    exploud_par = Pokemon(name="exploud", moves=["tackle"])
    exploud_par.status = PAR_STATUS

    assert exploud.speed == exploud_par.speed
    assert floor(exploud.effective_stat("spe") / 2) ==\
        exploud_par.effective_stat("spe")
Ejemplo n.º 2
0
def test_attack_burn():
    """
    Test that the attack drop happens on burn.

    Burned attack = 1/2 * normal attack
    """
    exploud = Pokemon(name="exploud", moves=["tackle"])
    exploud_brn = Pokemon(name="exploud", moves=["tackle"])
    exploud_brn.status = BRN_STATUS

    assert exploud.attack == exploud_brn.attack
    assert floor(exploud.effective_stat("atk") / 2) ==\
        exploud_brn.effective_stat("atk")
Ejemplo n.º 3
0
def test_effective_stats():
    """Test that stat boosts are calculated effectively."""
    pkmn1 = Pokemon(name="spinda", moves=["tackle"], level=50)

    # Positive boosts
    pkmn1.boosts["atk"] = 1
    assert pkmn1.effective_stat("atk") == 80 * 1.5
    pkmn1.boosts["atk"] = 6
    assert pkmn1.effective_stat("atk") == 80 * 4

    pkmn1.boosts["atk"] = -1
    assert pkmn1.effective_stat("atk") == int(80 * 2 / 3)
    pkmn1.boosts["atk"] = -6
    assert pkmn1.effective_stat("atk") == 80 * 2 / 8