|
From: <gi...@cr...> - 2025-12-01 20:25:14
|
via b6ab66b0f8b2cfcccb1efa350216c1248c52e1a5 (commit)
from f00789f1cf048ec560fd567beaddf22b96ed1149 (commit)
-----------------------------------------------------------------------
commit b6ab66b0f8b2cfcccb1efa350216c1248c52e1a5
Author: Zhang Haocheng <505...@us...>
Date: Tue Dec 2 04:21:50 2025 +0800
feat: show failure rates of abilities in chardump (#4821)
Shows failure rates of abilities in the chardump `a:` list, e.g. `a:
Oozemancy (3%), Slimify (12%)`, similar to the passive effects list in
format.
There were a couple of times that either me or my friends wanted to know
the failure rates of abilities without having to start the game. I'm not
sure if it's intuitive enough so that most people won't mistake it for
success rate, or something else. Maybe showing a table like the spell
library can be better?
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/ability.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/crawl-ref/source/ability.cc b/crawl-ref/source/ability.cc
index d332ee5730..2ac849e8c5 100644
--- a/crawl-ref/source/ability.cc
+++ b/crawl-ref/source/ability.cc
@@ -908,9 +908,9 @@ string print_abilities()
{
for (unsigned int i = 0; i < talents.size(); ++i)
{
- if (i)
- text += ", ";
- text += ability_name(talents[i].which);
+ text += make_stringf("%s%s (%s)", i ? ", " : "",
+ ability_name(talents[i].which).c_str(),
+ failure_rate_to_string(talents[i].fail).c_str());
}
}
--
Dungeon Crawl Stone Soup
|