summaryrefslogtreecommitdiffstats
path: root/stone_soup/crawl-ref/source/lua/stash.lua
blob: 461a504cf3ed5236fcaa19db1bc30a614d802cb2 (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
---------------------------------------------------------------------------
-- stash.lua
-- Annotates items for the stash-tracker.
--
-- To use this, add this line to your init.txt:
--   lua_file = lua/stash.lua
--
---------------------------------------------------------------------------

-- Annotate items for searches
function ch_stash_search_annotate_item(it)
    local annot = ""

    if item.artifact(it) then
        annot = annot .. "{art} "
    elseif item.branded(it) then
        annot = annot .. "{ego} "
    elseif item.class(it, true) == "book" then
        annot = annot .. "{book} "
    end

    local skill = item.weap_skill(it)
    if skill then
        annot = annot .. "{" .. skill .. "} "
    end

    return annot
end

--- If you want dumps (.lst files) to be annotated, uncomment this line:
-- ch_stash_dump_annotate_item = ch_stash_search_annotate_item