2020-08-21 23:35:49 +00:00
|
|
|
namespace PKHeX.Core
|
|
|
|
{
|
2020-11-27 19:51:02 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Encounter Slot found in <see cref="GameVersion.XD"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <inheritdoc cref="EncounterSlot"/>
|
2020-12-24 04:40:59 +00:00
|
|
|
public sealed record EncounterSlot3PokeSpot : EncounterSlot, INumberedSlot
|
2020-08-21 23:35:49 +00:00
|
|
|
{
|
|
|
|
public override int Generation => 3;
|
|
|
|
|
2020-11-27 19:51:02 +00:00
|
|
|
public int SlotNumber { get; }
|
2020-08-21 23:35:49 +00:00
|
|
|
|
2021-01-01 18:53:05 +00:00
|
|
|
public EncounterSlot3PokeSpot(EncounterArea3XD area, int species, int min, int max, int slot) : base(area, species, 0, min, max)
|
2020-08-21 23:35:49 +00:00
|
|
|
{
|
|
|
|
SlotNumber = slot;
|
|
|
|
}
|
|
|
|
|
|
|
|
// PokeSpot encounters always have Fateful Encounter set.
|
|
|
|
protected override void SetFormatSpecificData(PKM pk) => pk.FatefulEncounter = true;
|
|
|
|
|
|
|
|
protected override void SetPINGA(PKM pk, EncounterCriteria criteria)
|
|
|
|
{
|
2021-02-01 05:53:11 +00:00
|
|
|
var pi = pk.PersonalInfo;
|
|
|
|
int gender = criteria.GetGender(-1, pi);
|
2020-08-21 23:35:49 +00:00
|
|
|
int nature = (int)criteria.GetNature(Nature.Random);
|
2021-03-24 00:05:15 +00:00
|
|
|
int ability = criteria.GetAbilityFromNumber(0);
|
2020-08-21 23:35:49 +00:00
|
|
|
PIDGenerator.SetRandomPokeSpotPID(pk, nature, gender, ability, SlotNumber);
|
|
|
|
pk.Gender = gender;
|
|
|
|
pk.StatNature = nature;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|