Skip to content
Snippets Groups Projects
Commit 126d7392 authored by DarkGod's avatar DarkGod
Browse files

Fixed tutorial mode achievement

parent db29501d
No related branches found
No related tags found
No related merge requests found
......@@ -49,19 +49,27 @@ end
-- @param id the achievement to gain
-- @param src who did it
function _M:gainAchievement(id, src, ...)
local no_difficulties = false
if type(id) == "table" then
no_difficulties = id.no_difficulties
id = id.id
end
local a = self.achiev_defs[id]
-- Do not unlock things in easy mode
if not a then return end
if game.difficulty == game.DIFFICULTY_EASY and not a.tutorial then return end
if game.permadeath == game.PERMADEATH_INFINITE then id = "EXPLORATION_"..id end
if game.difficulty == game.DIFFICULTY_NORMAL and game.permadeath == game.PERMADEATH_ONE then id = "NORMAL_ROGUELIKE_"..id end
if game.difficulty == game.DIFFICULTY_NIGHTMARE and game.permadeath == game.PERMADEATH_MANY then id = "NIGHTMARE_ADVENTURE_".. id end
if game.difficulty == game.DIFFICULTY_NIGHTMARE and game.permadeath == game.PERMADEATH_ONE then id = "NIGHTMARE_"..id end
if game.difficulty == game.DIFFICULTY_INSANE and game.permadeath == game.PERMADEATH_MANY then id = "INSANE_ADVENTURE_"..id end
if game.difficulty == game.DIFFICULTY_INSANE and game.permadeath == game.PERMADEATH_ONE then id = "INSANE_"..id end
if game.difficulty == game.DIFFICULTY_MADNESS and game.permadeath == game.PERMADEATH_MANY then id = "MADNESS_ADVENTURE_"..id end
if game.difficulty == game.DIFFICULTY_MADNESS and game.permadeath == game.PERMADEATH_ONE then id = "MADNESS_"..id end
if not no_difficulties then
if game.permadeath == game.PERMADEATH_INFINITE then id = "EXPLORATION_"..id end
if game.difficulty == game.DIFFICULTY_NORMAL and game.permadeath == game.PERMADEATH_ONE then id = "NORMAL_ROGUELIKE_"..id end
if game.difficulty == game.DIFFICULTY_NIGHTMARE and game.permadeath == game.PERMADEATH_MANY then id = "NIGHTMARE_ADVENTURE_".. id end
if game.difficulty == game.DIFFICULTY_NIGHTMARE and game.permadeath == game.PERMADEATH_ONE then id = "NIGHTMARE_"..id end
if game.difficulty == game.DIFFICULTY_INSANE and game.permadeath == game.PERMADEATH_MANY then id = "INSANE_ADVENTURE_"..id end
if game.difficulty == game.DIFFICULTY_INSANE and game.permadeath == game.PERMADEATH_ONE then id = "INSANE_"..id end
if game.difficulty == game.DIFFICULTY_MADNESS and game.permadeath == game.PERMADEATH_MANY then id = "MADNESS_ADVENTURE_"..id end
if game.difficulty == game.DIFFICULTY_MADNESS and game.permadeath == game.PERMADEATH_ONE then id = "MADNESS_"..id end
end
local knew = self.achieved[id]
......
......@@ -41,7 +41,7 @@ end
on_status_change = function(self, who, status, sub)
if self:isCompleted() then
who:setQuestStatus(self.id, engine.Quest.DONE)
--world:gainAchievement("TUTORIAL_DONE", game.player)
--world:gainAchievement({id="TUTORIAL_DONE",no_difficulties=true}, game.player)
end
end
......
......@@ -27,7 +27,7 @@ end
on_status_change = function(self, who, status, sub)
if self:isCompleted() then
who:setQuestStatus(self.id, engine.Quest.DONE)
world:gainAchievement("TUTORIAL_DONE", game.player)
world:gainAchievement({id="TUTORIAL_DONE",no_difficulties=true}, game.player)
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