mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Pass form when form doesn't match encounter
This is still a horrible hack, needs to be done similar to encounter slots handle the galar NFE formchange cases
This commit is contained in:
parent
8a54e8c7b9
commit
913d2773bf
9 changed files with 14 additions and 11 deletions
|
@ -448,7 +448,7 @@ namespace PKHeX.Core
|
|||
};
|
||||
}
|
||||
|
||||
private static bool IsEvolvedFormChange(PKM pkm)
|
||||
private static bool IsEvolvedFormChange(PKM pkm, int expected)
|
||||
{
|
||||
if (pkm.IsEgg)
|
||||
return false;
|
||||
|
@ -461,6 +461,8 @@ namespace PKHeX.Core
|
|||
return pkm.AltForm == 1;
|
||||
if (GalarForm0Evolutions.TryGetValue(pkm.Species, out var orig))
|
||||
return pkm.AltForm != orig; // bad compare?
|
||||
if ((int) Species.Darmanitan == pkm.Species)
|
||||
return pkm.AltForm == (expected == 1 ? 2 : 0);
|
||||
if ((int) Species.Toxtricity == pkm.Species)
|
||||
return pkm.AltForm == EvolutionMethod.GetAmpLowKeyResult(pkm.Nature);
|
||||
if ((int) Species.Alcremie == pkm.Species)
|
||||
|
@ -554,11 +556,12 @@ namespace PKHeX.Core
|
|||
/// <summary>Checks if the form may be different than the original encounter detail.</summary>
|
||||
/// <param name="pkm">Pokémon</param>
|
||||
/// <param name="species">Original species</param>
|
||||
internal static bool IsFormChangeable(PKM pkm, int species)
|
||||
/// <param name="form">Original form</param>
|
||||
internal static bool IsFormChangeable(PKM pkm, int species, int form)
|
||||
{
|
||||
if (FormChange.Contains(species))
|
||||
return true;
|
||||
if (species != pkm.Species && IsEvolvedFormChange(pkm))
|
||||
if (species != pkm.Species && IsEvolvedFormChange(pkm, form))
|
||||
return true;
|
||||
if (species == (int)Species.Zygarde && pkm.InhabitedGeneration(7) && pkm.AltForm > 1)
|
||||
return true;
|
||||
|
|
|
@ -302,7 +302,7 @@ namespace PKHeX.Core
|
|||
var expectForm = pkm.Format == 7 ? Form : FormConverter.GetTotemBaseForm(Species, Form);
|
||||
return expectForm == pkm.AltForm;
|
||||
}
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, Form))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ namespace PKHeX.Core
|
|||
if (CurrentLevel != -1 && CurrentLevel > pkm.CurrentLevel)
|
||||
return false;
|
||||
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, Form))
|
||||
return false;
|
||||
if (OTGender != -1 && OTGender != pkm.OT_Gender)
|
||||
return false;
|
||||
|
|
|
@ -161,7 +161,7 @@ namespace PKHeX.Core
|
|||
return false;
|
||||
}
|
||||
|
||||
if (wc.AltForm != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (wc.AltForm != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, wc.AltForm))
|
||||
return false;
|
||||
|
||||
if (wc.Ball != pkm.Ball) return false;
|
||||
|
|
|
@ -369,7 +369,7 @@ namespace PKHeX.Core
|
|||
return false;
|
||||
}
|
||||
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, Form))
|
||||
return false;
|
||||
|
||||
if (Level != pkm.Met_Level) return false;
|
||||
|
|
|
@ -474,7 +474,7 @@ namespace PKHeX.Core
|
|||
if (EncryptionConstant != 0 && EncryptionConstant != pkm.EncryptionConstant) return false;
|
||||
}
|
||||
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, Form))
|
||||
return false;
|
||||
|
||||
if (IsEgg)
|
||||
|
|
|
@ -478,7 +478,7 @@ namespace PKHeX.Core
|
|||
if (EncryptionConstant != 0 && EncryptionConstant != pkm.EncryptionConstant) return false;
|
||||
if (Language != 0 && Language != pkm.Language) return false;
|
||||
}
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, Form))
|
||||
return false;
|
||||
|
||||
if (IsEgg)
|
||||
|
|
|
@ -509,7 +509,7 @@ namespace PKHeX.Core
|
|||
if (Language != 0 && Language != pkm.Language) return false;
|
||||
}
|
||||
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, Form))
|
||||
{
|
||||
if (Species == (int)Core.Species.Rockruff && Form == 1 && pkm.Species == 745 && pkm.AltForm == 2)
|
||||
{
|
||||
|
|
|
@ -519,7 +519,7 @@ namespace PKHeX.Core
|
|||
}
|
||||
}
|
||||
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species, Form))
|
||||
return false;
|
||||
|
||||
if (IsEgg)
|
||||
|
|
Loading…
Reference in a new issue