From aa3717c904d5d25c9f58f5d17e66379966f00a8f Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 10 Jun 2008 07:41:27 +0000 Subject: Move pickup_butcher_tool.txt into (the recently freed) pickup.lua, re-enable it (whoops) and clean up its code. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5698 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/settings/init.txt | 7 ++++--- crawl-ref/settings/pickup_butcher_tool.txt | 33 ------------------------------ 2 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 crawl-ref/settings/pickup_butcher_tool.txt (limited to 'crawl-ref/settings') diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt index d489f53e32..7499e48ec6 100644 --- a/crawl-ref/settings/init.txt +++ b/crawl-ref/settings/init.txt @@ -80,6 +80,7 @@ lua_file = lua/runrest.lua lua_file = lua/gearset.lua lua_file = lua/eat.lua lua_file = lua/trapwalk.lua +lua_file = lua/pickup.lua # kills.lua yields more information at the cost of huge dumps. # lua_file = lua/kills.lua @@ -90,9 +91,9 @@ lua_file = lua/trapwalk.lua # autopickup = $?!+"/%) -# lua routines for automatically picking up one butchering tool -# This require ) in autopickup and no further weapons are picked up. -include = pickup_butcher_tool.txt +# Note that ")" have to be in the above list for pickup.lua +# (autopickup a butchering tool if you don't already have one) +# to work. # There is a long list of autopickup exceptions in include = autopickup_exceptions.txt diff --git a/crawl-ref/settings/pickup_butcher_tool.txt b/crawl-ref/settings/pickup_butcher_tool.txt deleted file mode 100644 index d6408811d1..0000000000 --- a/crawl-ref/settings/pickup_butcher_tool.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Pick up a butchering weapon if we don't already have one -< do -local function can_butcher(it, name) - if not item.can_cut_meat(it) then - return false - end - if item.cursed(it) then - return false - end - if name:find("distort", 0, true) then - return false - end - return true -end -function pickup_butcher(it, name) - if you.has_claws() > 0 then - return false - end - if not you.can_consume_corpses() and not you.god_likes_butchery() then - return false - end - if not can_butcher(it, name) then - return false - end - for _, inv_it in pairs(item.inventory()) do - if can_butcher(inv_it, item.name(inv_it)) then - return false - end - end - return true -end -add_autopickup_func(pickup_butcher) -end > -- cgit v1.2.3-54-g00ecf