mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-22 10:23:09 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Encounter Slot found in <see cref="GameVersion.XY"/>.
|
|
/// </summary>
|
|
/// <inheritdoc cref="EncounterSlot"/>
|
|
public sealed record EncounterSlot6XY : EncounterSlot
|
|
{
|
|
public override int Generation => 6;
|
|
public bool Pressure { get; init; }
|
|
public bool IsFriendSafari => Area.Type == SlotType.FriendSafari;
|
|
public bool IsHorde => Area.Type == SlotType.Horde;
|
|
|
|
public EncounterSlot6XY(EncounterArea6XY area, int species, int form, byte min, byte max) : base(area, species, form, min, max)
|
|
{
|
|
}
|
|
|
|
protected override void SetFormatSpecificData(PKM pk)
|
|
{
|
|
var pk6 = (PK6)pk;
|
|
pk6.SetRandomMemory6();
|
|
pk6.SetRandomEC();
|
|
}
|
|
|
|
public override string GetConditionString(out bool valid)
|
|
{
|
|
valid = true;
|
|
return Pressure ? LegalityCheckStrings.LEncConditionLead : LegalityCheckStrings.LEncCondition;
|
|
}
|
|
|
|
public EncounterSlot6XY CreatePressureFormCopy(int form) => this with {Form = form, Pressure = true};
|
|
|
|
protected override HiddenAbilityPermission IsHiddenAbilitySlot() => IsHorde || IsFriendSafari ? HiddenAbilityPermission.Possible : HiddenAbilityPermission.Never;
|
|
}
|