summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-08 21:33:27 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-08 21:33:27 +0000
commit5b2d47dfa224b441c5d39007bf6f98ef0597f9d6 (patch)
tree96889984514f88f848b6a984ca71b325017a1e9d /crawl-ref/source/spells4.cc
parent34bb40ababedcea0f05e00b7a41cdaffaf216357 (diff)
downloadcrawl-ref-5b2d47dfa224b441c5d39007bf6f98ef0597f9d6.tar.gz
crawl-ref-5b2d47dfa224b441c5d39007bf6f98ef0597f9d6.zip
Replace TSO's Smiting with Divine Shield.
Actually, I wasn't entirely sure which of the many attack invocations to replace and I chose Smiting mostly because of the new overlap with Zin and because such a change is easiest to revert (copy code from Zin). :p Divine Shield strengthens existing shields (also magical, which might have to be excluded) or else creates a new magical one. Either way, the shields value is increased by 3 + skills(SHIELDS)/5 and this bonus lasts for 5 + (skills(SHIELS) + 2*skills(INVOCATIONS))/6 turns, after which it is decreased by 1 every two out of three turns until it reaches 0. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3225 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 665ebd1901..603c16932b 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -44,6 +44,7 @@
#include "ouch.h"
#include "player.h"
#include "randart.h"
+#include "religion.h"
#include "skills.h"
#include "spells1.h"
#include "spells4.h"
@@ -2816,6 +2817,35 @@ void cast_condensation_shield(int pow)
return;
} // end cast_condensation_shield()
+// shield bonus = attribute for duration turns, then decreasing by 1
+// every two out of three turns
+// overall shield duration = duration + attribute
+// recasting simply resets those two values (to better values, presumably)
+void cast_divine_shield()
+{
+ if (!you.duration[DUR_DIVINE_SHIELD])
+ {
+ you.redraw_armour_class = true;
+ if (you.shield() || you.duration[DUR_FIRE_SHIELD]
+ || you.duration[DUR_CONDENSATION_SHIELD])
+ {
+ mprf("Your shield is strengthened by %s's divine power.",
+ god_name(you.religion).c_str());
+ }
+ else
+ mpr("A divine shield forms around you!");
+ }
+
+ // duration of complete shield bonus up to 18 turns
+ you.duration[DUR_DIVINE_SHIELD]
+ = 5 + (you.skills[SK_SHIELDS] + you.skills[SK_INVOCATIONS]*2)/6;
+
+ // shield bonus up to 8
+ you.attribute[ATTR_DIVINE_SHIELD] = 3 + you.skills[SK_SHIELDS]/5;
+
+ return;
+}
+
static int quadrant_blink(int x, int y, int pow, int garbage)
{
UNUSED( garbage );