2018-03-09 05:18:32 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Trade Encounter data with a fixed PID.
|
|
|
|
|
/// </summary>
|
2018-12-30 06:24:34 +00:00
|
|
|
|
public sealed class EncounterTradePID : EncounterTrade
|
2018-03-09 05:18:32 +00:00
|
|
|
|
{
|
2019-09-10 07:21:51 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fixed <see cref="PKM.PID"/> value the encounter must have.
|
|
|
|
|
/// </summary>
|
2018-03-09 05:18:32 +00:00
|
|
|
|
public uint PID;
|
2019-09-10 07:21:51 +00:00
|
|
|
|
|
2018-03-17 02:35:55 +00:00
|
|
|
|
public override Shiny Shiny { get; set; } = Shiny.FixedValue;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2019-11-16 01:34:18 +00:00
|
|
|
|
|
|
|
|
|
protected override bool IsMatchNatureGenderShiny(PKM pkm)
|
|
|
|
|
{
|
|
|
|
|
if (pkm.PID != pkm.EncryptionConstant)
|
|
|
|
|
return false;
|
|
|
|
|
if (Nature != Nature.Random && (int)Nature != pkm.Nature) // gen5 BW only
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2018-03-09 05:18:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|