2019-11-19 03:23:01 +00:00
|
|
|
|
using System;
|
2020-01-19 00:31:24 +00:00
|
|
|
|
using System.Collections.Generic;
|
2019-11-19 03:23:01 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2020-12-24 08:06:40 +00:00
|
|
|
|
public sealed record EncounterTrade8 : EncounterTrade, IDynamaxLevel, IRelearn, IMemoryOT
|
2019-11-19 03:23:01 +00:00
|
|
|
|
{
|
2020-08-30 22:35:59 +00:00
|
|
|
|
public override int Generation => 8;
|
|
|
|
|
|
2019-11-19 03:23:01 +00:00
|
|
|
|
public byte DynamaxLevel { get; set; }
|
2020-12-24 08:06:40 +00:00
|
|
|
|
public IReadOnlyList<int> Relearn { get; init; } = Array.Empty<int>();
|
2019-11-19 03:23:01 +00:00
|
|
|
|
|
2020-08-01 00:25:14 +00:00
|
|
|
|
public int OT_Memory { get; set; }
|
|
|
|
|
public int OT_TextVar { get; set; }
|
|
|
|
|
public int OT_Feeling { get; set; }
|
|
|
|
|
public int OT_Intensity { get; set; }
|
2019-11-26 18:46:16 +00:00
|
|
|
|
|
2021-01-04 00:49:49 +00:00
|
|
|
|
public EncounterTrade8(GameVersion game, int species, int level, int m, int a, int f, int i) : base(game)
|
2019-11-19 03:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
Species = species;
|
|
|
|
|
Level = level;
|
2019-11-26 18:46:16 +00:00
|
|
|
|
|
|
|
|
|
OT_Memory = m;
|
|
|
|
|
OT_TextVar = a;
|
|
|
|
|
OT_Feeling = f;
|
|
|
|
|
OT_Intensity = i;
|
2019-11-19 03:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
public override bool IsMatch(PKM pkm, DexLevel evo)
|
2019-11-19 03:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
if (pkm is IDynamaxLevel d && d.DynamaxLevel < DynamaxLevel)
|
|
|
|
|
return false;
|
2020-06-19 23:51:15 +00:00
|
|
|
|
if (pkm.FlawlessIVCount < FlawlessIVCount)
|
|
|
|
|
return false;
|
2020-08-21 23:35:49 +00:00
|
|
|
|
return base.IsMatch(pkm, evo);
|
2019-11-19 03:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
protected override void ApplyDetails(ITrainerInfo sav, EncounterCriteria criteria, PKM pk)
|
2019-11-19 03:23:01 +00:00
|
|
|
|
{
|
2020-06-17 02:46:22 +00:00
|
|
|
|
base.ApplyDetails(sav, criteria, pk);
|
2019-11-26 18:46:16 +00:00
|
|
|
|
pk.SetRelearnMoves(Relearn);
|
|
|
|
|
|
|
|
|
|
var pk8 = (PK8)pk;
|
|
|
|
|
pk8.DynamaxLevel = DynamaxLevel;
|
2020-06-17 02:46:22 +00:00
|
|
|
|
pk8.HT_Language = sav.Language;
|
2019-11-26 18:46:16 +00:00
|
|
|
|
pk8.OT_Memory = OT_Memory;
|
|
|
|
|
pk8.OT_TextVar = OT_TextVar;
|
|
|
|
|
pk8.OT_Feeling = OT_Feeling;
|
|
|
|
|
pk8.OT_Intensity = OT_Intensity;
|
2019-11-19 03:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|