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

New achievement for winning the game without ever going west.

parent 56733791
No related branches found
No related tags found
No related merge requests found
......@@ -293,8 +293,10 @@ function _M:saveGenericProfile(name, data, nosync, nowrite)
if not nowrite then
local pop = self:mountProfile(true)
local f = fs.open("/generic/"..name..".profile", "w")
f:write(serialize(dataenv))
f:close()
if f then
f:write(serialize(dataenv))
f:close()
end
self:umountProfile(true, pop)
end
......@@ -340,8 +342,10 @@ function _M:saveModuleProfile(name, data, nosync, nowrite)
local online = self:filterSaveData(name)
local pop = self:mountProfile(online, module)
local f = fs.open("/modules/"..module.."/"..name..".profile", "w")
f:write(serialize(dataenv))
f:close()
if f then
f:write(serialize(dataenv))
f:close()
end
self:umountProfile(online, pop)
end
......
......@@ -131,6 +131,11 @@ newAchievement{
show = "name", huge=true,
desc = [[Fought the two Sorcerers and closed four invocation portals.]],
}
newAchievement{
name = "Never Look Back And There Again", id = "WIN_NEVER_WEST",
show = "full", huge=true,
desc = [[Win the game without ever setting foot on Maj'Eyal.]],
}
-------------- Other quests
newAchievement{
......
......@@ -121,6 +121,8 @@ function win(self, how)
elseif how == "yeek-sacrifice" then world:gainAchievement("YEEK_SACRIFICE", game.player)
end
if not game.state.gone_west then world:gainAchievement("WIN_NEVER_WEST", game.player) end
game:setAllowedBuild("adventurer", true)
if game.difficulty == game.DIFFICULTY_NIGHTMARE then game:setAllowedBuild("difficulty_insane", true) end
if game.difficulty == game.DIFFICULTY_INSANE then game:setAllowedBuild("difficulty_madness", true) end
......
......@@ -41,6 +41,7 @@ end
if zone == "Maj'Eyal" then
wda.cur_patrols = wda.cur_patrols or 0
wda.cur_hostiles = wda.cur_hostiles or 0
game.state.gone_west = true
-- Spawn random encounters
local g = game.level.map(game.player.x, game.player.y, Map.TERRAIN)
......
......@@ -114,6 +114,7 @@ newEntity{ define_as = "CORRUPTOR",
{type="armor", subtype="heavy", force_drop=true, tome_drops="boss", forbid_power_source={antimagic=true}, autoreq=true},
},
resolvers.drops{chance=100, nb=3, {tome_drops="boss"} },
resolvers.drops{chance=100, nb=1, {type="jewelry", subtype="orb", defined="ORB_MANY_WAYS"} },
resolvers.talents{
[Talents.T_ARMOUR_TRAINING]=2,
......
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