summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-abil.cc
diff options
context:
space:
mode:
authorVsevolod Kozlov <zaba@thorium.homeunix.org>2009-11-05 19:58:50 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-05 19:58:50 +1000
commitb9def0122143459c4d1fd0721384028f3974dc69 (patch)
treef7b26f422d93b6f6769a45cb757c9075279a7c6a /crawl-ref/source/mon-abil.cc
parent313465bf23382559f7c26c63849b64266c8d939f (diff)
downloadcrawl-ref-b9def0122143459c4d1fd0721384028f3974dc69.tar.gz
crawl-ref-b9def0122143459c4d1fd0721384028f3974dc69.zip
Move *_res(ist)_magic to relevant classes, provide actor interface.
Signed-off-by: Jude Brown <bookofjude@users.sourceforge.net>
Diffstat (limited to 'crawl-ref/source/mon-abil.cc')
-rw-r--r--crawl-ref/source/mon-abil.cc26
1 files changed, 11 insertions, 15 deletions
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index 93a79b534b..094e64abef 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -455,7 +455,7 @@ bool slime_split_merge(monsters *thing)
// Returns true if you resist the siren's call.
static bool _siren_movement_effect(const monsters *monster)
{
- bool do_resist = (you.attribute[ATTR_HELD] || you_resist_magic(70));
+ bool do_resist = (you.attribute[ATTR_HELD] || you.check_res_magic(70));
if (!do_resist)
{
@@ -1250,7 +1250,7 @@ bool mon_special_ability(monsters *monster, bolt & beem)
// Once mesmerised by a particular monster, you cannot resist
// anymore.
if (!already_mesmerised
- && (you.species == SP_MERFOLK || you_resist_magic(100)))
+ && (you.species == SP_MERFOLK || you.check_res_magic(100)))
{
if (!did_resist)
canned_msg(MSG_YOU_RESIST);
@@ -1390,23 +1390,19 @@ void mon_nearby_ability(monsters *monster)
foe->name(DESC_NOCAP_THE).c_str());
int confuse_power = 2 + random2(3);
-
- if (foe->atype() == ACT_PLAYER
- && you_resist_magic((monster->hit_dice * 5) * confuse_power))
- {
- canned_msg(MSG_YOU_RESIST);
- break;
- }
- else if (foe->atype() == ACT_MONSTER)
+
+ if (foe->check_res_magic((monster->hit_dice * 5) * confuse_power))
{
- const monsters* foe_mons = dynamic_cast<const monsters*>(foe);
- if (check_mons_resist_magic(foe_mons, (monster->hit_dice * 5) * confuse_power))
+ if (foe->atype() == ACT_PLAYER)
+ canned_msg(MSG_YOU_RESIST);
+ else if (foe->atype() == ACT_MONSTER)
{
+ const monsters *foe_mons = dynamic_cast<const monsters*>(foe);
simple_monster_message(foe_mons, mons_resist_string(foe_mons));
- break;
- }
+ }
+ break;
}
-
+
foe->confuse(monster, 2 + random2(3));
}
break;