From 3e5f8c7683df31a047038b9f5dd7b916f86e4516 Mon Sep 17 00:00:00 2001 From: Sean Petrie Date: Sun, 4 Aug 2024 12:39:03 -0500 Subject: [PATCH 1/4] Updated tooltips to correctly display durability --- .../OverrideStatTooltips/Stats/DurabilityStat.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs index f3e8770b..cf122c8b 100644 --- a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs +++ b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs @@ -1,4 +1,4 @@ -using BattleTech; +using BattleTech; using Localize; using MechEngineer.Features.ArmorStructureChanges; using MechEngineer.Features.OverrideStatTooltips.Helper; @@ -13,13 +13,13 @@ public void SetupTooltip(StatTooltipData tooltipData, MechDef mechDef) { var value = mechDef.MechDefAssignedArmor; value *= ArmorMultiplier(mechDef); - value *= DamageReductionMultiplierAll(mechDef); + //value *= DamageReductionMultiplierAll(mechDef); tooltipData.dataList.Add("" + Strings.T("Armor") + "", $"{value}"); } { - var value = DamageReductionMultiplierAll(mechDef); - tooltipData.dataList.Add("" + Strings.T("Damage Reduction") + "", Strings.T("{0} %", value)); + var value = 1 - DamageReductionMultiplierAll(mechDef); + tooltipData.dataList.Add("" + Strings.T("Damage Reduction") + "", Strings.T($"{value * 100} %")); /* ("DamageReductionMultiplierAll", 1f); ("DamageReductionMultiplierMelee", 1f); @@ -69,7 +69,7 @@ public float BarValue(MechDef mechDef) { var armor = mechDef.MechDefAssignedArmor; armor *= ArmorMultiplier(mechDef); - armor *= DamageReductionMultiplierAll(mechDef); + armor /= DamageReductionMultiplierAll(mechDef); var stats = UnityGameInstance.BattleTechGame.MechStatisticsConstants; return MechStatUtils.NormalizeToFraction(armor, 0, stats.MaxArmorFactor); From f15148b7dc7d5ff20f5e391e1dab43ac028d6ede Mon Sep 17 00:00:00 2001 From: Sean Petrie Date: Sun, 4 Aug 2024 18:58:35 -0500 Subject: [PATCH 2/4] Update source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs Co-authored-by: CptMoore <39010654+CptMoore@users.noreply.github.com> --- source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs index cf122c8b..3b29a9c1 100644 --- a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs +++ b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs @@ -13,7 +13,6 @@ public void SetupTooltip(StatTooltipData tooltipData, MechDef mechDef) { var value = mechDef.MechDefAssignedArmor; value *= ArmorMultiplier(mechDef); - //value *= DamageReductionMultiplierAll(mechDef); tooltipData.dataList.Add("" + Strings.T("Armor") + "", $"{value}"); } From ecb9a5690b7cda57d973c04bd18ef5c30db9c253 Mon Sep 17 00:00:00 2001 From: Sean Petrie Date: Sun, 4 Aug 2024 18:59:10 -0500 Subject: [PATCH 3/4] Update source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs Co-authored-by: CptMoore <39010654+CptMoore@users.noreply.github.com> --- source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs index 3b29a9c1..f1217319 100644 --- a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs +++ b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs @@ -17,7 +17,8 @@ public void SetupTooltip(StatTooltipData tooltipData, MechDef mechDef) } { - var value = 1 - DamageReductionMultiplierAll(mechDef); + var reduction = 1 - DamageReductionMultiplierAll(mechDef); + var percent = (int)(reduction * 100); tooltipData.dataList.Add("" + Strings.T("Damage Reduction") + "", Strings.T($"{value * 100} %")); /* ("DamageReductionMultiplierAll", 1f); From bcb5f160e5321d73e2ecd4fa63905fa181558c06 Mon Sep 17 00:00:00 2001 From: Sean Petrie Date: Sun, 4 Aug 2024 19:11:46 -0500 Subject: [PATCH 4/4] Updated formatting --- source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs index f1217319..4bad1c53 100644 --- a/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs +++ b/source/Features/OverrideStatTooltips/Stats/DurabilityStat.cs @@ -18,8 +18,7 @@ public void SetupTooltip(StatTooltipData tooltipData, MechDef mechDef) { var reduction = 1 - DamageReductionMultiplierAll(mechDef); - var percent = (int)(reduction * 100); - tooltipData.dataList.Add("" + Strings.T("Damage Reduction") + "", Strings.T($"{value * 100} %")); + tooltipData.dataList.Add("" + Strings.T("Damage Reduction") + "", Strings.T("{0:P0}", reduction)); /* ("DamageReductionMultiplierAll", 1f); ("DamageReductionMultiplierMelee", 1f);