Skip to content
Snippets Groups Projects
Commit d09be55b authored by dg's avatar dg
Browse files

Reworked Nightmare and Insane dofficulties. Instead of weakening the player...

Reworked Nightmare and Insane dofficulties. Instead of weakening the player they will generate much nastier monsters. You have been warned.


git-svn-id: http://svn.net-core.org/repos/t-engine4@2059 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2f898917
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 53 deletions
......@@ -22,7 +22,7 @@ local Savefile = require "engine.Savefile"
local Dialog = require "engine.ui.Dialog"
local Map = require "engine.Map"
local Astar = require "engine.Astar"
local print = function() end
--local print = function() end
--- Defines a zone: a set of levels, with depth, nps, objects, level generator, ...
module(..., package.seeall, class.make)
......@@ -41,6 +41,7 @@ function _M:setup(t)
self.grid_class = require(t.grid_class or "engine.Grid")
self.trap_class = require(t.trap_class or "engine.Trap")
self.object_class = require(t.object_class or "engine.Object")
self.on_setup = t.on_setup
end
--- Loads a zone definition
......@@ -60,6 +61,8 @@ function _M:init(short_name, dynamic)
self.trap_list = self.trap_class:loadList("/data/zones/"..self.short_name.."/traps.lua")
end
if self.on_setup then self:on_setup() end
-- Determine a zone base level
self.base_level = self.level_range[1]
if self.level_scheme == "player" then
......
......@@ -155,6 +155,7 @@ function _M:newGame()
self.player:check("before_starting_zone")
self.player.wild_x, self.player.wild_y = self.player.default_wilderness[1], self.player.default_wilderness[2]
self.player.last_wilderness = self.player.default_wilderness[3] or "wilderness"
if self.player.__game_difficulty then self.difficulty = self.player.__game_difficulty end
self:changeLevel(self.player.starting_level or 1, self.player.starting_zone, nil, self.player.starting_level_force_down)
print("[PLAYER BIRTH] resolve...")
self.player:resolve()
......@@ -201,6 +202,7 @@ function _M:newGame()
-- Load the player directly
self.player:replaceWith(qb)
if self.player.__game_difficulty then self.difficulty = self.player.__game_difficulty end
self:changeLevel(self.player.starting_level or 1, self.player.starting_zone, nil, self.player.starting_level_force_down)
Map:setViewerFaction(self.player.faction)
self.player:removeQuest(self.player.starting_quest)
......@@ -225,7 +227,22 @@ function _M:loaded()
engine.GameTurnBased.loaded(self)
engine.interface.GameMusic.loaded(self)
engine.interface.GameSound.loaded(self)
Zone:setup{npc_class="mod.class.NPC", grid_class="mod.class.Grid", object_class="mod.class.Object", trap_class="mod.class.Trap"}
Zone:setup{
npc_class="mod.class.NPC", grid_class="mod.class.Grid", object_class="mod.class.Object", trap_class="mod.class.Trap",
on_setup = function(zone)
-- Increases zone level for higher difficulties
if not zone.__applied_difficulty then
zone.__applied_difficulty = true
if self.difficulty == self.DIFFICULTY_NIGHTMARE then
zone.level_range[1] = math.ceil(zone.level_range[1] * 1.4) + 5
zone.level_range[2] = math.ceil(zone.level_range[2] * 1.4) + 5
elseif self.difficulty == self.DIFFICULTY_INSANE then
zone.level_range[1] = zone.level_range[1] * 2 + 10
zone.level_range[2] = zone.level_range[2] * 2 + 10
end
end
end,
}
Map:setViewerActor(self.player)
Map:setViewPort(200, 20, self.w - 200, math.floor(self.h * 0.80) - 20, 32, 32, nil, 22, true, true)
if self.player then self.player.changed = true end
......
......@@ -379,10 +379,6 @@ function _M:heal(value, src)
-- Difficulty settings
if game.difficulty == game.DIFFICULTY_EASY then
value = value * 1.1
elseif game.difficulty == game.DIFFICULTY_NIGHTMARE then
value = value * 0.8
elseif game.difficulty == game.DIFFICULTY_INSANE then
value = value * 0.6
end
mod.class.Actor.heal(self, value, src)
......
......@@ -98,7 +98,7 @@ newBirthDescriptor{
copy = {
no_birth_levelup = true,
easy_mode_lifes = 99999,
resolvers.generic(function() game.difficulty = game.DIFFICULTY_EASY end)
__game_difficulty = 1,
},
}
newBirthDescriptor{
......@@ -119,7 +119,7 @@ newBirthDescriptor{
class = { ["Tutorial Adventurer"] = "forbid", },
},
copy = {
resolvers.generic(function() game.difficulty = game.DIFFICULTY_EASY end),
__game_difficulty = 1,
easy_mode_lifes = 1,
},
}
......@@ -137,7 +137,7 @@ newBirthDescriptor{
race = { ["Tutorial Human"] = "forbid", },
class = { ["Tutorial Adventurer"] = "forbid", },
},
copy = { resolvers.generic(function() game.difficulty = game.DIFFICULTY_NORMAL end) },
copy = { __game_difficulty = 2 },
}
newBirthDescriptor{
type = "difficulty",
......@@ -145,16 +145,14 @@ newBirthDescriptor{
desc =
{
"Hard game setting",
"All damage done to the player increased by 30%",
"All damage done by the player decreased by 30%",
"All healing for the player decreased by 20%",
"All zone levels increased by 40% + 5",
},
descriptor_choices =
{
race = { ["Tutorial Human"] = "forbid", },
class = { ["Tutorial Adventurer"] = "forbid", },
},
copy = { resolvers.generic(function() game.difficulty = game.DIFFICULTY_NIGHTMARE end) },
copy = { __game_difficulty = 3 },
}
newBirthDescriptor{
type = "difficulty",
......@@ -162,9 +160,7 @@ newBirthDescriptor{
desc =
{
"Absolutely unfair game setting",
"All damage done to the player increased by 50%",
"All damage done by the player decreased by 50%",
"All healing for the player decreased by 40%",
"All zone levels increased by 100% + 10",
"Player rank is normal instead of elite",
},
descriptor_choices =
......@@ -172,7 +168,7 @@ newBirthDescriptor{
race = { ["Tutorial Human"] = "forbid", },
class = { ["Tutorial Adventurer"] = "forbid", },
},
copy = { resolvers.generic(function() game.difficulty = game.DIFFICULTY_INSANE end), rank=2 },
copy = { __game_difficulty = 4, rank=2 },
}
......
......@@ -29,12 +29,6 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
-- Difficulty settings
if game.difficulty == game.DIFFICULTY_EASY and rtarget.player then
dam = dam * 0.7
elseif game.difficulty == game.DIFFICULTY_NIGHTMARE then
if rtarget.player then dam = dam * 1.3
elseif rsrc.player then dam = dam * 0.7 end
elseif game.difficulty == game.DIFFICULTY_INSANE then
if rtarget.player then dam = dam * 1.5
elseif rsrc.player then dam = dam * 0.5 end
end
print("[PROJECTOR] after difficulty dam", dam)
......
......@@ -40,13 +40,6 @@ newTalent = function(t)
end
damDesc = function(self, type, dam)
-- Difficulty settings
if game.difficulty == game.DIFFICULTY_NIGHTMARE then
if self:resolveSource().player then dam = dam * 0.7 end
elseif game.difficulty == game.DIFFICULTY_INSANE then
if self:resolveSource().player then dam = dam * 0.5 end
end
-- Increases damage
if self.inc_damage then
local inc = (self.inc_damage.all or 0) + (self.inc_damage[type] or 0)
......
......@@ -34,7 +34,7 @@ newEntity{ define_as = "GREATER_MUMMY_LORD",
name = "Greater Mummy Lord",
display = "Z", color=colors.VIOLET,
desc = [[The wrappings of this mummy radiates with so much power it feels like wind is blowing from it.]],
level_range = {30, 45}, exp_worth = 2,
level_range = {30, nil}, exp_worth = 2,
max_life = 250, life_rating = 21, fixed_rating = true,
max_stamina = 200,
max_mana = 200,
......@@ -82,7 +82,7 @@ newEntity{ base = "BASE_NPC_MUMMY",
allow_infinite_dungeon = true,
name = "ancient elven mummy", color=colors.ANTIQUE_WHITE,
desc = [[An animated corpse in mummy wrappings.]],
level_range = {7, 50}, exp_worth = 1,
level_range = {7, nil}, exp_worth = 1,
rarity = 1,
max_life = resolvers.rngavg(120,140),
ai_state = { talent_in=4, },
......@@ -105,7 +105,7 @@ newEntity{ base = "BASE_NPC_MUMMY",
allow_infinite_dungeon = true,
name = "animated mummy wrappings", color=colors.SLATE, display='[',
desc = [[An animated mummy wrappings, without a corpse inside... It seems like it can not move.]],
level_range = {7, 50}, exp_worth = 1,
level_range = {7, nil}, exp_worth = 1,
rarity = 4,
max_life = resolvers.rngavg(20,40), life_rating=4,
ai_state = { talent_in=2, },
......@@ -128,7 +128,7 @@ newEntity{ base = "BASE_NPC_MUMMY",
allow_infinite_dungeon = true,
name = "rotting mummy", color=colors.TAN,
desc = [[An rotting animated corpse in mummy wrappings.]],
level_range = {7, 50}, exp_worth = 1,
level_range = {7, nil}, exp_worth = 1,
rarity = 2,
max_life = resolvers.rngavg(60,80), life_rating=7,
ai_state = { talent_in=4, },
......
......@@ -27,7 +27,7 @@ newEntity{ define_as = "UNGOLE", base = "BASE_NPC_SPIDER",
allow_infinite_dungeon = true,
name = "Ungolë", color=colors.VIOLET, unique = true,
desc = [[A huge spider, shed in darkness, with red glowing eyes darting at you. She looks hungry.]],
level_range = {30, 45}, exp_worth = 2,
level_range = {30, nil}, exp_worth = 2,
max_life = 450, life_rating = 15, fixed_rating = true,
stats = { str=25, dex=10, cun=47, mag=10, con=20 },
rank = 4,
......
......@@ -163,7 +163,7 @@ newEntity{
faction = "sorcerers",
desc = [[The renegates mages from Angolwen, the Sorcerers have setup in the Far East, slowly growing corrupt. Now they must be stopped.]],
level_range = {70, 70}, exp_worth = 15,
level_range = {70, nil}, exp_worth = 15,
max_life = 1000, life_rating = 36, fixed_rating = true,
max_mana = 10000,
mana_regen = 10,
......@@ -219,7 +219,7 @@ newEntity{
faction = "sorcerers",
desc = [[The renegates mages from Angolwen, the Sorcerers have setup in the Far East, slowly growing corrupt. Now they must be stopped.]],
level_range = {70, 70}, exp_worth = 15,
level_range = {70, nil}, exp_worth = 15,
max_life = 1000, life_rating = 36, fixed_rating = true,
max_mana = 10000,
mana_regen = 10,
......
......@@ -33,7 +33,7 @@ newEntity{ define_as = "RANTHA_THE_WORM",
name = "Rantha the Worm",
display = "D", color=colors.VIOLET,
desc = [[Claws and teeth. Ice and death. Dragons are not all extinct it seems...]],
level_range = {12, 35}, exp_worth = 2,
level_range = {12, nil}, exp_worth = 2,
max_life = 230, life_rating = 17, fixed_rating = true,
max_stamina = 85,
max_mana = 200,
......@@ -78,7 +78,7 @@ newEntity{ base="BASE_NPC_ORC_GRUSHNAK", define_as = "MASSOK",
allow_infinite_dungeon = true,
name = "Massok the Dragonslayer", color=colors.VIOLET, unique = true,
desc = [[A huge and heavily-scarred orc with a humungous sword. His helm is fashioned from a dragon skull.]],
level_range = {45, 55}, exp_worth = 3,
level_range = {45, nil}, exp_worth = 3,
rank = 4,
max_life = 500, life_rating = 25, fixed_rating = true,
infravision = 20,
......
......@@ -29,7 +29,7 @@ newEntity{ define_as = "DRAEBOR",
name = "Draebor, the Imp",
display = "u", color=colors.VIOLET,
desc = [[An intensely irritating git of a monster.]],
level_range = {35, 75}, exp_worth = 3,
level_range = {35, nil}, exp_worth = 3,
max_life = 300, life_rating = 22, fixed_rating = true,
rank = 4,
size_category = 5,
......
......@@ -27,7 +27,7 @@ newEntity{ base="BASE_NPC_ORC", define_as = "UKRUK",
faction = "orc-pride",
color=colors.VIOLET,
desc = [[This ugly orc looks really nasty and vicious. He is obviously looking for something and bears an unknown symbol on his shield.]],
level_range = {30, 50}, exp_worth = 2,
level_range = {30, nil}, exp_worth = 2,
max_life = 1500, life_rating = 18, fixed_rating = true,
rank = 4,
size_category = 3,
......
......@@ -38,7 +38,7 @@ newEntity{ define_as = "THE_MASTER",
name = "The Master",
display = "V", color=colors.VIOLET,
desc = [[This elder vampire seems to be in control here and does not seem very happy about you.]],
level_range = {23, 45}, exp_worth = 2,
level_range = {23, nil}, exp_worth = 2,
max_life = 350, life_rating = 19, fixed_rating = true,
max_mana = 145,
max_stamina = 145,
......@@ -115,7 +115,7 @@ newEntity{ define_as = "PALE_DRAKE",
name = "Pale Drake",
display = "s", color=colors.VIOLET,
desc = [[A malevolent skeleton archmage that has taken control of the Dreadfell since the Master's demise.]],
level_range = {40, 50}, exp_worth = 3,
level_range = {40, nil}, exp_worth = 3,
max_life = 450, life_rating = 21, fixed_rating = true,
rank = 4,
size_category = 3,
......
......@@ -31,7 +31,7 @@ newEntity{ define_as = "SUN_PALADIN_GUREN",
faction = "sunwall",
name = "Sun Paladin Guren", color=colors.GOLD, unique = true,
desc = [[A human warrior, clad in a shining plate armour. Power radiates from him.]],
level_range = {50, 50}, exp_worth = 2,
level_range = {50, nil}, exp_worth = 2,
life_regen = 10,
rank = 3,
size_category = 3,
......
......@@ -31,7 +31,7 @@ newEntity{ define_as = "UKLLMSWWIK",
display = "D", color=colors.VIOLET,
desc = [[It looks like a cross between a shark and a dragon, only nastier.]],
energy = {mod = 1.4},
level_range = {30, 50}, exp_worth = 4,
level_range = {30, nil}, exp_worth = 4,
max_life = 250, life_rating = 27, fixed_rating = true,
max_stamina = 85,
stats = { str=25, dex=10, cun=48, wil=50, mag=50, con=20 },
......
......@@ -32,7 +32,7 @@ newEntity{ base="BASE_NPC_ORC_GORBAT", define_as = "GORBAT",
allow_infinite_dungeon = true,
name = "Gorbat, Supreme Wyrmic of the Pride", color=colors.VIOLET, unique = true,
desc = [[An orc with a scaly skin, claws an a pair of small wings on his back.]],
level_range = {40, 50}, exp_worth = 2,
level_range = {40, nil}, exp_worth = 2,
rank = 5,
max_life = 250, life_rating = 29, fixed_rating = true,
infravision = 20,
......
......@@ -28,7 +28,7 @@ newEntity{ base="BASE_NPC_ORC_GRUSHNAK", define_as = "GRUSHNAK",
allow_infinite_dungeon = true,
name = "Grushnak, Battlemaster of the Pride", color=colors.VIOLET, unique = true,
desc = [[An old orc, covered in battle scars, he looks fierce and very, very, dangerous.]],
level_range = {45, 55}, exp_worth = 2,
level_range = {45, nil}, exp_worth = 2,
rank = 5,
max_life = 700, life_rating = 25, fixed_rating = true,
infravision = 20,
......
......@@ -58,7 +58,7 @@ newEntity{
faction = "sorcerers",
desc = [[The renegates mages from Angolwen, the Sorcerers have setup in the Far East, slowly growing corrupt. Now they must be stopped.]],
level_range = {75, 75}, exp_worth = 15,
level_range = {75, nil}, exp_worth = 15,
max_life = 1000, life_rating = 36, fixed_rating = true,
max_mana = 10000,
mana_regen = 10,
......@@ -126,7 +126,7 @@ newEntity{
faction = "sorcerers",
desc = [[The renegates mages from Angolwen, the Sorcerers have setup in the Far East, slowly growing corrupt. Now they must be stopped.]],
level_range = {75, 75}, exp_worth = 15,
level_range = {75, nil}, exp_worth = 15,
max_life = 1000, life_rating = 36, fixed_rating = true,
max_mana = 10000,
mana_regen = 10,
......@@ -198,7 +198,7 @@ newEntity{ define_as = "FALLEN_SUN_PALADIN_AERYN",
faction = "sorcerers",
name = "Fallen Sun Paladin Aeryn", color=colors.VIOLET, unique = true,
desc = [[A beautiful woman, clad in a shining plate armour. Power radiates from her.]],
level_range = {56, 56}, exp_worth = 2,
level_range = {56, nil}, exp_worth = 2,
rank = 5,
size_category = 3,
female = true,
......
......@@ -38,7 +38,7 @@ newEntity{ define_as = "MINOTAUR_MAZE",
name = "Minotaur of the Labyrinth",
display = "H", color=colors.VIOLET,
desc = [[A fearsome bull-headed monster, he swings a mighty axe as he curses all that defy him.]],
level_range = {12, 35}, exp_worth = 2,
level_range = {12, nil}, exp_worth = 2,
max_life = 250, life_rating = 17, fixed_rating = true,
max_stamina = 200,
stats = { str=25, dex=10, cun=8, mag=20, wil=20, con=20 },
......
......@@ -36,7 +36,7 @@ newEntity{ define_as = "WRATHROOT",
name = "Wrathroot",
display = "#", color=colors.VIOLET,
desc = [[The ancient grey willow tree, ruler of the Old Forest. He despises trespassers in his territory.]],
level_range = {12, 35}, exp_worth = 2,
level_range = {12, nil}, exp_worth = 2,
max_life = 200, life_rating = 17, fixed_rating = true,
max_stamina = 85,
max_mana = 200,
......@@ -91,7 +91,7 @@ newEntity{ define_as = "SNAPROOT", -- backup guardian
name = "Snaproot",
display = "#", color=VIOLET,
desc = [[This ancient Treant's bark is scorched almost black. It sees humanity as a scourge, to be purged.]],
level_range = {50, 75}, exp_worth = 3,
level_range = {50, nil}, exp_worth = 3,
max_life = 1000, life_rating = 40, fixed_rating = true,
max_stamina = 200,
......
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