예제 #1
0
        private List <byte> GetCrystalValues(CrystalItemType itemType)
        {
            var crystalValues = new Dictionary <CrystalItemType, List <byte> >
            {
                { CrystalItemType.Crystal1, new List <byte> {
                      0x02, 0x02, 0x7F, 0x40, 0x06
                  } },
                { CrystalItemType.Crystal2, new List <byte> {
                      0x10, 0x10, 0x79, 0x40, 0x06
                  } },
                { CrystalItemType.Crystal3, new List <byte> {
                      0x40, 0x40, 0x6C, 0x40, 0x06
                  } },
                { CrystalItemType.Crystal4, new List <byte> {
                      0x20, 0x20, 0x6D, 0x40, 0x06
                  } },
                { CrystalItemType.Crystal5, new List <byte> {
                      0x04, 0x04, 0x6E, 0x40, 0x06
                  } },
                { CrystalItemType.Crystal6, new List <byte> {
                      0x01, 0x01, 0x6F, 0x40, 0x06
                  } },
                { CrystalItemType.Crystal7, new List <byte> {
                      0x08, 0x08, 0x7C, 0x40, 0x06
                  } }
            };

            return(crystalValues[itemType]);
        }
예제 #2
0
        internal void WriteCrystal(FileStream rom, Region region, CrystalItemType itemType)
        {
            var regionAddresses = GetRegionAddresses(region);
            var crystalValues   = GetCrystalValues(itemType);

            for (int i = 0; i < regionAddresses.Count; i++)
            {
                rom.WriteBytes(regionAddresses[i], crystalValues[i]);
            }

            var crystalAddress = GetCrystalAddress(itemType);
            var regionValue    = GetRegionValue(region);

            rom.WriteBytes(crystalAddress, regionValue);
        }
예제 #3
0
        private int GetCrystalAddress(CrystalItemType itemType)
        {
            var crystalAddresses = new Dictionary <CrystalItemType, int>
            {
                { CrystalItemType.Crystal1, 0x10860 },
                { CrystalItemType.Crystal2, 0x1085E },
                { CrystalItemType.Crystal3, 0x10862 },
                { CrystalItemType.Crystal4, 0x1086A },
                { CrystalItemType.Crystal5, 0x10866 },
                { CrystalItemType.Crystal6, 0x10864 },
                { CrystalItemType.Crystal7, 0x10868 }
            };

            return(crystalAddresses[itemType]);
        }
예제 #4
0
 public CrystalItem(CrystalItemType insertedItem)
 {
     Type = insertedItem;
 }
예제 #5
0
        internal bool CrystalAtLocation(string locationName, CrystalItemType item)
        {
            var itemAtLocation = GetItemAtLocation <CrystalItem>(SpecialLocations, locationName);

            return(itemAtLocation?.Type == item);
        }