public static void CalcEnhBoosters() { EnhBoosters = 0; for (var i = 0; i < MidsContext.Character.CurrentBuild.Powers.Count; i++) { for (var j = 0; j < MidsContext.Character.CurrentBuild.Powers[i].Slots.Length; i++) { var enhIdx = MidsContext.Character.CurrentBuild.Powers[i].Slots[j].Enhancement.Enh; if (enhIdx == -1) { continue; } var relativeLevel = MidsContext.Character.CurrentBuild.Powers[i].Slots[j].Enhancement.RelativeLevel; if (DatabaseAPI.EnhIsIO(enhIdx) & relativeLevel != Enums.eEnhRelative.Even & relativeLevel != Enums.eEnhRelative.None) { EnhBoosters += relativeLevel switch { Enums.eEnhRelative.PlusOne => 1, Enums.eEnhRelative.PlusTwo => 2, Enums.eEnhRelative.PlusThree => 3, Enums.eEnhRelative.PlusFour => 4, Enums.eEnhRelative.PlusFive => 5, _ => 0 }; } } } } }
public static void CalcAll() { TotalEnhancements = 0; EnhObtained = 0; EnhCatalysts = 0; EnhBoosters = 0; foreach (var p in MidsContext.Character.CurrentBuild.Powers) { for (var j = 0; j < p.Slots.Length; j++) { var enhIdx = p.Slots[j].Enhancement.Enh; if (enhIdx > -1) { TotalEnhancements++; } if (p.Slots[j].Enhancement.Obtained & enhIdx > -1) { EnhObtained++; } if (enhIdx == -1) { continue; } var enhName = Database.Instance.Enhancements[enhIdx].UID; if (DatabaseAPI.EnhHasCatalyst(enhName) && DatabaseAPI.EnhIsSuperior(enhIdx)) { EnhCatalysts++; } var relativeLevel = p.Slots[j].Enhancement.RelativeLevel; if (DatabaseAPI.EnhIsIO(enhIdx)) { EnhBoosters += relativeLevel switch { Enums.eEnhRelative.PlusOne => 1, Enums.eEnhRelative.PlusTwo => 2, Enums.eEnhRelative.PlusThree => 3, Enums.eEnhRelative.PlusFour => 4, Enums.eEnhRelative.PlusFive => 5, _ => 0 }; } } } }