include "../../Shared/AbilityType.fbs";
include "../../Shared/NatureType.fbs";
include "../../Shared/ShinyType.fbs";

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

table EncounterSlot {
    Species:int;
    SlotID:ulong;
    Gender:int;
    Form:int;
    ShinyLock:ShinyType;
    AbilityRandType:AbilityType;
    Nature:NatureType;
    Height:int;
    Weight:int;
    Field_09:bool;
    Field_10:bool;
    Field_11:bool;
    Field_12:bool;
    GV_HP :int;
    GV_ATK:int;
    GV_DEF:int;
    GV_SPA:int;
    GV_SPD:int;
    GV_SPE:int;
    IV_HP :int;
    IV_ATK:int;
    IV_DEF:int;
    IV_SPA:int;
    IV_SPD:int;
    IV_SPE:int;
    NumPerfectIvs:int;
    Behavior1:string (required);
    Behavior2:string (required);
    Field_28_AffectsLottery:byte;
    BaseProbability:int;
    OverrideMinLevel:int;
    OverrideMaxLevel:int;
    Field_32:int;
    HasMoveset:bool;
    Move1:int;
    Move2:int;
    Move3:int;
    Move4:int;
    Move1Mastered:bool;
    Move2Mastered:bool;
    Move3Mastered:bool;
    Move4Mastered:bool;
    Unused:string (required);
    Field_43_Func_1A25908:int;
    Field_44_SetsPropTo100Not8000:bool;
    Eligibility:EncounterEligiblityTraits (required);
    Oybn:EncounterOybnTraits (required);
}

table EncounterEligiblityTraits {
    ConditionTypeID:ulong;
    ConditionID:ulong;
    ConditionArg1:string (required);
    ConditionArg2:string (required);
    ConditionArg3:string (required);
    ConditionArg4:string (required);
    ConditionArg5:string (required);
    TimeOfDayMultiplier_0:float;
    TimeOfDayMultiplier_1:float;
    TimeOfDayMultiplier_2:float;
    TimeOfDayMultiplier_3:float;
    WeatherMultiplier_1:float;
    WeatherMultiplier_2:float;
    WeatherMultiplier_3:float;
    WeatherMultiplier_4:float;
    WeatherMultiplier_5:float;
    WeatherMultiplier_6:float;
    WeatherMultiplier_7:float;
    WeatherMultiplier_8:float;
}

table EncounterOybnTraits {
    Oybn1:bool;
    Oybn2:bool;
    Field_02:bool;
    Field_03:bool;
}

table EncounterTable (fs_serializer) {
    TableID:ulong (key);
    MinLevel:int;
    MaxLevel:int;
    Table:[EncounterSlot] (required);
}

table EncounterDataArchive (fs_serializer) {
    Table:[EncounterTable] (required);
}

root_type EncounterDataArchive;
