PKHeX/PKHeX.Core/Legality/Encounters/EncounterTradePID.cs
Kurt 62d08d7c30 Misc clean
split some methods with optional parameters=null
add more xmldoc
replace some magic numbers -> enum/const references
consolidate common array operations (span soon maybe?)
2019-09-10 00:21:51 -07:00

29 lines
No EOL
844 B
C#

namespace PKHeX.Core
{
/// <summary>
/// Trade Encounter data with a fixed PID.
/// </summary>
public sealed class EncounterTradePID : EncounterTrade
{
/// <summary>
/// Fixed <see cref="PKM.PID"/> value the encounter must have.
/// </summary>
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);
}
}
}