2018-03-31 07:43:41 +00:00
|
|
|
|
using System;
|
2020-01-19 00:46:38 +00:00
|
|
|
|
using System.Collections.Generic;
|
2018-04-30 01:26:36 +00:00
|
|
|
|
using System.Linq;
|
2018-03-31 07:43:41 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
2016-11-08 16:43:57 +00:00
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Trade Encounter data
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Trade data is fixed level in all cases except for the first few generations of games.
|
|
|
|
|
/// </remarks>
|
2020-08-30 22:35:59 +00:00
|
|
|
|
public abstract class EncounterTrade : IEncounterable, IMoveset, ILocation, IVersionSet
|
2016-11-08 16:43:57 +00:00
|
|
|
|
{
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public int Species { get; init; }
|
|
|
|
|
public int Form { get; init; }
|
|
|
|
|
public int Level { get; init; }
|
2020-11-23 00:19:03 +00:00
|
|
|
|
public virtual int LevelMin => Level;
|
2017-04-23 16:18:42 +00:00
|
|
|
|
public int LevelMax => 100;
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public IReadOnlyList<int> Moves { get; init; } = Array.Empty<int>();
|
2020-08-30 22:35:59 +00:00
|
|
|
|
public abstract int Generation { get; }
|
2016-11-08 16:43:57 +00:00
|
|
|
|
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public int CurrentLevel { get; init; } = -1;
|
|
|
|
|
public int Location { get; init; }
|
|
|
|
|
public int Ability { get; init; }
|
|
|
|
|
public int Gender { get; init; } = -1;
|
2016-11-08 16:43:57 +00:00
|
|
|
|
public Nature Nature = Nature.Random;
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public Shiny Shiny { get; init; } = Shiny.Never;
|
|
|
|
|
public int Ball { get; init; } = 4;
|
2020-08-30 22:35:59 +00:00
|
|
|
|
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public int TID { get; internal set; }
|
|
|
|
|
public int SID { get; internal set; }
|
|
|
|
|
public int OTGender { get; init; } = -1;
|
2020-08-31 02:24:24 +00:00
|
|
|
|
public GameVersion Version { get; set; } = GameVersion.Any;
|
2020-08-30 22:35:59 +00:00
|
|
|
|
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public IReadOnlyList<int> IVs { get; init; } = Array.Empty<int>();
|
|
|
|
|
public int FlawlessIVCount { get; init; }
|
2020-08-30 22:35:59 +00:00
|
|
|
|
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
public bool EggEncounter => false;
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public int EggLocation { get; init; }
|
|
|
|
|
public bool EvolveOnTrade { get; init; }
|
2018-12-30 06:24:34 +00:00
|
|
|
|
|
2018-11-11 05:07:31 +00:00
|
|
|
|
public int TID7
|
|
|
|
|
{
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
TID = (ushort) value;
|
|
|
|
|
SID = value >> 16;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-18 23:25:40 +00:00
|
|
|
|
private const string _name = "In-game Trade";
|
|
|
|
|
public string Name => _name;
|
2019-03-18 05:19:37 +00:00
|
|
|
|
public string LongName => _name;
|
2020-12-22 01:05:05 +00:00
|
|
|
|
public bool IsNicknamed { get; init; } = true;
|
2017-03-29 07:48:32 +00:00
|
|
|
|
|
2020-01-19 03:11:29 +00:00
|
|
|
|
public IReadOnlyList<string> Nicknames { get; internal set; } = Array.Empty<string>();
|
|
|
|
|
public IReadOnlyList<string> TrainerNames { get; internal set; } = Array.Empty<string>();
|
|
|
|
|
public string GetNickname(int language) => (uint)language < Nicknames.Count ? Nicknames[language] : string.Empty;
|
|
|
|
|
public string GetOT(int language) => (uint)language < TrainerNames.Count ? TrainerNames[language] : string.Empty;
|
2020-09-04 02:00:46 +00:00
|
|
|
|
public bool HasNickname => Nicknames.Count != 0 && IsNicknamed;
|
2020-01-19 03:11:29 +00:00
|
|
|
|
public bool HasTrainerName => TrainerNames.Count != 0;
|
2018-03-27 05:23:11 +00:00
|
|
|
|
|
2020-09-13 21:40:10 +00:00
|
|
|
|
private static int GetDefaultMetLocation(int generation)
|
2017-03-29 07:48:32 +00:00
|
|
|
|
{
|
2020-09-13 21:40:10 +00:00
|
|
|
|
return generation switch
|
|
|
|
|
{
|
|
|
|
|
1 => 0,
|
|
|
|
|
2 => Locations.LinkTrade2NPC,
|
|
|
|
|
3 => Locations.LinkTrade3NPC,
|
|
|
|
|
4 => Locations.LinkTrade4NPC,
|
|
|
|
|
5 => Locations.LinkTrade5NPC,
|
|
|
|
|
6 => Locations.LinkTrade6NPC,
|
|
|
|
|
7 => Locations.LinkTrade6NPC, // 7 is same as 6
|
|
|
|
|
8 => Locations.LinkTrade6NPC, // 8 is same as 6
|
|
|
|
|
_ => throw new IndexOutOfRangeException(nameof(generation)),
|
|
|
|
|
};
|
|
|
|
|
}
|
2018-03-29 03:38:07 +00:00
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
public PKM ConvertToPKM(ITrainerInfo sav) => ConvertToPKM(sav, EncounterCriteria.Unrestricted);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
public PKM ConvertToPKM(ITrainerInfo sav, EncounterCriteria criteria)
|
2018-03-31 07:43:41 +00:00
|
|
|
|
{
|
2018-12-30 06:24:34 +00:00
|
|
|
|
var pk = PKMConverter.GetBlank(Generation, Version);
|
2020-06-17 02:46:22 +00:00
|
|
|
|
sav.ApplyTo(pk);
|
2019-02-09 19:37:20 +00:00
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
ApplyDetails(sav, criteria, pk);
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return pk;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
protected virtual void ApplyDetails(ITrainerInfo sav, EncounterCriteria criteria, PKM pk)
|
2019-11-16 01:34:18 +00:00
|
|
|
|
{
|
2020-06-17 02:46:22 +00:00
|
|
|
|
var version = this.GetCompatibleVersion((GameVersion)sav.Game);
|
|
|
|
|
int lang = (int)Language.GetSafeLanguage(Generation, (LanguageID)sav.Language);
|
2018-03-31 07:43:41 +00:00
|
|
|
|
int level = CurrentLevel > 0 ? CurrentLevel : LevelMin;
|
2018-04-30 01:26:36 +00:00
|
|
|
|
if (level == 0)
|
2020-03-14 04:39:35 +00:00
|
|
|
|
level = Math.Max(1, LevelMin);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
|
|
|
|
|
int species = Species;
|
|
|
|
|
if (EvolveOnTrade)
|
|
|
|
|
species++;
|
2018-03-31 07:43:41 +00:00
|
|
|
|
|
|
|
|
|
pk.EncryptionConstant = Util.Rand32();
|
2018-12-30 06:24:34 +00:00
|
|
|
|
pk.Species = species;
|
2020-12-11 04:42:30 +00:00
|
|
|
|
pk.Form = Form;
|
2018-04-30 01:26:36 +00:00
|
|
|
|
pk.Language = lang;
|
2020-06-17 02:46:22 +00:00
|
|
|
|
pk.OT_Name = pk.Format == 1 ? StringConverter12.G1TradeOTStr : HasTrainerName ? GetOT(lang) : sav.OT;
|
|
|
|
|
pk.OT_Gender = HasTrainerName ? Math.Max(0, OTGender) : sav.Gender;
|
2020-09-04 02:00:46 +00:00
|
|
|
|
pk.SetNickname(HasNickname ? GetNickname(lang) : string.Empty);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.CurrentLevel = level;
|
2019-11-16 01:34:18 +00:00
|
|
|
|
pk.Version = (int) version;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.TID = TID;
|
|
|
|
|
pk.SID = SID;
|
|
|
|
|
pk.Ball = Ball;
|
|
|
|
|
pk.OT_Friendship = pk.PersonalInfo.BaseFriendship;
|
2018-03-31 07:43:41 +00:00
|
|
|
|
|
2019-02-09 19:37:20 +00:00
|
|
|
|
SetPINGA(pk, criteria);
|
|
|
|
|
SetMoves(pk, version, level);
|
2018-03-31 07:43:41 +00:00
|
|
|
|
|
2019-02-09 19:37:20 +00:00
|
|
|
|
var time = DateTime.Now;
|
2018-12-30 06:24:34 +00:00
|
|
|
|
if (pk.Format != 2 || version == GameVersion.C)
|
|
|
|
|
{
|
2020-09-13 21:40:10 +00:00
|
|
|
|
var location = Location != 0 ? Location : GetDefaultMetLocation(Generation);
|
2019-02-09 19:37:20 +00:00
|
|
|
|
SetMetData(pk, level, location, time);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
}
|
2020-09-04 02:00:46 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pk.OT_Gender = 0;
|
|
|
|
|
}
|
2019-11-16 01:34:18 +00:00
|
|
|
|
|
2018-12-30 06:24:34 +00:00
|
|
|
|
if (EggLocation != 0)
|
2019-02-09 19:37:20 +00:00
|
|
|
|
SetEggMetData(pk, time);
|
2018-03-31 07:43:41 +00:00
|
|
|
|
|
2018-05-08 04:16:54 +00:00
|
|
|
|
UpdateEdgeCase(pk);
|
|
|
|
|
|
2018-03-31 07:43:41 +00:00
|
|
|
|
if (pk.Format < 6)
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return;
|
2018-03-31 07:43:41 +00:00
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
sav.ApplyHandlingTrainerInfo(pk, force: true);
|
2018-03-31 07:43:41 +00:00
|
|
|
|
pk.SetRandomEC();
|
|
|
|
|
|
2020-08-01 00:25:14 +00:00
|
|
|
|
if (pk is PK6 pk6)
|
|
|
|
|
pk6.SetRandomMemory6();
|
2018-03-31 07:43:41 +00:00
|
|
|
|
}
|
2018-04-30 01:26:36 +00:00
|
|
|
|
|
2019-02-09 19:37:20 +00:00
|
|
|
|
protected virtual void SetPINGA(PKM pk, EncounterCriteria criteria)
|
2018-12-30 06:24:34 +00:00
|
|
|
|
{
|
2020-06-21 23:16:34 +00:00
|
|
|
|
var pi = pk.PersonalInfo;
|
|
|
|
|
int gender = criteria.GetGender(Gender, pi);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
int nature = (int)criteria.GetNature(Nature);
|
2020-06-23 03:01:42 +00:00
|
|
|
|
int ability = criteria.GetAbilityFromNumber(Ability, pi);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
|
2019-02-09 19:37:20 +00:00
|
|
|
|
PIDGenerator.SetRandomWildPID(pk, Generation, nature, ability, gender);
|
2020-06-27 16:46:23 +00:00
|
|
|
|
pk.Nature = pk.StatNature = nature;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.Gender = gender;
|
|
|
|
|
pk.RefreshAbility(ability);
|
|
|
|
|
|
|
|
|
|
SetIVs(pk);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void SetIVs(PKM pk)
|
|
|
|
|
{
|
2020-01-19 03:11:29 +00:00
|
|
|
|
if (IVs.Count != 0)
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.SetRandomIVs(IVs, 0);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
else
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.SetRandomIVs(flawless: 3);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetMoves(PKM pk, GameVersion version, int level)
|
|
|
|
|
{
|
2020-01-19 00:46:38 +00:00
|
|
|
|
var moves = Moves.Count != 0 ? Moves : MoveLevelUp.GetEncounterMoves(pk, level, version);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
if (pk.Format == 1 && moves.All(z => z == 0))
|
|
|
|
|
moves = ((PersonalInfoG1)PersonalTable.RB[Species]).Moves;
|
2020-01-19 00:46:38 +00:00
|
|
|
|
pk.SetMoves(moves);
|
2018-12-30 06:24:34 +00:00
|
|
|
|
pk.SetMaximumPPCurrent(moves);
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-09 19:37:20 +00:00
|
|
|
|
private void SetEggMetData(PKM pk, DateTime time)
|
2018-12-30 06:24:34 +00:00
|
|
|
|
{
|
|
|
|
|
pk.Egg_Location = EggLocation;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.EggMetDate = time;
|
2018-12-30 06:24:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-09 19:37:20 +00:00
|
|
|
|
private static void SetMetData(PKM pk, int level, int location, DateTime time)
|
2018-12-30 06:24:34 +00:00
|
|
|
|
{
|
|
|
|
|
pk.Met_Level = level;
|
|
|
|
|
pk.Met_Location = location;
|
2019-02-09 19:37:20 +00:00
|
|
|
|
pk.MetDate = time;
|
2018-12-30 06:24:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-04-30 01:26:36 +00:00
|
|
|
|
private void UpdateEdgeCase(PKM pkm)
|
|
|
|
|
{
|
|
|
|
|
switch (Generation)
|
|
|
|
|
{
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case 3 when Species == (int)Core.Species.Jynx && pkm.Version == (int) GameVersion.LG && pkm.Language == (int) LanguageID.Italian:
|
2018-04-30 01:26:36 +00:00
|
|
|
|
// Italian LG Jynx untranslated from English name
|
2019-06-01 17:22:49 +00:00
|
|
|
|
pkm.OT_Name = GetOT((int)LanguageID.English);
|
|
|
|
|
pkm.SetNickname(GetNickname((int)LanguageID.English));
|
2018-04-30 01:26:36 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case 4 when Version == GameVersion.DPPt && Species == (int)Core.Species.Magikarp: // Meister Magikarp
|
2018-04-30 01:26:36 +00:00
|
|
|
|
// Has German Language ID for all except German origin, which is English
|
|
|
|
|
pkm.Language = (int)(pkm.Language == (int)LanguageID.German ? LanguageID.English : LanguageID.German);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4 when Version == GameVersion.DPPt && (pkm.Version == (int)GameVersion.D || pkm.Version == (int)GameVersion.P):
|
|
|
|
|
// DP English origin are Japanese lang
|
2019-06-01 17:22:49 +00:00
|
|
|
|
pkm.Language = (int)LanguageID.Japanese;
|
2018-04-30 01:26:36 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case 4 when Version == GameVersion.HGSS && Species == (int)Core.Species.Pikachu: // Pikachu
|
2018-04-30 01:26:36 +00:00
|
|
|
|
// Has English Language ID for all except English origin, which is French
|
|
|
|
|
pkm.Language = (int)(pkm.Language == (int)LanguageID.English ? LanguageID.French : LanguageID.English);
|
|
|
|
|
break;
|
|
|
|
|
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case 5 when Version == GameVersion.BW && pkm.Language == (int)LanguageID.Japanese:
|
2018-04-30 01:26:36 +00:00
|
|
|
|
// Trades for JPN games have language ID of 0, not 1.
|
|
|
|
|
pkm.Language = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
public virtual bool IsMatch(PKM pkm, DexLevel evo)
|
2018-12-27 09:00:08 +00:00
|
|
|
|
{
|
2020-01-19 03:11:29 +00:00
|
|
|
|
if (IVs.Count != 0)
|
2018-12-27 09:00:08 +00:00
|
|
|
|
{
|
2019-05-15 19:07:48 +00:00
|
|
|
|
if (!Legal.GetIsFixedIVSequenceValidSkipRand(IVs, pkm))
|
2019-05-11 07:59:07 +00:00
|
|
|
|
return false;
|
2018-12-27 09:00:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
if (!IsMatchNatureGenderShiny(pkm))
|
|
|
|
|
return false;
|
2018-12-27 09:00:08 +00:00
|
|
|
|
if (TID != pkm.TID)
|
|
|
|
|
return false;
|
|
|
|
|
if (SID != pkm.SID)
|
|
|
|
|
return false;
|
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
if (!IsMatchLevel(pkm, evo))
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (CurrentLevel != -1 && CurrentLevel > pkm.CurrentLevel)
|
|
|
|
|
return false;
|
|
|
|
|
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (Form != evo.Form && !FormInfo.IsFormChangeable(Species, Form, pkm.Form, pkm.Format))
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return false;
|
|
|
|
|
if (OTGender != -1 && OTGender != pkm.OT_Gender)
|
|
|
|
|
return false;
|
|
|
|
|
if (EggLocation != pkm.Egg_Location)
|
|
|
|
|
return false;
|
|
|
|
|
// if (z.Ability == 4 ^ pkm.AbilityNumber == 4) // defer to Ability
|
2020-06-27 16:46:23 +00:00
|
|
|
|
// continue;
|
2019-11-16 01:34:18 +00:00
|
|
|
|
if (!Version.Contains((GameVersion)pkm.Version))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
private bool IsMatchLevel(PKM pkm, DexLevel evo)
|
2019-11-16 01:34:18 +00:00
|
|
|
|
{
|
2020-08-21 23:35:49 +00:00
|
|
|
|
if (!pkm.HasOriginalMetLocation)
|
2020-11-27 19:51:02 +00:00
|
|
|
|
return evo.Level >= Level;
|
2018-12-27 09:00:08 +00:00
|
|
|
|
|
2020-09-13 21:40:10 +00:00
|
|
|
|
var loc = Location != 0 ? Location : GetDefaultMetLocation(Generation);
|
2020-08-21 23:35:49 +00:00
|
|
|
|
if (loc != pkm.Met_Location)
|
2018-12-27 09:00:08 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
if (pkm.Format < 5)
|
2020-11-27 19:51:02 +00:00
|
|
|
|
return evo.Level >= Level;
|
2020-08-21 23:35:49 +00:00
|
|
|
|
|
2020-11-27 19:51:02 +00:00
|
|
|
|
return pkm.Met_Level == Level;
|
2019-11-16 01:34:18 +00:00
|
|
|
|
}
|
2018-12-27 09:00:08 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
protected virtual bool IsMatchNatureGenderShiny(PKM pkm)
|
|
|
|
|
{
|
|
|
|
|
if (!Shiny.IsValid(pkm))
|
2018-12-27 09:00:08 +00:00
|
|
|
|
return false;
|
2019-11-16 01:34:18 +00:00
|
|
|
|
if (Gender != -1 && Gender != pkm.Gender)
|
2018-12-27 09:00:08 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
if (Nature != Nature.Random && pkm.Nature != (int)Nature)
|
2018-12-27 09:00:08 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2019-11-26 18:46:16 +00:00
|
|
|
|
}
|
2016-11-08 16:43:57 +00:00
|
|
|
|
}
|