Ejemplo n.º 1
0
def neuroforce(attacking_move, attacking_pokemon, defending_pokemon,
               first_move, weather):
    if is_super_effective(attacking_move[constants.TYPE],
                          defending_pokemon.types):
        attacking_move = attacking_move.copy()
        attacking_move[constants.BASE_POWER] *= 1.25
    return attacking_move
def weaknesspolicy(attacking_move, attacking_pokemon, defending_pokemon):
    if attacking_move[
            constants.
            CATEGORY] in constants.DAMAGING_CATEGORIES and is_super_effective(
                attacking_move[constants.TYPE], defending_pokemon.types):
        attacking_move = attacking_move.copy()
        attacking_move[constants.BOOSTS] = {
            constants.ATTACK: 2,
            constants.SPECIAL_ATTACK: 2,
        }
    return attacking_move
Ejemplo n.º 3
0
def evaluate_matchup(user_pkmn, opponent_pkmn):
    score = 0

    if user_pkmn.hp <= 0 or opponent_pkmn.hp <= 0:
        return score

    if user_pkmn.speed > opponent_pkmn.speed:
        score += Scoring.FASTER_POKEMON_IN_MATCHUP
    elif user_pkmn.speed < opponent_pkmn.speed:
        score -= Scoring.FASTER_POKEMON_IN_MATCHUP

    # positive bonus for the bot's type being super effective against the opponent
    for user_type in user_pkmn.types:
        if is_super_effective(user_type, opponent_pkmn.types):
            score += Scoring.WEAK_TO_OPPONENT_TYPE

    # negative bonus for the opponent's type being super effective against the bot's
    for opponent_type in opponent_pkmn.types:
        if is_super_effective(opponent_type, user_pkmn.types):
            score -= Scoring.WEAK_TO_OPPONENT_TYPE

    return score
Ejemplo n.º 4
0
def wonderguard(attacking_move, attacking_pokemon, defending_pokemon):
    if not is_super_effective(attacking_move[constants.TYPE],
                              defending_pokemon.types):
        attacking_move = attacking_move.copy()
        attacking_move[constants.BASE_POWER] = 0
    return attacking_move
Ejemplo n.º 5
0
def solidrock(attacking_move, attacking_pokemon, defending_pokemon):
    if is_super_effective(attacking_move[constants.TYPE],
                          defending_pokemon.types):
        attacking_move = attacking_move.copy()
        attacking_move[constants.BASE_POWER] *= (3 / 4)
    return attacking_move
def expertbelt(attacking_move, attacking_pokemon, defending_pokemon):
    if is_super_effective(attacking_move[constants.TYPE],
                          defending_pokemon.types):
        attacking_move = attacking_move.copy()
        attacking_move[constants.BASE_POWER] *= 1.2
    return attacking_move