Fix level-up evolution without a level restriction

This commit is contained in:
Petr Viktorin 2011-05-04 20:47:59 +03:00
parent 731a172854
commit f65d8bb062

View file

@ -1196,6 +1196,10 @@ class PokemonNode(Node, Facade, namedtuple('PokemonNode',
cost += search.costs['evolution-delayed'] cost += search.costs['evolution-delayed']
else: else:
cost += search.costs['evolution-delayed'] cost += search.costs['evolution-delayed']
elif trigger == 'level-up':
# Have to gain a level
kwargs['level'] = self.level + 1
kwargs['new_level'] = True
if trigger in 'level-up use-item'.split(): if trigger in 'level-up use-item'.split():
pass pass
elif trigger == 'trade': elif trigger == 'trade':
@ -1354,7 +1358,7 @@ class BaseBreedNode(Node):
action = BreedAction(self.search, baby, all_bred_moves) action = BreedAction(self.search, baby, all_bred_moves)
node = PokemonNode(search=self.search, pokemon_=baby, node = PokemonNode(search=self.search, pokemon_=baby,
level=hatch_level, version_group_=vg, level=hatch_level, version_group_=vg,
moves_=all_bred_moves, new_level=True) moves_=all_bred_moves, new_level=False)
yield 0, action, node yield 0, action, node
def is_goal(self): def is_goal(self):