summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.com>2009-10-14 22:17:03 +1000
committerAdam Borowski <kilobyte@angband.pl>2009-10-14 14:20:54 +0200
commit3dc52ea4df7390b75b321d754ef77d684506c1f5 (patch)
treea6749cb1844092c452b731f02ff83e7681acbae1 /crawl-ref
parent8a134b6ef9aefd2facbc62c650976a8942d57729 (diff)
downloadcrawl-ref-3dc52ea4df7390b75b321d754ef77d684506c1f5.tar.gz
crawl-ref-3dc52ea4df7390b75b321d754ef77d684506c1f5.zip
Allow access to you.unique_creates in Lua, via you.uniques("Michael"), etc.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/clua.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index 11ac031f5d..c594e4f08c 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -787,6 +787,7 @@ LUARET1(you_exp_points, number, you.experience)
LUARET1(you_skill, number,
lua_isstring(ls, 1) ? you.skills[str_to_skill(lua_tostring(ls, 1))]
: 0)
+LUARET1(you_uniques, boolean, lua_isstring(ls, 1) ? you.unique_creatures[get_monster_by_name(lua_tostring(ls, 1))] : 0)
LUARET1(you_res_poison, number, player_res_poison(false))
LUARET1(you_res_fire, number, player_res_fire(false))
LUARET1(you_res_cold, number, player_res_cold(false))
@@ -895,6 +896,7 @@ static const struct luaL_reg you_lib[] =
{ "intelligence", you_intelligence },
{ "dexterity" , you_dexterity },
{ "skill" , you_skill },
+ { "uniques" , you_uniques },
{ "xl" , you_exp },
{ "exp" , you_exp_points },
{ "res_poison" , you_res_poison },