summaryrefslogtreecommitdiff
path: root/lib/mods
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-10 09:04:54 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-10 09:04:54 +0200
commitc40dff568a06733793a2351c9c172c180f7be542 (patch)
tree836808128e7d7f0ea7ba98474c5909f5601d1a8d /lib/mods
parent01382b9ad17cf77a7f2867b8efce4ceb619392f7 (diff)
Lua: Move Theme's movement hook to C
Diffstat (limited to 'lib/mods')
-rw-r--r--lib/mods/theme/scpt/monsters.lua37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/mods/theme/scpt/monsters.lua b/lib/mods/theme/scpt/monsters.lua
index 6c0cc197..df9c641d 100644
--- a/lib/mods/theme/scpt/monsters.lua
+++ b/lib/mods/theme/scpt/monsters.lua
@@ -1,42 +1,5 @@
-- This file holds various things that govern monster behaviour with respect to the player
--- Enables player to push past any monster who is >= MSTATUS_NEUTRAL.
--- Written by BauMog for the Intets Hevn module; permission granted to use in the Theme module
-
--- Adapted from defines.h
-function cave_floor_bold(y, x)
- local c_ptr = cave(y, x);
- if(cave_is(c_ptr, FF1_FLOOR) == TRUE) and (c_ptr.feat ~= FEAT_MON_TRAP) then
- return TRUE
- else
- return FALSE
- end
-end
-
--- Adapted from cmd1.c
-function __hook_push_past(y, x)
- local c_ptr = cave(y, x);
-
- if(c_ptr.m_idx > 0) then
- m_ptr = monster(c_ptr.m_idx);
- if(m_ptr.status >= MSTATUS_NEUTRAL) then
- if(cave_floor_bold(y, x) == TRUE) or (m_ptr.flags2 == RF2_PASS_WALL) then
- msg_print(format("You push past %s.", monster_desc(m_ptr, 0)));
- m_ptr.fy = player.py;
- m_ptr.fx = player.px;
- cave(player.py, player.px).m_idx = c_ptr.m_idx;
- c_ptr.m_idx = 0;
- else
- msg_print(format("%s is in your way!", monster_desc(m_ptr, 0)));
- energy_use = 0;
- end
- end
- end
-
-end
-
-add_hook_script(HOOK_MOVE, "__hook_push_past", "__hook_push_past");
-
-- Monster vs. Player Race alignment script
-- From T-Plus by Ingeborg S. Norden