Shedinja fixes

This commit is contained in:
Petr Viktorin 2011-04-27 18:49:02 +03:00
parent 5fb0eed9dc
commit d99d9219d2

View file

@ -1124,6 +1124,7 @@ class PokemonNode(Node, Facade, namedtuple('PokemonNode',
if level: if level:
if level > self.level: if level > self.level:
kwargs['level'] = level kwargs['level'] = level
cost += search.costs['per-level'] * (level - self.level)
kwargs['new_level'] = True kwargs['new_level'] = True
elif level == self.level: elif level == self.level:
if self.new_level: if self.new_level:
@ -1156,6 +1157,8 @@ class PokemonNode(Node, Facade, namedtuple('PokemonNode',
shed_kwargs = dict(kwargs) shed_kwargs = dict(kwargs)
shed_kwargs['level'] = new_level shed_kwargs['level'] = new_level
for shed_moves in powerset(moves): for shed_moves in powerset(moves):
if not shed_moves:
continue
shed_kwargs['moves_'] = new_moves = self.moves_.union(shed_moves) shed_kwargs['moves_'] = new_moves = self.moves_.union(shed_moves)
yield cost, ShedEvolutionAction(search, child, trigger, new_moves), self._replace( yield cost, ShedEvolutionAction(search, child, trigger, new_moves), self._replace(
**shed_kwargs) **shed_kwargs)