diff options
author | Neil Moore <neil@s-z.org> | 2014-04-14 02:33:28 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-04-14 03:18:17 -0400 |
commit | 82e4a9b1b9aa46d120cf07e31f2c117517a9928e (patch) | |
tree | 04f320dec46456b73b3a7f5eec19b2fffc18267c /crawl-ref/source/player-equip.cc | |
parent | 248eb57cf377b191ebf77f812cc1866aaa404235 (diff) | |
download | crawl-ref-82e4a9b1b9aa46d120cf07e31f2c117517a9928e.tar.gz crawl-ref-82e4a9b1b9aa46d120cf07e31f2c117517a9928e.zip |
Give the "powerless spirit" message again.
Now for everyone with MUT_MANA_SHIELD, not just vine stalkers.
Also, refactor out the duplicated code.
Diffstat (limited to 'crawl-ref/source/player-equip.cc')
-rw-r--r-- | crawl-ref/source/player-equip.cc | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/crawl-ref/source/player-equip.cc b/crawl-ref/source/player-equip.cc index 02e743a570..3cad2bf923 100644 --- a/crawl-ref/source/player-equip.cc +++ b/crawl-ref/source/player-equip.cc @@ -893,6 +893,21 @@ static void _unequip_weapon_effect(item_def& item, bool showMsgs, bool meld) } } +static void _spirit_shield_message(bool unmeld) +{ + if (!unmeld && you.spirit_shield() < 2) + { + dec_mp(you.magic_points); + mpr("You feel your power drawn to a protective spirit."); + if (you.species == SP_DEEP_DWARF) + mpr("Now linked to your health, your magic stops regenerating."); + } + else if (!unmeld && player_mutation_level(MUT_MANA_SHIELD)) + mpr("You feel the presence of a powerless spirit."); + else // unmeld or already spirit-shielded + mpr("You feel spirits watching over you."); +} + static void _equip_armour_effect(item_def& arm, bool unmeld) { const bool known_cursed = item_known_cursed(arm); @@ -989,18 +1004,7 @@ static void _equip_armour_effect(item_def& arm, bool unmeld) break; case SPARM_SPIRIT_SHIELD: - if (!unmeld && you.spirit_shield() < 2) - { - dec_mp(you.magic_points); - if (you.species == SP_VINE_STALKER) - mpr("You feel the presence of a powerless spirit."); - else - mpr("You feel your power drawn to a protective spirit."); - if (you.species == SP_DEEP_DWARF) - mpr("Now linked to your health, your magic stops regenerating."); - } - else - mpr("You feel spirits watching over you."); + _spirit_shield_message(unmeld); break; case SPARM_ARCHERY: @@ -1390,18 +1394,7 @@ static void _equip_jewellery_effect(item_def &item, bool unmeld) #endif case AMU_GUARDIAN_SPIRIT: - if (you.spirit_shield() < 2 && !unmeld) - { - dec_mp(you.magic_points); - if (you.species == SP_VINE_STALKER) - mpr("You feel the presence of a powerless spirit."); - else - mpr("You feel your power drawn to a protective spirit."); - if (you.species == SP_DEEP_DWARF) - mpr("Now linked to your health, your magic stops regenerating."); - } - else - mpr("You feel spirits watching over you."); + _spirit_shield_message(unmeld); ident = ID_KNOWN_TYPE; break; |