From 6cefca4c3f1ded484c4e00aeb9a660f131a48b16 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Thu, 5 Apr 2012 21:25:42 +0200 Subject: Lua: Move spell school usages of HOOK_CALC_BONUS to C --- src/xtra1.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') 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(); -- cgit v1.2.3