summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2010-01-02 17:02:30 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2010-01-02 17:06:11 +1000
commitcc5602c5e88b63d1db30bcdc34bee791768c5666 (patch)
tree4c18efebf7d98a3fa70bf8755337ae552a66c386 /crawl-ref/source
parent2bd7c49b579df905f1fe4d880051716d6649aaf8 (diff)
downloadcrawl-ref-cc5602c5e88b63d1db30bcdc34bee791768c5666.tar.gz
crawl-ref-cc5602c5e88b63d1db30bcdc34bee791768c5666.zip
Fix MP+X property in unrands (Mantis #294, Vandal).
calc_mp() only seemed to be called when games are loaded, meaning that putting on the unrand Hat of Pondering did not cause the player's max MP to immediately increase. Saving and reloading fixed this. The same happened with removing the hat: the player's max MP stays at the same value as when the hat was worn. Saving and reloading also fixed this. Fixed this by calling calc_mp(), and also cleaned up the code slightly. It still doesn't seem to be printing the "Your magic increases/decreases" messages, however.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/it_use2.cc13
-rw-r--r--crawl-ref/source/item_use.cc16
2 files changed, 14 insertions, 15 deletions
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index ccca70a29d..1588e86e84 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -719,14 +719,10 @@ void unuse_artefact(const item_def &item, bool *show_msgs)
}
}
- if (proprt[ARTP_MAGICAL_POWER])
+ if (proprt[ARTP_MAGICAL_POWER] && !known[ARTP_MAGICAL_POWER])
{
- you.redraw_magic_points = true;
- if (!known[ARTP_MAGICAL_POWER])
- {
- mprf("You feel your mana capacity %s.",
- proprt[ARTP_MAGICAL_POWER] > 0 ? "decrease" : "increase");
- }
+ mprf("You feel your mana capacity %s.",
+ proprt[ARTP_MAGICAL_POWER] > 0 ? "decrease" : "increase");
}
// Modify ability scores; always output messages.
@@ -750,6 +746,9 @@ void unuse_artefact(const item_def &item, bool *show_msgs)
if (proprt[ARTP_INVISIBLE] != 0 && you.duration[DUR_INVIS] > 1)
you.duration[DUR_INVIS] = 1;
+ if (proprt[ARTP_MAGICAL_POWER])
+ calc_mp();
+
if (is_unrandom_artefact(item))
{
const unrandart_entry *entry = get_unrand_entry(item.special);
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index cf13353bb6..9cd2d4fd2b 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -5630,15 +5630,11 @@ void use_artefact(item_def &item, bool *show_msgs, bool unmeld)
}
}
- if (proprt[ARTP_MAGICAL_POWER])
+ if (proprt[ARTP_MAGICAL_POWER] && !known[ARTP_MAGICAL_POWER])
{
- you.redraw_magic_points = true;
- if (!known[ARTP_MAGICAL_POWER])
- {
- mprf("You feel your mana capacity %s.",
- proprt[ARTP_MAGICAL_POWER] > 0? "increase" : "decrease");
- artefact_wpn_learn_prop(item, ARTP_MAGICAL_POWER);
- }
+ mprf("You feel your mana capacity %s.",
+ proprt[ARTP_MAGICAL_POWER] > 0? "increase" : "decrease");
+ artefact_wpn_learn_prop(item, ARTP_MAGICAL_POWER);
}
// Modify ability scores.
@@ -5699,6 +5695,10 @@ void use_artefact(item_def &item, bool *show_msgs, bool unmeld)
// there is a dangerous monster nearby...
xom_is_stimulated(128);
}
+
+ // Let's try this here instead of up there.
+ if (proprt[ARTP_MAGICAL_POWER])
+ calc_mp();
#undef unknown_proprt
}