diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-01 11:59:18 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-01 11:59:18 +0000 |
commit | b0bb78bd1d4f2364fb560ce31dadd878d3253573 (patch) | |
tree | 2ca8deb6038537b73f70788bd8a424cf982eb87a /crawl-ref/source/clua.cc | |
parent | 22995abf93b5514ed2b71219a693355ae9f7281f (diff) | |
download | crawl-ref-b0bb78bd1d4f2364fb560ce31dadd878d3253573.tar.gz crawl-ref-b0bb78bd1d4f2364fb560ce31dadd878d3253573.zip |
Added you.good_god() and you.evil_god() to check if the player is worshipping a good/evil god. Passing a god name is optional, and will check if that god is good/evil (you.good_god("Elyvilon") == true).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2715 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r-- | crawl-ref/source/clua.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 4539a81da2..d21522aeca 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -717,6 +717,12 @@ LUARET1(you_race, string, species_name(you.species, you.experience_level).c_str()) LUARET1(you_class, string, get_class_name(you.char_class)) LUARET1(you_god, string, god_name(you.religion)) +LUARET1(you_good_god, boolean, + lua_isstring(ls, 1) ? is_good_god(str_to_god(lua_tostring(ls, 1))) + : is_good_god(you.religion)) +LUARET1(you_evil_god, boolean, + lua_isstring(ls, 1) ? is_evil_god(str_to_god(lua_tostring(ls, 1))) + : is_evil_god(you.religion)) LUARET2(you_hp, number, you.hp, you.hp_max) LUARET2(you_mp, number, you.magic_points, you.max_magic_points) LUARET1(you_hunger, string, hunger_level()) @@ -797,6 +803,8 @@ static const struct luaL_reg you_lib[] = { "race" , you_race }, { "class" , you_class }, { "god" , you_god }, + { "good_god" , you_good_god }, + { "evil_god" , you_evil_god }, { "hp" , you_hp }, { "mp" , you_mp }, { "hunger" , you_hunger }, @@ -805,7 +813,6 @@ static const struct luaL_reg you_lib[] = { "dexterity" , you_dexterity }, { "xl" , you_exp }, { "exp" , you_exp_points }, - { "res_poison" , you_res_poison }, { "res_fire" , you_res_fire }, { "res_cold" , you_res_cold }, |