Restrict transfers to HoF team and prevent blocking starter route
Transfer modal now only appears when a Hall of Fame team is selected, using the existing hofTeam data instead of the survivors endpoint. Without a HoF selection, advance proceeds directly with no transfer step. Transferred encounters are now a separate category: they appear in their own "Transferred Pokemon" section, don't occupy route slots in the encounter map, and don't block the route-lock check (excluded via genlocke_transfers subquery). The run detail endpoint returns transferEncounterIds so the frontend can distinguish them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ from sqlalchemy.orm import joinedload, selectinload
|
||||
from app.core.database import get_session
|
||||
from app.models.encounter import Encounter
|
||||
from app.models.evolution import Evolution
|
||||
from app.models.genlocke_transfer import GenlockeTransfer
|
||||
from app.models.genlocke import GenlockeLeg
|
||||
from app.models.nuzlocke_run import NuzlockeRun
|
||||
from app.models.pokemon import Pokemon
|
||||
@@ -85,11 +86,14 @@ async def create_encounter(
|
||||
sibling_ids = [s.id for s in siblings]
|
||||
|
||||
# Check if any relevant sibling already has an encounter in this run
|
||||
# Exclude transfer-target encounters so they don't block the starter
|
||||
transfer_target_ids = select(GenlockeTransfer.target_encounter_id)
|
||||
existing_encounter = await session.execute(
|
||||
select(Encounter)
|
||||
.where(
|
||||
Encounter.run_id == run_id,
|
||||
Encounter.route_id.in_(sibling_ids),
|
||||
~Encounter.id.in_(transfer_target_ids),
|
||||
)
|
||||
)
|
||||
if existing_encounter.scalar_one_or_none() is not None:
|
||||
|
||||
Reference in New Issue
Block a user