summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/clua.cc9
-rw-r--r--crawl-ref/source/religion.cc4
-rw-r--r--crawl-ref/source/religion.h3
3 files changed, 13 insertions, 3 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 },
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 8aab39d714..e924109a87 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -359,7 +359,7 @@ void inc_penance(int god, int val);
void inc_penance(int val);
static bool followers_abandon_you(void); // Beogh
-static bool is_evil_god(god_type god)
+bool is_evil_god(god_type god)
{
return
god == GOD_KIKUBAAQUDGHA ||
@@ -370,7 +370,7 @@ static bool is_evil_god(god_type god)
god == GOD_LUGONU;
}
-static bool is_good_god(god_type god)
+bool is_good_god(god_type god)
{
return
god == GOD_SHINING_ONE ||
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 669b474e72..092de3edd0 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -52,4 +52,7 @@ bool ely_destroy_weapons();
bool trog_burn_books();
bool tso_stab_safe_monster(const actor *act);
+bool is_evil_god(god_type god);
+bool is_good_god(god_type god);
+
#endif