コード例 #1
0
ファイル: battle.py プロジェクト: popopop1279/showdown
 def update_moves_for_random_battles(self):
     if len(self.moves) == 4:
         logger.debug("{} revealed 4 moves: {}".format(
             self.name, self.moves))
         return
     additional_moves = get_all_possible_moves_for_random_battle(
         self.name, [m.name for m in self.moves])
     logger.debug("Guessing additional moves for {}: {}".format(
         self.name, additional_moves))
     for m in additional_moves:
         self.moves.append(Move(m))
コード例 #2
0
ファイル: battle.py プロジェクト: dgauraang/RLPokemonShowdown
    def get_possible_moves(self, moves, battle_type=constants.STANDARD_BATTLE):
        if battle_type == constants.RANDOM_BATTLE:
            known_move_names = [m.name for m in self.moves]
            return [], get_all_possible_moves_for_random_battle(
                self.name, known_move_names)

        moves_remaining = 4 - len(self.moves)
        expected_moves = list()
        chance_moves = list()

        for m in moves:
            if moves_remaining == 0:
                break
            elif m[1] > 60 and self.get_move(m[0]) is None:
                expected_moves.append(m[0])
                moves_remaining -= 1
            elif m[1] > 20 and self.get_move(m[0]) is None:
                chance_moves.append(m[0])

        return expected_moves, chance_moves