Commit 5823111530ec16d799184309f96bc0b563ab78d7
1 parent
5aec46c6
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
Showing
3 changed files
with
10 additions
and
1 deletions
@@ -85,6 +85,7 @@ function _M:learnLore(lore) | @@ -85,6 +85,7 @@ function _M:learnLore(lore) | ||
85 | end | 85 | end |
86 | 86 | ||
87 | self.lore_known[lore] = true | 87 | self.lore_known[lore] = true |
88 | + if not self.additional_lore[lore] and self.registerLoreFound then self:registerLoreFound(lore) end | ||
88 | print("[LORE] learnt", lore) | 89 | print("[LORE] learnt", lore) |
89 | if learnt then if l.on_learn then l.on_learn(self) end end | 90 | if learnt then if l.on_learn then l.on_learn(self) end end |
90 | end | 91 | end |
@@ -66,3 +66,11 @@ function _M:registerCharacterPlayed() | @@ -66,3 +66,11 @@ function _M:registerCharacterPlayed() | ||
66 | profile.mod.characters.characters[pid] = (profile.mod.characters.characters[pid] or 0) + 1 | 66 | profile.mod.characters.characters[pid] = (profile.mod.characters.characters[pid] or 0) + 1 |
67 | profile:saveModuleProfile("characters", profile.mod.characters) | 67 | profile:saveModuleProfile("characters", profile.mod.characters) |
68 | end | 68 | end |
69 | + | ||
70 | +function _M:registerLoreFound(lore) | ||
71 | + local pid = self:playerStatGetCharacterIdentifier(game.party:findMember{main=true}) | ||
72 | + | ||
73 | + profile.mod.lore = profile.mod.lore or { lore={} } | ||
74 | + profile.mod.lore.lore[lore] = true | ||
75 | + profile:saveModuleProfile("lore", profile.mod.lore) | ||
76 | +end |
@@ -45,5 +45,5 @@ Still, this is a golden age. Civilisations are healing the wounds of thousands o | @@ -45,5 +45,5 @@ Still, this is a golden age. Civilisations are healing the wounds of thousands o | ||
45 | You are an adventurer, set out to discover wonders, explore old places, and venture into the unknown for wealth and glory. | 45 | You are an adventurer, set out to discover wonders, explore old places, and venture into the unknown for wealth and glory. |
46 | ]] | 46 | ]] |
47 | starter = "mod.load" | 47 | starter = "mod.load" |
48 | -profile_stats_fields = {"artifacts", "characters", "deaths", "uniques"} | 48 | +profile_stats_fields = {"artifacts", "characters", "deaths", "uniques", "lore"} |
49 | allow_userchat = true | 49 | allow_userchat = true |
-
Please register or login to post a comment