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

Found lore is now also saved in the player's profile, for later use

git-svn-id: http://svn.net-core.org/repos/t-engine4@3383 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5aec46c6
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,7 @@ function _M:learnLore(lore)
end
self.lore_known[lore] = true
if not self.additional_lore[lore] and self.registerLoreFound then self:registerLoreFound(lore) end
print("[LORE] learnt", lore)
if learnt then if l.on_learn then l.on_learn(self) end end
end
......@@ -66,3 +66,11 @@ function _M:registerCharacterPlayed()
profile.mod.characters.characters[pid] = (profile.mod.characters.characters[pid] or 0) + 1
profile:saveModuleProfile("characters", profile.mod.characters)
end
function _M:registerLoreFound(lore)
local pid = self:playerStatGetCharacterIdentifier(game.party:findMember{main=true})
profile.mod.lore = profile.mod.lore or { lore={} }
profile.mod.lore.lore[lore] = true
profile:saveModuleProfile("lore", profile.mod.lore)
end
......@@ -45,5 +45,5 @@ Still, this is a golden age. Civilisations are healing the wounds of thousands o
You are an adventurer, set out to discover wonders, explore old places, and venture into the unknown for wealth and glory.
]]
starter = "mod.load"
profile_stats_fields = {"artifacts", "characters", "deaths", "uniques"}
profile_stats_fields = {"artifacts", "characters", "deaths", "uniques", "lore"}
allow_userchat = true
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