PKHeX/PKHeX.Core/Legality/Encounters/EncounterTradePID.cs
Kurt e79f46673c Refactoring iencounterable->pkm
SetPINGA{S}(pk, criteria) -> pid,iv, nature, gender, ability (stats
future?)
memes aside, this is where criteria data is forced

Split N encounterstatic (has fixed PID and special flag) from
EncounterStaticPID
2019-02-09 11:37:20 -08:00

25 lines
No EOL
727 B
C#

namespace PKHeX.Core
{
/// <summary>
/// Trade Encounter data with a fixed PID.
/// </summary>
public sealed class EncounterTradePID : EncounterTrade
{
public uint PID;
public override Shiny Shiny { get; set; } = Shiny.FixedValue;
protected override void SetPINGA(PKM pk, EncounterCriteria criteria)
{
int gender = criteria.GetGender(PKX.GetGenderFromPID(Species, PID), pk.PersonalInfo);
int nature = (int)criteria.GetNature(Nature);
int ability = Ability >> 1;
pk.PID = PID;
pk.Nature = nature;
pk.Gender = gender;
pk.RefreshAbility(ability);
SetIVs(pk);
}
}
}