Skip to content
Snippets Groups Projects
Commit a5e030fc authored by dg's avatar dg
Browse files

identify now works on equipment too

git-svn-id: http://svn.net-core.org/repos/t-engine4@597 51575b47-30f0-44d4-a5cc-537603b46e54
parent fb94d3c3
No related branches found
No related tags found
No related merge requests found
......@@ -51,13 +51,16 @@ newEntity{ base = "BASE_SCROLL",
use_simple = { name="identify one object (or all with high magic stat)", use = function(self, who)
if who:getMag() < 28 then
who:showInventory("Identify object", who:getInven(who.INVEN_INVEN), nil, function(o, item)
who:showEquipInven("Identify object", function(o) return not o:isIdentified() end, function(o)
o:identify(true)
game.logPlayer(who, "You identify: "..o:getName())
game.logPlayer(who, "You identify: "..o:getName{do_color=true})
return true
end)
else
for i, o in ipairs(who:getInven("INVEN")) do
o:identify(true)
for inven_id, inven in pairs(who.inven) do
for i, o in ipairs(inven) do
o:identify(true)
end
end
game.logPlayer(who, "You identify all your inventory.")
end
......
......@@ -56,18 +56,21 @@ newTalent{
local rad = math.floor(0 + (self:getTalentLevel(t) - 4))
if self:getTalentLevel(t) < 3 then
self:showInventory("Identify object", self:getInven(self.INVEN_INVEN), nil, function(o, item)
self:showEquipInven("Identify object", function(o) return not o:isIdentified() end, function(o)
o:identify(true)
game.logPlayer(self, "You identify: "..o:getName())
game.logPlayer(self, "You identify: "..o:getName{do_color=true})
return true
end)
return true
end
if self:getTalentLevel(t) >= 3 then
for i, o in ipairs(self:getInven("INVEN")) do
o:identify(true)
for inven_id, inven in pairs(self.inven) do
for i, o in ipairs(inven) do
o:identify(true)
end
end
game.logPlayer(who, "You identify all your inventory.")
game.logPlayer(self, "You identify all your inventory.")
end
if self:getTalentLevel(t) >= 4 then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment