3 * Summary: Monsters stealth methods.
11 static int _clamp_stealth (int stealth
)
17 else if (stealth
< -3)
27 // Monster stealth is a value between:
29 // -3 - Extremely unstealthy
30 // -2 - Very unstealthy
35 // 3 - Extremely stealthy
37 int monster::stealth() const
39 int base_stealth
= -(std::min((int) body_size(), 6) - 3);
41 int actual_stealth
= base_stealth
;
43 // Undead are inherently more stealthy.
44 if (holiness() == MH_UNDEAD
)
46 // Zombies are less stealthy.
47 if (type
== MONS_ZOMBIE_SMALL
)
50 // Larger zombies even more so.
51 else if (type
== MONS_ZOMBIE_LARGE
)
54 // Other undead are otherwise stealthy.
59 // If you're floundering in water, you're unstealthy.
63 // Orcs are a noisy bunch and get a penalty here to affect orc wizard
65 if (mons_genus(this->type
) == MONS_ORC
)
68 // Not an issue with invisibility, but glowing or haloes make you
70 if (glows_naturally() || halo_radius2() != -1)
73 // Some specific overrides
74 if (type
== MONS_UNSEEN_HORROR
)
77 return _clamp_stealth(actual_stealth
);