Minor clean

Adds IEncounter9a to WA9 for extra metadata fetch
This commit is contained in:
Kurt 2025-11-15 22:25:33 -06:00
parent 9f21f45f25
commit 5113e5e641
3 changed files with 12 additions and 10 deletions

View File

@ -5,7 +5,7 @@ namespace PKHeX.Core;
/// <summary>
/// Details about the original encounter.
/// </summary>
/// <param name="Species">Species the encounter originated as</param>
/// <param name="Species">Most-evolved species the encounter originated as</param>
/// <param name="Context">Context the encounter originated in</param>
/// <param name="Generation">Generation the encounter originated in</param>
/// <param name="LevelMin">Minimum level the encounter originated at</param>

View File

@ -8,7 +8,7 @@ namespace PKHeX.Core;
/// Generation 9 Mystery Gift Template File
/// </summary>
public sealed class WA9(Memory<byte> raw) : DataMysteryGift(raw), ILangNick, INature, IAlpha, IRibbonIndex, IMemoryOT,
ILangNicknamedTemplate, IEncounterServerDate, IRelearn, IMetLevel, ISeedCorrelation64<PKM>,
ILangNicknamedTemplate, IEncounterServerDate, IRelearn, IMetLevel, IEncounter9a,
IRibbonSetEvent3, IRibbonSetEvent4, IRibbonSetCommon3, IRibbonSetCommon4, IRibbonSetCommon6, IRibbonSetCommon7,
IRibbonSetCommon8, IRibbonSetMark8, IRibbonSetCommon9, IRibbonSetMark9, IEncounterMarkExtra
{
@ -836,12 +836,13 @@ public bool IsMissingExtraMark(PKM pk, out RibbonIndex missing)
? SeedCorrelationResult.Success
: SeedCorrelationResult.Invalid;
private GenerateParam9a GetParams(PersonalInfo9ZA pi)
public LumioseCorrelation Correlation => LumioseCorrelation.SkipTrainer;
public byte FlawlessIVCount => GetFlawlessIVCount(IV_HP);
public GenerateParam9a GetParams(PersonalInfo9ZA pi)
{
const LumioseCorrelation correlation = LumioseCorrelation.SkipTrainer;
const byte rollCount = 1;
var hp = IV_HP;
var flawless = GetFlawlessIVCount(hp);
var ivs = new IndividualValueSet((sbyte)hp, (sbyte)IV_ATK, (sbyte)IV_DEF, (sbyte)IV_SPE, (sbyte)IV_SPA, (sbyte)IV_SPD);
var sizeType = Scale == 256 ? SizeType9.RANDOM : SizeType9.VALUE;
var gender = Gender switch
@ -851,7 +852,7 @@ private GenerateParam9a GetParams(PersonalInfo9ZA pi)
2 => PersonalInfo.RatioMagicGenderless,
_ => pi.Gender,
};
return new GenerateParam9a(gender, flawless, rollCount, correlation, sizeType, (byte)Scale, Nature, Ability, Shiny, ivs);
return new GenerateParam9a(gender, FlawlessIVCount, rollCount, Correlation, sizeType, (byte)Scale, Nature, Ability, Shiny, ivs);
}
private static byte GetFlawlessIVCount(int hp)

View File

@ -7,7 +7,7 @@ namespace PKHeX.WinForms;
public sealed partial class SAV_Fashion9 : Form
{
private readonly IFashionBlockEditor[] _grids = [];
private readonly IFashionBlockEditor[] _grids;
private readonly SaveFile SAV;
private readonly SaveFile Origin;
@ -28,7 +28,8 @@ private SAV_Fashion9(SaveFile sav)
TC_Features.Multiline = true;
// Create grids for each block
if (SAV is SAV9SV sav9sv) {
if (SAV is SAV9SV sav9sv)
{
var accessor = sav9sv.Blocks;
_grids =
[
@ -43,7 +44,8 @@ private SAV_Fashion9(SaveFile sav)
];
B_SetAllOwned.Visible = false;
} else if (SAV is SAV9ZA sav9ZA)
}
else if (SAV is SAV9ZA sav9ZA)
{
var accessor = sav9ZA.Blocks;
_grids =
@ -81,7 +83,6 @@ private SAV_Fashion9(SaveFile sav)
throw new ArgumentException("Invalid SaveFile Type");
}
// Translate headings
WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);