From 26b88d93e43d4852cfcd47ed37dac5693d520d8e Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Tue, 27 Nov 2012 15:13:25 +0000 Subject: [PATCH] Reintroduced Nightmare mode as a step between normal and insane Insane mode is now unlocked by winning on Nightmare mode git-svn-id: http://svn.net-core.org/repos/t-engine4@5851 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/modules/tome/class/Game.lua | 7 +++- game/modules/tome/class/GameState.lua | 6 +++- game/modules/tome/class/NPC.lua | 7 +++- game/modules/tome/data/birth/descriptors.lua | 25 ++++++++++++-- game/modules/tome/data/quests/high-peak.lua | 1 + .../tome/data/talents/spells/enhancement.lua | 2 +- .../data/texts/unlock-difficulty_insane.lua | 33 +++++++++++++++++++ .../tome/data/zones/golem-graveyard/grids.lua | 4 ++- 8 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 game/modules/tome/data/texts/unlock-difficulty_insane.lua diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 290156ef4e..1f6508d6a0 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -325,7 +325,12 @@ function _M:loaded() -- Increases zone level for higher difficulties if not zone.__applied_difficulty then zone.__applied_difficulty = true - if self.difficulty == self.DIFFICULTY_INSANE then + if self.difficulty == self.DIFFICULTY_NIGHTMARE then + zone.base_level_range = table.clone(zone.level_range, true) + zone.specific_base_level.object = -10 -zone.level_range[1] + zone.level_range[1] = zone.level_range[1] * 1.2 + 10 + zone.level_range[2] = zone.level_range[2] * 1.2 + 10 + elseif self.difficulty == self.DIFFICULTY_INSANE then zone.base_level_range = table.clone(zone.level_range, true) zone.specific_base_level.object = -10 -zone.level_range[1] zone.level_range[1] = zone.level_range[1] * 2 + 10 diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua index c4045864b5..25b67014c0 100644 --- a/game/modules/tome/class/GameState.lua +++ b/game/modules/tome/class/GameState.lua @@ -144,7 +144,11 @@ function _M:zoneCheckBackupGuardian() if self.allow_backup_guardians[game.zone.short_name] then local data = self.allow_backup_guardians[game.zone.short_name] game.zone.base_level = data.new_level - if game.difficulty == game.DIFFICULTY_INSANE then + if game.difficulty == game.DIFFICULTY_NIGHTMARE then + game.zone.base_level_range = table.clone(game.zone.level_range, true) + game.zone.specific_base_level.object = -10 -game.zone.base_level + game.zone.base_level = game.zone.base_level * 1.2 + 10 + elseif game.difficulty == game.DIFFICULTY_INSANE then game.zone.base_level_range = table.clone(game.zone.level_range, true) game.zone.specific_base_level.object = -10 -game.zone.base_level game.zone.base_level = game.zone.base_level * 2 + 10 diff --git a/game/modules/tome/class/NPC.lua b/game/modules/tome/class/NPC.lua index 130279e8b7..188dcb5dfe 100644 --- a/game/modules/tome/class/NPC.lua +++ b/game/modules/tome/class/NPC.lua @@ -336,7 +336,12 @@ end --- Call when added to a level -- Used to make escorts and such function _M:addedToLevel(level, x, y) - if game.difficulty == game.DIFFICULTY_INSANE and not game.party:hasMember(self) then + if game.difficulty == game.DIFFICULTY_NIGHTMARE and not game.party:hasMember(self) then + -- Increase talent level + for tid, lev in pairs(self.talents) do + self:learnTalent(tid, true, math.ceil(lev / 2)) + end + elseif game.difficulty == game.DIFFICULTY_INSANE and not game.party:hasMember(self) then -- Increase talent level for tid, lev in pairs(self.talents) do self:learnTalent(tid, true, lev) diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index 743d3cfaa4..b8f2b42ebe 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -162,7 +162,7 @@ newBirthDescriptor{ selection_default = true, desc = { - "#GOLD##{bold}#Adventure mode#WHITE##{normal}#", + "#GOLD##{bold}#Normal mode#WHITE##{normal}#", "Provides the normal level of chalenges.", }, descriptor_choices = @@ -174,13 +174,34 @@ newBirthDescriptor{ __game_difficulty = 2, }, } +newBirthDescriptor{ + type = "difficulty", + name = "Nightmare", + desc = + { + "#GOLD##{bold}#Nightmare mode#WHITE##{normal}#", + "Unfair game setting", + "All zone levels increased by 20% + 10", + "All creatures talent levels increased by 50%", + }, + descriptor_choices = + { + race = { ["Tutorial Human"] = "forbid", }, + class = { ["Tutorial Adventurer"] = "forbid", }, + }, + copy = { + __game_difficulty = 3, + }, +} newBirthDescriptor{ type = "difficulty", name = "Insane", + locked = function() return profile.mod.allow_build.difficulty_insane end, + locked_desc = "Easy is for the weak! Normal is for the weak! Nightmare is too easy! Bring on the true pain!", desc = { "#GOLD##{bold}#Insane mode#WHITE##{normal}#", - "Absolutely unfair game setting", + "Absolutely unfair game setting, you are really mentally ill to play this mode!", "All zone levels increased by 100% + 10", "All creatures talent levels increased by 100%", "Player rank is normal instead of elite", diff --git a/game/modules/tome/data/quests/high-peak.lua b/game/modules/tome/data/quests/high-peak.lua index 22aff439b5..1441c38994 100644 --- a/game/modules/tome/data/quests/high-peak.lua +++ b/game/modules/tome/data/quests/high-peak.lua @@ -122,6 +122,7 @@ function win(self, how) end game:setAllowedBuild("adventurer", true) + if game.difficulty == game.DIFFICULTY_NIGHTMARE then game:setAllowedBuild("difficulty_insane", true) end local p = game:getPlayer(true) p.winner = how diff --git a/game/modules/tome/data/talents/spells/enhancement.lua b/game/modules/tome/data/talents/spells/enhancement.lua index d34bb27dcf..d476c558a3 100644 --- a/game/modules/tome/data/talents/spells/enhancement.lua +++ b/game/modules/tome/data/talents/spells/enhancement.lua @@ -104,7 +104,7 @@ newTalent{ info = function(self, t) local icedamage = t.getIceDamage(self, t) local icedamageinc = t.getIceDamageIncrease(self, t) - return ([[Engulfs your hands (and weapons) in a sheath of lightnings, dealing %d lightning damage per melee attack and increasing all lightning damage by %d%%. + return ([[Engulfs your hands (and weapons) in a sheath of lightnings, dealing %d lightning damage with a chance to daze per melee attack and increasing all lightning damage by %d%%. Each hit will also regenerate %0.2f mana. The effects will increase with your Spellpower.]]): format(damDesc(self, DamageType.LIGHTNING, icedamage), icedamageinc, self:getTalentLevel(t) / 3) diff --git a/game/modules/tome/data/texts/unlock-difficulty_insane.lua b/game/modules/tome/data/texts/unlock-difficulty_insane.lua new file mode 100644 index 0000000000..73326d29a6 --- /dev/null +++ b/game/modules/tome/data/texts/unlock-difficulty_insane.lua @@ -0,0 +1,33 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +return "New game difficulty mode: #LIGHT_GREEN#Insane", +[[You won the game on Nightmare mode, you are a big tought player. +You thought you had seen it all, done it all... + +But no! If nightmare mode couldnt bring you down, Insane mode will! + +Insane features:#YELLOW# +- all zone levels increased by 100% + 10 +- all creatures talent levels increased by 100% +- player rank is normal instead of elite +- player can earn Insane version of achievements if also playing in Roguelike permadeath mode. + +#WHITE#May you suffer many fun and unfair deaths! +]] diff --git a/game/modules/tome/data/zones/golem-graveyard/grids.lua b/game/modules/tome/data/zones/golem-graveyard/grids.lua index 55aba640d2..01f5d0c827 100644 --- a/game/modules/tome/data/zones/golem-graveyard/grids.lua +++ b/game/modules/tome/data/zones/golem-graveyard/grids.lua @@ -39,7 +39,9 @@ Someone foolish has tried to reconstruct it, but it seems like it misses an eye 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) if not ret then return end - if game.difficulty == game.DIFFICULTY_INSANE then + if game.difficulty == game.DIFFICULTY_NIGHTMARE then + game.zone.base_level = 50 * 1.2 + 10 + elseif game.difficulty == game.DIFFICULTY_INSANE then game.zone.base_level = 50 * 2 + 10 else game.zone.base_level = 50 -- GitLab