Prevent providing beta safari zone encounters

Fixes Krabby / etc.
Fix genderless encounterstatic gender set (Voltorb)

Now at 103, Exeggutor
pretty cool that over 100 species can have every single encounter
generate a legal pkm ;)
might be useful to add metrics to count how many encounters are
generated in a session
This commit is contained in:
Kurt 2018-04-29 21:56:12 -07:00
parent ab71ea2d8b
commit ea2c6260fa
2 changed files with 6 additions and 1 deletions

View File

@ -255,8 +255,12 @@ private static IEnumerable<EncounterSlot> GetSlots(PKM pk, IReadOnlyCollection<i
var slots = EncounterSlotGenerator.GetPossible(pk);
foreach (var slot in slots)
{
if (slot.Generation == 2 && slot.Type.HasFlag(SlotType.Headbutt))
if (slot.Generation == 2)
{
if (slot.Type.HasFlag(SlotType.Safari))
continue;
if (slot.Type.HasFlag(SlotType.Headbutt))
if (Legal.GetGSCHeadbuttAvailability(slot, pk.TID) != TreeEncounterAvailable.ValidTree)
continue;
}

View File

@ -266,6 +266,7 @@ private static void SetRandomPIDIV(PKM pkm, uint seed)
private static void SetRandomWildPID4(PKM pk, int nature, int ability, int gender, PIDType specific = PIDType.None)
{
pk.RefreshAbility(ability);
pk.Gender = gender;
var type = GetPIDType(pk, specific);
var method = GetGeneratorMethod(type);