diff options
-rw-r--r-- | lib/mods/theme/scpt/s_eru.lua | 58 | ||||
-rw-r--r-- | lib/scpt/s_eru.lua | 58 | ||||
-rw-r--r-- | src/externs.h | 14 | ||||
-rw-r--r-- | src/spells.pkg | 17 | ||||
-rw-r--r-- | src/spells3.c | 90 |
5 files changed, 137 insertions, 100 deletions
diff --git a/lib/mods/theme/scpt/s_eru.lua b/lib/mods/theme/scpt/s_eru.lua index c0cb0aaf..d61b6118 100644 --- a/lib/mods/theme/scpt/s_eru.lua +++ b/lib/mods/theme/scpt/s_eru.lua @@ -14,24 +14,8 @@ ERU_SEE = add_spell -- Unnafected by blindness ["blind"] = FALSE, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - local obvious - obvious = set_tim_invis(randint(20) + 10 + get_level(ERU_SEE, 100)) - if get_level(ERU_SEE) >= 30 then - wiz_lite_extra() - obvious = TRUE - elseif get_level(ERU_SEE) >= 10 then - map_area() - obvious = TRUE - end - if get_level(ERU_SEE) >= 20 then - obvious = is_obvious(set_blind(0), obvious) - end - return obvious - end, - ["info"] = function() - return "dur "..(10 + get_level(ERU_SEE, 100)).."+d20" - end, + ["spell"] = function() return eru_see_the_music() end, + ["info"] = function() return eru_see_the_music_info() end, ["desc"] = { "Allows you to 'see' the Great Music from which the world", "originates, allowing you to see unseen things", @@ -53,21 +37,8 @@ ERU_LISTEN = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - if get_level(ERU_LISTEN) >= 30 then - ident_all() - identify_pack() - return TRUE - elseif get_level(ERU_LISTEN) >= 14 then - identify_pack() - return TRUE - else - return ident_spell() - end - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return eru_listen_to_the_music() end, + ["info"] = function() return eru_listen_to_the_music_info() end, ["desc"] = { "Allows you to listen to the Great Music from which the world", "originates, allowing you to understand the meaning of things", @@ -88,17 +59,8 @@ ERU_UNDERSTAND = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - if get_level(ERU_UNDERSTAND) >= 10 then - identify_pack_fully() - return TRUE - else - return identify_fully() - end - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return eru_know_the_music() end, + ["info"] = function() return eru_know_the_music_info() end, ["desc"] = { "Allows you to understand the Great Music from which the world", "originates, allowing you to know the full abilities of things", @@ -118,12 +80,8 @@ ERU_PROT = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - return fire_ball(GF_MAKE_GLYPH, 0, 1, 1 + get_level(ERU_PROT, 2, 0)) - end, - ["info"] = function() - return "rad "..(1 + get_level(ERU_PROT, 2, 0)) - end, + ["spell"] = function() return eru_lay_of_protection() end, + ["info"] = function() return eru_lay_of_protection_info() end, ["desc"] = { "Creates a circle of safety around you", } diff --git a/lib/scpt/s_eru.lua b/lib/scpt/s_eru.lua index c0cb0aaf..d61b6118 100644 --- a/lib/scpt/s_eru.lua +++ b/lib/scpt/s_eru.lua @@ -14,24 +14,8 @@ ERU_SEE = add_spell -- Unnafected by blindness ["blind"] = FALSE, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - local obvious - obvious = set_tim_invis(randint(20) + 10 + get_level(ERU_SEE, 100)) - if get_level(ERU_SEE) >= 30 then - wiz_lite_extra() - obvious = TRUE - elseif get_level(ERU_SEE) >= 10 then - map_area() - obvious = TRUE - end - if get_level(ERU_SEE) >= 20 then - obvious = is_obvious(set_blind(0), obvious) - end - return obvious - end, - ["info"] = function() - return "dur "..(10 + get_level(ERU_SEE, 100)).."+d20" - end, + ["spell"] = function() return eru_see_the_music() end, + ["info"] = function() return eru_see_the_music_info() end, ["desc"] = { "Allows you to 'see' the Great Music from which the world", "originates, allowing you to see unseen things", @@ -53,21 +37,8 @@ ERU_LISTEN = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - if get_level(ERU_LISTEN) >= 30 then - ident_all() - identify_pack() - return TRUE - elseif get_level(ERU_LISTEN) >= 14 then - identify_pack() - return TRUE - else - return ident_spell() - end - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return eru_listen_to_the_music() end, + ["info"] = function() return eru_listen_to_the_music_info() end, ["desc"] = { "Allows you to listen to the Great Music from which the world", "originates, allowing you to understand the meaning of things", @@ -88,17 +59,8 @@ ERU_UNDERSTAND = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - if get_level(ERU_UNDERSTAND) >= 10 then - identify_pack_fully() - return TRUE - else - return identify_fully() - end - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return eru_know_the_music() end, + ["info"] = function() return eru_know_the_music_info() end, ["desc"] = { "Allows you to understand the Great Music from which the world", "originates, allowing you to know the full abilities of things", @@ -118,12 +80,8 @@ ERU_PROT = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - return fire_ball(GF_MAKE_GLYPH, 0, 1, 1 + get_level(ERU_PROT, 2, 0)) - end, - ["info"] = function() - return "rad "..(1 + get_level(ERU_PROT, 2, 0)) - end, + ["spell"] = function() return eru_lay_of_protection() end, + ["info"] = function() return eru_lay_of_protection_info() end, ["desc"] = { "Creates a circle of safety around you", } diff --git a/src/externs.h b/src/externs.h index 408a7046..abf9473b 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1507,6 +1507,20 @@ char *earth_strike_info(); bool_ *earth_shake(); char *earth_shake_info(); +extern s32b ERU_SEE; +extern s32b ERU_LISTEN; +extern s32b ERU_UNDERSTAND; +extern s32b ERU_PROT; + +bool_ *eru_see_the_music(); +char *eru_see_the_music_info(); +bool_ *eru_listen_to_the_music(); +char *eru_listen_to_the_music_info(); +bool_ *eru_know_the_music(); +char *eru_know_the_music_info(); +bool_ *eru_lay_of_protection(); +char *eru_lay_of_protection_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 e9e7c29d..d7206b41 100644 --- a/src/spells.pkg +++ b/src/spells.pkg @@ -2542,3 +2542,20 @@ bool_ *earth_strike(); char *earth_strike_info(); bool_ *earth_shake(); char *earth_shake_info(); + +/* + * Eru + */ +extern s32b ERU_SEE; +extern s32b ERU_LISTEN; +extern s32b ERU_UNDERSTAND; +extern s32b ERU_PROT; + +bool_ *eru_see_the_music(); +char *eru_see_the_music_info(); +bool_ *eru_listen_to_the_music(); +char *eru_listen_to_the_music_info(); +bool_ *eru_know_the_music(); +char *eru_know_the_music_info(); +bool_ *eru_lay_of_protection(); +char *eru_lay_of_protection_info(); diff --git a/src/spells3.c b/src/spells3.c index fc29ec00..3faefc97 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -37,6 +37,11 @@ s32b STONEPRISON; s32b STRIKE; s32b SHAKE; +s32b ERU_SEE; +s32b ERU_LISTEN; +s32b ERU_UNDERSTAND; +s32b ERU_PROT; + /* 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 cares about). */ @@ -1007,3 +1012,88 @@ char *earth_shake_info() return buf; } +bool_ *eru_see_the_music() +{ + set_tim_invis(randint(20) + 10 + get_level_s(ERU_SEE, 100)); + + if (get_level_s(ERU_SEE, 50) >= 30) + { + wiz_lite_extra(); + } + else if (get_level_s(ERU_SEE, 50) >= 10) + { + map_area(); + } + + if (get_level_s(ERU_SEE, 50) >= 20) + { + set_blind(0); + } + + return CAST; +} + +char *eru_see_the_music_info() +{ + static char buf[128]; + sprintf(buf, + "dur %d+d20", + (10 + get_level_s(ERU_SEE, 100))); + return buf; +} + +bool_ *eru_listen_to_the_music() +{ + if (get_level_s(ERU_LISTEN, 50) >= 30) + { + ident_all(); + identify_pack(); + } + else if (get_level_s(ERU_LISTEN, 50) >= 14) + { + identify_pack(); + } + else + { + ident_spell(); + } + return CAST; +} + +char *eru_listen_to_the_music_info() +{ + return ""; +} + +bool_ *eru_know_the_music() +{ + if (get_level_s(ERU_UNDERSTAND, 50) >= 10) + { + identify_pack_fully(); + } + else + { + identify_fully(); + } + return CAST; +} + +char *eru_know_the_music_info() +{ + return ""; +} + +bool_ *eru_lay_of_protection() +{ + fire_ball(GF_MAKE_GLYPH, 0, 1, 1 + get_level(ERU_PROT, 2, 0)); + return CAST; +} + +char *eru_lay_of_protection_info() +{ + static char buf[128]; + sprintf(buf, + "rad %d", + (1 + get_level(ERU_PROT, 2, 0))); + return buf; +} |