mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Fix honeytree RNG frame matching
See EncounterSlotDumper for associated change (forgot to retain SlotType)
This commit is contained in:
parent
0a9fbfc8c3
commit
8c93fd1cbd
6 changed files with 10 additions and 4 deletions
|
@ -9,7 +9,7 @@ namespace PKHeX.Core;
|
|||
public abstract record EncounterArea(GameVersion Version) : IVersion
|
||||
{
|
||||
public int Location { get; protected init; }
|
||||
public SlotType Type { get; protected init; } = SlotType.Any;
|
||||
public SlotType Type { get; protected init; }
|
||||
protected abstract IReadOnlyList<EncounterSlot> Raw { get; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
using System.Diagnostics;
|
||||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an RNG seed and the conditions of which it occurs.
|
||||
/// </summary>
|
||||
[DebuggerDisplay($"{{{nameof(FrameType)},nq}}[{{{nameof(Lead)},nq}}]")]
|
||||
public sealed class Frame
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -45,7 +48,7 @@ public sealed class Frame
|
|||
/// <returns>Slot number for this frame & lead value.</returns>
|
||||
public bool IsSlotCompatibile<T>(T slot, PKM pk) where T : EncounterSlot, IMagnetStatic, INumberedSlot, ISlotRNGType
|
||||
{
|
||||
if (FrameType != FrameType.MethodH) // gen3 always does level rand
|
||||
if (FrameType != FrameType.MethodH && slot.Type is not (SlotType.HoneyTree or SlotType.BugContest)) // gen3 always does level rand
|
||||
{
|
||||
bool hasLevelCall = slot.IsRandomLevel;
|
||||
if (Lead.NeedsLevelCall() != hasLevelCall)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Linq;
|
||||
using System.Linq;
|
||||
using static PKHeX.Core.SlotType;
|
||||
|
||||
namespace PKHeX.Core;
|
||||
|
@ -122,7 +122,10 @@ public static class SlotRange
|
|||
public static bool GetIsEncounterable<T>(T slot, FrameType frameType, int rand, LeadRequired lead) where T : ISlotRNGType
|
||||
#pragma warning restore IDE0060, RCS1163 // Unused parameter.
|
||||
{
|
||||
if (slot.Type.IsSweetScentType())
|
||||
var type = slot.Type;
|
||||
if (type.IsSweetScentType())
|
||||
return true;
|
||||
if (type is HoneyTree)
|
||||
return true;
|
||||
return true; // todo
|
||||
//return GetCanEncounter(slot, frameType, rand, lead);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue