mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-14 00:07:15 +00:00
Change shininess check
Encounter definitions should be marked as Never Shiny or not in their definition, rather than assuming
This commit is contained in:
parent
cce4707604
commit
83171ab133
2 changed files with 16 additions and 2 deletions
|
@ -32,7 +32,7 @@ namespace PKHeX.Core
|
|||
return false;
|
||||
|
||||
// EC/PID check doesn't exist for these, so check Shiny state here.
|
||||
if ((Shiny == Shiny.Always) != pkm.IsShiny)
|
||||
if (!IsShinyValid(pkm))
|
||||
return false;
|
||||
|
||||
if (TID != -1 && pkm.TID != TID)
|
||||
|
@ -52,6 +52,13 @@ namespace PKHeX.Core
|
|||
return true;
|
||||
}
|
||||
|
||||
private bool IsShinyValid(PKM pkm) => Shiny switch
|
||||
{
|
||||
Shiny.Never => !pkm.IsShiny,
|
||||
Shiny.Always => pkm.IsShiny,
|
||||
_ => true
|
||||
};
|
||||
|
||||
public override bool IsMatchDeferred(PKM pkm)
|
||||
{
|
||||
if (base.IsMatchDeferred(pkm))
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace PKHeX.Core
|
|||
return false;
|
||||
|
||||
// EC/PID check doesn't exist for these, so check Shiny state here.
|
||||
if ((Shiny == Shiny.Always) != pkm.IsShiny && Location != 14) // Celebi is the only Wild "event", can be either.
|
||||
if (!IsShinyValid(pkm))
|
||||
return false;
|
||||
|
||||
if (EggEncounter && !pkm.IsEgg)
|
||||
|
@ -61,6 +61,13 @@ namespace PKHeX.Core
|
|||
return true;
|
||||
}
|
||||
|
||||
private bool IsShinyValid(PKM pkm) => Shiny switch
|
||||
{
|
||||
Shiny.Never => !pkm.IsShiny,
|
||||
Shiny.Always => pkm.IsShiny,
|
||||
_ => true
|
||||
};
|
||||
|
||||
public override bool IsMatchDeferred(PKM pkm)
|
||||
{
|
||||
if (base.IsMatchDeferred(pkm))
|
||||
|
|
Loading…
Reference in a new issue