2018-03-09 05:18:32 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2020-11-27 19:51:02 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generation 5 Static Encounter from N
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <inheritdoc cref="EncounterStatic"/>
|
2020-12-24 04:40:59 +00:00
|
|
|
|
internal sealed record EncounterStatic5N : EncounterStatic5
|
2018-03-09 05:18:32 +00:00
|
|
|
|
{
|
2020-01-25 20:31:56 +00:00
|
|
|
|
public readonly uint PID;
|
2020-08-21 23:35:49 +00:00
|
|
|
|
public const bool NSparkle = true;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
|
2021-01-04 00:49:49 +00:00
|
|
|
|
internal EncounterStatic5N(uint pid) : base(GameVersion.B2W2)
|
2020-10-12 18:04:29 +00:00
|
|
|
|
{
|
|
|
|
|
Shiny = Shiny.FixedValue;
|
|
|
|
|
PID = pid;
|
|
|
|
|
}
|
2020-01-25 20:31:56 +00:00
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
protected override void SetPINGA(PKM pk, EncounterCriteria criteria)
|
2019-02-09 19:37:20 +00:00
|
|
|
|
{
|
|
|
|
|
int gender = criteria.GetGender(PKX.GetGenderFromPID(Species, PID), pk.PersonalInfo);
|
2020-09-04 02:00:46 +00:00
|
|
|
|
int nature = (int)Nature;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
int ability = Ability;
|
|
|
|
|
|
|
|
|
|
pk.PID = PID;
|
|
|
|
|
pk.Gender = gender;
|
|
|
|
|
SetIVs(pk);
|
|
|
|
|
|
2020-09-04 02:00:46 +00:00
|
|
|
|
pk.Nature = nature;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.RefreshAbility(ability >> 1);
|
|
|
|
|
}
|
2019-11-16 01:34:18 +00:00
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
public override bool IsMatch(PKM pkm, DexLevel evo)
|
2019-11-16 01:34:18 +00:00
|
|
|
|
{
|
|
|
|
|
if (PID != pkm.PID)
|
|
|
|
|
return false;
|
2020-08-21 23:35:49 +00:00
|
|
|
|
return base.IsMatch(pkm, evo);
|
2019-11-16 01:34:18 +00:00
|
|
|
|
}
|
2019-02-09 19:37:20 +00:00
|
|
|
|
|
2020-09-13 21:40:10 +00:00
|
|
|
|
protected override void ApplyDetails(ITrainerInfo sav, EncounterCriteria criteria, PKM pk)
|
|
|
|
|
{
|
|
|
|
|
base.ApplyDetails(sav, criteria, pk);
|
|
|
|
|
SetNPokemonData((PK5)pk, pk.Language);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void SetNPokemonData(PK5 pk5, int lang)
|
2019-02-09 19:37:20 +00:00
|
|
|
|
{
|
|
|
|
|
pk5.IV_HP = pk5.IV_ATK = pk5.IV_DEF = pk5.IV_SPA = pk5.IV_SPD = pk5.IV_SPE = 30;
|
|
|
|
|
pk5.NPokémon = NSparkle;
|
2020-10-07 03:09:14 +00:00
|
|
|
|
pk5.OT_Name = GetOT(lang);
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk5.TID = 00002;
|
|
|
|
|
pk5.SID = 00000;
|
|
|
|
|
}
|
2020-10-07 03:09:14 +00:00
|
|
|
|
|
|
|
|
|
public static string GetOT(int lang) => lang == (int)LanguageID.Japanese ? "N" : "N";
|
2018-03-09 05:18:32 +00:00
|
|
|
|
}
|
2020-10-07 03:09:14 +00:00
|
|
|
|
}
|