Add fossil encounter checks

This commit is contained in:
Kaphotics 2016-03-16 19:15:49 -07:00
parent eedddce9a3
commit d471c965aa
3 changed files with 21 additions and 1 deletions

View file

@ -191,6 +191,12 @@ namespace PKHeX
if (z != null)
return new LegalityCheck(Severity.Valid, "Valid gift/static encounter.");
if (Legal.getIsFossil(pk6))
{
return pk6.AbilityNumber != 4
? new LegalityCheck(Severity.Valid, "Valid revived fossil.")
: new LegalityCheck(Severity.Invalid, "Hidden ability on revived fossil.");
}
int FriendSafari = Legal.getFriendSafariValid(pk6);
if (FriendSafari > 0)
{

View file

@ -123,6 +123,19 @@ namespace PKHeX
{
return getValidPreEvolutions(pk6).Count() > 1;
}
internal static bool getIsFossil(PK6 pk6)
{
if (pk6.Met_Level != 20)
return false;
if (pk6.Egg_Location != 0)
return false;
if (pk6.XY && pk6.Met_Location == 44)
return Fossils.Contains(getBaseSpecies(pk6));
if (pk6.AO && pk6.Met_Location == 190)
return Fossils.Contains(getBaseSpecies(pk6));
return false;
}
internal static int getFriendSafariValid(PK6 pk6)
{
int vers = pk6.Version;
@ -181,7 +194,7 @@ namespace PKHeX
return null;
}
private static int getBaseSpecies(PK6 pk6, int skipOption)
private static int getBaseSpecies(PK6 pk6, int skipOption = 0)
{
DexLevel[] evos = Evolves[pk6.Species].Evos;
switch (skipOption)

View file

@ -351,6 +351,7 @@
internal static readonly int[] InvalidSketch = {Struggle, Chatter};
internal static readonly int[] EggLocations = {318, 60002, 30002};
internal static readonly int[] LightBall = {25, 26, 172};
internal static readonly int[] Fossils = {138, 140, 142, 345, 347, 408, 410, 564, 566, 696, 698};
internal static readonly int[] WildForms =
{
422, 423, // Shellos