Update event database, handle HOME gifts horribly

This commit is contained in:
Kurt 2020-03-14 14:22:45 -07:00
parent d21cca7a90
commit 3aaf318035
6 changed files with 31 additions and 3 deletions

View file

@ -356,6 +356,11 @@ namespace PKHeX.Core
metSWSH_40000[i] += " (-)";
metSWSH_40000[29] += " (-)"; // a Video game Event (in spanish etc) -- duplicate with line 39
metSWSH_40000[52] += " (-)"; // a Pokémon event -- duplicate with line 37
// metSWSH_40000[80] += " (-)"; // Pokémon GO -- duplicate with 30000's entry
// metSWSH_40000[85] += " (-)"; // Pokémon HOME -- duplicate with 30000's entry
metSWSH_30000[11] += " (-)"; // Pokémon GO -- duplicate with 40000's entry
metSWSH_30000[17] += " (-)"; // Pokémon HOME -- duplicate with 40000's entry
}
public IReadOnlyList<string> GetItemStrings(int generation, GameVersion game = GameVersion.Any)

View file

@ -26,7 +26,16 @@ namespace PKHeX.Core
var Info = data.Info;
if ((Info.Generation >= 6 || (Info.Generation < 3 && pkm.Format >= 7)) && pkm.PID == pkm.EncryptionConstant)
data.AddLine(GetInvalid(LPIDEqualsEC)); // better to flag than 1:2^32 odds since RNG is not feasible to yield match
{
if (Info.EncounterMatch is WC8 wc8 && wc8.PID == 0 &&wc8.EncryptionConstant == 0)
{
// We'll allow this to pass.
}
else
{
data.AddLine(GetInvalid(LPIDEqualsEC)); // better to flag than 1:2^32 odds since RNG is not feasible to yield match
}
}
VerifyShiny(data);
}

View file

@ -294,6 +294,8 @@ namespace PKHeX.Core
return 0x12C + (index * 0x1C);
}
private bool IsHOMEGift => PIDType == Shiny.FixedValue && PID == 0 && EncryptionConstant == 0;
public override PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria)
{
if (!IsPokémon)
@ -306,7 +308,7 @@ namespace PKHeX.Core
var pk = new PK8
{
EncryptionConstant = EncryptionConstant != 0 ? EncryptionConstant : Util.Rand32(),
EncryptionConstant = EncryptionConstant != 0 || IsHOMEGift ? EncryptionConstant : Util.Rand32(),
TID = TID,
SID = SID,
Species = Species,
@ -502,7 +504,19 @@ namespace PKHeX.Core
var OT = GetOT(pkm.Language); // May not be guaranteed to work.
if (!string.IsNullOrEmpty(OT) && OT != pkm.OT_Name) return false;
if (OriginGame != 0 && OriginGame != pkm.Version) return false;
if (EncryptionConstant != 0 && EncryptionConstant != pkm.EncryptionConstant) return false;
if (EncryptionConstant != 0)
{
if (EncryptionConstant != pkm.EncryptionConstant)
return false;
}
else if (IsHOMEGift)// 0
{
// HOME gifts -- PID and EC are zeroes...
if (EncryptionConstant != pkm.EncryptionConstant)
return false;
if (IsShiny)
return false;
}
}
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))

Binary file not shown.

Binary file not shown.

Binary file not shown.