From: <gi...@cr...> - 2013-04-17 20:05:26
|
via b6b0b3154d4c274aba3e52efbc40882b985e7da7 (commit) from 231196a0620ac86d6ad1165f256f5577c905478a (commit) ----------------------------------------------------------------------- commit b6b0b3154d4c274aba3e52efbc40882b985e7da7 Author: Pekka Lampila <pek...@ik...> Date: Sat Apr 13 20:37:44 2013 +0300 Annotate god gifts for stash search ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/dat/clua/stash.lua | 4 ++++ crawl-ref/source/l_item.cc | 11 +++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/crawl-ref/source/dat/clua/stash.lua b/crawl-ref/source/dat/clua/stash.lua index 0c7743a..2a5de56 100644 --- a/crawl-ref/source/dat/clua/stash.lua +++ b/crawl-ref/source/dat/clua/stash.lua @@ -41,6 +41,10 @@ function ch_stash_search_annotate_item(it) annot = annot .. "{stick} " end + if it.god_gift then + annot = annot .. "{god gift} " + end + if food.isfruit(it) then annot = annot .. "{fruit} " end diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc index 58c1b61..05176fc 100644 --- a/crawl-ref/source/l_item.cc +++ b/crawl-ref/source/l_item.cc @@ -623,6 +623,16 @@ IDEF(snakable) return 1; } +IDEF(god_gift) +{ + if (!item || !item->defined()) + return 0; + + lua_pushboolean(ls, origin_is_god_gift(*item)); + + return 1; +} + // DLUA-only functions static int l_item_do_pluses(lua_State *ls) { @@ -1040,6 +1050,7 @@ static ItemAccessor item_attrs[] = { "artefact", l_item_artefact }, { "branded", l_item_branded }, { "snakable", l_item_snakable }, + { "god_gift", l_item_god_gift }, { "class", l_item_class }, { "subtype", l_item_subtype }, { "cursed", l_item_cursed }, -- Dungeon Crawl Stone Soup |