Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert change that prevented EV Train mode from ever rotating #628

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions modules/modes/ev_train.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Generator, Optional, TYPE_CHECKING
from typing import Generator

from rich.table import Table

Expand All @@ -12,15 +12,12 @@
from ._interface import BotMode, BotModeError
from .util import navigate_to, heal_in_pokemon_center, spin
from .util.map import map_has_pokemon_center_nearby, find_closest_pokemon_center
from ..battle_state import BattleOutcome, BattleState
from ..battle_strategies import BattleStrategy, DefaultBattleStrategy, BattleStrategyUtil
from ..battle_state import BattleOutcome
from ..battle_strategies import BattleStrategy, DefaultBattleStrategy
from ..console import console
from ..encounter import handle_encounter, EncounterInfo
from ..gui.ev_selection_window import ask_for_ev_targets

if TYPE_CHECKING:
from modules.battle_strategies import TurnAction

_list_of_stats = ("hp", "attack", "defence", "special_attack", "special_defence", "speed")


Expand Down Expand Up @@ -84,14 +81,6 @@ class NoRotateLeadDefaultBattleStrategy(DefaultBattleStrategy):
def choose_new_lead_after_battle(self) -> int | None:
return None

def _handle_lead_cannot_battle(
self, battle_state: BattleState, util: BattleStrategyUtil, reason: str
) -> tuple["TurnAction", Optional[any]]:
# Never try to rotate into another Pokémon as that might mess up their EVs.
# Instead, always attempt to escape if the lead Pokémon is no longer able to
# battle.
return super()._handle_flee(battle_state, util, reason)


class EVTrainMode(BotMode):
@staticmethod
Expand Down
10 changes: 7 additions & 3 deletions wiki/pages/Mode - EV Train.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

# 💊 EV Train Mode

This mode will continuously fight battles in order to EV Train your lead Pokémon. It
will not rotate the lead Pokémon regardless of configuration, so that none of your
other party members' EVs are messed up.
This mode will continuously fight battles in order to EV Train your lead Pokémon.
If the lead is unable to battle, the mode will swap to another mon in the party if
that is enabled in the profile battle settings (see
[⚔ Battling and Pickup config](Configuration%20-%20Battling%20and%20Pickup.md)).
This is useful for training weak mons, but keep in mind it will alter the EVs of
the mon switched to. The mode only tracks the lead's EVs and does not switch the
lead outside of battle.

When the active Pokémon is defeated or gets low on HP, it will heal at the nearest
Pokémon Center automatically. Likewise, if your entire party gets defeated it will
Expand Down
Loading