1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-17 07:07:38 +00:00

ru:: stats now can be fractional

This commit is contained in:
Zeno Rogue
2025-05-23 09:17:13 +02:00
parent b001514ccc
commit 9266d2dea2
3 changed files with 8 additions and 4 deletions

View File

@@ -22,8 +22,12 @@ void draw_stats() {
dialog::addSelItem("free experience", its(m.experience), 'x');
for(auto st: allstats) {
string s = its(m.base_stats[st]);
if(m.current.stats[st] != m.base_stats[st]) s += " (" + its(m.current.stats[st]) + ")";
auto bas = m.base_stats[st];
auto cur = m.current.stats[st];
string s = its(bas);
int curi = cur + 0.01;
if(cur != bas && abs(cur-curi) < 1e-6) s += " (" + its(curi) + ")";
else if(cur != bas) s += " (" + format("%.2f", cur) + ")";
dialog::addSelItem(statdata[st].name, s, statdata[st].key);
dialog::add_action_push([st] {
render_the_map();