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

Wearing the cloak of deception will make NPC call you human instead of undead

git-svn-id: http://svn.net-core.org/repos/t-engine4@6418 51575b47-30f0-44d4-a5cc-537603b46e54
parent c235cda4
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,6 @@ end
--- Replace some keywords in the given text
function _M:replace(text)
text = text:gsub("@playername@", self.player.name):gsub("@npcname@", self.npc.name)
text = text:gsub("@playerdescriptor.(.-)@", function(what) return self.player.descriptor[what] end)
text = text:gsub("@playerdescriptor.(.-)@", function(what) return self.player.descriptor["fake_"..what] or self.player.descriptor[what] end)
return text
end
......@@ -2186,10 +2186,14 @@ newEffect{
activate = function(self, eff)
self.old_faction_cloak = self.faction
self.faction = "allied-kingdoms"
if self.descriptor and self.descriptor.race and self:attr("undead") then self.descriptor.fake_race = "Human" end
if self.descriptor and self.descriptor.subrace and self:attr("undead") then self.descriptor.fake_subrace = "Cornac" end
if self.player then engine.Map:setViewerFaction(self.faction) end
end,
deactivate = function(self, eff)
self.faction = self.old_faction_cloak
if self.descriptor and self.descriptor.race and self:attr("undead") then self.descriptor.fake_race = nil end
if self.descriptor and self.descriptor.subrace and self:attr("undead") then self.descriptor.fake_subrace = nil end
if self.player then engine.Map:setViewerFaction(self.faction) end
end,
}
......
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