mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-16 21:38:40 +00:00
Use Gen8 toxel gift IVs in ctor
ty anubis
This commit is contained in:
parent
93ddee4be4
commit
0f7e623842
3 changed files with 14 additions and 2 deletions
|
@ -134,6 +134,18 @@ public sealed record EncounterGift1(ushort Species, byte Level, GameVersion Vers
|
|||
return false;
|
||||
if (Form != evo.Form && !FormInfo.IsFormChangeable(Species, Form, pk.Form, Context, pk.Context))
|
||||
return false;
|
||||
if (IVs.IsSpecified)
|
||||
{
|
||||
if (Shiny == Shiny.Always && !pk.IsShiny)
|
||||
return false;
|
||||
if (Shiny == Shiny.Never && pk.IsShiny)
|
||||
return false;
|
||||
if (pk.Format <= 2)
|
||||
{
|
||||
if (!Legal.GetIsFixedIVSequenceValidNoRand(IVs, pk))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// EC/PID check doesn't exist for these, so check Shiny state here.
|
||||
if (!IsShinyValid(pk))
|
||||
|
|
|
@ -135,7 +135,7 @@ public sealed record EncounterStatic7(GameVersion Version)
|
|||
criteria.SetRandomIVs(pk, IVs);
|
||||
else
|
||||
criteria.SetRandomIVs(pk, FlawlessIVCount);
|
||||
|
||||
|
||||
var ability = criteria.GetAbilityFromNumber(Ability);
|
||||
pk.Nature = (int)criteria.GetNature(Nature);
|
||||
pk.Gender = criteria.GetGender(Gender, pi);
|
||||
|
|
|
@ -124,7 +124,7 @@ public sealed record EncounterStatic8(GameVersion Version = GameVersion.SWSH)
|
|||
var rand = Util.Rand;
|
||||
pk.EncryptionConstant = rand.Rand32();
|
||||
pk.PID = rand.Rand32();
|
||||
criteria.SetRandomIVs(pk);
|
||||
criteria.SetRandomIVs(pk, IVs);
|
||||
return;
|
||||
}
|
||||
var shiny = Shiny == Shiny.Random ? Shiny.FixedValue : Shiny;
|
||||
|
|
Loading…
Add table
Reference in a new issue