From 83a78c65abdbfa995225122be56548a75d46f0ff Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 4 Dec 2009 08:52:58 +0100 Subject: Added monster MR display (petato, mantis-id 113). Adds a line to the monster description screen that tells you how resistant it is to magic. Uses the same scale as player MR (eg on the % screen) except it skips "not resistant" levels of (non-)resistance. Uploaded a new version of the patch; now includes experimental MR display rescaling for both players and npcs. Try it out on the % screen, or examine a creature. Adverbs stolen from the stealth display, crazy resistant creatures are described as "almost entirely resistant". --- crawl-ref/source/describe.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crawl-ref/source/describe.cc') diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 47c8d42f66..b4ef97cf18 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2732,6 +2732,23 @@ static std::string _monster_stat_description(const monsters& mon) // Magic resistance at MAG_IMMUNE. if (mons_immune_magic(&mon)) result << pronoun << " is immune to magical enchantments.$"; + else // How resistant is it? Same scale as the player. + { + const int mr = mon.res_magic(); + if (mr >= 10) + { + result << pronoun << make_stringf(" is %s resistant to magic.$", + (mr < 30) ? "slightly" : + (mr < 60) ? "somewhat" : + (mr < 90) ? "quite" : + (mr < 120) ? "very" : + (mr < 150) ? "extremely" : + (mr < 190) ? "extraordinarily" : + (mr < 240) ? "incredibly" : + (mr < 300) ? "uncannily" + : "almost entirely"); + } + } if (mons_class_flag(mon.type, M_STATIONARY)) result << pronoun << " cannot move.$"; -- cgit v1.2.3-54-g00ecf