mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-11 07:04:16 +00:00
Add ingame trade checks
There's memories associated, IVs, EVs, whatever; best to check them in the individual legality check methods.
This commit is contained in:
parent
0fc4da3431
commit
d986b3bb86
3 changed files with 24 additions and 5 deletions
|
@ -7,6 +7,7 @@ namespace PKHeX
|
|||
{
|
||||
private readonly PK6 pk6;
|
||||
private WC6 MatchedWC6;
|
||||
private object EncounterMatch;
|
||||
private LegalityCheck ECPID, Nickname, IDs, IVs, EVs, Encounter;
|
||||
|
||||
public bool Valid = true;
|
||||
|
@ -39,12 +40,12 @@ namespace PKHeX
|
|||
|
||||
private void updateChecks()
|
||||
{
|
||||
Encounter = verifyEncounter();
|
||||
ECPID = verifyECPID();
|
||||
Nickname = verifyNickname();
|
||||
IDs = verifyID();
|
||||
IVs = verifyIVs();
|
||||
EVs = verifyEVs();
|
||||
Encounter = verifyEncounter();
|
||||
SecondaryChecked = true;
|
||||
}
|
||||
private string getLegalityReport()
|
||||
|
|
|
@ -212,8 +212,7 @@ namespace PKHeX
|
|||
|
||||
return new LegalityCheck(Severity.Valid, "Valid friend safari encounter.");
|
||||
}
|
||||
|
||||
// Not Implemented: In-Game Trades
|
||||
|
||||
if (Legal.getDexNavValid(pk6))
|
||||
return new LegalityCheck(Severity.Valid, "Valid (DexNav) encounter at location.");
|
||||
if (Legal.getWildEncounterValid(pk6))
|
||||
|
@ -222,6 +221,12 @@ namespace PKHeX
|
|||
? new LegalityCheck(Severity.Valid, "Valid encounter at location.")
|
||||
: new LegalityCheck(Severity.Invalid, "Hidden ability on valid encounter.");
|
||||
}
|
||||
EncounterTrade t = Legal.getIngameTrade(pk6);
|
||||
if (t != null)
|
||||
{
|
||||
EncounterMatch = t; // Check in individual methods
|
||||
return new LegalityCheck(Severity.Valid, "Valid ingame trade.");
|
||||
}
|
||||
return new LegalityCheck(Severity.Invalid, "Not a valid encounter.");
|
||||
}
|
||||
private LegalityCheck[] verifyMoves()
|
||||
|
|
|
@ -494,11 +494,24 @@ namespace PKHeX
|
|||
#region Static Encounter/Gift Tables
|
||||
private static readonly EncounterTrade[] TradeGift_XY =
|
||||
{
|
||||
new EncounterTrade { Species = 296, Ability = 2, Gender = 0, TID = 30724, Nature = Nature.Brave, },
|
||||
new EncounterTrade { Species = 129, Level = 5, Ability = 1, Gender = 0, TID = 44285, Nature = Nature.Adamant, }, // Magikarp
|
||||
new EncounterTrade { Species = 133, Level = 5, Ability = 1, Gender = 1, TID = 29294, Nature = Nature.Docile, }, // Eevee
|
||||
|
||||
new EncounterTrade { Species = 83, Level = 10, Ability = 1, Gender = 0, TID = 00185, Nature = Nature.Jolly, IVs = new[] {-1, -1, -1, 31, -1, -1}, }, // Farfetch'd
|
||||
new EncounterTrade { Species = 208, Level = 20, Ability = 1, Gender = 1, TID = 19250, Nature = Nature.Impish, IVs = new[] {-1, -1, 31, -1, -1, -1}, }, // Steelix
|
||||
new EncounterTrade { Species = 625, Level = 50, Ability = 1, Gender = 0, TID = 03447, Nature = Nature.Adamant, IVs = new[] {-1, 31, -1, -1, -1, -1}, }, // Bisharp
|
||||
|
||||
new EncounterTrade { Species = 656, Level = 5, Ability = 1, Gender = 0, TID = 00037, Nature = Nature.Jolly, IVs = new[] {20, 20, 20, 31, 20, 20}, }, // Froakie
|
||||
new EncounterTrade { Species = 650, Level = 5, Ability = 1, Gender = 0, TID = 00037, Nature = Nature.Adamant, IVs = new[] {20, 31, 20, 20, 20, 20}, }, // Chespin
|
||||
new EncounterTrade { Species = 653, Level = 5, Ability = 1, Gender = 0, TID = 00037, Nature = Nature.Modest, IVs = new[] {20, 20, 20, 20, 31, 20}, }, // Fennekin
|
||||
|
||||
new EncounterTrade { Species = 280, Level = 5, Ability = 1, Gender = 1, TID = 37110, Nature = Nature.Modest, IVs = new[] {20, 20, 20, 31, 31, 20}, }, // Ralts
|
||||
};
|
||||
private static readonly EncounterTrade[] TradeGift_AO =
|
||||
{
|
||||
new EncounterTrade { Species = 296, Ability = 2, Gender = 0, TID = 30724, Nature = Nature.Brave, },
|
||||
new EncounterTrade { Species = 296, Level = 9, Ability = 2, Gender = 0, TID = 30724, Nature = Nature.Brave, IVs = new[] {-1, 31, -1, -1, -1, -1}, }, // Makuhita
|
||||
new EncounterTrade { Species = 300, Level = 25, Ability = 1, Gender = 1, TID = 03239, Nature = Nature.Naughty, IVs = new[] {-1, -1, -1, 31, -1, -1}, }, // Skitty
|
||||
new EncounterTrade { Species = 222, Level = 50, Ability = 4, Gender = 1, TID = 00325, Nature = Nature.Calm, IVs = new[] {31, -1, -1, -1, -1, 31}, }, // Corsola
|
||||
};
|
||||
#endregion
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue