diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-11 16:04:45 -0500 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-11 16:04:45 -0500 |
commit | 7d6de33069c359f758c866bb2d6a94521b1a4ad5 (patch) | |
tree | 76bffc4c406f8bded1520d45c1fe8a74ba7d12f8 /crawl-ref/source/clua.cc | |
parent | f5441fc9dd70ad0d0bca04e0bbf6838b97dcb24e (diff) | |
download | crawl-ref-7d6de33069c359f758c866bb2d6a94521b1a4ad5.tar.gz crawl-ref-7d6de33069c359f758c866bb2d6a94521b1a4ad5.zip |
Make gods that take corpse offerings do so without the butchery step,
i.e., allow merely praying over said corpses. Now, the only gods that
pay attention to butchery are Kikubaaqudgha and Elyvilon. Also, add
several miscellaneous fixes.
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r-- | crawl-ref/source/clua.cc | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 8a9c7bc5b9..11ac031f5d 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -767,6 +767,10 @@ LUARET1(you_good_god, boolean, LUARET1(you_evil_god, boolean, lua_isstring(ls, 1) ? is_evil_god(str_to_god(lua_tostring(ls, 1))) : is_evil_god(you.religion)) +LUARET1(you_god_likes_fresh_corpses, boolean, + lua_isstring(ls, 1) ? + god_likes_fresh_corpses(str_to_god(lua_tostring(ls, 1))) : + god_likes_fresh_corpses(you.religion)) LUARET1(you_god_likes_butchery, boolean, lua_isstring(ls, 1) ? god_likes_butchery(str_to_god(lua_tostring(ls, 1))) : @@ -907,8 +911,9 @@ static const struct luaL_reg you_lib[] = { "flying", you_flying }, { "transform", you_transform }, - { "god_likes_butchery", you_god_likes_butchery }, - { "can_consume_corpses", you_can_consume_corpses }, + { "god_likes_fresh_corpses", you_god_likes_fresh_corpses }, + { "god_likes_butchery", you_god_likes_butchery }, + { "can_consume_corpses", you_can_consume_corpses }, { "stop_activity", you_stop_activity }, { "taking_stairs", you_taking_stairs }, @@ -2525,14 +2530,14 @@ MDEF(hd) static const char *_monuse_names[] = { - "nothing", "open_doors", "starting_equipment", - "weapons_armour", "magic_items" + "nothing", "open_doors", "starting_equipment", "weapons_armour", + "magic_items" }; -static const char *_monuse_to_str(mon_itemuse_type ityp) +static const char *_monuse_to_str(mon_itemuse_type utyp) { COMPILE_CHECK(ARRAYSZ(_monuse_names) == NUM_MONUSE, c1); - return _monuse_names[ityp]; + return _monuse_names[utyp]; } MDEF(muse) @@ -2544,6 +2549,26 @@ MDEF(muse) return (0); } +static const char *_moneat_names[] = +{ + "nothing", "items", "corpses", "food" +}; + +static const char *_moneat_to_str(mon_itemeat_type etyp) +{ + COMPILE_CHECK(ARRAYSZ(_moneat_names) == NUM_MONEAT, c1); + return _moneat_names[etyp]; +} + +MDEF(meat) +{ + if (const monsterentry *me = mons->find_monsterentry()) + { + PLUARET(string, _moneat_to_str(me->gmon_eat)); + } + return (0); +} + static int l_mons_do_dismiss(lua_State *ls) { // dismiss is only callable from dlua, not from managed VMs (i.e. @@ -2580,6 +2605,7 @@ static MonsAccessor mons_attrs[] = { "y" , l_mons_y }, { "hd" , l_mons_hd }, { "muse", l_mons_muse }, + { "meat", l_mons_meat }, { "dismiss", l_mons_dismiss }, { "experience", l_mons_experience }, }; |