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

start adding moria

git-svn-id: http://svn.net-core.org/repos/t-engine4@581 51575b47-30f0-44d4-a5cc-537603b46e54
parent 270ce958
No related branches found
No related tags found
No related merge requests found
......@@ -47,13 +47,13 @@ function _M:findOpenings(t, c, i, j, mx, my)
local d = self.raw
if self:isOpening(c, d) and (i == 1 or i == mx or j == 1 or j == my) then
if i == 1 and j == 1 then
table.insert(t.openings, {i, j, 7})
-- table.insert(t.openings, {i, j, 7})
elseif i == 1 and j == my then
table.insert(t.openings, {i, j, 1})
-- table.insert(t.openings, {i, j, 1})
elseif i == mx and j == my then
table.insert(t.openings, {i, j, 3})
-- table.insert(t.openings, {i, j, 3})
elseif i == mx and j == 1 then
table.insert(t.openings, {i, j, 9})
-- table.insert(t.openings, {i, j, 9})
elseif i == 1 then
table.insert(t.openings, {i, j, 4})
elseif i == mx then
......@@ -88,7 +88,7 @@ function _M:loadTiles(tileset)
local i = mx - ri + 1
t[i] = t[i] or {}
t[i][j] = ts[ri][j]
self:findOpenings(t, c, i, j, mx, my)
self:findOpenings(t, t[i][j], i, j, mx, my)
end end
t.sizew, t.sizeh = mx / d.base.w, my / d.base.h
......@@ -100,7 +100,7 @@ function _M:loadTiles(tileset)
local j = my - rj + 1
t[i] = t[i] or {}
t[i][j] = ts[i][rj]
self:findOpenings(t, c, i, j, mx, my)
self:findOpenings(t, t[i][j], i, j, mx, my)
end end
t.sizew, t.sizeh = mx / d.base.w, my / d.base.h
......@@ -112,7 +112,7 @@ function _M:loadTiles(tileset)
local i = mx - ri + 1
t[i] = t[i] or {}
t[i][j] = ts[j][ri]
self:findOpenings(t, c, i, j, mx, my)
self:findOpenings(t, t[i][j], i, j, mx, my)
end end
t.sizew, t.sizeh = mx / d.base.w, my / d.base.h
......@@ -125,7 +125,7 @@ function _M:loadTiles(tileset)
local j = my - rj + 1
t[i] = t[i] or {}
t[i][j] = ts[ri][rj]
self:findOpenings(t, c, i, j, mx, my)
self:findOpenings(t, t[i][j], i, j, mx, my)
end end
t.sizew, t.sizeh = mx / d.base.w, my / d.base.h
......@@ -137,7 +137,7 @@ function _M:loadTiles(tileset)
local j = my - rj + 1
t[i] = t[i] or {}
t[i][j] = ts[rj][i]
self:findOpenings(t, c, i, j, mx, my)
self:findOpenings(t, t[i][j], i, j, mx, my)
end end
t.sizew, t.sizeh = mx / d.base.w, my / d.base.h
......@@ -294,6 +294,7 @@ function _M:buildTile(tile, bx, by, rid)
end
local opens = {}
for i, o in ipairs(tile.openings) do
print(" * opening in dir ", o[3], "::", o[1], o[2])
local coord = dir_to_coord[o[3]]
local mts, type = self:findMatchingTiles(tile, o[3])
-- if we found no match for the given type try the other one
......
......@@ -421,7 +421,7 @@ function _M:setupCommands()
self.key:addCommands{
[{"_d","ctrl"}] = function()
if config.settings.tome.cheat then self:changeLevel(1, "flooded-cave") end
if config.settings.tome.cheat then self:changeLevel(1, "moria") end
end,
}
self.key:addBinds
......
-- ToME - Tales of Middle-Earth
-- 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
-- This file defines the generic matchers and such for 7x7 tiles, but no tiles
base = {w=7, h=7}
is_opening = function(c)
return (c == '.' or c == "'" or c == '+') and true or false
end
matcher = function(t1, t2)
local ok = false
if t1 == '.' or t2 == '.' or t1 == "'" or t2 == "'" then ok = true end
if t1 == t2 then return true, ok end
if t1 == '.' and t2 == "'" then return true, ok end
if t2 == '.' and t1 == "'" then return true, ok end
return false
end
-- Remove some silly doors
filler = function(c, x, y, room_map, data)
if c ~= "'" then return c end
local nb = 0
if room_map[x-1] and room_map[x-1][y] and (room_map[x-1][y].symbol == '.' or room_map[x-1][y].symbol == '+' or room_map[x-1][y].symbol == "'") then nb = nb + 1 end
if room_map[x+1] and room_map[x+1][y] and (room_map[x+1][y].symbol == '.' or room_map[x+1][y].symbol == '+' or room_map[x+1][y].symbol == "'") then nb = nb + 1 end
if room_map[x] and room_map[x][y-1] and (room_map[x][y-1].symbol == '.' or room_map[x][y-1].symbol == '+' or room_map[x][y-1].symbol == "'") then nb = nb + 1 end
if room_map[x] and room_map[x][y+1] and (room_map[x][y+1].symbol == '.' or room_map[x][y+1].symbol == '+' or room_map[x][y+1].symbol == "'") then nb = nb + 1 end
if nb == 2 and rng.percent(data.door_chance or 25) then return '+'
elseif nb < 2 then return '#'
else return '.'
end
end
tiles = {}
-- ToME - Tales of Middle-Earth
-- 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
tiles =
{
{type="tunnel", define_as="WIDE_TUNNEL",
[[##...##]],
[[##...##]],
[[##...##]],
[[##...##]],
[[##...##]],
[[##...##]],
[[##...##]],
},
{type="room", base="WIDE_TUNNEL", rotation="90"},
{type="tunnel", define_as="WIDE_TUNNEL_PILLAR",
[[##...##]],
[[##...##]],
[[##.#.##]],
[[##...##]],
[[##.#.##]],
[[##...##]],
[[##...##]],
},
{type="room", base="WIDE_TUNNEL_PILLAR", rotation="90"},
{type="tunnel", define_as="3CORRIDOR_PILLAR",
[[##...##]],
[[##...##]],
[[.....##]],
[[...#.##]],
[[.....##]],
[[##...##]],
[[##...##]],
},
{type="room", base="3CORRIDOR_PILLAR", rotation="90"},
{type="room", base="3CORRIDOR_PILLAR", rotation="180"},
{type="room", base="3CORRIDOR_PILLAR", rotation="270"},
{type="tunnel",
[[##...##]],
[[##...##]],
[[.......]],
[[.......]],
[[.......]],
[[##...##]],
[[##...##]],
},
}
-- ToME - Tales of Middle-Earth
-- 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")
-- ToME - Tales of Middle-Earth
-- 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/npcs/skeleton.lua")
load("/data/general/npcs/ghoul.lua")
load("/data/general/npcs/wight.lua")
load("/data/general/npcs/vampire.lua")
local Talents = require("engine.interface.ActorTalents")
-- The boss of Tol Falas, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "THE_MASTER",
type = "undead", subtype = "vampire", unique = true,
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,
max_life = 350, life_rating = 19, fixed_rating = true,
max_mana = 145,
max_stamina = 145,
rank = 5,
size_category = 3,
stats = { str=19, dex=19, cun=34, mag=25, con=16 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, NECK=1, },
equipment = resolvers.equip{
{type="weapon", subtype="greatsword", ego_chance=100},
{type="armor", subtype="heavy", ego_chance=50},
{type="jewelry", subtype="amulet", defined="AMULET_DREAD"},
},
resolvers.drops{chance=100, nb=5, {ego_chance=100} },
resolvers.drops{chance=100, nb=1, {type="weapon", subtype="staff", defined="STAFF_ABSORPTION"} },
summon = {
{type="undead", number=2, hasxp=true},
},
blind_immune = 1,
stun_immone = 0.7,
see_invisible = 20,
undead = 1,
resolvers.talents{
[Talents.T_SUMMON]=1,
[Talents.T_HEAVY_ARMOUR_TRAINING]=1,
[Talents.T_MANA_POOL]=1,
[Talents.T_CONGEAL_TIME]=2,
[Talents.T_MANATHRUST]=4,
[Talents.T_FREEZE]=4,
[Talents.T_PHASE_DOOR]=2,
[Talents.T_STRIKE]=3,
[Talents.T_STAMINA_POOL]=1,
[Talents.T_SWORD_MASTERY]=3,
[Talents.T_STUNNING_BLOW]=1,
[Talents.T_RUSH]=4,
[Talents.T_SPELL_SHIELD]=4,
[Talents.T_BLINDING_SPEED]=4,
[Talents.T_PERFECT_STRIKE]=3,
},
autolevel = "warriormage",
ai = "dumb_talented_simple", ai_state = { talent_in=1, },
on_die = function(self, who)
world:gainAchievement("VAMPIRE_CRUSHER", who:resolveSource())
who:resolveSource():grantQuest("tol-falas")
who:resolveSource():setQuestStatus("tol-falas", engine.Quest.DONE)
end,
}
-- ToME - Tales of Middle-Earth
-- 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")
newEntity{ base = "BASE_AMULET",
define_as = "AMULET_DREAD", rarity=false,
name = "Choker of Dread", unique=true,
unided_name = "dark amulet", color=colors.LIGHT_DARK,
desc = [[The evilness of undeath radiates from this amulet.]],
cost = 5000,
wielder = {
see_invisible = 10,
blind_immune = 1,
combat_spellpower = 5,
combat_dam = 5,
},
max_power = 60, power_regen = 1,
use_power = { name = "summon an elder vampire to your side", power = 60, use = function(self, who)
-- Find space
local x, y = util.findFreeGrid(who.x, who.y, 5, true, {[engine.Map.ACTOR]=true})
if not x then
game.logPlayer(who, "Not enough space to invoke the vampire!")
return
end
print("Invoking gardian on", x, y)
local NPC = require "mod.class.NPC"
local vampire = NPC.new{
type = "undead", subtype = "vampires",
display = "V",
name = "elder vampire", color=colors.RED,
desc=[[A terrible robed undead figure, this creature has existed in its unlife for many centuries by stealing the life of others. It can
summon the very shades of its victims from beyond the grave to come enslaved to its aid.]],
combat = { dam=resolvers.rngavg(9,13), atk=10, apr=9, damtype=DamageType.DRAINLIFE, dammod={str=1.9} },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
autolevel = "warriormage",
ai = "summoned", ai_real = "dumb_talented_simple", ai_state = { talent_in=3, },
energy = { mod=1 },
stats = { str=12, dex=12, mag=12, con=12 },
life_regen = 3,
size_category = 3,
rank = 3,
resolvers.tmasteries{ ["technique/other"]=0.5, ["spell/phantasm"]=0.8, },
resists = { [DamageType.COLD] = 80, [DamageType.NATURE] = 80, [DamageType.LIGHT] = -50, },
blind_immune = 1,
confusion_immune = 1,
see_invisible = 5,
undead = 1,
level_range = {who.level, who.level}, exp_worth = 0,
max_life = resolvers.rngavg(90,100),
combat_armor = 12, combat_def = 10,
resolvers.talents{ [who.T_STUN]=2, [who.T_BLUR_SIGHT]=3, [who.T_PHANTASMAL_SHIELD]=2, [who.T_ROTTING_DISEASE]=3, },
faction = who.faction,
summoner = who,
summon_time = 10,
}
vampire:resolve()
game.zone:addEntity(game.level, vampire, "actor", x, y)
game:playSoundNear(who, "talents/spell_generic")
end },
}
-- ToME - Tales of Middle-Earth
-- 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")
-- ToME - Tales of Middle-Earth
-- 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 = "Mines of Moria",
level_range = {20, 30},
level_scheme = "player",
max_level = 7,
decay = {300, 800},
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = 140, height = 140,
all_remembered = true,
all_lited = true,
-- persistant = "zone",
ambiant_music = "cirith-ungol.ogg",
generator = {
map = {
class = "engine.generator.map.TileSet",
tileset = {"7x7/base", "7x7/tunnel",},
['.'] = "FLOOR",
['#'] = "WALL",
['+'] = "DOOR",
["'"] = "DOOR",
up = "UP",
down = "DOWN",
},
--[[
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
guardian = "THE_MASTER",
},
object = {
class = "engine.generator.object.Random",
nb_object = {6, 9},
filters = { {ego_chance = 20} }
},
trap = {
class = "engine.generator.trap.Random",
nb_trap = {6, 9},
},
]]
},
levels =
{
[1] = {
generator = { map = {
up = "UP_WILDERNESS",
}, },
},
},
}
No preview for this file type
No preview for this file type
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