Handle downleveled raids

Closes #2573
- self-hosted raids can be downleveled too (see cufant), probably only
by 1 rank
- min-rank check now checks for downleveled cases

- Add extra gyarados/ferrothorn locations
This commit is contained in:
Kurt 2019-12-26 12:59:16 -08:00
parent 4740fab5ec
commit baf0f52f06
3 changed files with 11 additions and 4 deletions

View file

@ -141,7 +141,7 @@ namespace PKHeX.Core
new EncounterStatic8S{ Species = 091, Level = 46, Locations = new[] {128, 130}, }, // Cloyster at East/West Lake Axewell (in a Wild Area)
new EncounterStatic8S{ Species = 131, Level = 56, Locations = new[] {128, 130, 134, 138, 154 }, }, // Lapras at North/East/South/West Lake Miloch/Axwell, the Lake of Outrage (in a Wild Area)
new EncounterStatic8S{ Species = 119, Level = 46, Locations = new[] {128, 130, 134, 138, 142, 154 }, }, // Seaking in Bridge Field, at North/East/South/West Lake Miloch/Axwell, at the Lake of Outrage (in a Wild Area)
new EncounterStatic8 { Species = 130, Level = 56, Location = 146, }, // Gyarados in Dusty Bowl (in a Wild Area)
new EncounterStatic8S{ Species = 130, Level = 56, Locations = new[] {128, 146}, }, // Gyarados in East Lake Axewell, Dusty Bowl (in a Wild Area)
new EncounterStatic8 { Species = 279, Level = 46, Location = 142, }, // Pelipper in Bridge Field (in a Wild Area)
new EncounterStatic8 { Species = 853, Level = 56, Location = 130, }, // Grapploct at West Lake Axewell (in a Wild Area)
new EncounterStatic8S{ Species = 593, Level = 46, Locations = new[] {128, 130, 134, 138, 154 }, }, // Jellicent at North/East/South/West Lake Miloch/Axwell, the Lake of Outrage (in a Wild Area)
@ -166,7 +166,7 @@ namespace PKHeX.Core
new EncounterStatic8 { Species = 768, Level = 50, Location = 142, }, // Golisopod in Bridge Field (in a Wild Area)
new EncounterStatic8 { Species = 760, Level = 42, Location = 142, }, // Bewear in Bridge Field (in a Wild Area)
new EncounterStatic8 { Species = 820, Level = 42, Location = 142, }, // Greedent in Bridge Field (in a Wild Area)
new EncounterStatic8 { Species = 598, Level = 40, Location = 142, }, // Ferrothorn in Bridge Field (in a Wild Area)
new EncounterStatic8S{ Species = 598, Level = 40, Locations = new[] {142, 144}, }, // Ferrothorn in Bridge Field (in a Wild Area)
new EncounterStatic8 { Species = 344, Level = 42, Location = 144, }, // Claydol in the Stony Wilderness (in a Wild Area)
new EncounterStatic8 { Species = 477, Level = 60, Location = 144, }, // Dusknoir in the Stony Wilderness (in a Wild Area)
new EncounterStatic8 { Species = 623, Level = 43, Location = 144, }, // Golurk in the Stony Wilderness (in a Wild Area)

View file

@ -51,8 +51,15 @@ namespace PKHeX.Core
var rank = (uint)(metLevel / 10);
if (rank > 4)
return false;
if (rank < MinRank || MaxRank < rank)
if (rank > MaxRank)
return false;
if (rank < MinRank) // downleveled
{
if (pkm.Met_Location == SharedNest)
{ } // shared nests can be downleveled to any
else if (MinRank - rank > 1) // native downlevels: only allow 1 rank down (?)
return false;
}
return metLevel % 10 <= 5;
}

View file

@ -33,7 +33,7 @@ namespace PKHeX.Core
{
switch (encounter)
{
case EncounterStatic8N r when pkm.Met_Location == Encounters8Nest.SharedNest && !EncounterStatic8N.IsHighestLevelTier(pkm.Met_Level):
case EncounterStatic8N r when !EncounterStatic8N.IsHighestLevelTier(pkm.Met_Level): // Downleveled Raid can happen for shared raids and self-hosted raids.
moves.AddRange(MoveLevelUp.GetMovesLevelUp(pkm, r.Species, -1, -1, 60, r.Form, GameVersion.SW, false, 8));
break;
}