

def _get_battle_target(self):
    if (self in self.battle.teamA):
        other_team = self.battle.teamB
    else:
        other_team = self.battle.teamA
    if self._battle_target:
        if (not (self._battle_target in other_team)):
            self._battle_target = other_team[0]
        self.world.log.debug(('%s attack target: %s' % (self.fancy_name(), self._battle_target.fancy_name())))
        return self._battle_target

dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/models/character.py Character._get_battle_target/original