summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-05-10 21:07:52 +0200
committerBardur Arantsson <bardur@scientician.net>2012-05-10 21:30:10 +0200
commit226d3565889f551c00d4fccf184c98edb12c07c7 (patch)
treea8c76716fb1f2ca9a4b5aa8c6a210013050e5461 /src
parent9c849217091714882ab73d03c6f11efb7f610924 (diff)
Lua: Move "Tulkas" spell functions to C
Diffstat (limited to 'src')
-rw-r--r--src/externs.h11
-rw-r--r--src/spells.pkg11
-rw-r--r--src/spells3.c59
3 files changed, 81 insertions, 0 deletions
diff --git a/src/externs.h b/src/externs.h
index 6db58e36..dd83e876 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -1655,6 +1655,17 @@ char *tempo_essence_of_speed_info();
bool_ *tempo_banishment();
char *tempo_banishment_info();
+extern s32b TULKAS_AIM;
+extern s32b TULKAS_WAVE;
+extern s32b TULKAS_SPIN;
+
+bool_ *tulkas_divine_aim();
+char *tulkas_divine_aim_info();
+bool_ *tulkas_wave_of_power();
+char *tulkas_wave_of_power_info();
+bool_ *tulkas_whirlwind();
+char *tulkas_whirlwind_info();
+
/* randart.c */
extern int get_activation_power(void);
extern void build_prob(cptr learn);
diff --git a/src/spells.pkg b/src/spells.pkg
index eeae6e7d..3b7ce060 100644
--- a/src/spells.pkg
+++ b/src/spells.pkg
@@ -2660,3 +2660,14 @@ bool_ *tempo_essence_of_speed();
char *tempo_essence_of_speed_info();
bool_ *tempo_banishment();
char *tempo_banishment_info();
+
+extern s32b TULKAS_AIM;
+extern s32b TULKAS_WAVE;
+extern s32b TULKAS_SPIN;
+
+bool_ *tulkas_divine_aim();
+char *tulkas_divine_aim_info();
+bool_ *tulkas_wave_of_power();
+char *tulkas_wave_of_power_info();
+bool_ *tulkas_whirlwind();
+char *tulkas_whirlwind_info();
diff --git a/src/spells3.c b/src/spells3.c
index 9cca482a..6220cd25 100644
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -90,6 +90,10 @@ s32b SLOWMONSTER;
s32b ESSENCESPEED;
s32b BANISHMENT;
+s32b TULKAS_AIM;
+s32b TULKAS_WAVE;
+s32b TULKAS_SPIN;
+
/* FIXME: Hackish workaround while we're still tied to Lua. This lets
us return Lua's "nil" and a non-nil value (which is all the s_aux.lua
@@ -2776,3 +2780,58 @@ char *tempo_banishment_info()
tempo_banishment_power());
return buf;
}
+
+bool_ *tulkas_divine_aim()
+{
+ s32b dur = get_level_s(TULKAS_AIM, 50) + randint(10);
+
+ set_strike(dur);
+ if (get_level_s(TULKAS_AIM, 50) >= 20)
+ {
+ set_tim_deadly(dur);
+ }
+
+ return CAST;
+}
+
+char *tulkas_divine_aim_info()
+{
+ static char buf[128];
+ sprintf(buf,
+ "dur " FMTs32b "+d10",
+ get_level_s(TULKAS_AIM, 50));
+ return buf;
+}
+
+bool_ *tulkas_wave_of_power()
+{
+ int dir;
+
+ if (!get_aim_dir(&dir))
+ {
+ return NO_CAST;
+ }
+
+ fire_bolt(GF_ATTACK, dir, get_level_s(TULKAS_WAVE, p_ptr->num_blow));
+ return CAST;
+}
+
+char *tulkas_wave_of_power_info()
+{
+ static char buf[128];
+ sprintf(buf,
+ "blows " FMTs32b,
+ get_level_s(TULKAS_WAVE, p_ptr->num_blow));
+ return buf;
+}
+
+bool_ *tulkas_whirlwind()
+{
+ fire_ball(GF_ATTACK, 0, 1, 1);
+ return CAST;
+}
+
+char *tulkas_whirlwind_info()
+{
+ return "";
+}