diff --git a/game/engines/default/engine/Map.lua b/game/engines/default/engine/Map.lua index 8d2ebb8409a637c7b14faaa59d97094f533e9cfa..1bbf65ed95d71d9dca3abaca7094cf48cb9265e1 100644 --- a/game/engines/default/engine/Map.lua +++ b/game/engines/default/engine/Map.lua @@ -58,7 +58,7 @@ searchOrderSort = function(a, b) end color_shown = { 1, 1, 1, 1 } -color_obscure = { 1, 1, 1, 0.6 } +color_obscure = { 0.6, 0.6, 0.6, 1 } -- The minimap data MM_FLOOR = 1 diff --git a/game/engines/default/engine/Module.lua b/game/engines/default/engine/Module.lua index a90c973300dd0dc312e2ab5ee8a4c1970da0c8d2..5585a6254dc8c1a500832bad2fc4510407c9f423 100644 --- a/game/engines/default/engine/Module.lua +++ b/game/engines/default/engine/Module.lua @@ -101,9 +101,10 @@ function _M:loadDefinition(dir, team) -- print("Loading module definition from", team and (dir.."/mod/init.lua") or (dir.."/init.lua")) if mod_def then -- Call the file body inside its own private environment - local mod = {} + local mod = {rng=rng} setfenv(mod_def, mod) mod_def() + mod.rng = nil if not mod.long_name or not mod.name or not mod.short_name or not mod.version or not mod.starter then print("Bad module definition", mod.long_name, mod.name, mod.short_name, mod.version, mod.starter) diff --git a/game/modules/tome/class/Grid.lua b/game/modules/tome/class/Grid.lua index 9b2eb8f932dd0f99d632c9cd37aeb10e96ae8ab2..efd60db405e18b6acc85c51779235bf2fd9b457b 100644 --- a/game/modules/tome/class/Grid.lua +++ b/game/modules/tome/class/Grid.lua @@ -92,8 +92,8 @@ function _M:makeTrees(base, max) return engine.Entity.new{ z = z, display_scale = rng.float(0.5 + inb / 6, 1.3), - display_x = rng.range(-engine.Map.tile_w / 3 * nb / 3, engine.Map.tile_w / 3 * nb / 3), - display_y = rng.range(-engine.Map.tile_h / 3 * nb / 3, engine.Map.tile_h / 3 * nb / 3), + display_x = rng.float(-1 / 3 * nb / 3, 1 / 3 * nb / 3), + display_y = rng.float(-1 / 3 * nb / 3, 1 / 3 * nb / 3), display_on_seen = true, display_on_remember = true, image = (base or "terrain/tree_alpha")..rng.range(1,max or 5)..".png", @@ -121,8 +121,8 @@ function _M:makeShells(base, max) return engine.Entity.new{ z = z, display_scale = rng.float(0.1 + inb / 6, 0.2), - display_x = rng.range(-engine.Map.tile_w / 3 * nb / 3, engine.Map.tile_w / 3 * nb / 3), - display_y = rng.range(-engine.Map.tile_h / 3 * nb / 3, engine.Map.tile_h / 3 * nb / 3), + display_x = rng.range(-1 / 3 * nb / 3, 1 / 3 * nb / 3), + display_y = rng.range(-1 / 3 * nb / 3, 1 / 3 * nb / 3), display_on_seen = true, display_on_remember = true, image = (base or "terrain/tree_alpha")..rng.range(1,max or 5)..".png", diff --git a/game/modules/tome/class/NicerTiles.lua b/game/modules/tome/class/NicerTiles.lua index cab0484db457d883dbfa27c709bb93a15f162767..3e10a5ab0821c4f1790e5e9a7544c9c963e9718e 100644 --- a/game/modules/tome/class/NicerTiles.lua +++ b/game/modules/tome/class/NicerTiles.lua @@ -29,6 +29,13 @@ end function _M:getTile(name) if not name then return end + + if type(name) == "table" then + local n = name[1] + if rng.percent(name[2]) then n = n..rng.range(name[3], name[4]) end + name = n + end + if self.repo[name] then return self.repo[name] else self.repo[name] = game.zone:makeEntityByName(game.level, "terrain", name) @@ -43,11 +50,9 @@ function _M:replace(i, j, g) end function _M:postProcessLevelTiles(level) - if not Map.tiles.nicer_tiles then return end - for i = 0, level.map.w - 1 do for j = 0, level.map.h - 1 do local g = level.map(i, j, Map.TERRAIN) - if g.nice_tiler then + if g and Map.tiles.nicer_tiles and g.nice_tiler then self["niceTile"..g.nice_tiler.method:capitalize()](self, level, i, j, g, g.nice_tiler) end end end @@ -58,25 +63,37 @@ function _M:postProcessLevelTiles(level) end end --- Make walls have a pseudo 3D effect +--- Make walls have a pseudo 3D effect function _M:niceTileWall3d(level, i, j, g, nt) - local gn = level.map(i, j-1, Map.TERRAIN) or {define_as = g.define_as} - local gs = level.map(i, j+1, Map.TERRAIN) or {define_as = g.define_as} + local s = level.map:checkEntity(i, j, Map.TERRAIN, "block_move") and true or false + local gn = level.map:checkEntity(i, j-1, Map.TERRAIN, "block_move") and true or false + local gs = level.map:checkEntity(i, j+1, Map.TERRAIN, "block_move") and true or false + local gw = level.map:checkEntity(i-1, j, Map.TERRAIN, "block_move") and true or false + local ge = level.map:checkEntity(i+1, j, Map.TERRAIN, "block_move") and true or false + + local gnc = level.map:checkEntity(i, j-1, Map.TERRAIN, "block_move", {open_door=true}, false, true) and true or false + local gsc = level.map:checkEntity(i, j+1, Map.TERRAIN, "block_move", {open_door=true}, false, true) and true or false - if gs.define_as ~= g.define_as and gn.define_as ~= g.define_as then self:replace(i, j, self:getTile(nt.north_south)) - elseif gs.define_as ~= g.define_as then self:replace(i, j, self:getTile(nt.south)) - elseif gn.define_as ~= g.define_as then self:replace(i, j, self:getTile(nt.north)) + if gs ~= s and gn ~= s and gw ~= s and ge ~= s then self:replace(i, j, self:getTile(nt.small_pillar)) + elseif gs ~= s and gn ~= s and gw ~= s and ge == s then self:replace(i, j, self:getTile(nt.pillar_4)) + elseif gs ~= s and gn ~= s and gw == s and ge ~= s then self:replace(i, j, self:getTile(nt.pillar_6)) + elseif gs == s and gn ~= s and gw ~= s and ge ~= s then self:replace(i, j, self:getTile(nt.pillar_8)) + elseif gs ~= s and gn == s and gw ~= s and ge ~= s then self:replace(i, j, self:getTile(nt.pillar_2)) + elseif gsc ~= s and gnc ~= s then self:replace(i, j, self:getTile(nt.north_south)) + elseif gsc ~= s then self:replace(i, j, self:getTile(nt.south)) + elseif gnc ~= s then self:replace(i, j, self:getTile(nt.north)) + elseif nt.inner then self:replace(i, j, self:getTile(nt.inner)) end end --- Make doors have a pseudo 3D effect +--- Make doors have a pseudo 3D effect function _M:niceTileDoor3d(level, i, j, g, nt) - local gn = level.map(i, j-1, Map.TERRAIN) - local gs = level.map(i, j+1, Map.TERRAIN) - local gw = level.map(i-1, j, Map.TERRAIN) - local ge = level.map(i+1, j, Map.TERRAIN) + local gn = level.map:checkEntity(i, j-1, Map.TERRAIN, "block_move") and true or false + local gs = level.map:checkEntity(i, j+1, Map.TERRAIN, "block_move") and true or false + local gw = level.map:checkEntity(i-1, j, Map.TERRAIN, "block_move") and true or false + local ge = level.map:checkEntity(i+1, j, Map.TERRAIN, "block_move") and true or false - if gs and gs:check("block_move", i, j+1) and gn and gn:check("block_move", i, j-1) then self:replace(i, j, self:getTile(nt.north_south)) - elseif gw and gw:check("block_move", i, j-1) and ge and ge:check("block_move", i+1, j) then self:replace(i, j, self:getTile(nt.west_east)) + if gs and gn then self:replace(i, j, self:getTile(nt.north_south)) + elseif gw and ge then self:replace(i, j, self:getTile(nt.west_east)) end end diff --git a/game/modules/tome/data/general/grids/basic.lua b/game/modules/tome/data/general/grids/basic.lua index 4fb2226974d74dec9add6df640cd1d95d451219a..3263d9afd7725dc6f1c09aef0d5ab83cea543675 100644 --- a/game/modules/tome/data/general/grids/basic.lua +++ b/game/modules/tome/data/general/grids/basic.lua @@ -22,7 +22,7 @@ ----------------------------------------- newEntity{ define_as = "UP_WILDERNESS", - name = "exit to the worldmap", image = "terrain/stair_up_wild.png", + name = "exit to the worldmap", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/stair_up_wild.png"}}, display = '<', color_r=255, color_g=0, color_b=255, always_remember = true, notice = true, @@ -144,7 +144,7 @@ newEntity{ define_as = "WALL", name = "wall", image = "terrain/granite_wall1.png", display = '#', color_r=255, color_g=255, color_b=255, back_color=colors.GREY, - nice_tiler = { method="wall3d", north="WALL_NORTH", south="WALL_SOUTH", north_south="WALL_NORTH_SOUTH" }, + nice_tiler = { method="wall3d", inner={"WALL", 100, 1, 5}, north={"WALL_NORTH", 100, 1, 5}, south={"WALL_SOUTH", 10, 1, 17}, north_south="WALL_NORTH_SOUTH", small_pillar="WALL_SMALL_PILLAR", pillar_2="WALL_PILLAR_2", pillar_8={"WALL_PILLAR_8", 100, 1, 5}, pillar_4="WALL_PILLAR_4", pillar_6="WALL_PILLAR_6" }, always_remember = true, does_block_move = true, can_pass = {pass_wall=1}, @@ -152,21 +152,18 @@ newEntity{ air_level = -20, dig = "FLOOR", } -newEntity{ base = "WALL", - define_as = "WALL_NORTH", - image = "terrain/granite_wall1.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, -} -newEntity{ base = "WALL", - define_as = "WALL_NORTH_SOUTH", - image = "terrain/granite_wall2.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, -} -newEntity{ base = "WALL", - define_as = "WALL_SOUTH", - image = "terrain/granite_wall2.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, -} +for i = 1, 5 do + newEntity{ base = "WALL", define_as = "WALL"..i, image = "terrain/granite_wall1_"..i..".png", nice_tiler = false} + newEntity{ base = "WALL", define_as = "WALL_NORTH"..i, image = "terrain/granite_wall1_"..i..".png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false} + newEntity{ base = "WALL", define_as = "WALL_PILLAR_8"..i, image = "terrain/granite_wall1_"..i..".png", add_displays = {class.new{image="terrain/granite_wall_pillar_8.png", z=18, display_y=-1}}, nice_tiler = false} +end +newEntity{ base = "WALL", define_as = "WALL_NORTH_SOUTH", image = "terrain/granite_wall2.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "WALL", define_as = "WALL_SOUTH", image = "terrain/granite_wall2.png", nice_tiler = false} +for i = 1, 17 do newEntity{ base = "WALL", define_as = "WALL_SOUTH"..i, image = "terrain/granite_wall2_"..i..".png", nice_tiler = false} end +newEntity{ base = "WALL", define_as = "WALL_SMALL_PILLAR", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_small.png"}, class.new{image="terrain/granite_wall_pillar_small_top.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "WALL", define_as = "WALL_PILLAR_6", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_3.png"}, class.new{image="terrain/granite_wall_pillar_9.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "WALL", define_as = "WALL_PILLAR_4", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_1.png"}, class.new{image="terrain/granite_wall_pillar_7.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "WALL", define_as = "WALL_PILLAR_2", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_2.png"}}, nice_tiler = false} ----------------------------------------- -- Big Walls @@ -190,7 +187,7 @@ newEntity{ define_as = "HARDWALL", name = "wall", image = "terrain/granite_wall1.png", display = '#', color_r=255, color_g=255, color_b=255, back_color=colors.GREY, - nice_tiler = { method="wall3d", north="WALL_NORTH", south="WALL_SOUTH", north_south="WALL_NORTH_SOUTH" }, + nice_tiler = { method="wall3d", inner={"WALL", 100, 1, 5}, north={"WALL_NORTH", 100, 1, 5}, south={"WALL_SOUTH", 10, 1, 17}, north_south="WALL_NORTH_SOUTH", small_pillar="WALL_SMALL_PILLAR", pillar_2="WALL_PILLAR_2", pillar_8={"WALL_PILLAR_8", 100, 1, 5}, pillar_4="WALL_PILLAR_4", pillar_6="WALL_PILLAR_6" }, always_remember = true, does_block_move = true, block_sight = true, @@ -198,21 +195,18 @@ newEntity{ block_esp = true, air_level = -20, } -newEntity{ base = "HARDWALL", - define_as = "HARDWALL_NORTH", - image = "terrain/granite_wall1.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, -} -newEntity{ base = "HARDWALL", - define_as = "HARDWALL_NORTH_SOUTH", - image = "terrain/granite_wall2.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, -} -newEntity{ base = "HARDWALL", - define_as = "HARDWALL_SOUTH", - image = "terrain/granite_wall2.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, -} +for i = 1, 5 do + newEntity{ base = "HARDWALL", define_as = "HARDWALL"..i, image = "terrain/granite_wall1_"..i..".png", nice_tiler = false} + newEntity{ base = "HARDWALL", define_as = "HARDWALL_NORTH"..i, image = "terrain/granite_wall1_"..i..".png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false} + newEntity{ base = "HARDWALL", define_as = "HARDWALL_PILLAR_8"..i, image = "terrain/granite_wall1_"..i..".png", add_displays = {class.new{image="terrain/granite_wall_pillar_8.png", z=18, display_y=-1}}, nice_tiler = false} +end +newEntity{ base = "HARDWALL", define_as = "HARDWALL_NORTH_SOUTH", image = "terrain/granite_wall2.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "HARDWALL", define_as = "HARDWALL_SOUTH", image = "terrain/granite_wall2.png", nice_tiler = false} +for i = 1, 17 do newEntity{ base = "HARDWALL", define_as = "HARDWALL_SOUTH"..i, image = "terrain/granite_wall2_"..i..".png", nice_tiler = false} end +newEntity{ base = "HARDWALL", define_as = "HARDWALL_SMALL_PILLAR", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_small.png"}, class.new{image="terrain/granite_wall_pillar_small_top.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "HARDWALL", define_as = "HARDWALL_PILLAR_6", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_3.png"}, class.new{image="terrain/granite_wall_pillar_9.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "HARDWALL", define_as = "HARDWALL_PILLAR_4", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_1.png"}, class.new{image="terrain/granite_wall_pillar_7.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "HARDWALL", define_as = "HARDWALL_PILLAR_2", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_2.png"}}, nice_tiler = false} ----------------------------------------- @@ -222,12 +216,12 @@ newEntity{ define_as = "DOOR", name = "door", image = "terrain/granite_door1.png", display = '+', color_r=238, color_g=154, color_b=77, back_color=colors.DARK_UMBER, - nice_tiler = { method="door3d", north_south="DOOR_VERT", west_east="DOOR_NORTH_SOUTH" }, + nice_tiler = { method="door3d", north_south="DOOR_VERT", west_east="DOOR_HORIZ" }, notice = true, always_remember = true, block_sight = true, door_opened = "DOOR_OPEN", - dig = "DOOR_OPEN", + dig = "FLOOR", } newEntity{ define_as = "DOOR_OPEN", @@ -236,38 +230,16 @@ newEntity{ always_remember = true, door_closed = "DOOR", } - -newEntity{ base = "DOOR", - define_as = "DOOR_NORTH_SOUTH", - image = "terrain/granite_door1.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, - door_opened = "DOOR_NORTH_SOUTH_OPEN", -} -newEntity{ base = "DOOR_OPEN", - define_as = "DOOR_NORTH_SOUTH_OPEN", - image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_door1_open.png", z=17}, class.new{image="terrain/granite_wall3.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, - door_closed = "DOOR_NORTH_SOUTH", -} - -newEntity{ base = "DOOR", - define_as = "DOOR_VERT", - image = "terrain/granite_door1_vert.png", add_displays = {class.new{image="terrain/granite_door1_vert_north.png", z=18, display_y=-engine.Map.tile_h}}, - door_opened = "DOOR_OPEN_VERT", - nice_tiler = false, - dig = "DOOR_OPEN_VERT", -} -newEntity{ base = "DOOR_OPEN", - define_as = "DOOR_OPEN_VERT", - image = "terrain/granite_door1_open_vert.png", add_displays = {class.new{image="terrain/granite_door1_open_vert_north.png", z=18, display_y=-engine.Map.tile_h}}, - nice_tiler = false, - door_closed = "DOOR_VERT", -} +newEntity{ base = "DOOR", define_as = "DOOR_HORIZ", image = "terrain/granite_door1.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false, door_opened = "DOOR_HORIZ_OPEN"} +newEntity{ base = "DOOR_OPEN", define_as = "DOOR_HORIZ_OPEN", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_door1_open.png", z=17}, class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false, door_closed = "DOOR_HORIZ"} +newEntity{ base = "DOOR", define_as = "DOOR_VERT", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_door1_vert.png", z=17}, class.new{image="terrain/granite_door1_vert_north.png", z=18, display_y=-1}}, door_opened = "DOOR_OPEN_VERT", nice_tiler = false, dig = "DOOR_OPEN_VERT"} +newEntity{ base = "DOOR_OPEN", define_as = "DOOR_OPEN_VERT", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_door1_open_vert.png", z=17}, class.new{image="terrain/granite_door1_open_vert_north.png", z=18, display_y=-1}}, nice_tiler = false, door_closed = "DOOR_VERT"} newEntity{ define_as = "DOOR_VAULT", name = "sealed door", image = "terrain/granite_door1.png", display = '+', color_r=238, color_g=154, color_b=77, back_color=colors.DARK_UMBER, + nice_tiler = { method="door3d", north_south="DOOR_VAULT_VERT", west_east="DOOR_VAULT_HORIZ" }, notice = true, always_remember = true, block_sight = true, @@ -275,15 +247,16 @@ newEntity{ block_esp = true, door_player_check = "This door seems to have been sealed off, you think you can open it.", door_opened = "DOOR_OPEN", - dig = "DOOR_OPEN", } +newEntity{ base = "DOOR_VAULT", define_as = "DOOR_VAULT_HORIZ", image = "terrain/granite_door1.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false, door_opened = "DOOR_HORIZ_OPEN"} +newEntity{ base = "DOOR_VAULT", define_as = "DOOR_VAULT_VERT", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_door1_vert.png", z=17}, class.new{image="terrain/granite_door1_vert_north.png", z=18, display_y=-1}}, door_opened = "DOOR_OPEN_VERT", nice_tiler = false} ----------------------------------------- --- Ol +-- Old walls ----------------------------------------- newEntity{ define_as = "OLD_FLOOR", - name = "floor", image = "terrain/maze_floor.png", + name = "floor", image = "terrain/marble_floor.png", display = '.', color_r=255, color_g=255, color_b=255, back_color=colors.DARK_GREY, } @@ -291,8 +264,22 @@ newEntity{ define_as = "OLD_WALL", name = "wall", image = "terrain/granite_wall_lichen.png", back_color=colors.GREY, display = '#', color_r=255, color_g=255, color_b=255, + nice_tiler = { method="wall3d", inner={"OLD_WALL", 100, 1, 5}, north={"OLD_WALL_NORTH", 100, 1, 5}, south={"OLD_WALL_SOUTH", 70, 1, 3}, north_south={"OLD_WALL_NORTH_SOUTH", 70, 1, 3}, small_pillar="OLD_WALL_SMALL_PILLAR", pillar_2="OLD_WALL_PILLAR_2", pillar_8={"OLD_WALL_PILLAR_8", 100, 1, 5}, pillar_4="OLD_WALL_PILLAR_4", pillar_6="OLD_WALL_PILLAR_6" }, always_remember = true, does_block_move = true, block_sight = true, air_level = -20, } +for i = 1, 5 do + newEntity{ base = "OLD_WALL", define_as = "OLD_WALL"..i, image = "terrain/granite_wall1_"..i..".png", nice_tiler = false} + newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_NORTH"..i, image = "terrain/granite_wall1_"..i..".png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false} + newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_PILLAR_8"..i, image = "terrain/granite_wall1_"..i..".png", add_displays = {class.new{image="terrain/granite_wall_pillar_8.png", z=18, display_y=-1}}, nice_tiler = false} +end +newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_NORTH_SOUTH", image = "terrain/granite_wall2.png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false} +for i = 1, 3 do newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_NORTH_SOUTH"..i, image = "terrain/granite_wall_lichen_"..i..".png", add_displays = {class.new{image="terrain/granite_wall3.png", z=18, display_y=-1}}, nice_tiler = false} end +newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_SOUTH", image = "terrain/granite_wall2.png", nice_tiler = false} +for i = 1, 3 do newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_SOUTH"..i, image = "terrain/granite_wall_lichen_"..i..".png", nice_tiler = false} end +newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_SMALL_PILLAR", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_small.png"}, class.new{image="terrain/granite_wall_pillar_small_top.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_PILLAR_6", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_3.png"}, class.new{image="terrain/granite_wall_pillar_9.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_PILLAR_4", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_1.png"}, class.new{image="terrain/granite_wall_pillar_7.png", z=18, display_y=-1}}, nice_tiler = false} +newEntity{ base = "OLD_WALL", define_as = "OLD_WALL_PILLAR_2", image = "terrain/marble_floor.png", add_displays = {class.new{image="terrain/granite_wall_pillar_2.png"}}, nice_tiler = false} diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open.png index bb2c8152d5b6ecadc5fba678fabfff498add0ce0..14675085b555eebf6224046e488446062ba49837 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open.png and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert.png index 9977a9cda2db12d8eae2b1bf96aa75551227fc92..c4610339a9e8b2e9c79fdda7ae1c4dd70d287cdf 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert.png and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert_north.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert_north.png index ca2c5898004153e965b58cd180839434d4d8562f..1d8260c9b4d5526df97ae8f725259eff5e49127a 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert_north.png and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_open_vert_north.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert.png index dbc4b564bc1227240b180ccbf245b237f556ce7c..0a66132f6245676616f8cd74443a5bf0de062357 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert.png and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert_north.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert_north.png index 30d95eb727cd1560e94d1945bf25e684685835ae..b3e5d50051a4ce6529889f9f9303aec636df64a1 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert_north.png and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_door1_vert_north.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_1.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_1.png new file mode 100644 index 0000000000000000000000000000000000000000..8932e8de28bceab84d9261d24fb4b6615da86506 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_1.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_10.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_10.png new file mode 100644 index 0000000000000000000000000000000000000000..7d2120788652308c0047c3b46e18aa984f3283d4 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_10.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_11.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_11.png new file mode 100644 index 0000000000000000000000000000000000000000..f69652f7a39b7d58463a6ece12c3b7b98abe5c3a Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_11.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_12.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_12.png new file mode 100644 index 0000000000000000000000000000000000000000..5befed5dc5a5ec7159a53ecde94f45ff868c648f Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_12.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_13.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_13.png new file mode 100644 index 0000000000000000000000000000000000000000..f64454f415a8686336d74bfa06e3de5d593d9959 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_13.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_14.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_14.png new file mode 100644 index 0000000000000000000000000000000000000000..e51e52ee6c4fbec78f23c4ac1a4ad9612a8bd355 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_14.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_15.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_15.png new file mode 100644 index 0000000000000000000000000000000000000000..b84552a64acfcc393de2425066f32b87e996366e Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_15.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_16.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_16.png new file mode 100644 index 0000000000000000000000000000000000000000..59d26223ceb5bf24bbda4aeb89fb99770dce08c4 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_16.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_17.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_17.png new file mode 100644 index 0000000000000000000000000000000000000000..df939f3995babc37bffd26622ac1f294aa0ed4cd Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_17.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_2.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_2.png new file mode 100644 index 0000000000000000000000000000000000000000..f388f966c8bc45621ef2ec65af09f3e4c40e3b09 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_2.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_3.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_3.png new file mode 100644 index 0000000000000000000000000000000000000000..fcbe23f7f7a77113c28eeb3b03a2e26bde35d202 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_3.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_4.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_4.png new file mode 100644 index 0000000000000000000000000000000000000000..44152eee725fe0d08a2cbd830e25f8198570dc84 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_4.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_5.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_5.png new file mode 100644 index 0000000000000000000000000000000000000000..25beb40f6689423f886416786a89ac1fc7d3780f Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_5.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_6.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_6.png new file mode 100644 index 0000000000000000000000000000000000000000..964bc8e697c5891ba5a1b81ffc2ec5fd3293b5fd Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_6.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_7.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_7.png new file mode 100644 index 0000000000000000000000000000000000000000..67d5c12d92ea56cc4b7a1aaac9f89c6dc5fd8ca3 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_7.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_8.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_8.png new file mode 100644 index 0000000000000000000000000000000000000000..19532b32cc96972ca0932ed3ca60f362fa52a97b Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_8.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_9.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_9.png new file mode 100644 index 0000000000000000000000000000000000000000..79385b13282741f04e779f3429b44e34b9636b3a Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall2_9.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall3.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall3.png index 41371f6fc01c56a1bd5d2586c0e8e25a5c00dff3..e53124450675bcb7ee60f5818361174b565dffb1 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall3.png and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall3.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_1.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_1.png new file mode 100644 index 0000000000000000000000000000000000000000..4666dcbfc4a001a227e15f8d3f721460f0874b1f Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_1.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_2.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_2.png new file mode 100644 index 0000000000000000000000000000000000000000..68062e6a0986f07374269c276aa8441d103081e5 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_2.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_3.png b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_3.png new file mode 100644 index 0000000000000000000000000000000000000000..23a7360ebb50cbd1a3f3bfabd965c1394621b8b5 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/granite_wall_lichen_3.png differ diff --git a/game/modules/tome/data/maps/vaults/amon-sul-crypt.lua b/game/modules/tome/data/maps/vaults/amon-sul-crypt.lua index 00a1ca4e7f339e209e997122b34b6207e59aac55..47850424528fdd08c56521a7dd7c8a8ddb1b19ec 100644 --- a/game/modules/tome/data/maps/vaults/amon-sul-crypt.lua +++ b/game/modules/tome/data/maps/vaults/amon-sul-crypt.lua @@ -20,6 +20,7 @@ setStatusAll{no_teleport=true} defineTile('.', "FLOOR") +defineTile('#', "WALL") defineTile('X', "HARDWALL") defineTile('!', "DOOR_VAULT") defineTile('D', "DOOR") @@ -41,4 +42,7 @@ return { [[..XX!XX..]], [[...X^X...]], [[.........]], +[[.#..#..#.]], +[[.........]], +[[.........]], } diff --git a/game/modules/tome/data/maps/vaults/circle.lua b/game/modules/tome/data/maps/vaults/circle.lua index c370e0f665161c69250e829429e791ed7d9d243d..ca4b3208b26c7897f78592ebdae640c1688da98b 100644 --- a/game/modules/tome/data/maps/vaults/circle.lua +++ b/game/modules/tome/data/maps/vaults/circle.lua @@ -35,18 +35,18 @@ starty = 0 return { [[...........]], [[...XX!XX...]], -[[..XXD2DXX..]], -[[.XX.XXX.XX.]], +[[..XX.2.XX..]], +[[.XXXDXDXXX.]], [[.X...X...X.]], [[.X3.3X3.3X.]], [[.XDXDXDXDX.]], -[[.X2XX2XX2X.]], +[[.X2X.2.X2X.]], [[.XXXDXDXXX.]], -[[.XX.XXX.XX.]], +[[.XX..X..XX.]], [[.X...X...X.]], [[.X3.3X3.3X.]], [[.XXXDXDXXX.]], -[[..XXX1XXX..]], +[[..XX.1.XX..]], [[...XXXXX...]], [[...........]], } \ No newline at end of file diff --git a/game/modules/tome/data/maps/vaults/treasure1.lua b/game/modules/tome/data/maps/vaults/treasure1.lua index 8d0577560e0c4aa1451b7db6c517d53f6a89eb92..8fe9d3e3b3e6c083f893ab9fc4a70f5f01870508 100644 --- a/game/modules/tome/data/maps/vaults/treasure1.lua +++ b/game/modules/tome/data/maps/vaults/treasure1.lua @@ -34,7 +34,7 @@ return { [[;########!!########;]], [[;#..#...+XX+...#..#;]], [[;#..+...#XX#...+..#;]], -[[;##+##.+#++#+.##+##;]], +[[;##+##.##++##.##+##;]], [[;#...###....###...#;]], [[;#...+X######X+...#;]], [[;#.#+#XX+XX+XX#+#.#;]], diff --git a/game/modules/tome/data/maps/vaults/troll-hideout-dark.lua b/game/modules/tome/data/maps/vaults/troll-hideout-dark.lua index 4601ee371de5eb2d28ca661a77f1391b45d843ff..768eff6c53d3bc875c69445cbc0267e8d31ecf49 100644 --- a/game/modules/tome/data/maps/vaults/troll-hideout-dark.lua +++ b/game/modules/tome/data/maps/vaults/troll-hideout-dark.lua @@ -39,14 +39,14 @@ return { [[,XX~#####~,,~#####~,,,]], [[,XX~#...#~~~~#...#~,X,]], [[,XX~#.t.######.t.#~,,,]], -[[,,X~#...#.t..#...#~,X,]], -[[,XX~####+..t.+####~,,,]], +[[,,X~#...#.t..+...#~,X,]], +[[,XX~###+#..t.#####~,,,]], [[,XX~~~#....#####~~~,,,]], [[,,,..t+....#$$$#~,,,X,]], [[,,,..t+....+$$T#~,,,X,]], [[,XX~~~#....#####~~~,X,]], -[[,,X~####+....+####~,X,]], -[[,,X~#...#....#...#~,X,]], +[[,,X~###+#....#####~,X,]], +[[,,X~#...#....+...#~,X,]], [[,,X~#.t.######.t.#~,,,]], [[,XX~#...#~~~~#...#~,,,]], [[,,X~#####~,,~#####~,,,]], diff --git a/game/modules/tome/data/maps/vaults/troll-hideout.lua b/game/modules/tome/data/maps/vaults/troll-hideout.lua index d29b002c4034db9584f8b118227e4f298111b4b1..8226c78d05fbf039433ee27f2a41869195013317 100644 --- a/game/modules/tome/data/maps/vaults/troll-hideout.lua +++ b/game/modules/tome/data/maps/vaults/troll-hideout.lua @@ -39,14 +39,14 @@ return { [[,XX~#####~,,~#####~,,,]], [[,XX~#...#~~~~#...#~,X,]], [[,XX~#.t.######.t.#~,,,]], -[[,,X~#...#.t..#...#~,X,]], -[[,XX~####+..t.+####~,,,]], +[[,,X~#...#.t..+...#~,X,]], +[[,XX~###+#..t.#####~,,,]], [[,XX~~~#....#####~~~,,,]], [[,,,..t+....#$$$#~,,,X,]], [[,,,..t+....+$$T#~,,,X,]], [[,XX~~~#....#####~~~,X,]], -[[,,X~####+....+####~,X,]], -[[,,X~#...#....#...#~,X,]], +[[,,X~###+#....#####~,X,]], +[[,,X~#...#....+...#~,X,]], [[,,X~#.t.######.t.#~,,,]], [[,XX~#...#~~~~#...#~,,,]], [[,,X~#####~,,~#####~,,,]], diff --git a/game/modules/tome/data/maps/zones/tannen-tower-2.lua b/game/modules/tome/data/maps/zones/tannen-tower-2.lua index 5241cf49b5c61d1c2bff563a72bd71da0c0202a9..2c7bc71de35f9fc971bc37d8df141c1db0114423 100644 --- a/game/modules/tome/data/maps/zones/tannen-tower-2.lua +++ b/game/modules/tome/data/maps/zones/tannen-tower-2.lua @@ -42,8 +42,8 @@ XXX..XX.....X.....XX..XXX XXX.XX......+......XX.XXX XX..X.......X.......X..XX XX.XX.......X.......XX.XX -XX.X.......XXX.......X.XX -X..X......+X.XX......X..X +XX.X......XXXX.......X.XX +X..X......+..XX......X..X X.XX.....XX...XX.....XX.X X.XXXXXXXX..<..XXX+XXXX.X X.XX.....XX...XX.....XX.X diff --git a/game/modules/tome/data/maps/zones/tannen-tower-4.lua b/game/modules/tome/data/maps/zones/tannen-tower-4.lua index f5d00b3ac3b7261de589d4ef2210371faf0edc14..350686364af88e82596f4300afebe68f74a8175b 100644 --- a/game/modules/tome/data/maps/zones/tannen-tower-4.lua +++ b/game/modules/tome/data/maps/zones/tannen-tower-4.lua @@ -71,9 +71,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX.+.+.XXXXXXXXXX XXXXXXX....X+X....XXXXXXX XXXXX...X+XX.XXXX...XXXXX -XXXX..XX# #X.X!~XXX..XXXX -XXX..XXX# #X.XU!~!+X..XXX -XXX.XX### #X.X!~!U!+X.XXX +XXXX..XX# #X.X!~X+X..XXXX +XXX..XXX# #X.XU!~!XX..XXX +XXX.XX### #X.X!~!U!XX.XXX XX..X## #X.X~!U!~!X..XX XX.XX# #X.X!~!~!UXX.XX XX.XX# " #X.XU!~!U!~X.XX diff --git a/src/map.c b/src/map.c index 828873357dfef0b6929e5b5e7a8d352c6560f5e7..dbfc5b0bc1fa812e640b996f11da28eeb2fa652f 100644 --- a/src/map.c +++ b/src/map.c @@ -688,11 +688,11 @@ static int map_set_scroll(lua_State *L) } -inline void display_map_quad(map_type *map, int dx, int dy, float dz, map_object *m, int i, int j, float a, bool obscure, int nb_keyframes) ALWAYS_INLINE; -void display_map_quad(map_type *map, int dx, int dy, float dz, map_object *m, int i, int j, float a, bool obscure, int nb_keyframes) +inline void display_map_quad(map_type *map, int dx, int dy, float dz, map_object *m, int i, int j, float a, float seen, int nb_keyframes) ALWAYS_INLINE; +void display_map_quad(map_type *map, int dx, int dy, float dz, map_object *m, int i, int j, float a, float seen, int nb_keyframes) { float r, g, b; - if (!obscure) + if (seen) { if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) { @@ -702,6 +702,9 @@ void display_map_quad(map_type *map, int dx, int dy, float dz, map_object *m, in { r = map->shown_r; g = map->shown_g; b = map->shown_b; } + r *= seen; + g *= seen; + b *= seen; } else { @@ -751,7 +754,7 @@ void display_map_quad(map_type *map, int dx, int dy, float dz, map_object *m, in animdx = map->tile_w * (adx * step / (float)m->move_max - adx); animdy = map->tile_h * (ady * step / (float)m->move_max - ady); tglColor4f(r, g, b, a * 2 / (3 + z)); - DO_QUAD(dx + m->dx + animdx, dy + m->dy + animdy, 0, m->scale); + DO_QUAD(dx + m->dx * map->tile_w + animdx, dy + m->dy * map->tile_h + animdy, 0, m->scale); } } } @@ -764,7 +767,7 @@ void display_map_quad(map_type *map, int dx, int dy, float dz, map_object *m, in // Final display tglColor4f(r, g, b, a); - DO_QUAD(dx + m->dx + animdx, dy + m->dy + animdy, 0, m->scale); + DO_QUAD(dx + m->dx * map->tile_w + animdx, dy + m->dy * map->tile_h + animdy, 0, m->scale); // Unbind any shaders if (m->shader) glUseProgramObjectARB(0); @@ -785,9 +788,9 @@ static int map_to_screen(lua_State *L) for (z = 0; z < map->zdepth; z++) { - for (i = map->mx; i < map->mx + map->mwidth; i++) + for (j = map->my; j < map->my + map->mheight; j++) { - for (j = map->my; j < map->my + map->mheight; j++) + for (i = map->mx; i < map->mx + map->mwidth; i++) { if ((i < 0) || (j < 0) || (i >= map->w) || (j >= map->h)) continue; @@ -800,11 +803,11 @@ static int map_to_screen(lua_State *L) { if (map->grids_seens[i][j]) { - display_map_quad(map, dx, dy, z, mo, i, j, map->shown_a * map->grids_seens[i][j], FALSE, nb_keyframes); + display_map_quad(map, dx, dy, z, mo, i, j, map->shown_a, map->grids_seens[i][j], nb_keyframes); } else { - display_map_quad(map, dx, dy, z, mo, i, j, map->obscure_a, TRUE, nb_keyframes); + display_map_quad(map, dx, dy, z, mo, i, j, map->obscure_a, 0, nb_keyframes); } } }