mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
In addition to the Method 1 (and other sibling PIDIV types) correlation, an encounter can only be triggered if the calls prior land on the Method {1} seed. The RNG community has dubbed these patterns as "Method J" (D/P/Pt), "Method K" (HG/SS), and "Method H" (Gen3, coined by yours truly). The basic gist of these is that they are pre-requisites, like the Shadow locks of Colosseum/XD. Rename/re-type a bunch of properties to get the codebase more in line with correct property names & more obvious underlying types.
52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Simple record containing trainer data
|
|
/// </summary>
|
|
public sealed record SimpleTrainerInfo : ITrainerInfo, IRegionOrigin
|
|
{
|
|
public string OT { get; set; } = "PKHeX";
|
|
public ushort TID16 { get; set; } = 12345;
|
|
public ushort SID16 { get; set; } = 54321;
|
|
public byte Gender { get; set; }
|
|
public int Language { get; set; } = (int)LanguageID.English;
|
|
public uint ID32 { get => (uint)(TID16 | (SID16 << 16)); set => (TID16, SID16) = ((ushort)value, (ushort)(value >> 16)); }
|
|
public TrainerIDFormat TrainerIDDisplayFormat => this.GetTrainerIDFormat();
|
|
|
|
// IRegionOrigin for generation 6/7
|
|
public byte ConsoleRegion { get; set; } = 1; // North America
|
|
public byte Region { get; set; } = 7; // California
|
|
public byte Country { get; set; } = 49; // USA
|
|
|
|
public GameVersion Version { get; }
|
|
public byte Generation { get; init; } = PKX.Generation;
|
|
public EntityContext Context { get; init; } = PKX.Context;
|
|
|
|
public SimpleTrainerInfo(GameVersion game = PKX.Version)
|
|
{
|
|
Version = game;
|
|
SanityCheckRegionOrigin(game);
|
|
}
|
|
|
|
private void SanityCheckRegionOrigin(GameVersion game)
|
|
{
|
|
if (GameVersion.Gen7b.Contains(game) || game.GetGeneration() >= 8)
|
|
this.ClearRegionOrigin();
|
|
}
|
|
|
|
public SimpleTrainerInfo(ITrainerInfo other) : this(other.Version)
|
|
{
|
|
OT = other.OT;
|
|
TID16 = other.TID16;
|
|
SID16 = other.SID16;
|
|
Gender = other.Gender;
|
|
Language = other.Language;
|
|
Generation = other.Generation;
|
|
Context = other.Context;
|
|
|
|
if (other is IRegionOrigin r)
|
|
r.CopyRegionOrigin(this);
|
|
|
|
SanityCheckRegionOrigin(Version);
|
|
}
|
|
}
|