private void ExtractGunlanceShellingInfo(JObject attributes, out GunlanceShellingType shellingType, out int shellingLevel) { shellingType = GunlanceShellingType.None; shellingLevel = 0; if (attributes.TryGetValue("shellingType", out JToken value)) { string shellingInfoContent = (string)value; string[] shellingInfoParts = shellingInfoContent.Split(' '); if (shellingInfoParts.Length != 2 || shellingInfoParts[1].StartsWith("LV") == false) { throw new FormatException($"Unsupported '{shellingInfoContent}' Gunlance shelling info."); } shellingType = ConvertGunlanceShellingType(shellingInfoParts[0]); if (int.TryParse(shellingInfoParts[1].Substring(2), out shellingLevel) == false) { throw new FormatException($"Unsupported '{shellingInfoParts}' Gunlance shelling level."); } } else { throw new FormatException($"A Gunlance is missing shelling info."); } }
public Gunlance( IDataSource dataSource, string name, GunlanceShellingType shellingType, int rarity, int shellingLevel, int attack, int affinity, int defense, int[] sharpnessRanksLevel1, int[] sharpnessRanksLevel5, EldersealLevel elderseal, ElementInfo[] elements, int[] slots) : base( dataSource, name, WeaponType.Gunlance, rarity, attack, affinity, defense, sharpnessRanksLevel1, sharpnessRanksLevel5, elderseal, elements, slots ) { ShellingType = shellingType; ShellingLevel = shellingLevel; }