summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-02 06:27:40 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-02 06:27:40 +0000
commitb072984d6840b43de8121f3262b699a8f59dbefa (patch)
treead9e2c437a28f03638aca71e6f5942afb1dbe524 /crawl-ref/source/clua.cc
parent1b96ed97e6315034c53b3206565f37489ce1148f (diff)
downloadcrawl-ref-b072984d6840b43de8121f3262b699a8f59dbefa.tar.gz
crawl-ref-b072984d6840b43de8121f3262b699a8f59dbefa.zip
Applied bobbens' patch: you.skills("foo") gets skill level of foo from Lua.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2721 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index d21522aeca..2bca2b3562 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -731,6 +731,9 @@ LUARET2(you_intelligence, number, you.intel, you.max_intel)
LUARET2(you_dexterity, number, you.dex, you.max_dex)
LUARET1(you_exp, number, you.experience_level)
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_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))
@@ -811,6 +814,7 @@ static const struct luaL_reg you_lib[] =
{ "strength" , you_strength },
{ "intelligence", you_intelligence },
{ "dexterity" , you_dexterity },
+ { "skill" , you_skill },
{ "xl" , you_exp },
{ "exp" , you_exp_points },
{ "res_poison" , you_res_poison },