Fix misc matching regressions

Gen4/8b Muchlax tree (&& -> ||)
Colo Umbreon w/ Bite (IMoveset)
WC3 unhatched -> use MysteryGift validator

Remove wurmple defer check for Static3 (no wurmple encounters)
Remove unnecessary spaces for colo enc definitions
This commit is contained in:
Kurt 2023-08-23 22:03:36 -07:00
parent a7f4d572e7
commit 00bb8ec7de
6 changed files with 26 additions and 27 deletions

View file

@ -23,27 +23,27 @@ internal static class Encounters3Colo
{
new(01, 03000, ColoMakuhita) { Species = 296, Level = 30, Moves = new(193,116,233,238), Location = 005 }, // Makuhita: Miror B.Peon Trudly @ Phenac City
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 003 }, // Bayleef: Cipher Peon Verde @ Phenac City
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 069 }, // Bayleef: Cipher Peon Verde @ Shadow PKMN Lab
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 115 }, // Bayleef: Cipher Peon Verde @ Realgam Tower
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 132 }, // Bayleef: Cipher Peon Verde @ Snagem Hideout
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 003 }, // Quilava: Cipher Peon Rosso @ Phenac City
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 069 }, // Quilava: Cipher Peon Rosso @ Shadow PKMN Lab
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 115 }, // Quilava: Cipher Peon Rosso @ Realgam Tower
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 132 }, // Quilava: Cipher Peon Rosso @ Snagem Hideout
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 003 }, // Croconaw: Cipher Peon Bluno @ Phenac City
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 069 }, // Croconaw: Cipher Peon Bluno @ Shadow PKMN Lab
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 115 }, // Croconaw: Cipher Peon Bluno @ Realgam Tower
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 132 }, // Croconaw: Cipher Peon Bluno @ Snagem Hideout
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 003 }, // Bayleef: Cipher Peon Verde @ Phenac City
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 069 }, // Bayleef: Cipher Peon Verde @ Shadow PKMN Lab
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 115 }, // Bayleef: Cipher Peon Verde @ Realgam Tower
new(02, 03000, First) { Species = 153, Level = 30, Moves = new(241,235,075,034), Location = 132 }, // Bayleef: Cipher Peon Verde @ Snagem Hideout
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 003 }, // Quilava: Cipher Peon Rosso @ Phenac City
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 069 }, // Quilava: Cipher Peon Rosso @ Shadow PKMN Lab
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 115 }, // Quilava: Cipher Peon Rosso @ Realgam Tower
new(03, 03000, First) { Species = 156, Level = 30, Moves = new(241,108,091,172), Location = 132 }, // Quilava: Cipher Peon Rosso @ Snagem Hideout
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 003 }, // Croconaw: Cipher Peon Bluno @ Phenac City
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 069 }, // Croconaw: Cipher Peon Bluno @ Shadow PKMN Lab
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 115 }, // Croconaw: Cipher Peon Bluno @ Realgam Tower
new(04, 03000, First) { Species = 159, Level = 30, Moves = new(240,184,044,057), Location = 132 }, // Croconaw: Cipher Peon Bluno @ Snagem Hideout
new(05, 03000, First) { Species = 164, Level = 30, Moves = new(211,095,115,019), Location = 015 }, // Noctowl: Rider Nover @ Pyrite Town
new(06, 03000, First) { Species = 180, Level = 30, Moves = new(085,086,178,084), Location = 015 }, // Flaaffy: St.Performer Diogo @ Pyrite Town
new(07, 03000, First) { Species = 188, Level = 30, Moves = new(235,079,178,072), Location = 015 }, // Skiploom: Rider Leba @ Pyrite Town
new(08, 04000, First) { Species = 195, Level = 30, Moves = new(341,133,021,057), Location = 015 }, // Quagsire: Bandana Guy Divel @ Pyrite Town
new(09, 04000, First) { Species = 200, Level = 30, Moves = new(060,109,212,247), Location = 015 }, // Misdreavus: Rider Vant @ Pyrite Town
new(10, 05000, First) { Species = 193, Level = 33, Moves = new(197,048,049,253), Location = 025 }, // Yanma: Cipher Peon Nore @ Pyrite Bldg
new(10, 05000, First) { Species = 193, Level = 33, Moves = new(197,048,049,253), Location = 132 }, // Yanma: Cipher Peon Nore @ Snagem Hideout
new(11, 05000, First) { Species = 162, Level = 33, Moves = new(231,270,098,070), Location = 015 }, // Furret: Rogue Cail @ Pyrite Town
new(12, 04000, First) { Species = 218, Level = 30, Moves = new(241,281,088,053), Location = 015 }, // Slugma: Roller Boy Lon @ Pyrite Town
new(10, 05000, First) { Species = 193, Level = 33, Moves = new(197,048,049,253), Location = 025 }, // Yanma: Cipher Peon Nore @ Pyrite Bldg
new(10, 05000, First) { Species = 193, Level = 33, Moves = new(197,048,049,253), Location = 132 }, // Yanma: Cipher Peon Nore @ Snagem Hideout
new(11, 05000, First) { Species = 162, Level = 33, Moves = new(231,270,098,070), Location = 015 }, // Furret: Rogue Cail @ Pyrite Town
new(12, 04000, First) { Species = 218, Level = 30, Moves = new(241,281,088,053), Location = 015 }, // Slugma: Roller Boy Lon @ Pyrite Town
new(13, 04000, First) { Species = 223, Level = 20, Moves = new(061,199,060,062), Location = 028 }, // Remoraid: Miror B.Peon Reath @ Pyrite Bldg
new(13, 04000, First) { Species = 223, Level = 20, Moves = new(061,199,060,062), Location = 030 }, // Remoraid: Miror B.Peon Reath @ Pyrite Cave
new(14, 05000, First) { Species = 226, Level = 33, Moves = new(017,048,061,036), Location = 028 }, // Mantine: Miror B.Peon Ferma @ Pyrite Bldg

View file

@ -4,7 +4,7 @@ namespace PKHeX.Core;
/// Generation 3 Static Encounter
/// </summary>
public sealed record EncounterStatic3Colo(ushort Species, byte Level)
: IEncounterable, IEncounterMatch, IEncounterConvertible<CK3>, IFixedGender, IRandomCorrelation
: IEncounterable, IEncounterMatch, IEncounterConvertible<CK3>, IFixedGender, IRandomCorrelation, IMoveset
{
public int Generation => 3;
public EntityContext Context => EntityContext.Gen3;
@ -102,6 +102,8 @@ public sealed record EncounterStatic3Colo(ushort Species, byte Level)
{
if (IsMatchPartial(pk))
return EncounterMatchRating.PartialMatch;
if (pk.FatefulEncounter) // Clash with XD's starter Eevee
return EncounterMatchRating.DeferredErrors;
return EncounterMatchRating.Match;
}

View file

@ -139,7 +139,6 @@ public sealed record EncounterStatic3(ushort Species, byte Level, GameVersion Ve
return EncounterMatchRating.PartialMatch;
return EncounterMatchRating.Match;
}
private bool IsDeferredWurmple(PKM pk) => Species == (int)Core.Species.Wurmple && pk.Species != (int)Core.Species.Wurmple && !WurmpleUtil.IsWurmpleEvoValid(pk);
private bool IsDeferredSafari3(bool IsSafariBall) => IsSafariBall != Locations.IsSafariZoneLocation3(Location);
@ -184,8 +183,6 @@ public sealed record EncounterStatic3(ushort Species, byte Level, GameVersion Ve
{
if (IsDeferredSafari3(pk.Ball == (int)Ball.Safari))
return true;
if (IsDeferredWurmple(pk))
return true;
if (Gift && pk.Ball != (byte)FixedBall)
return true;
if (FatefulEncounter != pk.FatefulEncounter)

View file

@ -80,9 +80,9 @@ public sealed record EncounterArea4 : IEncounterArea<EncounterSlot4>, ISlotRNGTy
private static bool IsMunchlaxTree(in MunchlaxTreeSet4 trees, ushort location)
{
return LocationID_HoneyTree[trees.Tree1] == location
&& LocationID_HoneyTree[trees.Tree2] == location
&& LocationID_HoneyTree[trees.Tree3] == location
&& LocationID_HoneyTree[trees.Tree4] == location;
|| LocationID_HoneyTree[trees.Tree2] == location
|| LocationID_HoneyTree[trees.Tree3] == location
|| LocationID_HoneyTree[trees.Tree4] == location;
}
private static ReadOnlySpan<byte> LocationID_HoneyTree => new byte[]

View file

@ -95,9 +95,9 @@ public sealed record EncounterArea8b : IEncounterArea<EncounterSlot8b>, IAreaLoc
private static bool IsMunchlaxTree(in MunchlaxTreeSet4 trees, ushort location)
{
return LocationID_HoneyTree[trees.Tree1] == location
&& LocationID_HoneyTree[trees.Tree2] == location
&& LocationID_HoneyTree[trees.Tree3] == location
&& LocationID_HoneyTree[trees.Tree4] == location;
|| LocationID_HoneyTree[trees.Tree2] == location
|| LocationID_HoneyTree[trees.Tree3] == location
|| LocationID_HoneyTree[trees.Tree4] == location;
}
private static ReadOnlySpan<ushort> LocationID_HoneyTree => new ushort[]

View file

@ -22,12 +22,12 @@ public static class EncounterVerifier
private static CheckResult VerifyEncounter(PKM pk, IEncounterTemplate enc) => enc switch
{
EncounterEgg e => VerifyEncounterEgg(pk, e.Generation),
{ EggEncounter: true } => VerifyEncounterEgg(pk, enc.Generation),
EncounterShadow3Colo { EReader: true } when pk.Language != (int)LanguageID.Japanese => GetInvalid(LG3EReader),
EncounterStatic3 { Species: (int)Species.Mew, Location: 201 } when pk.Language != (int)LanguageID.Japanese => GetInvalid(LEncUnreleasedEMewJP),
EncounterStatic3 { Species: (int)Species.Deoxys, Location: 200 } when pk.Language == (int)LanguageID.Japanese => GetInvalid(LEncUnreleased),
EncounterStatic4 { Roaming: true } when pk is G4PKM { Met_Location: 193, GroundTile: GroundTileType.Water } => GetInvalid(LG4InvalidTileR45Surf),
MysteryGift g => VerifyEncounterEvent(pk, g),
{ EggEncounter: true } => VerifyEncounterEgg(pk, enc.Generation),
EncounterInvalid => GetInvalid(LEncInvalid),
_ => GetValid(string.Empty), // todo: refactor
};