summaryrefslogtreecommitdiff
path: root/lib/scpt/gods.lua
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2010-01-08 20:28:34 +0100
committerBardur Arantsson <bardur@scientician.net>2010-01-08 23:46:06 +0100
commit6aa48afdd57d03314fdf4be6c9da911c32277c84 (patch)
tree2dc401f9aae2dc6736d2fc3811c8f8099d3eabe6 /lib/scpt/gods.lua
Import tome-2.3.5.
Diffstat (limited to 'lib/scpt/gods.lua')
-rw-r--r--lib/scpt/gods.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/scpt/gods.lua b/lib/scpt/gods.lua
new file mode 100644
index 00000000..014a4423
--- /dev/null
+++ b/lib/scpt/gods.lua
@@ -0,0 +1,26 @@
+add_hooks
+{
+ [HOOK_FOLLOW_GOD] = function(god, action)
+ if action == "ask" then
+ if not (god == GOD_MELKOR) then
+ local i = INVEN_WIELD
+ while i < INVEN_TOTAL do
+ -- 13 is ART_POWER
+ if player.inventory(i).name1 == 13 then
+ msg_print("The One Ring has corrupted you, and you are rejected.")
+ return TRUE
+ end
+ i = i + 1
+ end
+ end
+ end
+ return FALSE
+ end,
+ [HOOK_RECALC_SKILLS] = function()
+ if not (player.pgod == GOD_NONE) and (get_skill(SKILL_ANTIMAGIC) > 0) then
+ msg_print("You no longer believe.")
+ abandon_god(GOD_ALL)
+ end
+ return FALSE
+ end,
+}