private void ExtractSwitchAxePhialInfo(JObject attributes, out SwitchAxePhialType phialType, out int phialValue) { phialType = SwitchAxePhialType.None; phialValue = 0; if (attributes.TryGetValue("phialType", out JToken value)) { string phialTypeContent = (string)value; int i = 0; int index = -1; foreach (char c in phialTypeContent) { if (char.IsNumber(c)) { index = i; break; } i++; } if (index > -1) { phialType = ConvertSwitchAxePhialType(phialTypeContent.Substring(0, index - 1)); if (int.TryParse(phialTypeContent.Substring(index), out phialValue) == false) { throw new FormatException($"Unsupported '{phialTypeContent}' Switch Axe phial type."); } } else { phialType = ConvertSwitchAxePhialType(phialTypeContent); } } }
public SwitchAxe( IDataSource dataSource, string name, SwitchAxePhialType phialType, int rarity, int phialValue, int attack, int affinity, int defense, int[] sharpnessRanksLevel1, int[] sharpnessRanksLevel5, EldersealLevel elderseal, ElementInfo[] elements, int[] slots) : base( dataSource, name, WeaponType.SwitchAxe, rarity, attack, affinity, defense, sharpnessRanksLevel1, sharpnessRanksLevel5, elderseal, elements, slots ) { PhialType = phialType; PhialValue = phialValue; }