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

identify identifies all of a stack

git-svn-id: http://svn.net-core.org/repos/t-engine4@540 51575b47-30f0-44d4-a5cc-537603b46e54
parent 6c4d6015
No related branches found
No related tags found
No related merge requests found
......@@ -59,13 +59,15 @@ end
--- Identify the object
function _M:identify(id)
self.identified = id
if self.id_by_type then
game.object_known_types = game.object_known_types or {}
game.object_known_types[self.type] = game.object_known_types[self.type] or {}
game.object_known_types[self.type][self.subtype] = game.object_known_types[self.type][self.subtype] or {}
game.object_known_types[self.type][self.subtype][self.name] = id
end
self:forAllStack(function(so)
so.identified = id
if so.id_by_type then
game.object_known_types = game.object_known_types or {}
game.object_known_types[so.type] = game.object_known_types[so.type] or {}
game.object_known_types[so.type][so.subtype] = game.object_known_types[so.type][so.subtype] or {}
game.object_known_types[so.type][so.subtype][so.name] = id
end
end)
end
--- Get the unided name
......
......@@ -144,7 +144,12 @@ end
--- Gets the full desc of the object
function _M:getDesc()
local _, c = self:getDisplayColor()
local desc = { c..self:getName().."#FFFFFF#", self.desc }
local desc
if not self:isIdentified() then
desc = { c..self:getName().."#FFFFFF#" }
else
desc = { c..self:getName().."#FFFFFF#", self.desc }
end
local reqs = self:getRequirementDesc(game.player)
if reqs 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