Exemple #1
0
        public static EncounterArea2[] GetAreas(byte[][] input, GameVersion game)
        {
            var result = new EncounterArea2[input.Length];

            for (int i = 0; i < input.Length; i++)
            {
                result[i] = new EncounterArea2(input[i], game);
            }
            return(result);
        }
Exemple #2
0
        private static EncounterArea2[] GetTables2(GameVersion Version)
        {
            // Fishing
            var f = EncounterArea2.GetArray2Fishing(Util.GetBinaryResource("encounter_gsc_f.pkl"));

            var Slots = Array.Empty <EncounterArea2>();

            if (Version.Contains(GameVersion.GS))
            {
                Slots = GetSlots_GS(f);
            }
            if (Version.Contains(GameVersion.C))
            {
                Slots = AddExtraTableSlots(Slots, GetSlots_C(f));
            }

            return(Slots);
        }
Exemple #3
0
        private static EncounterArea2[] GetSlots_C(EncounterArea2[] f)
        {
            // Grass/Water
            var c = EncounterArea2.GetArray2GrassWater(Util.GetBinaryResource("encounter_crystal.pkl"));
            // Headbutt/Rock Smash
            var h_c      = EncounterArea2.GetArray2Headbutt(Util.GetBinaryResource("encounter_crystal_h.pkl"));
            var safari_c = EncounterSafari_GSC;
            var bcc_c    = EncounterBCC_GSC;

            MarkEncountersVersion(bcc_c, GameVersion.C);
            MarkEncountersVersion(safari_c, GameVersion.C);
            MarkEncountersVersion(f, GameVersion.C);
            MarkEncountersVersion(c, GameVersion.C);
            MarkEncountersVersion(h_c, GameVersion.C);

            var extra = AddExtraTableSlots(c, h_c, f, bcc_c, safari_c);

            return(extra);
        }
Exemple #4
0
        private static EncounterArea2[] GetSlots_GS(EncounterArea2[] f)
        {
            // Grass/Water
            var g = EncounterArea2.GetArray2GrassWater(Util.GetBinaryResource("encounter_gold.pkl"));
            var s = EncounterArea2.GetArray2GrassWater(Util.GetBinaryResource("encounter_silver.pkl"));
            // Headbutt/Rock Smash
            var h_g       = EncounterArea2.GetArray2Headbutt(Util.GetBinaryResource("encounter_gold_h.pkl"));
            var h_s       = EncounterArea2.GetArray2Headbutt(Util.GetBinaryResource("encounter_silver_h.pkl"));
            var safari_gs = EncounterSafari_GSC;
            var bcc_gs    = EncounterBCC_GSC;

            MarkEncountersVersion(bcc_gs, GameVersion.GS);
            MarkEncountersVersion(f, GameVersion.GS);
            MarkEncountersVersion(g, GameVersion.GD);
            MarkEncountersVersion(s, GameVersion.SV);
            MarkEncountersVersion(h_g, GameVersion.GD);
            MarkEncountersVersion(h_s, GameVersion.SV);
            MarkEncountersVersion(safari_gs, GameVersion.GS);

            return(AddExtraTableSlots(g, s, h_g, h_s, f, bcc_gs, safari_gs));
        }
Exemple #5
0
        private static IEnumerable <EncounterArea2> GetAreas2(byte[] data, ref int ofs, SlotType t, int slotSets, int slotCount)
        {
            var areas = new List <EncounterArea2>();

            while (data[ofs] != 0xFF) // end
            {
                var location = data[ofs++] << 8 | data[ofs++];
                var slots    = GetSlots2GrassWater(data, ref ofs, t, slotSets, slotCount);
                var area     = new EncounterArea2
                {
                    Location = location,
                    Slots    = slots,
                };
                foreach (var slot in slots)
                {
                    slot.Area = area;
                }
                areas.Add(area);
            }
            ofs++;
            return(areas);
        }
Exemple #6
0
 private static EncounterArea2[] Get(string name, string ident, GameVersion game) =>
 EncounterArea2.GetAreas(BinLinker.Unpack(Util.GetBinaryResource($"encounter_{name}.pkl"), ident), game);