Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdawg1989 committed Jun 16, 2024
1 parent b39dd30 commit 35ef98b
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions SysBot.Pokemon/SV/BotRaid/RotatingRaidBotSV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3186,7 +3186,15 @@ private async Task ProcessAllRaids(CancellationToken token)
var allRewards = container.Rewards;
uint denHexSeedUInt;
denHexSeedUInt = uint.Parse(denHexSeed, NumberStyles.AllowHexSpecifier);
await FindSeedIndexInRaids(denHexSeedUInt, token);
bool seedFound = await FindSeedIndexInRaids(denHexSeedUInt, token);

if (!seedFound)
{
Log($"Seed {denHexSeedUInt:X8} not found in any region. Stopping processing and refreshing the map.");
shouldRefreshMap = true;
return;
}

var raidInfoList = await ExtractPaldeaRaidInfo(token);
bool newEventSpeciesFound = false;
var (distGroupIDs, mightGroupIDs) = GetPossibleGroups(container);
Expand Down Expand Up @@ -3418,7 +3426,7 @@ private async Task ProcessAllRaids(CancellationToken token)
}
}

private async Task FindSeedIndexInRaids(uint denHexSeedUInt, CancellationToken token)
private async Task<bool> FindSeedIndexInRaids(uint denHexSeedUInt, CancellationToken token)
{
var upperBound = KitakamiDensCount == 25 ? 94 : 95;
var startIndex = KitakamiDensCount == 25 ? 94 : 95;
Expand All @@ -3431,7 +3439,7 @@ private async Task FindSeedIndexInRaids(uint denHexSeedUInt, CancellationToken t
if (seed == denHexSeedUInt)
{
SeedIndexToReplace = i;
return;
return true;
}
}

Expand All @@ -3443,7 +3451,7 @@ private async Task FindSeedIndexInRaids(uint denHexSeedUInt, CancellationToken t
if (seed == denHexSeedUInt)
{
SeedIndexToReplace = i + 69;
return;
return true;
}
}

Expand All @@ -3455,12 +3463,11 @@ private async Task FindSeedIndexInRaids(uint denHexSeedUInt, CancellationToken t
if (seed == denHexSeedUInt)
{
SeedIndexToReplace = i - 1;
return;
return true;
}
}
Log($"Seed {denHexSeedUInt:X8} not found in any region.");
await CloseGame(Hub.Config, token).ConfigureAwait(false);
await StartGameRaid(Hub.Config, token).ConfigureAwait(false);

return false;
}

public static (PK9, Embed) RaidInfoCommand(string seedValue, int contentType, TeraRaidMapParent map, int storyProgressLevel, int raidDeliveryGroupID, List<string> rewardsToShow, bool moveTypeEmojis, List<MoveTypeEmojiInfo> customTypeEmojis, int queuePosition = 0, bool isEvent = false)
Expand Down

0 comments on commit 35ef98b

Please sign in to comment.