summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 16:17:48 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 16:17:48 +0000
commit7b7a36d0531a016ba81520bec2a4a4177e2ca8ed (patch)
tree2054ca1b5243de711a38a2751edc06f39d92b001 /crawl-ref/source/clua.cc
parent5443a68f96b0ba24b0de77573ad36a5633b39cd7 (diff)
downloadcrawl-ref-7b7a36d0531a016ba81520bec2a4a4177e2ca8ed.tar.gz
crawl-ref-7b7a36d0531a016ba81520bec2a4a4177e2ca8ed.zip
Yikes, so many files! And all I did was add more item evaluation
functions for menu colouring and pickup... Added: emergency_item, good_item, dangerous_item, bad_item, and useless_item, all taking into account player species and mutations, so e.g. =see invisible is useless for Naga, and !poison is always bad but only useless if you don't know Evaporate. Never autopickup useless, dangerous (e.g. ?immolation) or inedible items, and simplify the item colour/pickup options accordingly. I'll have to see if pickup.lua is still even needed after this. Removed the menu_colour_prefix_id option as I can't see any reason to turn it off. Oh, and fixed a bug where Kenku were unable to stop levitating if they gained level 15 while levitating. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5658 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index 237fe16601..87b4dd3028 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -735,7 +735,7 @@ 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)
+ : 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))
@@ -752,6 +752,7 @@ LUARET1(you_transform, string, transform_name())
LUARET1(you_where, string, level_id::current().describe().c_str())
LUARET1(you_branch, string, level_id::current().describe(false, false).c_str())
LUARET1(you_subdepth, number, level_id::current().depth)
+// Increase by 1 because check happens on old level.
LUARET1(you_absdepth, number, you.your_level + 1)
LUAWRAP(you_stop_activity, interrupt_activity(AI_FORCE_INTERRUPT))
LUARET1(you_turns, number, you.num_turns)
@@ -761,7 +762,6 @@ LUARET1(you_see_grid_no_trans, boolean,
see_grid_no_trans(luaL_checkint(ls, 1), luaL_checkint(ls, 2)))
LUARET1(you_can_smell, boolean, player_can_smell())
-// increase by 1 because check happens on old level
void lua_push_floor_items(lua_State *ls);
static int you_floor_items(lua_State *ls)
@@ -1181,7 +1181,7 @@ static const char *ring_types[] =
"protection from magic",
"fire",
"ice",
- "teleport control",
+ "teleport control"
};
static const char *amulet_types[] =
@@ -1250,6 +1250,11 @@ static int l_item_subtype(lua_State *ls)
return (2);
}
+// Used to divide a given potion into one of four categories:
+// 0 : unknown potion
+// 1 : always beneficial
+// 2 : always bad
+// 3 : depends on species etc.
static int l_item_potion_type(lua_State *ls)
{
LUA_ITEM(item, 1);
@@ -1291,7 +1296,7 @@ static int l_item_potion_type(lua_State *ls)
val = 2;
break;
- // need more refined handling:
+ // Need more refined handling:
// for eating habits
case POT_BLOOD:
case POT_BLOOD_COAGULATED:
@@ -1316,7 +1321,7 @@ static int l_item_cursed(lua_State *ls)
{
LUA_ITEM(item, 1);
bool cursed = item && item_ident(*item, ISFLAG_KNOW_CURSE)
- && item_cursed(*item);
+ && item_cursed(*item);
lua_pushboolean(ls, cursed);
return (1);
}
@@ -2192,8 +2197,6 @@ static option_handler handlers[] =
option_hboolean },
{ "menu_colour_prefix_class", &Options.menu_colour_prefix_class,
option_hboolean },
- { "menu_colour_prefix_id", &Options.menu_colour_prefix_id,
- option_hboolean },
};
static const option_handler *get_handler(const char *optname)