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

the MAZE !

git-svn-id: http://svn.net-core.org/repos/t-engine4@225 51575b47-30f0-44d4-a5cc-537603b46e54
parent 9793296d
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ module(..., package.seeall, class.inherit(engine.Generator))
function _M:init(zone, map, grid_list, data)
engine.Generator.init(self, zone, map)
self.data = data
self.floor = grid_list[data.floor]
self.wall = grid_list[data.wall]
self.up = grid_list[data.up]
......@@ -63,7 +64,7 @@ function _M:generate(lev, old_lev)
local ux, uy = 1, 1
local dx, dy = math.floor(self.map.w/2)*2-1-2*(1-math.mod(self.map.w,2)), math.floor(self.map.h/2)*2-1-2*(1-math.mod(self.map.h,2))
self.map(ux, uy, Map.TERRAIN, self.up)
if lev < self.zone.max_level then
if lev < self.zone.max_level or self.data.force_last_stair then
self.map(dx, dy, Map.TERRAIN, self.down)
end
if lev > old_lev then
......
......@@ -240,7 +240,7 @@ function _M:generate(lev, old_lev)
-- Put down stairs
local dx, dy
if lev < self.zone.max_level then
if lev < self.zone.max_level or self.data.force_last_stair then
while true do
dx, dy = rng.range(1, self.map.w - 1), rng.range(1, self.map.h - 1)
if not self.map:checkEntity(dx, dy, Map.TERRAIN, "block_move") and not self.room_map[dx][dy].special then
......
game/modules/tome/data/gfx/terrain/granite_wall_lichen.png

996 B

game/modules/tome/data/gfx/terrain/maze_floor.png

1.63 KiB

game/modules/tome/data/gfx/terrain/maze_teleport.png

1.79 KiB

load("/data/general/grids/basic.lua")
newEntity{
define_as = "QUICK_EXIT",
name = "teleporting circle to the surface", image = "terrain/maze_teleport.png",
display = '>', color_r=255, color_g=0, color_b=255,
change_level = 1, change_zone = "wilderness",
}
newEntity{
define_as = "MAZE_FLOOR",
name = "floor", image = "terrain/maze_floor.png",
display = '.', color_r=255, color_g=255, color_b=255,
}
newEntity{
define_as = "MAZE_WALL",
name = "wall", image = "terrain/granite_wall_lichen.png",
display = '#', color_r=255, color_g=255, color_b=255,
block_move = true,
block_sight = true,
}
load("/data/general/npcs/vermin.lua")
load("/data/general/npcs/wolf.lua")
load("/data/general/npcs/troll.lua")
load("/data/general/npcs/snake.lua")
local Talents = require("engine.interface.ActorTalents")
-- The boss of trollshaws, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "TROLL_BILL",
type = "giant", subtype = "troll", unique = true,
name = "Bill the Stone Troll",
display = "T", color=colors.VIOLET,
desc = [[Big, brawny, powerful and with a taste for hobbit. He has friends called Bert and Tom.
He is wielding a small tree trunk and towering toward you.
He should have turned to stone long ago, how could he still walk?!]],
level_range = {7, 10}, exp_worth = 2,
max_life = 250, life_rating = 17, fixed_rating = true,
max_stamina = 85,
stats = { str=25, dex=10, cun=8, mag=10, con=20 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="weapon", subtype="greatmaul", defined="GREATMAUL_BILL_TRUNK"}, },
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
talents = resolvers.talents{
[Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=2, [Talents.T_KNOCKBACK]=1,
},
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=4, },
}
load("/data/general/objects/objects.lua")
-- Artifact, droped (and used!) by Bill the Stone Troll
newEntity{ base = "BASE_GREATMAUL",
define_as = "GREATMAUL_BILL_TRUNK",
name = "Bill's Tree Trunk", unique=true,
require = { stat = { str=25 }, },
cost = 5,
combat = {
dam = 30,
apr = 7,
physcrit = 1.5,
dammod = {str=1.3},
damrange = 1.7,
},
wielder = {
},
}
return {
name = "The Maze",
level_range = {7, 18},
level_scheme = "player",
max_level = 7,
width = 40, height = 40,
-- all_remembered = true,
-- all_lited = true,
-- persistant = true,
generator = {
map = {
class = "engine.generator.map.Maze",
up = "UP",
down = "DOWN",
wall = "MAZE_WALL",
floor = "MAZE_FLOOR",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
ood = {chance=5, range={1, 10}},
adjust_level = {-1, 2},
guardian = "TROLL_BILL",
},
object = {
class = "engine.generator.object.Random",
nb_object = {4, 6},
ood = {chance=5, range={1, 10}},
filters = { {type="potion" }, {type="potion" }, {type="potion" }, {type="scroll" }, {}, {} }
},
},
levels =
{
[1] = {
generator = { map = {
up = "UP_WILDERNESS",
}, },
},
[7] = {
generator = { map = {
force_last_stair = true,
down = "QUICK_EXIT",
}, },
},
},
}
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