diff options
-rw-r--r-- | lib/mods/theme/scpt/corrupt.lua | 11 | ||||
-rw-r--r-- | lib/mods/theme/scpt/misc.lua | 11 | ||||
-rw-r--r-- | lib/scpt/corrupt.lua | 11 | ||||
-rw-r--r-- | src/cmd6.c | 18 | ||||
-rw-r--r-- | src/defines.h | 1 |
5 files changed, 18 insertions, 34 deletions
diff --git a/lib/mods/theme/scpt/corrupt.lua b/lib/mods/theme/scpt/corrupt.lua index 51d7233b..f3ae60eb 100644 --- a/lib/mods/theme/scpt/corrupt.lua +++ b/lib/mods/theme/scpt/corrupt.lua @@ -13,17 +13,6 @@ CORRUPT_BALROG_AURA = add_corruption " Surrounds you with a fiery aura", " But it can burn scrolls when you read them" }, - ["hooks"] = - { - [HOOK_READ] = function(obj) - if magik(5) == TRUE then - msg_print("Your demon aura burns the scroll before you read it!") - return TRUE, TRUE, FALSE - else - return FALSE - end - end, - }, } CORRUPT_BALROG_WINGS = add_corruption diff --git a/lib/mods/theme/scpt/misc.lua b/lib/mods/theme/scpt/misc.lua index acb45f3c..6738b8f3 100644 --- a/lib/mods/theme/scpt/misc.lua +++ b/lib/mods/theme/scpt/misc.lua @@ -1,14 +1,3 @@ --- New scrolls -function sterilize_scroll(tval, sval) - if tval == 70 and sval == 54 then - msg_print("A neutralising wave radiates from you!") - set_no_breeders(randint(100) + 100) - return TRUE - end -end - -add_hook_script(HOOK_READ, "sterilize_scroll", "sterilize_scroll") - -- Neil's automagic statgain script player.last_rewarded_level = 1 diff --git a/lib/scpt/corrupt.lua b/lib/scpt/corrupt.lua index 1435df6e..ff2b6541 100644 --- a/lib/scpt/corrupt.lua +++ b/lib/scpt/corrupt.lua @@ -12,17 +12,6 @@ CORRUPT_BALROG_AURA = add_corruption " Surrounds you with a fiery aura", " But it can burn scrolls when you read them" }, - ["hooks"] = - { - [HOOK_READ] = function(obj) - if magik(5) == TRUE then - msg_print("Your demon aura burns the scroll before you read it!") - return TRUE, TRUE, FALSE - else - return FALSE - end - end, - }, } CORRUPT_BALROG_WINGS = add_corruption @@ -2899,8 +2899,16 @@ void do_cmd_read_scroll(void) /* Assume the scroll will get used up */ used_up = TRUE; + /* Corruption */ + if (player_has_corruption(CORRUPT_BALROG_AURA) && magik(5)) + { + msg_print("Your demon aura burns the scroll before you read it!"); + used_up = TRUE; + ident = FALSE; + } + /* New scripts, can override the ingame code */ - if (process_hooks_ret(HOOK_READ, "dd", "(O)", o_ptr)) + else if (process_hooks_ret(HOOK_READ, "dd", "(O)", o_ptr)) { used_up = process_hooks_return[0].num; ident = process_hooks_return[1].num; @@ -3509,6 +3517,14 @@ void do_cmd_read_scroll(void) break; } + case SV_SCROLL_STERILIZATION: + { + msg_print("A neutralising wave radiates from you!"); + set_no_breeders(randint(100) + 100); + + break; + } + default: { break; diff --git a/src/defines.h b/src/defines.h index 2677008a..3d258caf 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1938,6 +1938,7 @@ #define SV_SCROLL_RUMOR 51 #define SV_SCROLL_ARTIFACT 52 #define SV_SCROLL_NOTHING 53 +#define SV_SCROLL_STERILIZATION 54 /* The "sval" codes for TV_POTION */ #define SV_POTION_WATER 0 |