2018-11-17 23:12:32 +00:00
using System ;
using System.Collections.Generic ;
2018-11-15 01:40:41 +00:00
using System.Linq ;
using static PKHeX . Core . EncounterUtil ;
2018-11-11 21:12:24 +00:00
namespace PKHeX.Core
{
internal static class Encounters7b
{
internal static readonly EncounterArea [ ] SlotsGP = GetEncounterTables ( GameVersion . GP ) ;
internal static readonly EncounterArea [ ] SlotsGE = GetEncounterTables ( GameVersion . GE ) ;
internal static readonly EncounterStatic [ ] StaticGP , StaticGE ;
2018-11-15 01:40:41 +00:00
internal static readonly EncounterArea [ ] SlotsGO_GG = GetGoParkArea ( ) ;
2018-11-11 21:12:24 +00:00
static Encounters7b ( )
{
StaticGP = GetStaticEncounters ( Encounter_GG , GameVersion . GP ) ;
StaticGE = GetStaticEncounters ( Encounter_GG , GameVersion . GE ) ;
SlotsGP . SetVersion ( GameVersion . GP ) ;
SlotsGE . SetVersion ( GameVersion . GE ) ;
2018-11-17 23:12:32 +00:00
ManuallyAddRareSpawns ( SlotsGP ) ;
ManuallyAddRareSpawns ( SlotsGE ) ;
2018-11-11 21:12:24 +00:00
Encounter_GG . SetVersion ( GameVersion . GG ) ;
TradeGift_GG . SetVersion ( GameVersion . GG ) ;
MarkEncountersGeneration ( 7 , SlotsGP , SlotsGE ) ;
MarkEncountersGeneration ( 7 , StaticGP , StaticGE , TradeGift_GG ) ;
}
private static readonly EncounterStatic [ ] Encounter_GG =
{
// encounters
new EncounterStatic { Species = 144 , Level = 50 , Location = 44 , IV3 = true , } , // Articuno @ Seafoam Islands
new EncounterStatic { Species = 145 , Level = 50 , Location = 42 , IV3 = true , } , // Zapdos @ Power Plant
new EncounterStatic { Species = 146 , Level = 50 , Location = 45 , IV3 = true , } , // Moltres @ Victory Road
new EncounterStatic { Species = 150 , Level = 70 , Location = 46 , IV3 = true , } , // Mewtwo @ Cerulean Cave
new EncounterStatic { Species = 143 , Level = 34 , Location = 14 , IV3 = true , } , // Snorlax @ Route 12
new EncounterStatic { Species = 143 , Level = 34 , Location = 18 , IV3 = true , } , // Snorlax @ Route 16
new EncounterStatic { Species = 100 , Level = 42 , Location = 42 , IV3 = true , } , // Voltorb @ Power Plant
new EncounterStatic { Species = 101 , Level = 42 , Location = 42 , IV3 = true , } , // Electrode @ Power Plant
// gifts
new EncounterStatic { Species = 025 , Level = 05 , Location = 28 , Gift = true , IVs = new [ ] { 31 , 31 , 31 , 31 , 31 , 31 } , Shiny = Shiny . Never , Form = 8 , Version = GameVersion . GP } , // Pikachu @ Pallet Town
new EncounterStatic { Species = 133 , Level = 05 , Location = 28 , Gift = true , IVs = new [ ] { 31 , 31 , 31 , 31 , 31 , 31 } , Shiny = Shiny . Never , Form = 1 , Version = GameVersion . GE } , // Eevee @ Pallet Town
2018-11-17 00:44:25 +00:00
new EncounterStatic { Species = 129 , Level = 05 , Location = 06 , Gift = true , IVs = new [ ] { 30 , 31 , 25 , 30 , 25 , 25 } } , // Magikarp @ Route 4
2018-11-11 21:12:24 +00:00
2018-11-19 04:39:15 +00:00
// unused new EncounterStatic { Species = 133, Level = 30, Location = 34, Gift = true }, // Eevee @ Celadon City
new EncounterStatic { Species = 131 , Level = 34 , Location = 52 , Gift = true , IVs = new [ ] { 31 , 25 , 25 , 25 , 30 , 30 } } , // Lapras @ Saffron City (Silph Co. Employee, inside)
2018-11-11 21:12:24 +00:00
new EncounterStatic { Species = 106 , Level = 30 , Location = 38 , Gift = true , IVs = new [ ] { 25 , 30 , 25 , 31 , 25 , 30 } } , // Hitmonlee @ Saffron City (Karate Master)
new EncounterStatic { Species = 107 , Level = 30 , Location = 38 , Gift = true , IVs = new [ ] { 25 , 31 , 30 , 25 , 25 , 30 } } , // Hitmonchan @ Saffron City (Karate Master)
new EncounterStatic { Species = 140 , Level = 44 , Location = 36 , Gift = true , IV3 = true } , // Kabuto @ Cinnabar Island (Cinnabar Pokémon Lab)
new EncounterStatic { Species = 138 , Level = 44 , Location = 36 , Gift = true , IV3 = true } , // Omanyte @ Cinnabar Island (Cinnabar Pokémon Lab)
new EncounterStatic { Species = 142 , Level = 44 , Location = 36 , Gift = true , IV3 = true } , // Aerodactyl @ Cinnabar Island (Cinnabar Pokémon Lab)
new EncounterStatic { Species = 001 , Level = 12 , Location = 31 , Gift = true , IVs = new [ ] { 31 , 25 , 30 , 25 , 25 , 30 } } , // Bulbasaur @ Cerulean City
new EncounterStatic { Species = 004 , Level = 14 , Location = 26 , Gift = true , IVs = new [ ] { 25 , 30 , 25 , 31 , 30 , 25 } } , // Charmander @ Route 24
new EncounterStatic { Species = 007 , Level = 16 , Location = 33 , Gift = true , IVs = new [ ] { 25 , 25 , 30 , 25 , 31 , 30 } } , // Squirtle @ Vermillion City
2018-11-19 04:39:15 +00:00
new EncounterStatic { Species = 137 , Level = 34 , Location = 38 , Gift = true , IVs = new [ ] { 25 , 25 , 30 , 25 , 31 , 30 } } , // Porygon @ Saffron City (Silph Co. Employee, outside)
2018-11-17 00:44:25 +00:00
new EncounterStatic { Species = 053 , Level = 16 , Location = 33 , Gift = true , IVs = new [ ] { 30 , 30 , 25 , 31 , 25 , 25 } , Version = GameVersion . GP } , // Persian @ Vermillion City (Outside Fan Club)
new EncounterStatic { Species = 059 , Level = 16 , Location = 33 , Gift = true , IVs = new [ ] { 25 , 30 , 25 , 31 , 30 , 25 } , Version = GameVersion . GE } , // Arcanine @ Vermillion City (Outside Fan Club)
2018-11-11 21:12:24 +00:00
} ;
private static readonly string [ ] T1 = { null , "ミニコ" , "Tatianna" , "BarbaRatatta" , "Addoloratta" , "Barbaratt" , null , "Tatiana" , "미니꼬" , "小幂妮" , "小幂妮" , } ;
private static readonly string [ ] T2 = { null , "ボーアイス" , "Nicholice" , "Iceman-4L0L4" , "Goffreddo" , "Eisper" , null , "Gelasio" , "보아이스" , "露冰冰" , "露冰冰" , } ;
private static readonly string [ ] T3 = { null , "レディダグ" , "Diggette" , "Taupilady" , "LadyGlett" , "Digga" , null , "Glenda" , "레이디그다" , "蒂淑" , "蒂淑" , } ;
private static readonly string [ ] T4 = { null , "ワルモン" , "Darko" , "AlolaZeDark" , "Mattetro" , "Bösbert" , null , "Sinesio" , "나뻐기" , "达怀丹" , "达怀丹" , } ;
private static readonly string [ ] T5 = { null , "エリッチ" , "Psytrice" , "TopDeTonCœur" , "Chulia" , "Assana" , null , "Menchu" , "엘리츄" , "晶莹丘" , "晶莹丘" , } ;
private static readonly string [ ] T6 = { null , "ジェンガラ" , "Genmar" , "OSS-Dandy7" , "Mr. Owak" , "Knoggelius" , null , "Mario" , "젠구리" , "申史加拉" , "申史加拉" , } ;
private static readonly string [ ] T7 = { null , "マニシ" , "Exemann" , "Koko-fan" , "Exechiele" , "Einrich" , null , "Gunter" , "마니시" , "艾浩舒" , "艾浩舒" , } ;
private static readonly string [ ] T8 = { null , "コツブ" , "Higeo" , "Montagnou" , "George" , "Karstein" , null , "Georgie" , "산돌" , "科布" , "科布" , } ;
internal static readonly EncounterTrade [ ] TradeGift_GG =
{
2018-11-16 01:35:34 +00:00
// Random candy values! They can be zero so no impact on legality even though statistically rare.
2018-11-16 22:20:06 +00:00
new EncounterTrade { Species = 019 , Level = 12 , Form = 1 , TrainerNames = T1 , TID7 = 121106 , OTGender = 1 , Shiny = Shiny . Random , IVs = new [ ] { 31 , 31 , - 1 , - 1 , - 1 , - 1 } , IsNicknamed = false } , // Rattata @ Cerulean City, AV rand [0-5)
new EncounterTrade { Species = 027 , Level = 27 , Form = 1 , TrainerNames = T2 , TID7 = 703019 , OTGender = 0 , Shiny = Shiny . Random , IVs = new [ ] { - 1 , 31 , 31 , - 1 , - 1 , - 1 } , IsNicknamed = false , Version = GameVersion . GP } , // Sandshrew @ Celadon City, AV rand [0-5)
new EncounterTrade { Species = 037 , Level = 27 , Form = 1 , TrainerNames = T2 , TID7 = 703019 , OTGender = 0 , Shiny = Shiny . Random , IVs = new [ ] { - 1 , - 1 , - 1 , 31 , 31 , - 1 } , IsNicknamed = false , Version = GameVersion . GE } , // Vulpix @ Celadon City, AV rand [0-5)
new EncounterTrade { Species = 050 , Level = 25 , Form = 1 , TrainerNames = T3 , TID7 = 520159 , OTGender = 1 , Shiny = Shiny . Random , IVs = new [ ] { - 1 , 31 , - 1 , 31 , - 1 , - 1 } , IsNicknamed = false } , // Diglett @ Lavender Town, AV rand [0-5)
new EncounterTrade { Species = 052 , Level = 44 , Form = 1 , TrainerNames = T4 , TID7 = 000219 , OTGender = 0 , Shiny = Shiny . Random , IVs = new [ ] { 31 , - 1 , - 1 , 31 , - 1 , - 1 } , IsNicknamed = false , Version = GameVersion . GE } , // Meowth @ Cinnabar Island, AV rand [0-10)
new EncounterTrade { Species = 088 , Level = 44 , Form = 1 , TrainerNames = T4 , TID7 = 000219 , OTGender = 0 , Shiny = Shiny . Random , IVs = new [ ] { 31 , 31 , - 1 , - 1 , - 1 , - 1 } , IsNicknamed = false , Version = GameVersion . GP } , // Grimer @ Cinnabar Island, AV rand [0-10)
new EncounterTrade { Species = 026 , Level = 30 , Form = 1 , TrainerNames = T5 , TID7 = 940711 , OTGender = 1 , Shiny = Shiny . Random , IVs = new [ ] { - 1 , - 1 , - 1 , 31 , 31 , - 1 } , IsNicknamed = false } , // Raichu @ Saffron City, AV rand [0-10)
new EncounterTrade { Species = 105 , Level = 38 , Form = 1 , TrainerNames = T6 , TID7 = 102595 , OTGender = 0 , Shiny = Shiny . Random , IVs = new [ ] { - 1 , 31 , 31 , - 1 , - 1 , - 1 } , IsNicknamed = false } , // Marowak @ Fuchsia City, AV rand [0-10)
new EncounterTrade { Species = 103 , Level = 46 , Form = 1 , TrainerNames = T7 , TID7 = 060310 , OTGender = 0 , Shiny = Shiny . Random , IVs = new [ ] { - 1 , 31 , - 1 , - 1 , 31 , - 1 } , IsNicknamed = false } , // Exeggutor @ Indigo Plateau, AV rand [0-15)
new EncounterTrade { Species = 074 , Level = 16 , Form = 1 , TrainerNames = T8 , TID7 = 551873 , OTGender = 0 , Shiny = Shiny . Random , IVs = new [ ] { 31 , 31 , - 1 , - 1 , - 1 , - 1 } , IsNicknamed = false } , // Geodude @ Vermilion City, AV rand [0-5)
2018-11-11 21:12:24 +00:00
} ;
2018-11-15 01:40:41 +00:00
private static EncounterArea [ ] GetGoParkArea ( )
{
var area = new EncounterArea { Location = 50 } ;
IEnumerable < EncounterSlot > GetAllSlot ( int species )
{
yield return GetSlot ( species , 0 ) ;
if ( Legal . AlolanOriginForms . Contains ( species ) | | Legal . EvolveToAlolanForms . Contains ( species ) )
yield return GetSlot ( species , 1 ) ;
}
EncounterSlot GetSlot ( int species , int form )
{
return new EncounterSlot
{
Area = area ,
Generation = 7 ,
Species = species ,
LevelMin = 2 , // todo
2018-11-17 23:12:32 +00:00
LevelMax = 40 , // todo
2018-11-15 01:40:41 +00:00
Form = form ,
Type = SlotType . GoPark ,
Version = GameVersion . GO ,
} ;
}
2018-11-19 21:07:21 +00:00
area . Slots = Enumerable . Range ( 1 , 150 ) . Concat ( Enumerable . Range ( 808 , 2 ) ) . SelectMany ( GetAllSlot ) . ToArray ( ) ;
2018-11-15 01:40:41 +00:00
return new [ ] { area } ;
}
2018-11-17 23:12:32 +00:00
// todo: manual addition of slots
private class RareSpawn
{
public int Species ;
public int [ ] Locations ;
}
private static readonly RareSpawn [ ] Rare =
{
// Normal
new RareSpawn { Species = 001 , Locations = new [ ] { 039 } } ,
new RareSpawn { Species = 004 , Locations = new [ ] { 005 , 006 , 041 } } ,
new RareSpawn { Species = 007 , Locations = new [ ] { 026 , 027 , 044 } } ,
new RareSpawn { Species = 106 , Locations = new [ ] { 045 } } ,
new RareSpawn { Species = 107 , Locations = new [ ] { 045 } } ,
new RareSpawn { Species = 113 , Locations = new [ ] { 007 , 008 , 010 , 011 , 012 , 013 , 014 , 015 , 016 , 017 , 018 , 019 , 020 , 023 , 025 , 040 , 042 , 043 , 045 , 047 , 051 } } ,
new RareSpawn { Species = 137 , Locations = new [ ] { 009 } } ,
new RareSpawn { Species = 143 , Locations = new [ ] { 046 } } ,
// Water
new RareSpawn { Species = 131 , Locations = new [ ] { 021 , 022 } } ,
// Fly
new RareSpawn { Species = 006 , Locations = new [ ] { 004 , 005 , 006 , 009 , 010 , 012 , 013 , 014 , 015 , 016 , 017 , 018 , 019 , 020 , 021 , 023 , 024 , 025 , 026 , 027 } } ,
2018-11-18 18:36:28 +00:00
new RareSpawn { Species = 144 , Locations = new [ ] { 004 , 005 , 006 , 009 , 010 , 012 , 013 , 014 , 015 , 016 , 017 , 018 , 019 , 020 , 021 , 023 , 024 , 025 , 026 , 027 } } ,
new RareSpawn { Species = 145 , Locations = new [ ] { 004 , 005 , 006 , 009 , 010 , 012 , 013 , 014 , 015 , 016 , 017 , 018 , 019 , 020 , 021 , 023 , 024 , 025 , 026 , 027 } } ,
new RareSpawn { Species = 146 , Locations = new [ ] { 004 , 005 , 006 , 009 , 010 , 012 , 013 , 014 , 015 , 016 , 017 , 018 , 019 , 020 , 021 , 023 , 024 , 025 , 026 , 027 } } ,
2018-11-17 23:12:32 +00:00
new RareSpawn { Species = 149 , Locations = new [ ] { 004 , 005 , 006 , 009 , 010 , 012 , 013 , 014 , 015 , 016 , 017 , 018 , 019 , 020 , 021 , 023 , 024 , 025 , 026 , 027 } }
} ;
private static void ManuallyAddRareSpawns ( IEnumerable < EncounterArea > areas )
{
foreach ( var table in areas )
{
var loc = table . Location ;
var species = Rare . Where ( z = > z . Locations . Contains ( loc ) ) . Select ( z = > z . Species ) . ToArray ( ) ;
if ( species . Length = = 0 )
continue ;
var slots = table . Slots ;
var first = slots [ 0 ] ;
var extra = species
. Select ( z = > new EncounterSlot
{
Area = table ,
Species = z ,
LevelMin = ( z = = 006 | | z = = 149 ) ? 03 : first . LevelMin ,
LevelMax = ( z = = 006 | | z = = 149 ) ? 56 : first . LevelMax ,
} ) . ToArray ( ) ;
int count = slots . Length ;
Array . Resize ( ref slots , count + extra . Length ) ;
extra . CopyTo ( slots , count ) ;
table . Slots = slots ;
}
}
2018-11-11 21:12:24 +00:00
}
}