summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-16 05:20:47 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-16 05:20:47 +0000
commit123b89f4285862a89c54d944b08c4ae43433000e (patch)
treed693eb6af0bbebd5cd03d527e6c80fad2a931afa /crawl-ref/source
parent0d4f396c1c1b9a3aacbd5f2bb80c0ec00146e8c1 (diff)
downloadcrawl-ref-123b89f4285862a89c54d944b08c4ae43433000e.tar.gz
crawl-ref-123b89f4285862a89c54d944b08c4ae43433000e.zip
Make Elyvilon's Divine Vigour temporarily increase MP as well as HP.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9780 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/abl-show.cc2
-rw-r--r--crawl-ref/source/dat/descript/ability.txt2
-rw-r--r--crawl-ref/source/output.cc40
-rw-r--r--crawl-ref/source/player.cc10
-rw-r--r--crawl-ref/source/spells1.cc4
5 files changed, 40 insertions, 18 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index a608e28acc..b0a35bc933 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -290,7 +290,7 @@ static const ability_def Ability_List[] =
{ ABIL_ELYVILON_GREATER_HEALING_OTHERS, "Greater Healing",
2, 0, 250, 2, ABFLAG_CONF_OK },
{ ABIL_ELYVILON_RESTORATION, "Restoration", 3, 0, 400, 3, ABFLAG_CONF_OK },
- { ABIL_ELYVILON_DIVINE_VIGOUR, "Divine Vigour", 6, 0, 600, 5,
+ { ABIL_ELYVILON_DIVINE_VIGOUR, "Divine Vigour", 0, 0, 600, 6,
ABFLAG_CONF_OK },
// Lugonu
diff --git a/crawl-ref/source/dat/descript/ability.txt b/crawl-ref/source/dat/descript/ability.txt
index dcb5681c57..05764a82d0 100644
--- a/crawl-ref/source/dat/descript/ability.txt
+++ b/crawl-ref/source/dat/descript/ability.txt
@@ -302,7 +302,7 @@ Fully restore your Strength, Dexterity and Intelligence, and heal a large amount
%%%%
Divine Vigour
-Depending on your Invocations skill, heal a large amount of, and temporarily increase, your hit points.
+Depending on your Invocations skill, restore a large amount of, and temporarily increase, both your hit points and your magic points.
%%%%
# Lugonu
Depart the Abyss
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 5d4b208a07..282ebb9df6 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -281,6 +281,12 @@ static void _print_stats_mp(int x, int y)
{
// Calculate colour
short mp_colour = HUD_VALUE_COLOUR;
+
+ const bool boosted = you.duration[DUR_DIVINE_VIGOUR];
+
+ if (boosted)
+ mp_colour = LIGHTBLUE;
+ else
{
int mp_percent = (you.max_magic_points == 0
? 100
@@ -294,8 +300,11 @@ static void _print_stats_mp(int x, int y)
cgotoxy(x+8, y, GOTO_STAT);
textcolor(mp_colour);
cprintf("%d", you.magic_points);
- textcolor(HUD_VALUE_COLOUR);
- cprintf("/%d", you.max_magic_points );
+ if (!boosted)
+ textcolor(HUD_VALUE_COLOUR);
+ cprintf("/%d", you.max_magic_points);
+ if (boosted)
+ textcolor(HUD_VALUE_COLOUR);
int col = _count_digits(you.magic_points)
+ _count_digits(you.max_magic_points) + 1;
@@ -334,12 +343,12 @@ static void _print_stats_hp(int x, int y)
textcolor(HUD_CAPTION_COLOUR);
cprintf(max_max_hp != you.hp_max ? "HP: " : "Health: ");
textcolor(hp_colour);
- cprintf( "%d", you.hp );
+ cprintf("%d", you.hp);
if (!boosted)
textcolor(HUD_VALUE_COLOUR);
- cprintf( "/%d", you.hp_max );
+ cprintf("/%d", you.hp_max);
if (max_max_hp != you.hp_max)
- cprintf( " (%d)", max_max_hp );
+ cprintf(" (%d)", max_max_hp);
if (boosted)
textcolor(HUD_VALUE_COLOUR);
@@ -1871,12 +1880,13 @@ static std::vector<formatted_string> _get_overview_stats()
// 4 columns
column_composer cols1(4, 18, 28, 40);
- const bool boosted = you.duration[DUR_DIVINE_VIGOUR]
- || you.duration[DUR_BERSERKER];
+ const bool boosted_hp = you.duration[DUR_DIVINE_VIGOUR]
+ || you.duration[DUR_BERSERKER];
+ const bool boosted_mp = you.duration[DUR_DIVINE_VIGOUR];
if (!player_rotted())
{
- if (boosted)
+ if (boosted_hp)
{
snprintf(buf, sizeof buf, "HP <lightblue>%3d/%d</lightblue>",
you.hp, you.hp_max);
@@ -1886,7 +1896,7 @@ static std::vector<formatted_string> _get_overview_stats()
}
else
{
- if (boosted)
+ if (boosted_hp)
{
snprintf(buf, sizeof buf, "HP <lightblue>%3d/%d (%d)</lightblue>",
you.hp, you.hp_max, get_real_hp(true, true));
@@ -1899,8 +1909,16 @@ static std::vector<formatted_string> _get_overview_stats()
}
cols1.add_formatted(0, buf, false);
- snprintf(buf, sizeof buf, "MP %3d/%d",
- you.magic_points, you.max_magic_points);
+ if (boosted_mp)
+ {
+ snprintf(buf, sizeof buf, "MP <lightblue>%3d/%d</lightblue>",
+ you.magic_points, you.max_magic_points);
+ }
+ else
+ {
+ snprintf(buf, sizeof buf, "MP %3d/%d",
+ you.magic_points, you.max_magic_points);
+ }
cols1.add_formatted(0, buf, false);
snprintf(buf, sizeof buf, "Gold %d", you.gold);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 2aac34031c..85cafca2e2 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4771,8 +4771,7 @@ void dec_mp(int mp_loss)
you.magic_points -= mp_loss;
- if (you.magic_points < 0)
- you.magic_points = 0;
+ you.magic_points = std::max(0, you.magic_points);
if (Options.magic_point_warning
&& you.magic_points < (you.max_magic_points
@@ -4845,7 +4844,7 @@ void inc_mp(int mp_gain, bool max_too)
you.magic_points += mp_gain;
if (max_too)
- inc_max_mp( mp_gain );
+ inc_max_mp(mp_gain);
if (you.magic_points > you.max_magic_points)
you.magic_points = you.max_magic_points;
@@ -5091,8 +5090,9 @@ int get_real_mp(bool include_items)
enp += player_magical_power();
// Analogous to ROBUST/FRAIL
- enp *= (10 + player_mutation_level(MUT_HIGH_MAGIC)
- - player_mutation_level(MUT_LOW_MAGIC));
+ enp *= 10 + player_mutation_level(MUT_HIGH_MAGIC)
+ + you.attribute[ATTR_DIVINE_VIGOUR]
+ - player_mutation_level(MUT_LOW_MAGIC);
enp /= 10;
if (enp > 50)
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index f7806536e6..968e034686 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -817,6 +817,7 @@ void remove_divine_vigour()
you.duration[DUR_DIVINE_VIGOUR] = 0;
you.attribute[ATTR_DIVINE_VIGOUR] = 0;
calc_hp();
+ calc_mp();
}
bool cast_divine_vigour()
@@ -830,11 +831,14 @@ bool cast_divine_vigour()
const int vigour_amt = 1 + (you.skills[SK_INVOCATIONS]/6);
const int old_hp_max = you.hp_max;
+ const int old_mp_max = you.max_magic_points;
you.attribute[ATTR_DIVINE_VIGOUR] = vigour_amt;
you.duration[DUR_DIVINE_VIGOUR]
= 40 + (you.skills[SK_INVOCATIONS]*5)/2;
calc_hp();
inc_hp(you.hp_max - old_hp_max, false);
+ calc_mp();
+ inc_mp(you.max_magic_points - old_mp_max, false);
success = true;
}