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>2007-08-24 11:39:43 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-24 11:39:43 +0000
commitcb76f80426af8941a42b7346aacba92529e41338 (patch)
treeae73182eb6be8c941aaef6683c5a539124b83552 /crawl-ref/source/clua.cc
parenta42cf252322e22af17e24e3f5e8f2f7a35cc0bd7 (diff)
downloadcrawl-ref-cb76f80426af8941a42b7346aacba92529e41338.tar.gz
crawl-ref-cb76f80426af8941a42b7346aacba92529e41338.zip
Finally fixed pickup.lua to work as intended (I hope).
Other small changes: - default yesno for renouncing religion to 'n' - plants and fungi aren't "interesting", even when OOD - added WIZ designator to listed saved characters git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2031 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index f6f9c07f2f..85e73b20df 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -1180,12 +1180,18 @@ static int l_item_subtype(lua_State *ls)
{
if (item->sub_type == POT_BLOOD)
s = "blood";
- else if (item->sub_type == POT_BERSERK_RAGE)
- s = "berserk";
else if (item->sub_type == POT_WATER)
s = "water";
else if (item->sub_type == POT_PORRIDGE)
s = "porridge";
+ else if (item->sub_type == POT_BERSERK_RAGE)
+ s = "berserk";
+ else if (item->sub_type == POT_GAIN_STRENGTH
+ || item->sub_type == POT_GAIN_DEXTERITY
+ || item->sub_type == POT_GAIN_INTELLIGENCE)
+ s = "gain ability";
+ else if (item->sub_type == POT_CURE_MUTATION)
+ s = "cure mutation";
}
if (s)
@@ -1207,11 +1213,13 @@ static int l_item_potion_type(lua_State *ls)
{
LUA_ITEM(item, 1);
int val = 99;
-
+
if (item && item->base_type == OBJ_POTIONS)
{
if (!item_type_known(*item))
+ {
val = 0;
+ }
else
{
switch(item->sub_type)
@@ -1221,15 +1229,11 @@ static int l_item_potion_type(lua_State *ls)
case POT_HEAL_WOUNDS:
case POT_SPEED:
case POT_MIGHT:
- case POT_GAIN_STRENGTH:
- case POT_GAIN_DEXTERITY:
- case POT_GAIN_INTELLIGENCE:
case POT_LEVITATION:
case POT_INVISIBILITY:
case POT_EXPERIENCE:
case POT_MAGIC:
case POT_RESTORE_ABILITIES:
- case POT_CURE_MUTATION:
case POT_RESISTANCE:
val = 1;
break;
@@ -1247,10 +1251,16 @@ static int l_item_potion_type(lua_State *ls)
break;
// need more refined handling:
- case POT_BERSERK_RAGE:
+ // for eating habits
case POT_BLOOD:
case POT_WATER:
case POT_PORRIDGE:
+ // for undead
+ case POT_BERSERK_RAGE:
+ case POT_GAIN_STRENGTH:
+ case POT_GAIN_DEXTERITY:
+ case POT_GAIN_INTELLIGENCE:
+ case POT_CURE_MUTATION:
default:
val = 3;
}