include "Utils/SpeciesSize.fbs";

namespace pkNX.Structures.FlatBuffers.SWSH;
attribute "fs_serializer";

// *.gfbpokecfg

enum SpeciesOrigin : ubyte
{
    Rg_Series = 0,
    Gs_Series,
    Rs_Series,
    Dp_Series,
    Bw_Series, //5
    B2W2_Series, // 6 (Therian formes)
    Xy_Series, // 7
    Oras_Series, // 8
    Sm_Series, // 9
    Usm_Series, // 10
    Beluga_Series, // 11
    Orion_Series, // 12
    Rigel_Series, // 13
    Next_Series, // 14, Speculative
}

enum SpeciesModel : ushort
{
    Model_Egg,
    Model_Bulbasaur = 1,
    Model_Ivysaur,
    Model_Venusaur,
    Model_Charmander,
    Model_Charmeleon,
    Model_Charizard,
    Model_Squirtle,
    Model_Wartortle,
    Model_Blastoise,
    Model_Caterpie,
    Model_Metapod,
    Model_Butterfree,
    Model_Pikachu = 25,
    Model_Raichu,
    Model_Sandshrew,
    Model_Sandslash,
    Model_Nidoran_F,
    Model_Nidorina,
    Model_Nidoqueen,
    Model_Nidoran_M,
    Model_Nidorino,
    Model_Nidoking,
    Model_Clefairy = 35,
    Model_Clefable,
    Model_Vulpix,
    Model_Ninetales,
    Model_Jigglypuff,
    Model_Wigglytuff,
    Model_Zubat,
    Model_Golbat,
    Model_Oddish,
    Model_Gloom,
    Model_Vileplume,
    Model_Diglett = 50,
    Model_Dugtrio,
    Model_Meowth,
    Model_Persian,
    Model_Psyduck,
    Model_Golduck,
    Model_Growlithe = 58,
    Model_Arcanine,
    Model_Poliwag,
    Model_Poliwhirl,
    Model_Poliwrath,
    Model_Abra,
    Model_Kadabra,
    Model_Alakazam,
    Model_Machop,
    Model_Machoke,
    Model_Machamp,
    Model_Tentacool = 72,
    Model_Tentacruel,
    Model_Ponyta = 77,
    Model_Rapidash,
    Model_Slowpoke,
    Model_Slowbro,
    Model_Magnemite,
    Model_Magneton,
    Model_Farfetchd,
    Model_Shellder = 90,
    Model_Cloyster,
    Model_Gastly,
    Model_Haunter,
    Model_Gengar,
    Model_Onix,
    Model_Krabby = 98,
    Model_Kingler,
    Model_Exeggcute = 102,
    Model_Exeggutor,
    Model_Cubone,
    Model_Marowak,
    Model_Hitmonlee = 106,
    Model_Hitmonchan,
    Model_Lickitung,
    Model_Koffing,
    Model_Weezing,
    Model_Rhyhorn,
    Model_Rhydon,
    Model_Chansey,
    Model_Tangela,
    Model_Kangaskhan,
    Model_Horsea,
    Model_Seadra,
    Model_Goldeen,
    Model_Seaking,
    Model_Staryu,
    Model_Starmie,
    Model_Mrmime,
    Model_Scyther,
    Model_Jynx,
    Model_Electabuzz,
    Model_Magmar,
    Model_Pinsir,
    Model_Tauros,
    Model_Magikarp,
    Model_Gyarados,
    Model_Lapras,
    Model_Ditto,
    Model_Eevee,
    Model_Vaporeon,
    Model_Jolteon,
    Model_Flareon,
    Model_Porygon,
    Model_Omanyte,
    Model_Omastar,
    Model_Kabuto,
    Model_Kabutops,
    Model_Aerodactyl,
    Model_Snorlax,
    Model_Articuno,
    Model_Zapdos,
    Model_Moltres,
    Model_Dratini,
    Model_Dragonair,
    Model_Dragonite,
    Model_Mewtwo,
    Model_Mew,
    Model_Hoothoot = 163,
    Model_Noctowl,
    Model_Crobat = 169,
    Model_Chinchou,
    Model_Lanturn,
    Model_Pichu,
    Model_Cleffa,
    Model_Igglybuff,
    Model_Togepi = 175,
    Model_Togetic,
    Model_Natu,
    Model_Xatu,
    Model_Bellossom = 182,
    Model_Marill,
    Model_Azumarill,
    Model_Sudowoodo = 185,
    Model_Politoed,
    Model_Wooper = 194,
    Model_Quagsire,
    Model_Espeon,
    Model_Umbreon,
    Model_Slowking = 199,
    Model_Wobbuffet = 202,
    Model_Dunsparce = 206,
    Model_Steelix = 208,
    Model_Qwilfish = 211,
    Model_Scizor,
    Model_Shuckle,
    Model_Heracross,
    Model_Sneasel,
    Model_Swinub = 220,
    Model_Piloswine,
    Model_Corsola,
    Model_Remoraid,
    Model_Octillery,
    Model_Delibird,
    Model_Mantine,
    Model_Skarmory,
    Model_Kingdra = 230,
    Model_Porygon2 = 233,
    Model_Tyrogue = 236,
    Model_Hitmontop,
    Model_Smoochum,
    Model_Elekid,
    Model_Magby,
    Model_Milktank = 241,
    Model_Blissey,
    Model_Raikou,
    Model_Entei,
    Model_Suicune,
    Model_Larvitar,
    Model_Pupitar,
    Model_Tyranitar,
    Model_Lugia,
    Model_Hooh,
    Model_Celebi, // End of Johto Series
    Model_Treecko,
    Model_Grovyle,
    Model_Sceptile,
    Model_Torchic,
    Model_Combusken,
    Model_Blaziken,
    Model_Mudkip,
    Model_Marshtomp,
    Model_Swampert,
    Model_Zigzagoon = 263,
    Model_Linoone,
    Model_Lotad = 270,
    Model_Lombre,
    Model_Ludicolo,
    Model_Seedot,
    Model_Nuzleaf,
    Model_Shiftry,
    Model_Wingull = 278,
    Model_Pelipper,
    Model_Ralts,
    Model_Kirlia,
    Model_Gardevoir,
    Model_Nincada = 290,
    Model_Ninjask,
    Model_Shedinja,
    Model_Whismur,
    Model_Loudred,
    Model_Exploud,
    Model_Azurill = 298,
    Model_Sableye = 302,
    Model_Mawile,
    Model_Aron,
    Model_Lairon,
    Model_Aggron,
    Model_Electrike = 309,
    Model_Manectric,
    Model_Roselia = 315,
    Model_Carvanha = 318,
    Model_Sharpedo,
    Model_Wailmer,
    Model_Wailord,
    Model_Torkoal = 324,
    Model_Trapinch = 328,
    Model_Vibrava,
    Model_Flygon,
    Model_Swablu = 333,
    Model_Altaria,
    Model_Lunatone = 337,
    Model_Solrock,
    Model_Barboach,
    Model_Whiscash,
    Model_Corphish,
    Model_Crawdaunt,
    Model_Baltoy,
    Model_Claydol,
    Model_Lileep,
    Model_Cradily,
    Model_Anorith,
    Model_Armaldo,
    Model_Feebas,
    Model_Milotic,
    Model_Duskull = 355,
    Model_Dusclops,
    Model_Absol = 359,
    Model_Wynaut,
    Model_Snorunt,
    Model_Glalie,
    Model_Spheal,
    Model_Sealeo,
    Model_Walrein,
    Model_Relicanth = 369,
    Model_Bagon = 371,
    Model_Shelgon,
    Model_Salamence,
    Model_Beldum,
    Model_Metang,
    Model_Metagross,
    Model_Regirock,
    Model_Regice,
    Model_Registeel,
    Model_Latias,
    Model_Latios,
    Model_Kyogre,
    Model_Groudon,
    Model_Rayquaza,
    Model_Jirachi = 385, //End of Hoenn series
    Model_Shinx = 403,
    Model_Luxio,
    Model_Luxray,
    Model_Budew,
    Model_Roserade,
    Model_Combee = 415,
    Model_Vespiquen,
    Model_Cherubi = 420,
    Model_Cherrim,
    Model_Shellos,
    Model_Gastrodon,
    Model_Drifloon = 425,
    Model_Drifblim,
    Model_Buneary,
    Model_Lopunny,
    Model_Stunky = 434,
    Model_Skuntank,
    Model_Bronzor,
    Model_Bronzong,
    Model_Bonsly,
    Model_Mimejr,
    Model_Happiny,
    Model_Spiritomb = 442,
    Model_Gible,
    Model_Gabite,
    Model_Garchomp,
    Model_Munchlax,
    Model_Riolu,
    Model_Lucario,
    Model_Hippopotas,
    Model_Hippowdon,
    Model_Skorupi,
    Model_Drapion,
    Model_Croagunk,
    Model_Toxicroak,
    Model_Mantyke = 458,
    Model_Snover,
    Model_Abomasnow,
    Model_Weavile,
    Model_Magnezone,
    Model_Lickilicky,
    Model_Rhyperior,
    Model_Tangrowth,
    Model_Electivire,
    Model_Magmortar,
    Model_Togekiss,
    Model_Leafeon = 470,
    Model_Glaceon,
    Model_Mamoswine,
    Model_Porgonz = 474,
    Model_Gallade,
    Model_Dusknoir = 477,
    Model_Froslass,
    Model_Rotom,
    Model_Uxie,
    Model_Mesprit,
    Model_Azelf,
    Model_Dialga,
    Model_Palkia,
    Model_Heatran,
    Model_Regigigas,
    Model_Giratina,
    Model_Cresselia, // End of Sinnoh series
    Model_Victini,
    Model_Lillipup = 506,
    Model_Herdier,
    Model_Stoutland,
    Model_Purrloin,
    Model_Liepard,
    Model_Munna = 517,
    Model_Musharna,
    Model_Pidove,
    Model_Tranquill,
    Model_Unfezant,
    Model_Roggenrola = 524,
    Model_Boldore,
    Model_Gigalith,
    Model_Woobat,
    Model_Swoobat,
    Model_Drilbur,
    Model_Excadrill,
    Model_Audino,
    Model_Timburr,
    Model_Gurdurr,
    Model_Conkeldurr,
    Model_Tympole,
    Model_Palpitoad,
    Model_Seismitoad,
    Model_Throh,
    Model_Sawk,
    Model_Venipede = 543,
    Model_Whirlipede,
    Model_Scolipede,
    Model_Cottonee,
    Model_Whimsicott,
    Model_Petilil,
    Model_Lilligant,
    Model_Basculin = 550,
    Model_Sandile,
    Model_Krokorok,
    Model_Krookodile,
    Model_Darumaka,
    Model_Darmanitan,
    Model_Maractus,
    Model_Dwebble,
    Model_Crustle,
    Model_Scraggy,
    Model_Scrafty,
    Model_Sigilyph,
    Model_Yamask,
    Model_Cofagrigus,
    Model_Tirtouga,
    Model_Carracosta,
    Model_Archen,
    Model_Archeops,
    Model_Trubbish,
    Model_Garbodor,
    Model_Zorua,
    Model_Zoroark,
    Model_Minccino,
    Model_Cinccino,
    Model_Gothita,
    Model_Gothorita,
    Model_Gothitelle,
    Model_Solosis,
    Model_Duosion,
    Model_Reuniclus,
    Model_Vanillite = 582,
    Model_Vanillish,
    Model_Vanilluxe,
    Model_Emolga = 587,
    Model_Karrablast,
    Model_Escavalier,
    Model_Foongus,
    Model_Amoongus,
    Model_Frillish,
    Model_Jelicent,
    Model_Joltik = 595,
    Model_Galvantula,
    Model_Ferroseed,
    Model_Ferrothorn,
    Model_Klink,
    Model_Klang,
    Model_Klinklang,
    Model_Elgyem = 605,
    Model_Beheeyem,
    Model_Litwick,
    Model_Lampent,
    Model_Chandelure,
    Model_Axew,
    Model_Fraxure,
    Model_Haxorus,
    Model_Cubchoo,
    Model_Beartic,
    Model_Cryogonal,
    Model_Shelmet,
    Model_Accelgor,
    Model_Stunfisk,
    Model_Mienfoo,
    Model_Mienshao,
    Model_Druddigon,
    Model_Golett,
    Model_Golurk,
    Model_Pawniard,
    Model_Bisharp,
    Model_Bouffalant,
    Model_Rufflet,
    Model_Braviary,
    Model_Vullaby,
    Model_Mandibuzz,
    Model_Heatmor,
    Model_Durant,
    Model_Deino,
    Model_Zweilous,
    Model_Hydreigon,
    Model_Larvesta,
    Model_Volcarona,
    Model_Cobalion,
    Model_Terrakion,
    Model_Virizion,
    Model_Tornadus,
    Model_Thundurus,
    Model_Reshiram,
    Model_Zekrom,
    Model_Landorus,
    Model_Kyurem,
    Model_Keldeo,
    Model_Genesect = 649, //End of Unova Series
    Model_Phantump = 702,
    Model_Trevenant,
    Model_Skrelp = 709,
    Model_Dragalge,
    Model_Bunnelby,
    Model_Diggersby,
    Model_Noibat = 716,
    Model_Inkay = 726,
    Model_Malamar,
    Model_Pangoro = 730,
    Model_Helioptile,
    Model_Heliolisk,
    Model_Espurr,
    Model_Meowstic,
    Model_Pumpkaboo,
    Model_Gourgeist,
    Model_Tyrunt,
    Model_Tyrantrum,
    Model_Amaura,
    Model_Aurorus,
    Model_Dedenne,
    Model_Swirlix,
    Model_Slurpuff,
    Model_Honedge,
    Model_Doublade,
    Model_Aegislash,
    Model_Binacle,
    Model_Barbaracle,
    Model_Bergmite,
    Model_Avalugg = 751,
    Model_Pancham,
    Model_Fletchling,
    Model_Fletchinder,
    Model_Talonflame,
    Model_Clauncher,
    Model_Clawitzer,
    Model_Spritzee,
    Model_Aromatisse,
    Model_Klefki,
    Model_Hawlucha,
    Model_Noivern,
    Model_Goomy,
    Model_Sliggoo,
    Model_Goodra,
    Model_Carbink,
    Model_Sylveon,
    Model_Xerneas,
    Model_Yveltal,
    Model_Zygarde,
    Model_Diancie,
    Model_Volcanion = 773, // End of Kalos series
    Model_Mareanie = 801,
    Model_Toxapex,
    Model_Morelull,
    Model_Shiinotic,
    Model_Salandit,
    Model_Salazzle,
    Model_Pikipek,
    Model_Trumbeak,
    Model_Toucannon,
    Model_Oranguru = 810,
    Model_Bounsweet = 812,
    Model_Steenee,
    Model_Tsareena,
    Model_Passimian,
    Model_Jangmoo,
    Model_Hakamoo,
    Model_Kommoo,
    Model_Mimikyu,
    Model_Wishiwashi,
    Model_Pyukumuku,
    Model_Sandyghast,
    Model_Palossand,
    Model_Rockruff = 828,
    Model_Lycanroc,
    Model_Tapu_Koko,
    Model_Tapu_Lele,
    Model_Tapu_Bulu,
    Model_Tapu_Fini,
    Model_Cutiefly,
    Model_Ribombee,
    Model_Grubbin,
    Model_Charjabug,
    Model_Vikavolt,
    Model_Mudbray,
    Model_Mudsdale,
    Model_Rowlett,
    Model_Dartrix,
    Model_Decidueye,
    Model_Litten,
    Model_Torracat,
    Model_Incineroar,
    Model_Popplio,
    Model_Brionne,
    Model_Primarina,
    Model_Dewpider,
    Model_Araquanid,
    Model_Stufful,
    Model_Bewear,
    Model_Turonator,
    Model_Drampa = 856,
    Model_Dhelmise,
    Model_Togedemaru,
    Model_Typenull = 861,
    Model_Silvally,
    Model_Comfey,
    Model_Necrozma = 865,
    Model_Wimpod,
    Model_Golisopod,
    Model_Fomantis,
    Model_Lurantis,
    Model_Cosmog = 871,
    Model_Cosmoem,
    Model_Solgaleo,
    Model_Lunala,
    Model_Nihilego,
    Model_Guzzlord,
    Model_Buzzwole,
    Model_Xurkitree,
    Model_Pheromosa,
    Model_Kartana,
    Model_Celesteela,
    Model_Magearna,
    Model_Marshadow = 883, // End of Alola Series
    Model_Stakataka,
    Model_Blacephalon,
    Model_Poipole,
    Model_Naganedel,
    Model_Zeraora = 888, // End of Ultra series
    Model_Meltan = 891,
    Model_Melmetal,
    Model_Nickit = 901,
    Model_Thievul,
    Model_Chewtle,
    Model_Drednaw,
    Model_Gossifleur,
    Model_Eldegoss,
    Model_Yamper,
    Model_Boltund,
    Model_Skwovet,
    Model_Greedent,
    Model_Wooloo,
    Model_Dubwool,
    Model_Arrokuda,
    Model_Barraskewda,
    Model_Sizzlipede,
    Model_Centiskorch,
    Model_Cramorant,
    Model_Rookidee,
    Model_Corvisquire,
    Model_Corviknight,
    Model_Toxel,
    Model_Toxitricity,
    Model_Flalinks,
    Model_Milcery,
    Model_Alcremie,
    Model_Cufant,
    Model_Copperajah,
    Model_Obstagoon,
    Model_Duraludon,
    Model_Blipbug,
    Model_Dottler,
    Model_Orbeetle,
    Model_Rolycoly,
    Model_Carkol,
    Model_Coalossal,
    Model_Silicobra,
    Model_Sandaconda,
    Model_Zacian,
    Model_Zamazenta,
    Model_Eternatus,
    Model_Morpeko,
    Model_Indeedee,
    Model_Perrserker,
    Model_Pincurchin,
    Model_Snom,
    Model_Frosmoth,
    Model_Cursola,
    Model_Grookey,
    Model_Thwackey,
    Model_Rillaboom,
    Model_Sobble,
    Model_Drizzile,
    Model_Inteleon,
    Model_Scorbunny,
    Model_Raboot,
    Model_Cinderace,
    Model_Impidimp,
    Model_Morgrem,
    Model_Grimmsnarl,
    Model_Dracozolt,
    Model_Arctozolt,
    Model_Dracovish,
    Model_Arctovish,
    Model_Clobbopus,
    Model_Grapploct,
    Model_Applin,
    Model_Flapple,
    Model_Appletun,
    Model_Hatenna,
    Model_Hattrem,
    Model_Hatterene,
    Model_Sinistea,
    Model_Polteagiest,
    Model_Stonjourner,
    Model_Eiscue,
    Model_Dreepy,
    Model_Drakloak,
    Model_Dragapult,
    Model_Runerigus,
    Model_Mrrime,
    Model_Sirfetchd = 981, // End of Orion Series
    Model_Kubfu,
    Nodel_Urshifu,
    Model_Glastrier,
    Model_Spectrier,
    Model_Calyrex,
    Model_Zarude = 988,
    Model_Regieleki,
    Model_Regidrago,  //  End of Rigel Series
}

table MeshProperty (fs_serializer) {
    IsVisible: bool;
    MeshName: string;
}

table MeshEntries (fs_serializer) {
    Entry: [MeshProperty];
}

table SpeciesModelProperties (fs_serializer) {
    SpeciesParamType: SpeciesSize;
    SpeciesSetting: [MeshEntries];
}

table MaterialEntry (fs_serializer) {
    MaterialName: string;
}


table GFBPokeConfig (fs_serializer) {
    MajorVer: uint = 0; // Might be a bit mask, either 3 or 5
    MinorVer: uint; // Never defined

    SpeciesId: SpeciesModel;
    FormId: ushort = 0; // Used for female forms, alternate forms, GMax and Alolan forms

    Name: string; // Always empty vec
    JpName: string; // Always empty vec

    Origin: SpeciesOrigin;
    SizeIndex: SpeciesSize;

    
    Height: float;
    AdjustHeight: float;
    FieldAdjust: float;

    
    MinBX: float;
    MinBY: float;
    MinBZ: float;
    MaxBX: float;
    MaxBY: float;
    MaxBZ: float;

    InframeHeight: float;
    InframeVerticalRotYOrigin: float;
    InframeBottomYOffset: float;
    InframeCenterYOffset: float;
    InframeLeftRotation: float;
    InframeRightRotation: float;

    RegionId: ushort; // Reserved for Galarian forms/crossgens

    WaitMotionBRate: float; // it's 0.00 for some mon, 1.00 for most
    WaitMotionCRate: float; // 1.00, 0.00 And 35345604608.0 for Eternatus

    Undef26: ushort; // Never defined
    Undef27: ushort; // Never defined

    MaterialEntries: [MaterialEntry];
    SpeciesModelProperty: SpeciesModelProperties;

}

root_type GFBPokeConfig;
