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]); }
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); }
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]); }
public CrystalItem(CrystalItemType insertedItem) { Type = insertedItem; }
internal bool CrystalAtLocation(string locationName, CrystalItemType item) { var itemAtLocation = GetItemAtLocation <CrystalItem>(SpecialLocations, locationName); return(itemAtLocation?.Type == item); }