diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 3e20bb80ef0b44894da4008de67b416c56f59e28..334e9e7d234f948ff351c321d2d8cace4e85ab02 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -218,7 +218,7 @@ function _M:setupMiniMap() end function _M:save() - return class.save(self, self:defaultSavedFields{}, true) + return class.save(self, self:defaultSavedFields{difficulty=true}, true) end function _M:getSaveDescription() @@ -821,6 +821,9 @@ function _M:saveGame() end function _M:setAllowedBuild(what, notify) + -- Do not unlock things in easy mode + if game.difficulty == game.DIFFICULTY_EASY then return end + config.settings.tome = config.settings.tome or {} config.settings.tome.allow_build = config.settings.tome.allow_build or {} if config.settings.tome.allow_build[what] then return false end diff --git a/game/modules/tome/class/World.lua b/game/modules/tome/class/World.lua index a2d4addabe74b24da10eb37eb782cbb87aca07b2..2d109ce952f8762833fed674a8d549304d5aec53 100644 --- a/game/modules/tome/class/World.lua +++ b/game/modules/tome/class/World.lua @@ -42,3 +42,13 @@ end function _M:achievementWho(src) return src.name.." the "..game.player.descriptor.subrace.." "..game.player.descriptor.subclass end + +--- Gain an achievement +-- @param id the achivement to gain +-- @param src who did it +function _M:gainAchievement(id, src, ...) + -- Do not unlock things in easy mode + if game.difficulty == game.DIFFICULTY_EASY then return end + + engine.interface.WorldAchievements.gainAchievement(self, id, src, ...) +end