mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-09 00:05:58 -05:00
Add den crossover via online share
fix ability deferral for non-HA (eg. A4 mr rime encounter)
This commit is contained in:
@@ -26,8 +26,10 @@ static Encounters8()
|
||||
|
||||
StaticSW = GetStaticEncounters(Encounter_SWSH, SW);
|
||||
StaticSH = GetStaticEncounters(Encounter_SWSH, SH);
|
||||
StaticSW = ArrayUtil.ConcatAll(StaticSW, Nest_Common, Nest_SW, GetStaticEncounters(Crystal_SWSH, SW));
|
||||
StaticSH = ArrayUtil.ConcatAll(StaticSH, Nest_Common, Nest_SH, GetStaticEncounters(Crystal_SWSH, SH));
|
||||
|
||||
// Include Nest Tables for both versions -- online play can share them across versions! In the IsMatch method we check if it's a valid share.
|
||||
StaticSW = ArrayUtil.ConcatAll(StaticSW, Nest_Common, Nest_SW, Nest_SH, GetStaticEncounters(Crystal_SWSH, SW));
|
||||
StaticSH = ArrayUtil.ConcatAll(StaticSH, Nest_Common, Nest_SW, Nest_SH, GetStaticEncounters(Crystal_SWSH, SH));
|
||||
|
||||
MarkEncountersGeneration(8, SlotsSW, SlotsSH);
|
||||
MarkEncountersGeneration(8, StaticSW, StaticSH, TradeGift_SWSH);
|
||||
|
||||
@@ -100,7 +100,7 @@ internal static class Encounters8Nest
|
||||
private const byte Nest91 = 91;
|
||||
private const byte Nest92 = 92;
|
||||
|
||||
internal static IReadOnlyList<IReadOnlyList<byte>> NestLocations = new []
|
||||
internal static readonly IReadOnlyList<IReadOnlyList<byte>> NestLocations = new []
|
||||
{
|
||||
new byte[] {144, 134, 122}, // 00 : Stony Wilderness, South Lake Miloch, Rolling Fields
|
||||
new byte[] {144, 126}, // 01 : Stony Wilderness, Watchtower Ruins
|
||||
@@ -196,10 +196,10 @@ internal static class Encounters8Nest
|
||||
new byte[] {142, 124}, // 91 : Bridge Field, Dappled Grove
|
||||
new byte[] {146}, // 92 : Dusty Bowl
|
||||
};
|
||||
|
||||
|
||||
// Abilities Allowed
|
||||
internal const int A3 = 0; // 1/2 only
|
||||
internal const int A4 = -1; // 1/2/H
|
||||
private const int A4 = -1; // 1/2/H
|
||||
|
||||
internal static readonly EncounterStatic8N[] Nest_Common =
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ protected override bool IsMatchLevel(PKM pkm, int lvl)
|
||||
protected override bool IsMatchLocation(PKM pkm)
|
||||
{
|
||||
var loc = pkm.Met_Location;
|
||||
return loc == OnlineNest || loc <= 255 && NestLocations.Contains((byte)loc);
|
||||
return loc == OnlineNest || (loc <= 255 && NestLocations.Contains((byte)loc));
|
||||
}
|
||||
|
||||
public override bool IsMatch(PKM pkm, int lvl)
|
||||
@@ -66,6 +66,9 @@ public override bool IsMatch(PKM pkm, int lvl)
|
||||
if (pkm.FlawlessIVCount < MinRank + 1)
|
||||
return false;
|
||||
|
||||
if (Version != GameVersion.SWSH && pkm.Version != (int) Version && pkm.Met_Location != OnlineNest)
|
||||
return false;
|
||||
|
||||
return base.IsMatch(pkm, lvl);
|
||||
}
|
||||
|
||||
@@ -74,7 +77,7 @@ public override bool IsMatchDeferred(PKM pkm)
|
||||
if (base.IsMatchDeferred(pkm))
|
||||
return true;
|
||||
if (Ability == Encounters8Nest.A3 && pkm.AbilityNumber == 4)
|
||||
return false;
|
||||
return true;
|
||||
if (pkm is IGigantamax g && g.CanGigantamax != CanGigantamax)
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user