mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-14 00:25:15 -05:00
RSE: prefer swarm match
special moves and hard to verify vblanks, just prefer the special move source first. I guess it's also the more statistically likely (players using swarms to catch the species that are much less common otherwise?)
This commit is contained in:
@@ -49,8 +49,8 @@ private enum YieldState : byte
|
||||
StartCaptures,
|
||||
|
||||
SlotStart,
|
||||
SlotR,
|
||||
SlotS,
|
||||
SlotR,
|
||||
SlotE,
|
||||
SwarmRSE,
|
||||
SlotFR,
|
||||
@@ -74,6 +74,7 @@ private enum YieldState : byte
|
||||
|
||||
public bool MoveNext()
|
||||
{
|
||||
top:
|
||||
switch (State)
|
||||
{
|
||||
case YieldState.Start:
|
||||
@@ -145,33 +146,32 @@ public bool MoveNext()
|
||||
case YieldState.SlotStart:
|
||||
if (!EncounterStateUtil.CanBeWildEncounter(Entity))
|
||||
goto case YieldState.SlotEnd;
|
||||
if (Version == GameVersion.R)
|
||||
{ State = YieldState.SlotR; goto case YieldState.SlotR; }
|
||||
if (Version == GameVersion.S)
|
||||
{ State = YieldState.SlotS; goto case YieldState.SlotS; }
|
||||
if (Version == GameVersion.E)
|
||||
{ State = YieldState.SlotE; goto case YieldState.SlotE; }
|
||||
if (Version == GameVersion.FR)
|
||||
{ State = YieldState.SlotFR; goto case YieldState.SlotFR; }
|
||||
if (Version == GameVersion.LG)
|
||||
{ State = YieldState.SlotLG; goto case YieldState.SlotLG; }
|
||||
throw new ArgumentOutOfRangeException(nameof(Version));
|
||||
if (Version is not (GameVersion.R or GameVersion.S or GameVersion.E))
|
||||
throw new ArgumentOutOfRangeException(nameof(Version));
|
||||
State = YieldState.SwarmRSE; goto case YieldState.SwarmRSE;
|
||||
|
||||
case YieldState.SwarmRSE:
|
||||
// Aggressively check for Swarm (special move), only one match possible. Next loop will reach regular slots.
|
||||
// higher priority due to having special move, and poor vblank matching deferral tiebreaks
|
||||
if (TryGetNext<EncounterArea3, EncounterSlot3>(Encounters3RSE.SlotsSwarmRSE))
|
||||
return true;
|
||||
Index = 0; State = YieldState.SlotS + (byte)((byte)Version - 1); Index = 0; goto top;
|
||||
|
||||
case YieldState.SlotR:
|
||||
if (TryGetNext<EncounterArea3, EncounterSlot3>(Encounters3RSE.SlotsR))
|
||||
return true;
|
||||
Index = 0; State = YieldState.SwarmRSE; goto case YieldState.SwarmRSE;
|
||||
Index = 0; goto case YieldState.SlotEnd;
|
||||
case YieldState.SlotS:
|
||||
if (TryGetNext<EncounterArea3, EncounterSlot3>(Encounters3RSE.SlotsS))
|
||||
return true;
|
||||
Index = 0; State = YieldState.SwarmRSE; goto case YieldState.SwarmRSE;
|
||||
Index = 0; goto case YieldState.SlotEnd;
|
||||
case YieldState.SlotE:
|
||||
if (TryGetNext<EncounterArea3, EncounterSlot3>(Encounters3RSE.SlotsE))
|
||||
return true;
|
||||
Index = 0; State = YieldState.SwarmRSE; goto case YieldState.SwarmRSE;
|
||||
case YieldState.SwarmRSE:
|
||||
if (TryGetNext<EncounterArea3, EncounterSlot3>(Encounters3RSE.SlotsSwarmRSE))
|
||||
return true;
|
||||
Index = 0; goto case YieldState.SlotEnd;
|
||||
|
||||
case YieldState.SlotFR:
|
||||
|
||||
@@ -37,8 +37,7 @@ private void InitializeBindings()
|
||||
var handlers = SaveUtil.Handlers.ToList();
|
||||
handlers.Insert(0, new SaveHandlerDefault());
|
||||
CB_Handler.DataSource = handlers
|
||||
.Select(z => new HandlerItem(GetHandlerDisplayName(z), z))
|
||||
.ToList();
|
||||
.ConvertAll(z => new HandlerItem(GetHandlerDisplayName(z), z));
|
||||
|
||||
UpdateSubVersionChoices();
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user