summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/lua/stash.lua
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/lua/stash.lua')
-rw-r--r--crawl-ref/source/lua/stash.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/crawl-ref/source/lua/stash.lua b/crawl-ref/source/lua/stash.lua
new file mode 100644
index 0000000000..461a504cf3
--- /dev/null
+++ b/crawl-ref/source/lua/stash.lua
@@ -0,0 +1,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
+