PKHeX/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic8.cs
Lusamine 15da92f9bc
Document weather for static encounters (#3127)
This only matches the weather table with the Pokemon and does not fully
account for whether a location can spawn a particular weather.

Additional minor changes:
- Adds ScriptedNoMarks to Regis and Glimwood Tangle static encounters
- Corrects a few version-specific Pokemon such as Ludicolo/Shiftry
- Removes erroneous encounters such as Milotic in East/West Lake Axewell
- Removes an unused Motostoke Stadium encounter
2021-01-16 09:31:21 -08:00

40 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
namespace PKHeX.Core
{
/// <summary>
/// Generation 8 Static Encounter
/// </summary>
/// <inheritdoc cref="EncounterStatic"/>
public record EncounterStatic8 : EncounterStatic, IDynamaxLevel, IGigantamax, IRelearn
{
public sealed override int Generation => 8;
public bool ScriptedNoMarks { get; init; }
public bool CanGigantamax { get; set; }
public byte DynamaxLevel { get; set; }
public IReadOnlyList<int> Relearn { get; init; } = Array.Empty<int>();
public AreaWeather8 Weather {get; init; } = AreaWeather8.Normal;
public EncounterStatic8(GameVersion game) : base(game) { }
protected override bool IsMatchLevel(PKM pkm, DexLevel evo)
{
var met = pkm.Met_Level;
var lvl = Level;
if (met == lvl)
return true;
if (lvl < 60 && EncounterArea8.IsBoostedArea60(Location))
return met == 60;
return false;
}
public override bool IsMatch(PKM pkm, DexLevel evo)
{
if (pkm is IDynamaxLevel d && d.DynamaxLevel < DynamaxLevel)
return false;
return base.IsMatch(pkm, evo);
}
}
}