2020-12-22 01:04:09 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generation 4 Pokéwalker Encounter
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <inheritdoc cref="EncounterStatic"/>
|
2020-12-23 20:15:49 +00:00
|
|
|
|
public sealed class EncounterStatic4Pokewalker : EncounterStatic
|
2020-12-22 01:04:09 +00:00
|
|
|
|
{
|
2020-12-23 20:15:49 +00:00
|
|
|
|
public override int Generation => 4;
|
|
|
|
|
|
2020-12-22 01:04:09 +00:00
|
|
|
|
public EncounterStatic4Pokewalker(int species, int gender, int level)
|
|
|
|
|
{
|
2020-12-22 01:12:21 +00:00
|
|
|
|
Species = species;
|
|
|
|
|
Gender = gender;
|
|
|
|
|
Level = level;
|
2020-12-22 01:04:09 +00:00
|
|
|
|
Gift = true;
|
2020-12-23 20:15:49 +00:00
|
|
|
|
Location = Locations.PokeWalker4;
|
2020-12-22 01:04:09 +00:00
|
|
|
|
Version = GameVersion.HGSS;
|
|
|
|
|
}
|
2020-12-23 20:15:49 +00:00
|
|
|
|
|
|
|
|
|
protected override bool IsMatchLocation(PKM pkm)
|
|
|
|
|
{
|
|
|
|
|
if (pkm.Format == 4)
|
|
|
|
|
return Location == pkm.Met_Location;
|
|
|
|
|
return true; // transfer location verified later
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void SetPINGA(PKM pk, EncounterCriteria criteria)
|
|
|
|
|
{
|
|
|
|
|
var pi = pk.PersonalInfo;
|
|
|
|
|
int gender = criteria.GetGender(Gender, pi);
|
|
|
|
|
int nature = (int)criteria.GetNature(Nature.Random);
|
|
|
|
|
|
|
|
|
|
// Cannot force an ability; nature-gender-trainerID only yield fixed PIDs.
|
|
|
|
|
// int ability = criteria.GetAbilityFromNumber(Ability, pi);
|
|
|
|
|
|
|
|
|
|
PIDGenerator.SetRandomPIDPokewalker(pk, nature, gender);
|
|
|
|
|
criteria.SetRandomIVs(pk);
|
|
|
|
|
}
|
2020-12-22 01:04:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|