summaryrefslogtreecommitdiff
path: root/src/xtra1.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-04-05 21:25:42 +0200
committerBardur Arantsson <bardur@scientician.net>2012-04-07 15:28:26 +0200
commit6cefca4c3f1ded484c4e00aeb9a660f131a48b16 (patch)
tree465f7117b764f7cecdfab6e2aa27861538f37735 /src/xtra1.c
parent1a5636844a5ac885821a1562e38e8f97631fe9d2 (diff)
Lua: Move spell school usages of HOOK_CALC_BONUS to C
Diffstat (limited to 'src/xtra1.c')
-rw-r--r--src/xtra1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/xtra1.c b/src/xtra1.c
index 4d3a4519..1d2d8ba0 100644
--- a/src/xtra1.c
+++ b/src/xtra1.c
@@ -2489,6 +2489,20 @@ static void calc_gods()
}
}
+/* Apply spell schools */
+static void calc_schools()
+{
+ if (get_skill(SKILL_AIR) >= 50)
+ {
+ p_ptr->magical_breath = TRUE;
+ }
+
+ if (get_skill(SKILL_WATER) >= 30)
+ {
+ p_ptr->water_breath = TRUE;
+ }
+}
+
/* Apply flags */
static int extra_blows;
static int extra_shots;
@@ -2903,6 +2917,9 @@ void calc_bonuses(bool_ silent)
/* Let the scripts do what they need */
process_hooks(HOOK_CALC_BONUS, "()");
+ /* Take care of spell schools */
+ calc_schools();
+
/* The powers gived by the wielded monster */
calc_wield_monster();