diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 9b9efb0e7e3d94ffbff507911b0b4985a5190da3..554973f94cfa5ca3778bc64dcdf805b866a14639 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -2166,7 +2166,7 @@ function _M:die(src, death_note) if self.tier1 then game.state:tier1Kill() end - if self.on_death_lore then game.player:learnLore(self.on_death_lore) end + if self.on_death_lore then game.party:learnLore(self.on_death_lore) end -- Do we get a blooooooody death ? if rng.percent(33) then self:bloodyDeath() end diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 00c7696024ec9d91c42ff90a6acd65e779a249a2..a9da6f08b137be50258d17193c626427892875a7 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -1543,7 +1543,7 @@ do return end local l = { "resume", "achievements", - { "Show known Lore", function() self:unregisterDialog(menu) self:registerDialog(require("mod.dialogs.ShowLore").new("Tales of Maj'Eyal Lore", self.player)) end }, + { "Show known Lore", function() self:unregisterDialog(menu) self:registerDialog(require("mod.dialogs.ShowLore").new("Tales of Maj'Eyal Lore", self.party)) end }, { "Show ingredients", function() self:unregisterDialog(menu) self:registerDialog(require("mod.dialogs.ShowIngredients").new(self.party)) end }, "highscores", { "Inventory", function() self:unregisterDialog(menu) self.key:triggerVirtual("SHOW_INVENTORY") end }, diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index df1443bcaa24450a88360389ed5ac26ef8c61252..b172064aae671e87b8dd91d9686c1b6749dfb51b 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -1487,12 +1487,12 @@ function _M:on_prepickup(who, idx) end if who.player and self.lore then game.level.map:removeObject(who.x, who.y, idx) - who:learnLore(self.lore) + game.party:learnLore(self.lore) return true end if who.player and self.force_lore_artifact then - game.player:additionalLore(self.unique, self:getName(), "artifacts", self.desc) - game.player:learnLore(self.unique) + game.party:additionalLore(self.unique, self:getName(), "artifacts", self.desc) + game.party:learnLore(self.unique) end end @@ -1507,11 +1507,11 @@ end function _M:on_identify() game:onTickEnd(function() if self.on_id_lore then - game.player:learnLore(self.on_id_lore, false, false, true) + game.party:learnLore(self.on_id_lore, false, false, true) end if self.unique and self.desc and not self.no_unique_lore then - game.player:additionalLore(self.unique, self:getName{no_add_name=true, do_color=false, no_count=true}, "artifacts", self.desc) - game.player:learnLore(self.unique, false, false, true) + game.party:additionalLore(self.unique, self:getName{no_add_name=true, do_color=false, no_count=true}, "artifacts", self.desc) + game.party:learnLore(self.unique, false, false, true) end end) end diff --git a/game/modules/tome/class/Party.lua b/game/modules/tome/class/Party.lua index 57733f82944bc3112dfe45490682fba7bf684e42..c563649cc83e7bb83a2cd1640a76fb63d52d351c 100644 --- a/game/modules/tome/class/Party.lua +++ b/game/modules/tome/class/Party.lua @@ -24,16 +24,18 @@ local Dialog = require "engine.ui.Dialog" local GetQuantity = require "engine.dialogs.GetQuantity" local PartyOrder = require "mod.dialogs.PartyOrder" local PartyIngredients = require "mod.class.interface.PartyIngredients" +local PartyLore = require "mod.class.interface.PartyLore" local PartyRewardSelector = require "mod.dialogs.PartyRewardSelector" module(..., package.seeall, class.inherit( - engine.Entity, PartyIngredients + engine.Entity, PartyIngredients, PartyLore )) function _M:init(t, no_default) t.name = t.name or "party" engine.Entity.init(self, t, no_default) PartyIngredients.init(self, t) + PartyLore.init(self, t) self.members = {} self.m_list = {} @@ -201,8 +203,8 @@ function _M:setPlayer(actor, bypass) if actor == game.player then return true end -- Stop!! - if game.player.runStop then game.player:runStop("Switching control") end - if game.player.restStop then game.player:restStop("Switching control") end + if game.player and game.player.runStop then game.player:runStop("Switching control") end + if game.player and game.player.restStop then game.player:restStop("Switching control") end local def = self.members[actor] local oldp = self.player diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 392930a3bab59c6fa86008e0d5879b2cbd9123d1..40cf930ac309144be5a955c2f9d111abb461cc0a 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -25,7 +25,6 @@ require "engine.interface.PlayerHotkeys" require "engine.interface.PlayerSlide" require "engine.interface.PlayerMouse" require "mod.class.interface.PlayerStats" -require "mod.class.interface.PlayerLore" require "mod.class.interface.PlayerDumpJSON" require "mod.class.interface.PlayerExplore" require "mod.class.interface.PartyDeath" @@ -44,7 +43,6 @@ module(..., package.seeall, class.inherit( engine.interface.PlayerMouse, engine.interface.PlayerSlide, mod.class.interface.PlayerStats, - mod.class.interface.PlayerLore, mod.class.interface.PlayerDumpJSON, mod.class.interface.PlayerExplore, mod.class.interface.PartyDeath @@ -85,7 +83,6 @@ function _M:init(t, no_default) mod.class.Actor.init(self, t, no_default) engine.interface.PlayerHotkeys.init(self, t) - mod.class.interface.PlayerLore.init(self, t) self.descriptor = self.descriptor or {} self.died_times = self.died_times or {} diff --git a/game/modules/tome/class/Store.lua b/game/modules/tome/class/Store.lua index f8fda476451454c929c990f2b8e79a9c47e9fba2..48564b55424e42235391eefcc6f21a0ec1cd0337 100644 --- a/game/modules/tome/class/Store.lua +++ b/game/modules/tome/class/Store.lua @@ -163,7 +163,7 @@ function _M:doBuy(who, o, item, nb, store_dialog) -- Learn lore ? if who.player and o.lore then self:removeObject(self:getInven("INVEN"), item) - who:learnLore(o.lore) + game.party:learnLore(o.lore) else self:transfer(self, who, item, nb) end diff --git a/game/modules/tome/class/interface/PlayerLore.lua b/game/modules/tome/class/interface/PartyLore.lua similarity index 100% rename from game/modules/tome/class/interface/PlayerLore.lua rename to game/modules/tome/class/interface/PartyLore.lua diff --git a/game/modules/tome/class/uiset/Minimalist.lua b/game/modules/tome/class/uiset/Minimalist.lua index 1a861c64c1e67de3ffaf274ee2c1b651ce73d4c8..be1e0ace0ef50a66358539443a537c8c3bb01c74 100644 --- a/game/modules/tome/class/uiset/Minimalist.lua +++ b/game/modules/tome/class/uiset/Minimalist.lua @@ -1819,7 +1819,7 @@ function _M:displayToolbar(scale, bx, by) if event == "out" then self.tbbuttons.lore = 0.6 return else self.tbbuttons.lore = 1 end game.tooltip_x, game.tooltip_y = 1, 1; game:tooltipDisplayAtMap(game.w, game.h, "Left mouse to show quest log.\nRight mouse to show all known lore.") if button == "left" and not xrel and not yrel and event == "button" then game.key:triggerVirtual("SHOW_QUESTS") - elseif button == "right" and not xrel and not yrel and event == "button" then game:registerDialog(require("mod.dialogs.ShowLore").new("Tales of Maj'Eyal Lore", game.player)) end + elseif button == "right" and not xrel and not yrel and event == "button" then game:registerDialog(require("mod.dialogs.ShowLore").new("Tales of Maj'Eyal Lore", game.party)) end end game.mouse:registerZone(bx + x * scale, by +y*scale, tb_lore[6], tb_lore[7], desc_fct, nil, "tb_lore", true, scale) end diff --git a/game/modules/tome/data/achievements/lore.lua b/game/modules/tome/data/achievements/lore.lua index f2ac9efc9d28f5cb8def99853b2436d86e318dd8..854e3847e11f753e5ad3ba9ea5092b2ca0f8c1c1 100644 --- a/game/modules/tome/data/achievements/lore.lua +++ b/game/modules/tome/data/achievements/lore.lua @@ -23,15 +23,14 @@ newAchievement{ show = "full", mode = "player", can_gain = function(self, who, obj) - local p = game:getPlayer(true) - if not p:knownLore("spellblaze-chronicles-1") then return false end - if not p:knownLore("spellblaze-chronicles-2") then return false end - if not p:knownLore("spellblaze-chronicles-3") then return false end - if not p:knownLore("spellblaze-chronicles-4") then return false end - if not p:knownLore("spellblaze-chronicles-5") then return false end - if not p:knownLore("spellblaze-chronicles-6") then return false end - if not p:knownLore("spellblaze-chronicles-7") then return false end - if not p:knownLore("spellblaze-chronicles-8") then return false end + if not game.party:knownLore("spellblaze-chronicles-1") then return false end + if not game.party:knownLore("spellblaze-chronicles-2") then return false end + if not game.party:knownLore("spellblaze-chronicles-3") then return false end + if not game.party:knownLore("spellblaze-chronicles-4") then return false end + if not game.party:knownLore("spellblaze-chronicles-5") then return false end + if not game.party:knownLore("spellblaze-chronicles-6") then return false end + if not game.party:knownLore("spellblaze-chronicles-7") then return false end + if not game.party:knownLore("spellblaze-chronicles-8") then return false end return true end } @@ -42,12 +41,11 @@ newAchievement{ show = "full", mode = "player", can_gain = function(self, who, obj) - local p = game:getPlayer(true) - if not p:knownLore("garkul-history-1") then return false end - if not p:knownLore("garkul-history-2") then return false end - if not p:knownLore("garkul-history-3") then return false end - if not p:knownLore("garkul-history-4") then return false end - if not p:knownLore("garkul-history-5") then return false end + if not game.party:knownLore("garkul-history-1") then return false end + if not game.party:knownLore("garkul-history-2") then return false end + if not game.party:knownLore("garkul-history-3") then return false end + if not game.party:knownLore("garkul-history-4") then return false end + if not game.party:knownLore("garkul-history-5") then return false end return true end } @@ -58,12 +56,11 @@ newAchievement{ show = "full", mode = "player", can_gain = function(self, who, obj) - local p = game:getPlayer(true) - if not p:knownLore("orc-history-1") then return false end - if not p:knownLore("orc-history-2") then return false end - if not p:knownLore("orc-history-3") then return false end - if not p:knownLore("orc-history-4") then return false end - if not p:knownLore("orc-history-5") then return false end + if not game.party:knownLore("orc-history-1") then return false end + if not game.party:knownLore("orc-history-2") then return false end + if not game.party:knownLore("orc-history-3") then return false end + if not game.party:knownLore("orc-history-4") then return false end + if not game.party:knownLore("orc-history-5") then return false end return true end } diff --git a/game/modules/tome/data/achievements/quests.lua b/game/modules/tome/data/achievements/quests.lua index 924e670524f87b72d29ca9ce571382291c59afa6..f324e852c989f2de2e48d900bec1752c8c3e4f7b 100644 --- a/game/modules/tome/data/achievements/quests.lua +++ b/game/modules/tome/data/achievements/quests.lua @@ -61,7 +61,7 @@ newAchievement{ show = "name", desc = [[Activated a portal using the Orb of Many Ways.]], on_gain = function() - game:onTickEnd(function() game.player:learnLore("first-farportal") end) + game:onTickEnd(function() game.party:learnLore("first-farportal") end) end } newAchievement{ diff --git a/game/modules/tome/data/chats/shertul-fortress-caldizar.lua b/game/modules/tome/data/chats/shertul-fortress-caldizar.lua index a58b560e8fc1e11f7c9cdb8ac09305fc793c13e4..d76c9cd7a107fd3531618bb319aeab43e24c964c 100644 --- a/game/modules/tome/data/chats/shertul-fortress-caldizar.lua +++ b/game/modules/tome/data/chats/shertul-fortress-caldizar.lua @@ -42,7 +42,7 @@ A wave of mental and magical power blasts into you with the might of a falling s local spot = game.level:pickSpot{type="spawn", subtype="farportal"} or {x=39, y=29} game.player:move(spot.x, spot.y, true) world:gainAchievement("CALDIZAR", game.player) - game.player:learnLore("shertul-fortress-caldizar") + game.party:learnLore("shertul-fortress-caldizar") end}, } } diff --git a/game/modules/tome/data/general/objects/lore/maj-eyal.lua b/game/modules/tome/data/general/objects/lore/maj-eyal.lua index 969923a3cdec57c0ca08c475f2728cffa5e32227..fc2a705b205c1f64bc8c3752027efca152229ef5 100644 --- a/game/modules/tome/data/general/objects/lore/maj-eyal.lua +++ b/game/modules/tome/data/general/objects/lore/maj-eyal.lua @@ -18,7 +18,7 @@ -- darkgod@te4.org for i = 3, 10 do -local l = mod.class.interface.PlayerLore.lore_defs["races-"..i] +local l = mod.class.interface.PartyLore.lore_defs["races-"..i] newEntity{ base = "BASE_LORE_RANDOM", define_as = "RACES_NOTE"..i, subtype = "analysis", unique=true, diff --git a/game/modules/tome/data/general/objects/scrolls.lua b/game/modules/tome/data/general/objects/scrolls.lua index ed23607a51d35ec3911f4d820885226f78e53ee6..546afa9372625c8177189db2a35286b8410399d6 100644 --- a/game/modules/tome/data/general/objects/scrolls.lua +++ b/game/modules/tome/data/general/objects/scrolls.lua @@ -103,7 +103,7 @@ newEntity{ unided_name = "scroll", identified=true, display = "?", color=colors.ANTIQUE_WHITE, image="object/scroll-lore.png", encumber = 0, - checkFilter = function(self) if self.lore and game:getPlayer(true).lore_known and game:getPlayer(true).lore_known[self.lore] then print('[LORE] refusing', self.lore) return false else return true end end, + checkFilter = function(self) if self.lore and game.party.lore_known and game.party.lore_known[self.lore] then print('[LORE] refusing', self.lore) return false else return true end end, desc = [[This parchment contains some lore.]], } @@ -113,7 +113,7 @@ newEntity{ unided_name = "scroll", identified=true, display = "?", color=colors.ANTIQUE_WHITE, image="object/scroll.png", encumber = 0, - checkFilter = function(self) if self.lore and game:getPlayer(true).lore_known and game:getPlayer(true).lore_known[self.lore] then print('[LORE] refusing', self.lore) return false else return true end end, + checkFilter = function(self) if self.lore and game.party.lore_known and game.party.lore_known[self.lore] then print('[LORE] refusing', self.lore) return false else return true end end, desc = [[This parchment contains some lore.]], } diff --git a/game/modules/tome/data/maps/towns/last-hope.lua b/game/modules/tome/data/maps/towns/last-hope.lua index 301015d796118ad177b3438f947a4bda3605e20e..82252bc2ab7c3ca8abc8fac9e3d08596192149b3 100644 --- a/game/modules/tome/data/maps/towns/last-hope.lua +++ b/game/modules/tome/data/maps/towns/last-hope.lua @@ -17,10 +17,10 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org -quickEntity('@', {show_tooltip=true, name="Statue of King Tolak the Fair", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/statue_tolak.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then e:learnLore("last-hope-tolak-statue") end return true end}) -quickEntity('Z', {show_tooltip=true, name="Statue of King Toknor the Brave", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/statue_toknor.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then e:learnLore("last-hope-toknor-statue") end return true end}) -quickEntity('Y', {show_tooltip=true, name="Statue of Queen Mirvenia the Inspirer", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/statue_mirvenia.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then e:learnLore("last-hope-mirvenia-statue") end return true end}) -quickEntity('X', {show_tooltip=true, name="Declaration of the Unification of the Allied Kingdoms", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/monument_allied_kingdoms.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then e:learnLore("last-hope-allied-kingdoms-foundation") end return true end}) +quickEntity('@', {show_tooltip=true, name="Statue of King Tolak the Fair", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/statue_tolak.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then game.party:learnLore("last-hope-tolak-statue") end return true end}) +quickEntity('Z', {show_tooltip=true, name="Statue of King Toknor the Brave", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/statue_toknor.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then game.party:learnLore("last-hope-toknor-statue") end return true end}) +quickEntity('Y', {show_tooltip=true, name="Statue of Queen Mirvenia the Inspirer", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/statue_mirvenia.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then game.party:learnLore("last-hope-mirvenia-statue") end return true end}) +quickEntity('X', {show_tooltip=true, name="Declaration of the Unification of the Allied Kingdoms", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statues/monument_allied_kingdoms.png", z=18, display_y=-1, display_h=2}}, color=colors.LIGHT_BLUE, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then game.party:learnLore("last-hope-allied-kingdoms-foundation") end return true end}) -- defineTile section defineTile("<", "GRASS_UP_WILDERNESS") diff --git a/game/modules/tome/data/maps/towns/shatur.lua b/game/modules/tome/data/maps/towns/shatur.lua index b7f7f4c3ea794bcab0d3cb290be0a1f4cdf3e422..75251af526840632c761aa426cb28af4c5e552b7 100644 --- a/game/modules/tome/data/maps/towns/shatur.lua +++ b/game/modules/tome/data/maps/towns/shatur.lua @@ -25,7 +25,7 @@ defineTile('~', "DEEP_WATER") defineTile('.', "GRASS") defineTile('_', "COBBLESTONE") -quickEntity('@', {show_tooltip=true, name="Moss covered statue", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statue3.png"}}, color=colors.GREEN, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then e:learnLore("thaloren-lament") end return true end}) +quickEntity('@', {show_tooltip=true, name="Moss covered statue", display='@', image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/statue3.png"}}, color=colors.GREEN, block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then game.party:learnLore("thaloren-lament") end return true end}) defineTile('2', "ROCKY_GROUND", nil, nil, "SWORD_WEAPON_STORE") defineTile('3', "ROCKY_GROUND", nil, nil, "MAUL_WEAPON_STORE") diff --git a/game/modules/tome/data/quests/high-peak.lua b/game/modules/tome/data/quests/high-peak.lua index ceaa327895a9f724b48d94a7dc165e07830b988e..7ed1ee3972e60fa98758bd3721cb26bf4bb81850 100644 --- a/game/modules/tome/data/quests/high-peak.lua +++ b/game/modules/tome/data/quests/high-peak.lua @@ -113,7 +113,7 @@ end function win(self, how) game:playAndStopMusic("Lords of the Sky.ogg") - game.player:learnLore("closing-farportal") + game.party:learnLore("closing-farportal") if how == "full" then world:gainAchievement("WIN_FULL", game.player) elseif how == "aeryn-sacrifice" then world:gainAchievement("WIN_AERYN", game.player) diff --git a/game/modules/tome/data/quests/keepsake.lua b/game/modules/tome/data/quests/keepsake.lua index 74ba390097094d7f08d3d2130077a64a9dd05c13..0071e562a1e6f29b0a91012a421f3da12c5861c9 100644 --- a/game/modules/tome/data/quests/keepsake.lua +++ b/game/modules/tome/data/quests/keepsake.lua @@ -80,7 +80,7 @@ on_enter_cave_entrance = function(self, who) end on_start_dream = function(self, who) - who:learnLore("keepsake-dream") + game.party:learnLore("keepsake-dream") game.logPlayer(who, "#VIOLET#You find yourself in a dream.") -- make sure waking up returns to the same spot @@ -107,14 +107,14 @@ on_start_dream = function(self, who) end on_pickup_acorn = function(self, who) - who:learnLore("keepsake-acorn") + game.party:learnLore("keepsake-acorn") game.logPlayer(who, "#VIOLET#You have discovered a small iron acorn, a link to your past.") who:setQuestStatus("keepsake", engine.Quest.COMPLETED, "acorn-found") end on_find_caravan = function(self, who) - who:learnLore("keepsake-caravan") + game.party:learnLore("keepsake-caravan") game.logPlayer(who, "#VIOLET#The merchant caravan from the past has appeared in your dream.") -- turn the caravaneers hostile @@ -154,22 +154,22 @@ on_caravan_destroyed_chat_over = function(self, who) who.die = who.old_die who.old_die = nil - who:learnLore("keepsake-dreams-end") + game.party:learnLore("keepsake-dreams-end") game.logPlayer(who, "#VIOLET#You have begun your hunt for Kyless!") end on_cave_marker = function(self, who) - who:learnLore("keepsake-cave-marker") + game.party:learnLore("keepsake-cave-marker") game.logPlayer(who, "#VIOLET#You have a marker to the entrance of Kyless' cave!") end on_cave_entrance = function(self, who) - who:learnLore("keepsake-cave-entrance") + game.party:learnLore("keepsake-cave-entrance") game.logPlayer(who, "#VIOLET#You have found the entrance to Kyless' cave!") end on_cave_description = function(self, who) - who:learnLore("keepsake-cave-description") + game.party:learnLore("keepsake-cave-description") -- spawn the guards spot = game.level:pickSpot{type="guards", subtype="wardog"} @@ -186,7 +186,7 @@ on_cave_description = function(self, who) end on_vault_entrance = function(self, who) - who:learnLore("keepsake-vault-entrance") + game.party:learnLore("keepsake-vault-entrance") game.logPlayer(who, "#VIOLET#You have found the entrance to a vault!") end @@ -205,7 +205,7 @@ on_dog_vault = function(self, who) end on_kyless_encounter = function(self, who) - who:learnLore("keepsake-kyless-encounter") + game.party:learnLore("keepsake-kyless-encounter") game.logPlayer(who, "#VIOLET#You have found Kyless. You must destroy him.") end @@ -250,10 +250,10 @@ on_berethh_death = function(self, who, berethh) if self.balance > 0 then who:setQuestStatus("keepsake", engine.Quest.COMPLETED, "berethh-killed-good") - who:learnLore("keepsake-berethh-death-good") + game.party:learnLore("keepsake-berethh-death-good") else who:setQuestStatus("keepsake", engine.Quest.COMPLETED, "berethh-killed-evil") - who:learnLore("keepsake-berethh-death-evil") + game.party:learnLore("keepsake-berethh-death-evil") end self.spawn_companions = true diff --git a/game/modules/tome/data/quests/shertul-fortress.lua b/game/modules/tome/data/quests/shertul-fortress.lua index 70d18ba1a7ee47d1505feac007d8332f0c12794c..0a8fd01992066d50324bc71e4af5f7af02a20dbc 100644 --- a/game/modules/tome/data/quests/shertul-fortress.lua +++ b/game/modules/tome/data/quests/shertul-fortress.lua @@ -192,7 +192,7 @@ fly = function(self) f:takeControl(game.player) else - game.player:learnLore("shertul-fortress-takeoff") + game.party:learnLore("shertul-fortress-takeoff") local f = require("mod.class.FortressPC").new{} game:changeLevel(1, "wilderness", {direct_switch=true}) diff --git a/game/modules/tome/data/quests/staff-absorption.lua b/game/modules/tome/data/quests/staff-absorption.lua index 1c24eb3358abf5b793e2e3ee6e5b60ba1a54573d..461ca0d112039c7f921e0654052413af98e0ef6b 100644 --- a/game/modules/tome/data/quests/staff-absorption.lua +++ b/game/modules/tome/data/quests/staff-absorption.lua @@ -42,7 +42,7 @@ desc = function(self, who) end on_grant = function(self, who) - who:learnLore("master-slain") + game.party:learnLore("master-slain") game.logPlayer(who, "#00FFFF#You can feel the power of this staff just by carrying it. This is both ancient and dangerous.") game.logPlayer(who, "#00FFFF#It should be shown to the wise elders in Last Hope!") end diff --git a/game/modules/tome/data/talents/corruptions/shadowflame.lua b/game/modules/tome/data/talents/corruptions/shadowflame.lua index 87167d0272dd5c8bb59c456339403f7960eb8666..cb860afe79f3f53f8c052185984d0ae9fe800602 100644 --- a/game/modules/tome/data/talents/corruptions/shadowflame.lua +++ b/game/modules/tome/data/talents/corruptions/shadowflame.lua @@ -222,7 +222,7 @@ newTalent{ end game.logPlayer(game.player, "#LIGHT_RED#You are taken to the Fearscape!") - game.player:learnLore("fearscape-entry") + game.party:learnLore("fearscape-entry") level.allow_demon_plane_damage = true end) diff --git a/game/modules/tome/data/talents/psionic/slumber.lua b/game/modules/tome/data/talents/psionic/slumber.lua index 76d6aea2f0429ec140e0ef75ddcffe5f93046452..cb4c946a2b33e486371eb4cbd39a2e4c7d60ddf5 100644 --- a/game/modules/tome/data/talents/psionic/slumber.lua +++ b/game/modules/tome/data/talents/psionic/slumber.lua @@ -226,7 +226,7 @@ newTalent{ game.logPlayer(game.player, "#LIGHT_BLUE#You are taken to the Dreamscape!") - if game.party:hasMember(target) then game.player:learnLore("dreamscape-entry") end + if game.party:hasMember(target) then game.party:learnLore("dreamscape-entry") end end) local power = self:mindCrit(t.getPower(self, t)) diff --git a/game/modules/tome/data/talents/uber/wil.lua b/game/modules/tome/data/talents/uber/wil.lua index c20992ed16bac44d7c87cce0d4d45f60a674db16..0351dc521fdc975d117f30fa49312f33c6d572af 100644 --- a/game/modules/tome/data/talents/uber/wil.lua +++ b/game/modules/tome/data/talents/uber/wil.lua @@ -126,11 +126,11 @@ uberTalent{ local o1 = self:findInAllInventoriesBy("define_as", "SET_GARKUL_TEETH") local o2 = self:findInAllInventoriesBy("define_as", "HELM_OF_GARKUL") return o1 and o2 and o1.wielded and o2.wielded and (game.state.birth.ignore_prodigies_special_reqs or ( - game.player:knownLore("garkul-history-1") and - game.player:knownLore("garkul-history-2") and - game.player:knownLore("garkul-history-3") and - game.player:knownLore("garkul-history-4") and - game.player:knownLore("garkul-history-5") + game.party:knownLore("garkul-history-1") and + game.party:knownLore("garkul-history-2") and + game.party:knownLore("garkul-history-3") and + game.party:knownLore("garkul-history-4") and + game.party:knownLore("garkul-history-5") )) end} }, info = function(self, t) diff --git a/game/modules/tome/data/zones/crypt-kryl-feijan/zone.lua b/game/modules/tome/data/zones/crypt-kryl-feijan/zone.lua index e96a3ccfc10b7f524d5add16ea1c366d55e60f05..30a7f01225f76e170854582c9c33c1a01f519570 100644 --- a/game/modules/tome/data/zones/crypt-kryl-feijan/zone.lua +++ b/game/modules/tome/data/zones/crypt-kryl-feijan/zone.lua @@ -71,7 +71,7 @@ return { game.level.max_turn_counter = 20 * 10 game.level.turn_counter_desc = "The cultists are about to sacrifice the woman. Stop them!" game.player:grantQuest("kryl-feijan-escape") - game.player:learnLore("kryl-feijan-altar") + game.party:learnLore("kryl-feijan-altar") end end, on_turn = function(self) diff --git a/game/modules/tome/data/zones/demon-plane/zone.lua b/game/modules/tome/data/zones/demon-plane/zone.lua index 3a8279b8c14ad4644509714424604c43b806d810..dc4989912edf69fd6413d9bd2bc642f145caa571 100644 --- a/game/modules/tome/data/zones/demon-plane/zone.lua +++ b/game/modules/tome/data/zones/demon-plane/zone.lua @@ -65,6 +65,6 @@ return { }, }, on_enter = function(lev, old_lev, newzone) - if newzone then game.player:learnLore("fearscape-entry") end + if newzone then game.party:learnLore("fearscape-entry") end end, } diff --git a/game/modules/tome/data/zones/dreadfell/grids.lua b/game/modules/tome/data/zones/dreadfell/grids.lua index fa02c4137b1d2c360355211982d30a19269ba653..621ae431cf8211838f1786b961911d4afa4403c3 100644 --- a/game/modules/tome/data/zones/dreadfell/grids.lua +++ b/game/modules/tome/data/zones/dreadfell/grids.lua @@ -30,6 +30,6 @@ newEntity{ add_displays = {class.new{image="terrain/signpost.png"}}, always_remember = true, on_move = function(self, x, y, who) - if who.player then who:learnLore(self.lore) end + if who.player then game.party:learnLore(self.lore) end end, } diff --git a/game/modules/tome/data/zones/golem-graveyard/grids.lua b/game/modules/tome/data/zones/golem-graveyard/grids.lua index d49b5feeaec7973876ec33d3ea4ac28949e16365..31f5f0689e5ce1b11443e331fa476a6df748d8a4 100644 --- a/game/modules/tome/data/zones/golem-graveyard/grids.lua +++ b/game/modules/tome/data/zones/golem-graveyard/grids.lua @@ -34,7 +34,7 @@ Someone foolish has tried to reconstruct it, but it seems like it misses an eye dig = false, block_move = function(self, x, y, e, act, couldpass) if e and e.player and act then - e:learnLore("broken-atamathon") + game.party:learnLore("broken-atamathon") local eye, eye_item = e:findInInventoryBy(e:getInven("INVEN"), "define_as", "ATAMATHON_ACTIVATE") if eye then require("engine.ui.Dialog"):yesnoPopup("Atamathon", "It seems that your "..eye:getName{do_color=true}.." is made to fit inside the empty eye socket of Atamathon. This is probably very unwise.", function(ret) diff --git a/game/modules/tome/data/zones/lake-nur/grids.lua b/game/modules/tome/data/zones/lake-nur/grids.lua index 79c901e38484de84a24aa428f015cb5cbf4cddf5..74fd4aee0829ec47857cfebdb3f0b57c8dcd2df5 100644 --- a/game/modules/tome/data/zones/lake-nur/grids.lua +++ b/game/modules/tome/data/zones/lake-nur/grids.lua @@ -39,7 +39,7 @@ newEntity{ always_remember = true, change_level = 1, change_zone = "shertul-fortress", change_level_check = function(self, who) - if who:knownLore("old-forest-note-5") then + if who.player and game.party:knownLore("old-forest-note-5") then game.logPlayer(who, "#ANTIQUE_WHITE#You notice a hole that could fit the gem key you found earlier, inserting it reveals the passage to the next level.") who:setQuestStatus("shertul-fortress", engine.Quest.COMPLETED, "entered") else diff --git a/game/modules/tome/data/zones/last-hope-graveyard/npcs.lua b/game/modules/tome/data/zones/last-hope-graveyard/npcs.lua index cdf93236a69b32c9a9a179e39b1f106b68d060d4..b2372b6e9412191fe0ea251a6ed155b4ec6f1f63 100644 --- a/game/modules/tome/data/zones/last-hope-graveyard/npcs.lua +++ b/game/modules/tome/data/zones/last-hope-graveyard/npcs.lua @@ -102,10 +102,10 @@ newEntity{ define_as = "CELIA", Dialog:simpleLongPopup("Celia", "As you deal the last blow you quickly carve out Celia's heart for your Lichform ritual.\nCarefully weaving magic around it to keep it beating.", 400) p:setQuestStatus("grave-necromancer", engine.Quest.COMPLETED, "kill-necromancer") else - if game.player:knownLore("necromancer-primer-1") and - game.player:knownLore("necromancer-primer-2") and - game.player:knownLore("necromancer-primer-3") and - game.player:knownLore("necromancer-primer-4") then + if game.party:knownLore("necromancer-primer-1") and + game.party:knownLore("necromancer-primer-2") and + game.party:knownLore("necromancer-primer-3") and + game.party:knownLore("necromancer-primer-4") then game:setAllowedBuild("mage_necromancer", true) end p:setQuestStatus("grave-necromancer", engine.Quest.COMPLETED, "kill") diff --git a/game/modules/tome/data/zones/reknor/grids.lua b/game/modules/tome/data/zones/reknor/grids.lua index 0f5bad9599ea6422539fc03c6a53c35e0b3d3f36..e4968f5258bbf21758f7c546f0d4aa2b8edbd481 100644 --- a/game/modules/tome/data/zones/reknor/grids.lua +++ b/game/modules/tome/data/zones/reknor/grids.lua @@ -71,6 +71,6 @@ newEntity{ add_displays = {class.new{image="terrain/signpost.png"}}, always_remember = true, on_move = function(self, x, y, who) - if who.player then who:learnLore(self.lore) end + if who.player then game.party:learnLore(self.lore) end end, } diff --git a/game/modules/tome/data/zones/ruined-dungeon/grids.lua b/game/modules/tome/data/zones/ruined-dungeon/grids.lua index 3e265330349a949922f68a057c8a10ad83ba62dc..dc0a7cb784dad4d10e9635574d1c42af38de2134 100644 --- a/game/modules/tome/data/zones/ruined-dungeon/grids.lua +++ b/game/modules/tome/data/zones/ruined-dungeon/grids.lua @@ -33,7 +33,7 @@ newEntity{ if self.lore == "infinite-dungeon-4" then game:setAllowedBuild("campaign_infinite_dungeon", true) end - who:learnLore(self.lore) + game.party:learnLore(self.lore) end, } end diff --git a/game/modules/tome/data/zones/shertul-fortress/grids.lua b/game/modules/tome/data/zones/shertul-fortress/grids.lua index 2ac64c1a3fb6a5995749f371871e8b8bf615b172..43666ecd3c0ff79e04c70af94bf317f198d2b5a7 100644 --- a/game/modules/tome/data/zones/shertul-fortress/grids.lua +++ b/game/modules/tome/data/zones/shertul-fortress/grids.lua @@ -166,7 +166,7 @@ newEntity{ profile:setConfigsBatch(true) if profile.mod.lore and profile.mod.lore.lore then for lore, _ in pairs(profile.mod.lore.lore) do - game.player:learnLore(lore, true, true) + game.party:learnLore(lore, true, true) core.wait.manualTick(1) end end @@ -174,7 +174,7 @@ newEntity{ popup:done() - game:registerDialog(require("mod.dialogs.ShowLore").new("Yiilkgur's Library of Lost Mysteries", game.player)) + game:registerDialog(require("mod.dialogs.ShowLore").new("Yiilkgur's Library of Lost Mysteries", game.party)) end return true end, @@ -186,6 +186,6 @@ newEntity{ define_as = "MURAL_PAINTING"..i, name="mural painting", lore = "shertul-fortress-"..i, display='#', color=colors.LIGHT_RED, image="terrain/solidwall/solid_wall_mural_shertul"..i..".png", - block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then e:learnLore(self.lore) end return true end + block_move=function(self, x, y, e, act, couldpass) if e and e.player and act then game.party:learnLore(self.lore) end return true end } end diff --git a/game/modules/tome/data/zones/town-elvala/objects.lua b/game/modules/tome/data/zones/town-elvala/objects.lua index 6f36957a71ec994379648f1c7b86d8df189fac96..f74c190b88526bc998dbdf8536cae3d8a04c00ed 100644 --- a/game/modules/tome/data/zones/town-elvala/objects.lua +++ b/game/modules/tome/data/zones/town-elvala/objects.lua @@ -20,7 +20,7 @@ load("/data/general/objects/objects-maj-eyal.lua") for i = 1, 8 do -local l = mod.class.interface.PlayerLore.lore_defs["spellblaze-chronicles-"..i] +local l = mod.class.interface.PartyLore.lore_defs["spellblaze-chronicles-"..i] newEntity{ base = "BASE_LORE", define_as = "SPELLBLAZE_NOTE"..i, subtype = "spellblaze", unique=true, no_unique_lore=true, not_in_stores=false, diff --git a/game/modules/tome/data/zones/town-last-hope/objects.lua b/game/modules/tome/data/zones/town-last-hope/objects.lua index 544706b784dbb938830184938b98c3d52604ad61..0530f15fc16eeaeee3659603916aaca1bc4fff4f 100644 --- a/game/modules/tome/data/zones/town-last-hope/objects.lua +++ b/game/modules/tome/data/zones/town-last-hope/objects.lua @@ -32,7 +32,7 @@ newEntity{ base = "BASE_LORE", end for i = 0, 2 do -local l = mod.class.interface.PlayerLore.lore_defs["races-"..i] +local l = mod.class.interface.PartyLore.lore_defs["races-"..i] newEntity{ base = "BASE_LORE", define_as = "RACES_NOTE"..i, subtype = "analysis", unique=true, no_unique_lore=true, not_in_stores=false, diff --git a/game/modules/tome/data/zones/town-zigur/grids.lua b/game/modules/tome/data/zones/town-zigur/grids.lua index 15c93594a071f4198e924e605ac0a916d9ad5db7..0667ceee52517f0db65bc615502f381fc42941c8 100644 --- a/game/modules/tome/data/zones/town-zigur/grids.lua +++ b/game/modules/tome/data/zones/town-zigur/grids.lua @@ -31,7 +31,7 @@ newEntity{ add_displays = {class.new{image="terrain/signpost.png"}}, always_remember = true, on_move = function(self, x, y, who) - if who.player then who:learnLore(self.lore) end + if who.player then game.party:learnLore(self.lore) end end, } diff --git a/game/modules/tome/dialogs/ShowLore.lua b/game/modules/tome/dialogs/ShowLore.lua index 2428ded471176bb1fbf253f665de8f8a2ae80bd4..3514393c0dfc0516fd2efd3217df28d4d9543ff0 100644 --- a/game/modules/tome/dialogs/ShowLore.lua +++ b/game/modules/tome/dialogs/ShowLore.lua @@ -28,7 +28,7 @@ module(..., package.seeall, class.inherit(Dialog)) function _M:init(title, actor) self.actor = actor - print("Lore of player", actor.name) + print("Lore") local total = #actor.lore_defs + actor.additional_lore_nb local nb = 0 for id, data in pairs(actor.lore_known) do nb = nb + 1 end diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua index 672985847f20d171543c94434c1cdf8ac651d7d4..6317db68bba6b41716260beafd814cc9654cf8c9 100644 --- a/game/modules/tome/load.lua +++ b/game/modules/tome/load.lua @@ -43,7 +43,7 @@ local ActorLevel = require "engine.interface.ActorLevel" local Birther = require "engine.Birther" local Store = require "mod.class.Store" local WorldAchievements = require "mod.class.interface.WorldAchievements" -local PlayerLore = require "mod.class.interface.PlayerLore" +local PartyLore = require "mod.class.interface.PartyLore" local PartyIngredients = require "mod.class.interface.PartyIngredients" local PlayerHotkeys = require "engine.interface.PlayerHotkeys" local Quest = require "engine.Quest" @@ -146,7 +146,7 @@ _2DNoise = n:makeTexture2D(64, 64) WorldAchievements:loadDefinition("/data/achievements/") -- Lore -PlayerLore:loadDefinition("/data/lore/lore.lua") +PartyLore:loadDefinition("/data/lore/lore.lua") -- Useful keybinds KeyBind:load("move,hotkeys,inventory,actions,interface,tome,debug")