public static void CreateStatsGroups() { if (StatsView.StatsGroups != null) { return; } var brushConverter = new BrushConverter(); Brush fireBrush = Brushes.Red; Brush coldBrush = Brushes.Blue; Brush poisonBrush = Brushes.Green; Brush magicBrush = Brushes.Orange; Brush lightningBrush = (Brush)brushConverter.ConvertFromString("#FFCEBD00"); var g1 = new StatsGroup(GT("Base_stats"), StatGroups.Basic); g1.AddStat(GT("Strength_Base") + ": {0} " + GT("Bonus") + ": {359}%/{900}"); g1.AddStat(GT("Dexterity_Base") + ": {2} " + GT("Bonus") + ": {360}%/{901}"); g1.AddStat(GT("Vitality_Base") + ": {3} " + GT("Bonus") + ": {362}%/{902}"); g1.AddStat(GT("Energy_Base") + ": {1} " + GT("Bonus") + ": {361}%/{903}"); var g2 = new StatsGroup(GT("Other_stats"), StatGroups.Basic); g2.AddStat("{76}% " + GT("Maximum_Life")); g2.AddStat("{77}% " + GT("Maximum_Mana")); g2.AddStat("{96}%/{67}% " + GT("Faster_Run/Walk")); g2.AddStat("{80}% " + GT("Magic_Find")); g2.AddStat("{79}% " + GT("Gold_Find")); g2.AddStat("{85}% " + GT("Experience_gained")); g2.AddStat("{479} " + GT("Maximum_Skill_Level")); g2.AddStat("{185} " + GT("Signets_of_Learning"), GT("Signets_of_Learning_description"), new int[] { 185, 400, 400 }); //g2.AddItem("Veteran tokens", "On Nightmare and Hell difficulty, you can find veteran monsters near the end of|each Act. There are five types of veteran monsters, one for each Act||[Class Charm] + each of the 5 tokens ? returns [Class Charm] with added bonuses| +1 to [Your class] Skill Levels| +20% to Experience Gained", new int[] { 219, 1, 1}); g2.AddStat("{278} " + GT("Strength_Factor_(SF)")); g2.AddStat("{485} " + GT("Energy_Factor_(EF)")); g2.AddStat("{904}% " + GT("Factor_cap."), GT("Factor_cap_description")); g2.AddStat("{409}% " + GT("Buff/Debuff/Cold_Skill_Duration")); g2.AddStat("{27}% " + GT("Mana_Regeneration")); var g3 = new StatsGroup(GT("Life_/_Mana"), StatGroups.Basic); g3.AddStat("{60}%/{62}% " + GT("Life/Mana_Stolen_per_Hit")); g3.AddStat("{86}/{138} " + GT("Life/Mana_after_each_Kill_(*aeK)")); g3.AddStat("{208}/{209} " + GT("Life/Mana_on_Striking_(*oS)")); g3.AddStat("{210}/{295} " + GT("Life/Mana_on_Attack_(*oA)")); var g4 = new StatsGroup(GT("Minions"), StatGroups.Basic); g4.AddStat("{444}% " + GT("Life")); g4.AddStat("{470}% " + GT("Damage")); g4.AddStat("{487}% " + GT("Resist")); g4.AddStat("{500}% " + GT("Attack_Rating_(AR)")); var g5 = new StatsGroup(GT("Other"), StatGroups.Basic); g5.AddStat(GT("Slain_Monsters_Rest_In_Peace_(RIP)"), "", new int[] { 108, 1, 1 }); var g6 = new StatsGroup(GT("Resistance"), StatGroups.Defense); g6.AddStat("{39}% " + GT("Fire"), "", fireBrush); g6.AddStat("{43}% " + GT("Cold"), "", coldBrush); g6.AddStat("{41}% " + GT("Lightning"), "", lightningBrush); g6.AddStat("{45}% " + GT("Poison"), "", poisonBrush); g6.AddStat("{37}% " + GT("Magic"), "", magicBrush); g6.AddStat("{36}% " + GT("Physical")); g6.AddStat("{171}% " + GT("Total_Character_Defense_(TCD)")); g6.AddStat("{35} " + GT("Magic_Damage_Reduction_(MDR)")); g6.AddStat("{34} " + GT("Physical_Damage_Reduction_(PDR)")); g6.AddStat("{338}% " + GT("Dodge"), GT("Chance_to_avoid_melee_attacks_while_standing_still")); g6.AddStat("{339}% " + GT("Avoid"), GT("Chance_to_avoid_projectiles_while_standing_still")); g6.AddStat("{340}% " + GT("Evade"), GT("Chance_to_avoid_any_attack_while_moving")); g6.AddStat("{109}% " + GT("Curse_Length_Reduction_(CLR)")); g6.AddStat("{110}% " + GT("Poison_Length_Reduction_(PLR)")); var g7 = new StatsGroup(GT("Item_/_Skill"), StatGroups.Defense, GT("Speed_from_items_and_skills_behave_differently._Use_SpeedCalc_to_find_your_breakpoints")); g7.AddStat("{99}%/{69}% " + GT("Faster_Hit_Recovery_(FHR)")); g7.AddStat("{102}%/{69}% " + GT("Faster_Block_Rate_(FBR)")); var g8 = new StatsGroup(GT("Slow"), StatGroups.Defense); g8.AddStat("{150}%/{376}% " + GT("Slows_Target_/_Slows_Melee_Target")); g8.AddStat("{363}%/{493}% " + GT("Slows_Attacker_/_Slows_Ranged_Attacker")); var g9 = new StatsGroup(GT("Absorb_/_Flat_absorb"), StatGroups.Defense); g9.AddStat("{142}%/{143} " + GT("Fire"), "", fireBrush); g9.AddStat("{148}%/{149} " + GT("Cold"), "", coldBrush); g9.AddStat("{144}%/{145} " + GT("Lightning"), "", lightningBrush); g9.AddStat("{146}%/{147} " + GT("Magic"), "", magicBrush); var g10 = new StatsGroup(GT("Item_/_Skill"), StatGroups.Offense, GT("Speed_from_items_and_skills_behave_differently._Use_SpeedCalc_to_find_your_breakpoints")); g10.AddStat("{93}%/{68}% " + GT("Increased_Attack_Speed_(IAS)")); g10.AddStat("{105}%/0% " + GT("Faster_Cast_Rate_(FCR)")); var g11 = new StatsGroup(GT("Offens"), StatGroups.Offense); g11.AddStat("{25}% " + GT("Enchanced_Weapon_Damage_(EWD)")); g11.AddStat("{119}% " + GT("Attack_Rating_(AR)")); g11.AddStat("{136}% " + GT("Crushing_Blow._Chance_to_deal_physical_damage_based_on_target's_current_health_(CB)")); g11.AddStat("{141}% " + GT("Deadly_Strike._Chance_to_double_physical_damage_of_attack_(DS)")); g11.AddStat("{164}% " + GT("Uninterruptable_Attack_(UA)")); g11.AddStat("{489} " + GT("Target_Takes_Additional_Damage_(TTAD)")); var g12 = new StatsGroup(GT("Spell_damage_/_-Enemy_resist"), StatGroups.Offense); g12.AddStat("{329}%/{333}% " + GT("Fire"), "", fireBrush); g12.AddStat("{331}%/{335}% " + GT("Cold"), "", coldBrush); g12.AddStat("{330}%/{334}% " + GT("Lightning"), "", lightningBrush); g12.AddStat("{332}%/{336}% " + GT("Poison"), "", poisonBrush); g12.AddStat("{431}% " + GT("Poison_Skill_Duration_(PSD)"), "", poisonBrush); g12.AddStat("{357}%/0% " + GT("Physical/Magic"), "", magicBrush); var g13 = new StatsGroup(GT("Weapon_Damage"), StatGroups.Offense); g13.AddStat("{48}-{49} " + GT("Fire"), "", fireBrush); g13.AddStat("{54}-{55} " + GT("Cold"), "", coldBrush); g13.AddStat("{50}-{51} " + GT("Lightning"), "", lightningBrush); g13.AddStat("{57}-{58} " + GT("Poison/sec"), "", poisonBrush); g13.AddStat("{52}-{53} " + GT("Magic"), "", magicBrush); g13.AddStat("{21}-{22} " + GT("One-hand_physical_damage._Estimated;_may_be_inaccurate,_especially_when_dual_wielding")); g13.AddStat("{23}-{24} " + GT("Two-hand/Ranged_physical_damage._Estimated;_may_be_inaccurate,_especially_when_dual_wielding")); var statsGroups = new List <StatsGroup>(); statsGroups.AddRange(new[] { g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11, g12, g13 }); StatsView.StatsGroups = statsGroups; // GetTranslation() string GT(string key) { // WARNING: The null-check for MainWindow.mainInstance is only needed at design-time so it will display the labels (in StatsView.xaml). So dont remove it! if (MainWindow.mainInstance == null || (bool)(DesignerProperties.IsInDesignModeProperty.GetMetadata(typeof(StatsView)).DefaultValue)) { // Replace "_" with " " so it is more easy to read at design-time. return(key.Replace("_", " ")); } var translationString = MainWindow.mainInstance?.Resources.MergedDictionaries[0][key] as string; if (translationString == null) { throw new Exception($"No translation found for key '{key}'"); } return(translationString); } }
//#EndRegion //#Region GUI private List <StatsGroup> CreateStatsGroups() { var brushConverter = new BrushConverter(); Brush lightningBrush = (Brush)brushConverter.ConvertFromString("#FFCEBD00"); var g1 = new StatsGroup("Base stats", StatGroups.Basic); g1.AddStat(" Strength Base: {000} Bonus: {359}%/{900}"); g1.AddStat("Dexterity Base: {002} Bonus: {360}%/{901}"); g1.AddStat(" Vitality Base: {003} Bonus: {362}%/{902}"); g1.AddStat(" Energy Base: {001} Bonus: {361}%/{903}"); var g2 = new StatsGroup("Other stats", StatGroups.Basic); g2.AddStat("{076}% Maximum Life"); g2.AddStat("{077}% Maximum Mana"); g2.AddStat("{080}% Magic Find"); g2.AddStat("{079}% Gold Find"); g2.AddStat("{085}% Experience gained"); g2.AddStat("{479} Maximum Skill Level"); g2.AddStat("{185} Signets of Learning", "Up to 400 can be used || See cube recipes in Median-docu for details", new int[] { 185, 400, 400 }); //g2.AddItem("Veteran tokens", "On Nightmare and Hell difficulty, you can find veteran monsters near the end of|each Act. There are five types of veteran monsters, one for each Act||[Class Charm] + each of the 5 tokens ? returns [Class Charm] with added bonuses| +1 to [Your class] Skill Levels| +20% to Experience Gained", new int[] { 219, 1, 1}); g2.AddStat("{096}%/{067}% Faster Run/Walk", "Faster Run/Walk"); g2.AddStat("{278} Strength Factor (SF)"); g2.AddStat("{485} Energy Factor (EF)"); g2.AddStat("{904}% Factor cap.", "100% means you don't benefit from more str/ene factor"); g2.AddStat("{409}% Buff/Debuff/Cold Skill Duration"); g2.AddStat("{27}% Mana Regeneration"); var g3 = new StatsGroup("Minions", StatGroups.Basic); g3.AddStat("{444}% Life"); g3.AddStat("{470}% Damage"); g3.AddStat("{487}% Resist"); g3.AddStat("{500}% Attack Rating (AR)"); var g4 = new StatsGroup("Life / Mana", StatGroups.Basic); g4.AddStat("{060}%/{062}% Life/Mana Stolen per Hit"); g4.AddStat("{086}/{138} Life/Mana after each Kill (*aeK)"); g4.AddStat("{208}/{209} Life/Mana on Striking (*oS)"); g4.AddStat("{210}/{295} Life/Mana on Attack (*oA)"); var g5 = new StatsGroup("Other", StatGroups.Basic); g5.AddStat("RIP", "Slain Monsters Rest In Peace", new int[] { 108, 1, 1 }); var g6 = new StatsGroup("Resistance", StatGroups.Defense); g6.AddStat("{039}% Fire", "", Brushes.Red); g6.AddStat("{043}% Cold", "", Brushes.Blue); g6.AddStat("{041}% Lightning", "", lightningBrush); g6.AddStat("{045}% Poison", "", Brushes.Green); g6.AddStat("{037}% Magic", "", Brushes.Orange); g6.AddStat("{036}% Physical", ""); g6.AddStat("{171}% Total Character Defense (TCD)"); g6.AddStat("{035} Magic Damage Reduction (MDR)"); g6.AddStat("{034} Physical Damage Reduction (PDR)"); g6.AddStat("{338}% Dodge", "Chance to avoid melee attacks while standing still"); g6.AddStat("{339}% Avoid", "Chance to avoid projectiles while standing still"); g6.AddStat("{340}% Evade", "Chance to avoid any attack while moving"); g6.AddStat("{109}% Curse Length Reduction (CLR)"); g6.AddStat("{110}% Poison Length Reduction (PLR)"); var g7 = new StatsGroup("Item / Skill", StatGroups.Defense, "Speed from items and skills behave differently. Use SpeedCalc to find your breakpoints"); g7.AddStat("{099}%/{069}% Faster Hit Recovery (FHR)"); g7.AddStat("{102}%/{069}% Faster Block Rate (FBR)"); var g8 = new StatsGroup("Slow", StatGroups.Defense); g8.AddStat("{150}%/{376}% Slows Target / Slows Melee Target"); g8.AddStat("{363}%/{493}% Slows Attacker / Slows Ranged Attacker"); var g9 = new StatsGroup("Absorb / Flat absorb", StatGroups.Defense, "Absorb / Flat absorb"); g9.AddStat("{142}%/{143} Fire", "", Brushes.Red); g9.AddStat("{148}%/{149} Cold", "", Brushes.Blue); g9.AddStat("{144}%/{145} Lightning", "", lightningBrush); g9.AddStat("{146}%/{147} Magic", "", Brushes.Orange); var g10 = new StatsGroup("Item / Skill", StatGroups.Offense, "Speed from items and skills behave differently. Use SpeedCalc to find your breakpoints"); g10.AddStat("{093}%/{068}% Increased Attack Speed (IAS)"); g10.AddStat("{105}%/0% Faster Cast Rate (FCR)"); var g11 = new StatsGroup("Offens", StatGroups.Offense); g11.AddStat("{025}% Enchanced Weapon Damage (EWD)"); g11.AddStat("{119}% Attack Rating (AR)"); g11.AddStat("{136}% Crushing Blow. Chance to deal physical damage based on target's current health (CB)"); g11.AddStat("{141}% Deadly Strike. Chance to double physical damage of attack (DS)"); g11.AddStat("{164}% Uninterruptable Attack (UA)"); g11.AddStat("{489} Target Takes Additional Damage (TTAD)"); var g12 = new StatsGroup("Damage / Pierce", StatGroups.Offense, "Spell damage / -Enemy resist"); g12.AddStat("{329}%/{333}% Fire", "", Brushes.Red); g12.AddStat("{331}%/{335}% Cold", "", Brushes.Blue); g12.AddStat("{330}%/{334}% Lightning", "", lightningBrush); g12.AddStat("{332}%/{336}% Poison", "", Brushes.Green); g12.AddStat("{431}% Poison Skill Duration (PSD)", "", Brushes.Green); g12.AddStat("{357}%/0% Physical/Magic", "", Brushes.Orange); var g13 = new StatsGroup("Weapon Damage", StatGroups.Offense); g13.AddStat("{048}-{049} Fire", "", Brushes.Red); g13.AddStat("{054}-{055} Cold", "", Brushes.Blue); g13.AddStat("{050}-{051} Lightning", "", lightningBrush); g13.AddStat("{057}-{058} Poison/sec", "", Brushes.Green); g13.AddStat("{052}-{053} Magic", "", Brushes.Orange); g13.AddStat("{021}-{022}", "One-hand physical damage. Estimated; may be inaccurate, especially when dual wielding"); g13.AddStat("{023}-{024}", "Two-hand/Ranged physical damage. Estimated; may be inaccurate, especially when dual wielding"); var statsGroups = new List <StatsGroup>(); statsGroups.Add(g1); statsGroups.Add(g2); statsGroups.Add(g3); statsGroups.Add(g4); statsGroups.Add(g5); statsGroups.Add(g6); statsGroups.Add(g7); statsGroups.Add(g8); statsGroups.Add(g9); statsGroups.Add(g10); statsGroups.Add(g11); statsGroups.Add(g12); statsGroups.Add(g13); return(statsGroups); }