summaryrefslogtreecommitdiffstats
path: root/crawl-ref/settings/pickup_butcher_tool.txt
blob: d6408811d119029332b7f97004d0347591a12475 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 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 >