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

New world encounter: the ruined dungeon

git-svn-id: http://svn.net-core.org/repos/t-engine4@1799 51575b47-30f0-44d4-a5cc-537603b46e54
parent 73235f76
No related branches found
No related tags found
No related merge requests found
Showing
with 567 additions and 171 deletions
......@@ -158,5 +158,5 @@ function _M:pickSpot(filter)
for i, spot in ipairs(self.spots) do
if game.zone:checkFilter(spot, filter) then list[#list+1] = spot end
end
return rng.table(list)
return rng.table(list), list
end
......@@ -687,7 +687,7 @@ function _M:setupCommands()
a.faction = "enemies"
self.zone:addEntity(self.level, a, "actor", self.player.x+1, self.player.y)
--]]
self:changeLevel(3, "shadow-crypt")
self:changeLevel(1, "ruined-dungeon")
end
end,
}
......
......@@ -286,9 +286,9 @@ newBirthDescriptor{
stats = { mag=5, wil=3, cun=1, },
talents_types = {
["spell/arcane"]={true, 0.2},
["spell/earth"]={true, 0.3},
["spell/earth"]={true, 0.2},
["spell/storm"]={true, 0.4},
["spell/air"]={true, 0.2},
["spell/air"]={true, 0.3},
["spell/phantasm"]={true, 0.3},
["spell/temporal"]={false, 0.3},
["spell/meta"]={false, 0.3},
......
......@@ -39,7 +39,7 @@ newBirthDescriptor{
{
Tutorial = "disallow",
["Maj'Eyal"] = "allow",
["Infinite"] = "allow",
Infinite = function() return profile.mod.allow_build.campaign_infinite_dungeon and "allow" or "disallow" end,
Ents = "disallow",
Spydre = "disallow",
Orcs = "disallow",
......
......@@ -150,180 +150,26 @@ newEntity{
end,
}
--[[
newEntity{
name = "Departing Elves",
name = "Ruined Dungeon",
type = "harmless", subtype = "special", unique = true,
level_range = {30, 50},
level_range = {10, 30},
rarity = 1,
coords = {{ x=0, y=0, w=100, h=100}},
on_world_encounter = "infinite-dungeon",
on_encounter = function(self, who)
local x, y = self:findSpot(who)
if not x then return end
local g = mod.class.NPC.new{
name="Merwionna, Elven camp leader",
type="humanoid", subtype="elf", faction="shaloren",
display='@', color=colors.LIGHT_BLUE,
can_talk = "ringil-exchange",
local g = mod.class.Grid.new{
show_tooltip=true,
name="Entrance to a ruined dungeon",
display='>', color={r=255, g=0, b=0},
notice = true,
change_level=1, change_zone="ruined-dungeon"
}
g:resolve() g:resolve(nil, true)
game.zone:addEntity(game.level, g, "actor", x, y)
game.logPlayer(who, "#LIGHT_BLUE#You notice a small camp of travelling elves.")
return true
end,
}
]]
---------------------------- Hostiles -----------------------------
-- Ambushed!
--[[
newEntity{
name = "Bear ambush",
type = "hostile", subtype = "ambush",
level_range = {10, 50},
rarity = 8,
coords = {{ x=0, y=0, w=40, h=40}},
on_encounter = function(self, who)
local zone = engine.Zone.new("ambush", {
name = "Ambush!",
level_range = {1, 50},
level_scheme = "player",
max_level = 1,
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = 20, height = 20,
all_lited = true,
ambiant_music = "last",
generator = {
map = {
class = "engine.generator.map.Heightmap",
floor = "GRASS",
up = "UP_WILDERNESS",
},
actor = { class = "engine.generator.actor.Random",nb_npc = {5, 7}, },
trap = { class = "engine.generator.trap.Random", nb_trap = {0, 0}, },
},
npc_list = mod.class.NPC:loadList("/data/general/npcs/bear.lua"),
grid_list = mod.class.Grid:loadList{"/data/general/grids/basic.lua", "/data/general/grids/forest.lua"},
object_list = mod.class.Object:loadList("/data/general/objects/general.lua"),
trap_list = {},
})
game:changeLevel(1, zone)
engine.ui.Dialog:simplePopup("Ambush!", "You have been ambushed by bears!")
return true
end,
}
newEntity{
name = "bandits ambush",
type = "hostile", subtype = "ambush",
level_range = {5, 50},
rarity = 8,
coords = {{ x=0, y=0, w=40, h=40}},
on_encounter = function(self, who)
local zone = engine.Zone.new("ambush", {
name = "Ambush!",
level_range = {1, 50},
level_scheme = "player",
max_level = 1,
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = 20, height = 20,
all_lited = true,
ambiant_music = "last",
generator = {
map = {
class = "engine.generator.map.Heightmap",
floor = "GRASS",
up = "UP_WILDERNESS",
},
actor = { class = "engine.generator.actor.Random",nb_npc = {5, 7}, },
trap = { class = "engine.generator.trap.Random", nb_trap = {0, 0}, },
},
npc_list = mod.class.NPC:loadList("/data/general/npcs/thieve.lua"),
grid_list = mod.class.Grid:loadList{"/data/general/grids/basic.lua", "/data/general/grids/forest.lua"},
object_list = mod.class.Object:loadList("/data/general/objects/general.lua"),
trap_list = {},
})
game:changeLevel(1, zone)
engine.ui.Dialog:simplePopup("Ambush!", "You have been ambushed by a party of bandits!")
return true
end,
}
newEntity{
name = "Snake ambush",
type = "hostile", subtype = "ambush",
level_range = {3, 50},
rarity = 5,
coords = {{ x=0, y=0, w=40, h=40}},
on_encounter = function(self, who)
local zone = engine.Zone.new("ambush", {
name = "Ambush!",
level_range = {1, 50},
level_scheme = "player",
max_level = 1,
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = 20, height = 20,
all_lited = true,
ambiant_music = "last",
generator = {
map = {
class = "engine.generator.map.Heightmap",
floor = "GRASS",
up = "UP_WILDERNESS",
},
actor = { class = "engine.generator.actor.Random",nb_npc = {5, 7}, },
trap = { class = "engine.generator.trap.Random", nb_trap = {0, 0}, },
},
npc_list = mod.class.NPC:loadList("/data/general/npcs/snake.lua"),
grid_list = mod.class.Grid:loadList{"/data/general/grids/basic.lua", "/data/general/grids/forest.lua"},
object_list = mod.class.Object:loadList("/data/general/objects/general.lua"),
trap_list = {},
})
game:changeLevel(1, zone)
engine.ui.Dialog:simplePopup("Ambush!", "You setp in a nest of snakes!")
return true
end,
}
newEntity{
name = "Ant ambush",
type = "hostile", subtype = "ambush",
level_range = {3, 50},
rarity = 5,
coords = {{ x=0, y=0, w=40, h=40}},
on_encounter = function(self, who)
local zone = engine.Zone.new("ambush", {
name = "Ambush!",
level_range = {1, 50},
level_scheme = "player",
max_level = 1,
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = 50, height = 50,
all_lited = true,
all_remembered = true,
ambiant_music = "last",
generator = {
map = {
class = "engine.generator.map.GOL",
floor = "GRASS",
wall = "TREE",
up = "UP_WILDERNESS",
},
actor = { class = "engine.generator.actor.Random",nb_npc = {5, 7}, },
trap = { class = "engine.generator.trap.Random", nb_trap = {0, 0}, },
},
npc_list = mod.class.NPC:loadList("/data/general/npcs/ant.lua"),
grid_list = mod.class.Grid:loadList{"/data/general/grids/basic.lua", "/data/general/grids/forest.lua"},
object_list = mod.class.Object:loadList("/data/general/objects/general.lua"),
trap_list = {},
})
game:changeLevel(1, zone)
engine.ui.Dialog:simplePopup("Ambush!", "You step in a nest of ants!")
game.zone:addEntity(game.level, g, "terrain", x, y)
game.logPlayer(who, "#LIGHT_BLUE#You notice an entrance to a ruined dungeon. The air around it feels stale.")
return true
end,
}
]]
......@@ -55,6 +55,7 @@ loadIfNot("/data/general/npcs/plant.lua")
loadIfNot("/data/general/npcs/rodent.lua")
loadIfNot("/data/general/npcs/sandworm.lua")
loadIfNot("/data/general/npcs/skeleton.lua")
--loadIfNot("/data/general/npcs/shade.lua")
loadIfNot("/data/general/npcs/snake.lua")
loadIfNot("/data/general/npcs/snow-giant.lua")
loadIfNot("/data/general/npcs/spider.lua")
......
game/modules/tome/data/gfx/terrain/wall_hole.png

521 B

-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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
--------------------------------------------------------------------------
-- The Infinite Dungeon
--------------------------------------------------------------------------
newLore{
id = "infinite-dungeon-1",
category = "ruined dungeon",
name = "clue (ruined dungeon)",
lore = [[There is an inscription here:
#{italic}#"The river flows in its bed of stone...#{normal}#]],
}
newLore{
id = "infinite-dungeon-2",
category = "ruined dungeon",
name = "clue (ruined dungeon)",
lore = [[There is an inscription here:
#{italic}#...The feather flies gently in the wind.
The tree's root run deep...#{normal}#]],
}
newLore{
id = "infinite-dungeon-3",
category = "ruined dungeon",
name = "clue (ruined dungeon)",
lore = [[There is an inscription here:
#{italic}#...The eldritch force burns all that lives.#{normal}#]],
}
newLore{
id = "infinite-dungeon-4",
category = "ruined dungeon",
name = "infinite dungeon (ruined dungeon)",
lore = [[There is an inscription here:
#{italic}#The terrible hunt lasted for so many sun cycles.
Ever hunting, ever evaded, always deeper the prey goes.
Always deeper, without limits, without hope of escape.#{normal}#
This passage seems to point to the passage there, it seems to indicate there is no possible exits.
You should not enter it.]],
}
......@@ -20,5 +20,6 @@
load("/data/lore/trollshaws.lua")
load("/data/lore/daikara.lua")
load("/data/lore/tol-falas.lua")
load("/data/lore/infinite-dungeon.lua")
load("/data/lore/sunwall.lua")
load("/data/lore/spellhunt.lua")
......@@ -160,6 +160,11 @@ addZone({11, 87, 16, 94}, "zonename", "Tar'Eyal")
addZone({54, 23, 65, 37}, "world-encounter", "lumberjack-cursed")
addZone({3, 15, 19, 33}, "world-encounter", "angolwen")
addZone({136, 43, 145, 55}, "world-encounter", "shadow-crypt")
addZone({46, 6, 50, 8}, "world-encounter", "infinite-dungeon")
addZone({75, 6, 78, 9}, "world-encounter", "infinite-dungeon")
addZone({61, 8, 64, 10}, "world-encounter", "infinite-dungeon")
addZone({22, 3, 26, 5}, "world-encounter", "infinite-dungeon")
addZone({59, 42, 65, 46}, "world-encounter", "infinite-dungeon")
-- ASCII map section
return {
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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
startx = 48
starty = 48
-- defineTile section
defineTile("3", "LORE3")
defineTile("#", "WALL")
defineTile("4", "LORE4")
defineTile("$", "OLD_FLOOR", {random_filter={add_levels=5,ego_chance=70}})
defineTile("&", "OLD_WALL")
defineTile("*", "PORTAL")
defineTile("+", "DOOR")
defineTile("<", "UP_WILDERNESS")
defineTile(">", "INFINITE")
defineTile(".", "OLD_FLOOR")
defineTile("1", "LORE1")
defineTile("!", "LOCK")
defineTile("2", "LORE2")
-- addSpot section
addSpot({42, 8}, "portal", "portal")
addSpot({45, 27}, "portal", "portal")
addSpot({46, 34}, "portal", "portal")
addSpot({3, 37}, "portal", "portal")
addSpot({3, 13}, "portal", "portal")
addSpot({1, 27}, "portal", "portal")
addSpot({21, 8}, "door", "sealed")
-- addZone section
addZone({16, 0, 26, 8}, "no-teleport", "no-teleport")
-- ASCII map section
return [[
################&&&&&>&&&&&#######################
################&$$.....$$&#######################
################&$$.....$$&#######################
################&$$.....$$&#######################
################&$$..4..$$&#######################
################&.........&#######################
################&&.......&&###########.......#####
#################&&.....&&############.......#####
##################&&&!&&&######......+....*..#####
######..#############.#######...######.......#####
#####.....###########.#######.########.......#####
####.......##########.#######.####################
####...#...+........+.+..####.####################
###*..#....##########.##.####.####################
###..#....###########.##.###..####################
####....#############.##.###.#####################
####..###############.##.....#####################
#####################.############################
#####################.############################
#####################.############################
#####################.############################
################....#.#....#######################
################....#.#....#######################
#############.......+.+........###################
#.....#######.##....#.#....###.###################
#......######.##....#.#....###.#######.....#######
#.&&&....####.#######.########.######........#####
#*&&&&........#######.########.........&&&&..*####
#.&&&....####.#######.########.######........#####
#......######.#######.########.#######.....#######
#.....#######.###...#.#...####.###################
#############.###...#.#...####.###################
#############.......+.+........##############..###
#################...#.#...##################....##
#################...#.#...#############.......*.##
##...################.#############.....#####...##
#.....###############.############..#########..###
#..*..###############.############.###############
#.....###############.###########2.###############
##.##################.###########..###############
##.#...#...#....#####.###########.################
##.#.#.#.#.#.##.#####.###########+#########....###
##.#.#.#.#.#..#..####.########......#######....###
##.#.#.#.#.##.##.###...#######......#######....###
#..#.#.#.#..#..#...+.3.#######..&&..#######....###
#.##.#.#.##.##.#####...+........&&..+..........###
#.#..#.#..#....#####...#######......##############
#.#.##.##.####################......#########1####
#...##....####################......+...........<#
##################################################]]
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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 campaign: #LIGHT_GREEN#Infinite Dungeon: The Neverending Descent",
[[
During the Age of Haze, the nine Godslayers set out to destroy the gods.
The god Ralkur trying to escape one of the godslayer created the Infinite Dungeon.
He retreated there, but the godslayer followed, and each time he would reach the god, Ralkur would create a new level.
It is said the hunt continues even now, deep, very deep within the dungeon.
You have unlocked the secret of the Infinite Dungeon and can now create new characters in a new campaign: #LIGHT_GREEN#Infinite Dungeon#WHITE#.
The Infinite Dungeon is a set of ever increasing levels filled with terrible foes.
Campaign features:#YELLOW#
- No quests, plot, friendly creatures or a way out: only you against all odds.
- No win condition: you WILL die in the dungeon, but you can prove your worth by going as deep as possible
- Pure hack and slash MAYHEM!#WHITE#
]]
......@@ -45,5 +45,5 @@ end
for i, zone in ipairs(fs.list("/data/zones/")) do
local file = "/data/zones/"..zone.."/npcs.lua"
if fs.exists(file) and zone ~= "infinite-dungeon" then loadOuter(file) end
if fs.exists(file) and not zone:find("infinite%-dungeon") then loadOuter(file) end
end
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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
load("/data/general/grids/basic.lua")
for i = 1, 4 do
newEntity{
define_as = "LORE"..i,
name = "inscription", image = "terrain/maze_floor.png",
display = '_', color=colors.GREEN, back_color=colors.DARK_GREY,
add_displays = {class.new{image="terrain/signpost.png"}},
always_remember = true,
lore = "infinite-dungeon-"..i,
on_move = function(self, x, y, who)
if not who.player then return end
if self.lore == "infinite-dungeon-4" then
game:setAllowedBuild("campaign_infinite_dungeon", true)
end
who:learnLore(self.lore)
end,
}
end
newEntity{
define_as = "PORTAL",
name = "orb", image = "terrain/maze_teleport.png",
display = '*', color=colors.VIOLET, back_color=colors.DARK_GREY,
always_remember = true,
on_move = function(self, x, y, who)
if not who.player then return end
local text = "???"
if self.portal_type == "water" then text = "The orb seems to drip water."
elseif self.portal_type == "earth" then text = "The orb is covered in dust."
elseif self.portal_type == "wind" then text = "The orb is floating in the air."
elseif self.portal_type == "nature" then text = "Small seeds seem to be growing inside the orb."
elseif self.portal_type == "arcane" then text = "The orb swirls with magical energies."
elseif self.portal_type == "fire" then text = "Flames burst out of the orb."
end
require("engine.ui.Dialog"):yesnoLongPopup("Strange Orb", text.."\nDo you touch it?", 400, function(ret)
if ret then
game.level.data.touch_orb(self.portal_type, x, y)
end
end)
end,
}
newEntity{
define_as = "INFINITE",
name = "way into the infinite dungeon", image = "terrain/wall_hole.png",
display = '>', color=colors.VIOLET, back_color=colors.DARK_GREY,
always_remember = true,
on_move = function(self, x, y, who)
if not who.player then return end
require("engine.ui.Dialog"):simplePopup("Infinite Dungeon", "You should not go there, there is no way back. Ever.")
end,
}
newEntity{
define_as = "LOCK",
name = "sealed door", image = "terrain/sealed_door.png",
display = '+', color=colors.WHITE, back_color=colors.DARK_UMBER,
notice = true,
always_remember = true,
block_sight = true,
does_block_move = true,
}
newEntity{
define_as = "PORTAL",
name = "orb", image = "terrain/maze_teleport.png",
display = '*', color=colors.VIOLET, back_color=colors.DARK_GREY,
always_remember = true, force_clone=true,
on_move = function(self, x, y, who)
if not who.player then return end
local text = "???"
if self.portal_type == "water" then text = "The orb seems to drip water."
elseif self.portal_type == "earth" then text = "The orb is covered in dust."
elseif self.portal_type == "wind" then text = "The orb is floating in the air."
elseif self.portal_type == "nature" then text = "Small seeds seem to be growing inside the orb."
elseif self.portal_type == "arcane" then text = "The orb swirls with magical energies."
elseif self.portal_type == "fire" then text = "Flames burst out of the orb."
end
require("engine.ui.Dialog"):yesnoLongPopup("Strange Orb", text.."\nDo you touch it?", 400, function(ret)
if ret then
game.level.data.touch_orb(self.portal_type, x, y)
end
end)
end,
}
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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
-- Load all others
load("/data/general/npcs/all.lua")
load("/data/general/npcs/bone-giant.lua")
load("/data/general/npcs/faeros.lua")
load("/data/general/npcs/gwelgoroth.lua")
load("/data/general/npcs/mummy.lua")
load("/data/general/npcs/ritch.lua")
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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
load("/data/general/objects/objects.lua")
-- Id stuff
newEntity{ define_as = "ORB_KNOWLEDGE",
unique = true, quest=true,
type = "jewelry", subtype="orb",
unided_name = "orb", no_unique_lore = true,
name = "Orb of Knowledge", identified = true,
display = "*", color=colors.VIOLET, image = "object/ruby.png",
encumber = 1,
desc = [[This orb was given to you by Elisa the halfling scryer, it will automatically identify normal and rare items for you and can be activated to identify all others.]],
on_drop = function(self, who)
if who == game.player then
game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName())
return true
end
end,
max_power = 1, power_regen = 1,
use_power = { name = "use the orb", power = 1,
use = function(self, who)
for inven_id, inven in pairs(who.inven) do
for item, o in ipairs(inven) do
if not o:isIdentified() then
o:identify(true)
game.logPlayer(who, "You have: %s", o:getName{do_colour=true})
end
end
end
end
},
carrier = {
auto_id_mundane = 1,
},
}
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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
load("/data/general/traps/elemental.lua")
load("/data/general/traps/alarm.lua")
load("/data/general/traps/natural_forest.lua")
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 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 {
name = "Ruined Dungeon",
level_range = {10, 30},
level_scheme = "player",
max_level = 1,
actor_adjust_level = function(zone, level, e) return math.floor((zone.base_level + level.level-1) * 1.2) + e:getRankLevelAdjust() + rng.range(-1,2) end,
width = 50, height = 50,
all_remembered = true,
all_lited = true,
ambiant_music = "Far Away.ogg",
generator = {
map = {
class = "engine.generator.map.Static",
map = "zones/ruined-dungeon",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {60, 60},
},
object = {
class = "engine.generator.object.Random",
nb_object = {6, 6},
},
trap = {
class = "engine.generator.trap.Random",
nb_trap = {20, 20},
},
},
post_process = function(level)
-- Everything hates you in the infinite dungeon!
for uid, e in pairs(level.entities) do e.faction="enemies" end
level.orbs_touched = {}
-- Randomly assign portal types
local types = {"wind", "earth", "fire", "water", "arcane", "nature"}
local _, portals = level:pickSpot{type="portal", subtype="portal"}
for i, spot in ipairs(portals) do
local g = level.map(spot.x, spot.y, engine.Map.TERRAIN)
g.portal_type = rng.tableRemove(types)
end
-- Setup no teleport
for _, z in ipairs(level.custom_zones) do
if z.type == "no-teleport" then
for x = z.x1, z.x2 do for y = z.y1, z.y2 do
game.level.map.attrs(x, y, "no_teleport", true)
end end
end
end
end,
touch_orb = function(type, sx, sy)
local Dialog = require("engine.ui.Dialog")
local order = {"water", "earth", "wind", "nature", "arcane", "fire"}
local o = game.level.orbs_touched
o[#o+1] = type
for i = 1, #o do
-- Failed!
if o[i] ~= order[i] then
game.level.orbs_touched = {}
Dialog:simplePopup("Strange Orb", "The orb seems to react badly to your touch, there is a high shriek!")
for i = 1, 4 do
-- Find space
local x, y = util.findFreeGrid(sx, sy, 10, true, {[game.level.map.ACTOR]=true})
if not x then
break
end
-- Find an actor with that filter
local m = game.zone:makeEntity(game.level, "actor")
if m then
m.exp_worth = 0
game.zone:addEntity(game.level, m, "actor", x, y)
game.logSeen(who, "%s appears out of the thin air!", m.name:capitalize())
end
end
return
end
end
-- Success
if #o == #order then
Dialog:simplePopup("Strange Orb", "The orb glows brightly. There is a loud crack coming from the northern central chamber.")
local spot = game.level:pickSpot{type="door", subtype="sealed"}
local g = game.zone:makeEntityByName(game.level, "terrain", "OLD_FLOOR")
game.zone:addEntity(game.level, g, "terrain", spot.x, spot.y)
else
Dialog:simplePopup("Strange Orb", "The orb glows brightly.")
end
end,
}
No preview for this file type
......@@ -547,5 +547,35 @@
<property name="type" value="&quot;world-encounter&quot;"/>
</properties>
</object>
<object name="Infinite Dungeon" x="1499" y="197" width="124" height="85">
<properties>
<property name="subtype" value="&quot;infinite-dungeon&quot;"/>
<property name="type" value="&quot;world-encounter&quot;"/>
</properties>
</object>
<object name="Infinite Dungeon" x="2401" y="195" width="122" height="119">
<properties>
<property name="subtype" value="&quot;infinite-dungeon&quot;"/>
<property name="type" value="&quot;world-encounter&quot;"/>
</properties>
</object>
<object name="Infinite Dungeon" x="1953" y="259" width="124" height="85">
<properties>
<property name="subtype" value="&quot;infinite-dungeon&quot;"/>
<property name="type" value="&quot;world-encounter&quot;"/>
</properties>
</object>
<object name="Infinite Dungeon" x="735" y="101" width="124" height="85">
<properties>
<property name="subtype" value="&quot;infinite-dungeon&quot;"/>
<property name="type" value="&quot;world-encounter&quot;"/>
</properties>
</object>
<object name="Infinite Dungeon" x="1897" y="1353" width="212" height="147">
<properties>
<property name="subtype" value="&quot;infinite-dungeon&quot;"/>
<property name="type" value="&quot;world-encounter&quot;"/>
</properties>
</object>
</objectgroup>
</map>
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