2018-03-09 05:18:32 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2019-02-09 19:37:20 +00:00
|
|
|
|
internal class EncounterStaticPID : EncounterStatic
|
2018-03-09 05:18:32 +00:00
|
|
|
|
{
|
2020-01-25 20:31:56 +00:00
|
|
|
|
public readonly uint PID;
|
2019-10-04 22:56:22 +00:00
|
|
|
|
public sealed override Shiny Shiny { get; set; } = Shiny.FixedValue;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
|
2020-01-25 20:31:56 +00:00
|
|
|
|
internal EncounterStaticPID(uint pid) => PID = pid;
|
|
|
|
|
|
2019-10-04 22:56:22 +00:00
|
|
|
|
protected sealed 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);
|
|
|
|
|
int nature = (int)(PID % 25);
|
|
|
|
|
int ability = Ability;
|
|
|
|
|
|
|
|
|
|
pk.PID = PID;
|
|
|
|
|
pk.Gender = gender;
|
|
|
|
|
SetIVs(pk);
|
|
|
|
|
|
|
|
|
|
if (Generation >= 5)
|
|
|
|
|
pk.Nature = nature;
|
|
|
|
|
pk.RefreshAbility(ability >> 1);
|
|
|
|
|
}
|
2019-11-16 01:34:18 +00:00
|
|
|
|
|
|
|
|
|
public override bool IsMatch(PKM pkm, int lvl)
|
|
|
|
|
{
|
|
|
|
|
if (PID != pkm.PID)
|
|
|
|
|
return false;
|
|
|
|
|
return base.IsMatch(pkm, lvl);
|
|
|
|
|
}
|
2019-02-09 19:37:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-01-25 20:31:56 +00:00
|
|
|
|
internal sealed class EncounterStatic5N : EncounterStaticPID
|
2019-02-09 19:37:20 +00:00
|
|
|
|
{
|
2020-01-25 20:31:56 +00:00
|
|
|
|
public const bool NSparkle = true;
|
|
|
|
|
|
|
|
|
|
public EncounterStatic5N(uint pid) : base(pid) { }
|
2019-02-09 19:37:20 +00:00
|
|
|
|
|
|
|
|
|
internal void SetNPokemonData(PK5 pk5, int lang)
|
|
|
|
|
{
|
|
|
|
|
pk5.IV_HP = pk5.IV_ATK = pk5.IV_DEF = pk5.IV_SPA = pk5.IV_SPD = pk5.IV_SPE = 30;
|
|
|
|
|
pk5.NPokémon = NSparkle;
|
|
|
|
|
pk5.OT_Name = Legal.GetG5OT_NSparkle(lang);
|
|
|
|
|
pk5.TID = 00002;
|
|
|
|
|
pk5.SID = 00000;
|
|
|
|
|
}
|
2018-03-09 05:18:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|