From d41eb1b2b5ae57c15005250400a0ae3d85b0ad7c Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 15 May 2008 15:45:05 +0000 Subject: Add divine stamina (temporary stat-boosting) to Zin's Revitalisation. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5054 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 12 ++++++++++++ crawl-ref/source/enum.h | 2 ++ crawl-ref/source/output.cc | 18 +++++++++++++++--- crawl-ref/source/player.cc | 9 +++++++++ crawl-ref/source/spells1.cc | 31 ++++++++++++++++++++++++++++--- 5 files changed, 66 insertions(+), 6 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 07f651ddfb..4170989d79 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3071,6 +3071,18 @@ static void _decrement_durations() you.attribute[ATTR_DIVINE_ROBUSTNESS] = 0; calc_hp(); } + + if (_decrement_a_duration(DUR_DIVINE_STAMINA)) + { + mpr("Your divine stamina fades.", MSGCH_DURATION); + modify_stat(STAT_STRENGTH, -you.attribute[ATTR_DIVINE_STAMINA], + true, "Zin's divine stamina running out"); + modify_stat(STAT_INTELLIGENCE, -you.attribute[ATTR_DIVINE_STAMINA], + true, "Zin's divine stamina running out"); + modify_stat(STAT_DEXTERITY, -you.attribute[ATTR_DIVINE_STAMINA], + true, "Zin's divine stamina running out"); + you.attribute[ATTR_DIVINE_STAMINA] = 0; + } } static void _check_banished() diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 0e64ee75ef..07db487814 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -172,6 +172,7 @@ enum attribute_type ATTR_ABYSS_ENTOURAGE, // maximum number of hostile monsters in // sight of the player while in the Abyss. ATTR_DIVINE_ROBUSTNESS, // strength of Zin's Divine Robustness + ATTR_DIVINE_STAMINA, // strength of Zin's Divine Stamina ATTR_DIVINE_SHIELD, // strength of TSO's Divine Shield ATTR_UNIQUE_RUNES, ATTR_DEMONIC_RUNES, @@ -1073,6 +1074,7 @@ enum duration_type DUR_PRAYER, DUR_PIETY_POOL, // distribute piety over time DUR_DIVINE_ROBUSTNESS, // duration of Zin's Divine Robustness + DUR_DIVINE_STAMINA, // duration of Zin's Divine Stamina DUR_DIVINE_SHIELD, // duration of TSO's Divine Shield DUR_REGENERATION, DUR_SWIFTNESS, diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index f9542ea459..a10408e8f8 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -362,7 +362,7 @@ static void _print_stats_str(int x, int y) cgotoxy(x+5, y, GOTO_STAT); - if (you.duration[DUR_MIGHT]) + if (you.duration[DUR_MIGHT] || you.duration[DUR_DIVINE_STAMINA]) textcolor(LIGHTBLUE); // no end of effect warning else if (you.strength < you.max_strength) textcolor(YELLOW); @@ -391,7 +391,13 @@ static void _print_stats_int(int x, int y) cgotoxy(x+5, y, GOTO_STAT); - textcolor(you.intel < you.max_intel ? YELLOW : HUD_VALUE_COLOR); + if (you.duration[DUR_DIVINE_STAMINA]) + textcolor(LIGHTBLUE); // no end of effect warning + else if (you.intel < you.max_intel) + textcolor(YELLOW); + else + textcolor(HUD_VALUE_COLOR); + cprintf( "%d", you.intel ); if (you.intel != you.max_intel) @@ -412,7 +418,13 @@ static void _print_stats_dex(int x, int y) cgotoxy(x+5, y, GOTO_STAT); - textcolor(you.dex < you.max_dex ? YELLOW : HUD_VALUE_COLOR); + if (you.duration[DUR_DIVINE_STAMINA]) + textcolor(LIGHTBLUE); // no end of effect warning + else if (you.dex < you.max_dex) + textcolor(YELLOW); + else + textcolor(HUD_VALUE_COLOR); + cprintf( "%d", you.dex ); if (you.dex != you.max_dex) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 5774d736e5..075a99dc7f 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5167,6 +5167,9 @@ static int _strength_modifier() if (you.duration[DUR_MIGHT]) result += 5; + if (you.duration[DUR_DIVINE_STAMINA]) + result += you.attribute[ATTR_DIVINE_STAMINA]; + // ego items of strength result += 3 * count_worn_ego(SPARM_STRENGTH); @@ -5199,6 +5202,9 @@ static int _int_modifier() { int result = 0; + if (you.duration[DUR_DIVINE_STAMINA]) + result += you.attribute[ATTR_DIVINE_STAMINA]; + // ego items of intelligence result += 3 * count_worn_ego(SPARM_INTELLIGENCE); @@ -5219,6 +5225,9 @@ static int _dex_modifier() { int result = 0; + if (you.duration[DUR_DIVINE_STAMINA]) + result += you.attribute[ATTR_DIVINE_STAMINA]; + // ego items of dexterity result += 3 * count_worn_ego(SPARM_DEXTERITY); diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 6e988ab719..85bf2d39b6 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -948,7 +948,7 @@ int cast_revitalisation(int pow) // chaining indicator and the step counter. case 3: - // Restore and/or temporarily boost stats. + // Restore stats and/or add divine stamina. switch (step) { case 0: @@ -967,9 +967,34 @@ int cast_revitalisation(int pow) break; } - step = 6; + step = 3; // Deliberate fall through. - // XXX: Temporary stat boosting is not implemented yet. + + // Divine stamina. + case 3: + case 4: + case 5: + if ((step == 3 || you.duration[DUR_REVITALISATION_CHAIN] > 0) + && you.attribute[ATTR_DIVINE_STAMINA] == (step - 3)) + { + success = true; + mprf(MSGCH_DURATION, "Zin %s divine stamina.", + (step == 3) ? "grants you" : + (step == 4) ? "strengthens your" + : "maximises your"); + you.attribute[ATTR_DIVINE_STAMINA]++; + you.duration[DUR_DIVINE_STAMINA] += + (step == 3) ? (you.skills[SK_INVOCATIONS] * 2) : + (step == 4) ? (you.skills[SK_INVOCATIONS]) + : (you.skills[SK_INVOCATIONS] / 2); + + modify_stat(STAT_STRENGTH, 1, true, ""); + modify_stat(STAT_INTELLIGENCE, 1, true, ""); + modify_stat(STAT_DEXTERITY, 1, true, ""); + need_chain = true; + break; + } + default: break; } -- cgit v1.2.3-54-g00ecf