private static EncounterSlot4[] GetSlots4GrassHGSS(byte[] data, int ofs, int numslots)
        {
            var slots = new EncounterSlot4[numslots * 3];

            // First 36 slots are morning, day and night grass slots
            // The order is 12 level values, 12 morning species, 12 day species and 12 night species
            for (int i = 0; i < numslots; i++)
            {
                int level   = data[ofs + i];
                int species = BitConverter.ToUInt16(data, ofs + numslots + (i * 2));
                slots[i] = new EncounterSlot4
                {
                    LevelMin   = level,
                    LevelMax   = level,
                    Species    = species,
                    SlotNumber = i,
                };
                slots[numslots + i]               = (EncounterSlot4)slots[i].Clone();
                slots[numslots + i].Species       = BitConverter.ToUInt16(data, ofs + (numslots * 3) + (i * 2));
                slots[(numslots * 2) + i]         = (EncounterSlot4)slots[i].Clone();
                slots[(numslots * 2) + i].Species = BitConverter.ToUInt16(data, ofs + (numslots * 5) + (i * 2));
            }

            return(slots);
        }
示例#2
0
        private static EncounterSlot4[] GetSlots4GrassDPPt(byte[] data, int ofs, int numslots)
        {
            var slots = new EncounterSlot4[numslots];

            for (int i = 0; i < numslots; i++)
            {
                int o       = ofs + (i * 8);
                int level   = data[o];
                int species = BitConverter.ToInt32(data, o + 4);
                slots[i] = new EncounterSlot4
                {
                    LevelMax   = level,
                    LevelMin   = level,
                    Species    = species,
                    SlotNumber = i,
                };
            }
            return(slots);
        }