Add form/nature checks for gen5 trades

altform wasn't checked for EncounterTrade
nature wasn't checked for gen5 origin (decoupled from PID, but forced)
#1702
This commit is contained in:
Kurt 2017-12-16 14:09:03 -08:00
parent e5aa39a6bb
commit 0b58d4ffe9
2 changed files with 11 additions and 7 deletions

View file

@ -634,13 +634,13 @@ namespace PKHeX.Core
internal static readonly EncounterTrade[] TradeGift_BW =
{
new EncounterTradePID { Species = 548, Level = 15, Ability = 1, TID = 39922, SID = 00000, OTGender = 1, Gender = 1, IVs = new[] {20,20,20,20,31,20}, PID = 0x64000000, Version = GameVersion.B, }, // Petilil
new EncounterTradePID { Species = 546, Level = 15, Ability = 1, TID = 39922, SID = 00000, OTGender = 1, Gender = 1, IVs = new[] {20,20,20,20,31,20}, PID = 0x6400007E, Version = GameVersion.W, }, // Cottonee
new EncounterTradePID { Species = 550, Level = 25, Ability = 1, TID = 27646, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {20,31,20,20,20,20}, PID = 0x9400007F, Version = GameVersion.B, Form = 0, }, // Basculin-Red
new EncounterTradePID { Species = 550, Level = 25, Ability = 1, TID = 27646, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {20,31,20,20,20,20}, PID = 0x9400007F, Version = GameVersion.W, Form = 1, }, // Basculin-Blue
new EncounterTradePID { Species = 587, Level = 30, Ability = 1, TID = 11195, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {20,20,31,20,20,20}, PID = 0xD400007F, }, // Emolga
new EncounterTradePID { Species = 479, Level = 60, Ability = 1, TID = 54673, SID = 00000, OTGender = 1, Gender = 2, IVs = new[] {20,20,20,20,20,31}, PID = 0x2A000000, }, // Rotom
new EncounterTradePID { Species = 446, Level = 60, Ability = 2, TID = 40217, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {31,20,20,20,20,20}, PID = 0x6200001F, }, // Munchlax
new EncounterTradePID { Species = 548, Level = 15, Ability = 1, TID = 39922, SID = 00000, OTGender = 1, Gender = 1, IVs = new[] {20,20,20,20,31,20}, PID = 0x64000000, Nature = Nature.Modest, Version = GameVersion.B, }, // Petilil
new EncounterTradePID { Species = 546, Level = 15, Ability = 1, TID = 39922, SID = 00000, OTGender = 1, Gender = 1, IVs = new[] {20,20,20,20,31,20}, PID = 0x6400007E, Nature = Nature.Modest, Version = GameVersion.W, }, // Cottonee
new EncounterTradePID { Species = 550, Level = 25, Ability = 1, TID = 27646, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {20,31,20,20,20,20}, PID = 0x9400007F, Nature = Nature.Adamant, Version = GameVersion.B, Form = 0, }, // Basculin-Red
new EncounterTradePID { Species = 550, Level = 25, Ability = 1, TID = 27646, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {20,31,20,20,20,20}, PID = 0x9400007F, Nature = Nature.Adamant, Version = GameVersion.W, Form = 1, }, // Basculin-Blue
new EncounterTradePID { Species = 587, Level = 30, Ability = 1, TID = 11195, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {20,20,31,20,20,20}, PID = 0xD400007F, Nature = Nature.Lax, }, // Emolga
new EncounterTradePID { Species = 479, Level = 60, Ability = 1, TID = 54673, SID = 00000, OTGender = 1, Gender = 2, IVs = new[] {20,20,20,20,20,31}, PID = 0x2A000000, Nature = Nature.Gentle, }, // Rotom
new EncounterTradePID { Species = 446, Level = 60, Ability = 2, TID = 40217, SID = 00000, OTGender = 0, Gender = 0, IVs = new[] {31,20,20,20,20,20}, PID = 0x6200001F, Nature = Nature.Serious, }, // Munchlax
};
internal static readonly EncounterTrade[] TradeGift_B2W2_Regular =

View file

@ -971,6 +971,8 @@ namespace PKHeX.Core
{
if (p.PID != pkm.EncryptionConstant)
return false;
if (z.Nature != Nature.Random && (int)z.Nature != pkm.Nature) // gen5 BW only
return false;
}
else
{
@ -1004,6 +1006,8 @@ namespace PKHeX.Core
if (z.CurrentLevel != -1 && z.CurrentLevel > pkm.CurrentLevel)
return false;
if (z.Form != pkm.AltForm && !IsFormChangeable(pkm, pkm.Species))
return false;
if (z.OTGender != -1 && z.OTGender != pkm.OT_Gender)
return false;
if (z.Egg_Location != pkm.Egg_Location)