Skip to content

Commit

Permalink
Fix some formatting issues with passive descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercamp committed Feb 2, 2025
1 parent 644bd93 commit 93473fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions PalCalc.GenDB/BuildDBProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
Expand Down Expand Up @@ -138,6 +139,9 @@ Dictionary<string, string> commonTexts
return match.Value;
});


description = Regex.Replace(description, "<.+?>", "");

return description.Replace("\r\n", "\n");
}

Expand All @@ -155,8 +159,8 @@ string FormatEffect(string effect, float value)
"CraftSpeed" => commonTexts["COMMON_STATUS_SPEED"],
"ShotAttack" => commonTexts["COMMON_STATUS_RANGE_ATTACK"],
"Defense" => commonTexts["COMMON_STATUS_DEFENCE"],
var raw => effect,

_ => effect,
};

if (label == effect)
Expand All @@ -166,7 +170,7 @@ string FormatEffect(string effect, float value)
label = effect.Replace("EPalPassiveSkillEffectType::", "");
}

if (label != null) return $"{label} +{value}%";
if (label != null) return $"{label} {value.ToString("+0;-#")}%";
else return null;
}

Expand Down
2 changes: 1 addition & 1 deletion PalCalc.Model/breeding.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion PalCalc.Model/db.json

Large diffs are not rendered by default.

0 comments on commit 93473fb

Please sign in to comment.