diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-16 21:37:24 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-16 21:37:24 +0000 |
commit | 5d158ddd4568f46554d4daf09e69b33244a85163 (patch) | |
tree | 99e2e01279424a879bd5058dee1510500852330f /crawl-ref/source | |
parent | fefb960118cab78b5c43e1d29c44aa46719ddbb5 (diff) | |
download | crawl-ref-5d158ddd4568f46554d4daf09e69b33244a85163.tar.gz crawl-ref-5d158ddd4568f46554d4daf09e69b33244a85163.zip |
pickup lua again, this time with Vampires included
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1882 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/clua.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/lua/pickup.lua | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 849969c1ca..7f735179b1 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -1160,7 +1160,9 @@ static int l_item_subtype(lua_State *ls) } else if (item->base_type == OBJ_POTIONS) { - if (item->sub_type == POT_BERSERK_RAGE) + 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"; @@ -1227,6 +1229,7 @@ static int l_item_potion_type(lua_State *ls) // need more refined handling: case POT_BERSERK_RAGE: + case POT_BLOOD: case POT_WATER: case POT_PORRIDGE: default: diff --git a/crawl-ref/source/lua/pickup.lua b/crawl-ref/source/lua/pickup.lua index aa128dc51f..452ef0b965 100644 --- a/crawl-ref/source/lua/pickup.lua +++ b/crawl-ref/source/lua/pickup.lua @@ -21,7 +21,7 @@ function make_hash(ls) end
function you_undead()
- return you.race() == "Mummy" or you.race() == "Ghoul"
+ return you.race() == "Mummy" or you.race() == "Ghoul" or you.race() == "Vampire"
end
-- not identified
@@ -76,8 +76,9 @@ function ch_autopickup(it) end
end
- -- special cases for water and porridge
- if item.subtype(it) == "water" or item.subtype(it) == "porridge" then
+ -- special cases for blood, water, and porridge
+ if item.subtype(it) == "blood" or item.subtype(it) == "water"
+ or item.subtype(it) == "porridge" then
return food.can_eat(it, false)
end
end
@@ -86,7 +87,7 @@ function ch_autopickup(it) return true
end
- if item.class(it) == "Comestibles" then
+ if item.class(it) == "Carrion" or item.class(it) == "Comestibles" then
return food.can_eat(it, false)
end
@@ -107,3 +108,4 @@ function ch_autopickup(it) -- we only get here if class autopickup ON
return true
end
+
|