diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2011-01-23 08:51:38 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2011-01-23 08:51:38 +1000 |
commit | 41c4e1c773be8c4d3d7b5fb06e7cfed83e8d2b70 (patch) | |
tree | 31807cccf05209d482c4a1ac588674055112d84b /crawl-ref/source/mon-stealth.cc | |
parent | 8eaf1f23905e721f5cf2c9a59ca8147601d9edc7 (diff) | |
download | crawl-ref-41c4e1c773be8c4d3d7b5fb06e7cfed83e8d2b70.tar.gz crawl-ref-41c4e1c773be8c4d3d7b5fb06e7cfed83e8d2b70.zip |
Fix monster stealth, report when generate monster stats in WizMode.
Diffstat (limited to 'crawl-ref/source/mon-stealth.cc')
-rw-r--r-- | crawl-ref/source/mon-stealth.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-stealth.cc b/crawl-ref/source/mon-stealth.cc index 66b5377529..23b4cbbc10 100644 --- a/crawl-ref/source/mon-stealth.cc +++ b/crawl-ref/source/mon-stealth.cc @@ -10,7 +10,18 @@ static int _clamp_stealth (int stealth) { - return std::min(-3, std::max(3, stealth)); + if (stealth > 3) + { + return (3); + } + else if (stealth < -3) + { + return (-3); + } + else + { + return (stealth); + } } // Monster stealth is a value between: @@ -25,7 +36,7 @@ static int _clamp_stealth (int stealth) // int monster::stealth() const { - int base_stealth = -(std::max((int) body_size() - 3, 3)); + int base_stealth = -(std::min((int) body_size(), 6) - 3); int actual_stealth = base_stealth; @@ -59,5 +70,9 @@ int monster::stealth() const if (glows_naturally() || halo_radius2() != -1) actual_stealth -= 3; + // Some specific overrides + if (type == MONS_UNSEEN_HORROR) + actual_stealth = 3; + return _clamp_stealth(actual_stealth); } |