diff options
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 12110bb724..b508a3a54b 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -307,6 +307,27 @@ mon_resist_def get_mons_resists(const monsters *mon) return (resists); } +short mon_resist_def::get_resist_level(mon_resist_flags res_type) const +{ + switch (res_type) + { + case MR_RES_ELEC: + return elec; + case MR_RES_POISON: + return poison; + case MR_RES_FIRE: + return fire; + case MR_RES_STEAM: + return steam; + case MR_RES_COLD: + return cold; + case MR_RES_ACID: + return acid; + default: + return (0); + } +} + monsters *monster_at(const coord_def &pos) { const int mindex = mgrd(pos); |