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)
|
|
|
|
{
|
|
|
|
int gender = criteria.GetGender(-1, pk.PersonalInfo);
|
|
|
|
int nature = (int)criteria.GetNature(Nature.Random);
|
|
|
|
int ability = Util.Rand.Next(2);
|
|
|
|
PIDGenerator.SetRandomPokeSpotPID(pk, nature, gender, ability, SlotNumber);
|
|
|
|
pk.Gender = gender;
|
|
|
|
pk.StatNature = nature;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|