diff --git a/game/engines/default/engine/generator/map/Static.lua b/game/engines/default/engine/generator/map/Static.lua index 3b5e880f26cc9d517aedfe547423c58beeaf14df..adcc942909fd5ad663d5e9745559875821a31d47 100644 --- a/game/engines/default/engine/generator/map/Static.lua +++ b/game/engines/default/engine/generator/map/Static.lua @@ -110,6 +110,9 @@ function _M:loadMap(file) self.level.custom_zones = self.level.custom_zones or {} self.level.custom_zones[#self.level.custom_zones+1] = zone end, + updateZones = function(type, subtype, update) + for i, z in ipairs(self.level.custom_zones or {}) do update(z) end + end, } setfenv(f, setmetatable(g, {__index=_G})) local ret, err = f() diff --git a/game/modules/tome/class/Grid.lua b/game/modules/tome/class/Grid.lua index 62d4600c45c8909201636c382dc89f77de5b9fec..a66685f4aea3426b3d736271f24c33546847d35d 100644 --- a/game/modules/tome/class/Grid.lua +++ b/game/modules/tome/class/Grid.lua @@ -53,7 +53,7 @@ function _M:block_move(x, y, e, act, couldpass) Dialog:yesnoPopup(self.name, self.door_player_check, function(ret) if ret then game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened]) - game:playSoundNear({x=x,y=y}, {"ambient/door_creaks/creak_%d",1,4}) + game:playSoundNear({x=x,y=y}, self.door_sound or {"ambient/door_creaks/creak_%d",1,4}) if game.level.map.attrs(x, y, "vault_id") and e.openVault then e:openVault(game.level.map.attrs(x, y, "vault_id")) end end @@ -65,7 +65,7 @@ function _M:block_move(x, y, e, act, couldpass) end else game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened]) - game:playSoundNear({x=x,y=y}, {"ambient/door_creaks/creak_%d",1,4}) + game:playSoundNear({x=x,y=y}, self.door_sound or {"ambient/door_creaks/creak_%d",1,4}) if game.level.map.attrs(x, y, "vault_id") and e.openVault then e:openVault(game.level.map.attrs(x, y, "vault_id")) end end diff --git a/game/modules/tome/class/NicerTiles.lua b/game/modules/tome/class/NicerTiles.lua index 1f34e06c3289ca28d23d3a36c4b21eb7c6f654f5..44a7aff34a6826c2f0fa3bf9de0147bb62def630 100644 --- a/game/modules/tome/class/NicerTiles.lua +++ b/game/modules/tome/class/NicerTiles.lua @@ -22,6 +22,8 @@ local Map = require "engine.Map" module(..., package.seeall, class.make) +local NB_VARIATIONS = 1 + function _M:init() self.repo = {} self.repl = {} @@ -634,7 +636,7 @@ cavewall = { method="walls", type="cavewall", forbid={}, use_type=true, extended default4={add_displays={{image="terrain/cave/cave_ver_edge_left_01.png", display_x=-1}}, min=1, max=1}, default6={add_displays={{image="terrain/cave/cave_ver_edge_right_01.png", display_x=1}}, min=1, max=1}, }, -icecavewall = { method="walls", type="icecavewall", forbid={}, use_type=true, extended=true, +icecavewall = { method="walls", type="icecavewall", forbid={}, use_type=true, extended=true, consider_diagonal_doors=true, default8={add_displays={{image="terrain/icecave/icecavewall_8_%d.png", display_y=-1, z=16}}, min=1, max=3}, default8p={add_displays={{image="terrain/icecave/icecave_V3_pillar_top_0%d.png", display_y=-1, z=16}}, min=1, max=1}, default7={add_displays={{image="terrain/icecave/icecave_V3_inner_7_01.png", display_y=-1, z=16}}, min=1, max=1}, @@ -734,7 +736,7 @@ function _M:editTileGenericBorders(level, i, j, g, nt, type) if nt.forbid[g9] then g9 = type end end - local id = rng.range(1,100).."genbord:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g3==g5),tostring(g4==g5),tostring(g5==g5),tostring(g6==g5),tostring(g7==g5),tostring(g8==g5),tostring(g9==g5)}, ",") + local id = rng.range(1,NB_VARIATIONS).."genbord:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g3==g5),tostring(g4==g5),tostring(g5==g5),tostring(g6==g5),tostring(g7==g5),tostring(g8==g5),tostring(g9==g5)}, ",") -- Sides if g5 ~= g8 then self:edit(i, j, id, nt[g8.."8"] or nt["default8"]) end @@ -777,7 +779,7 @@ function _M:editTileGenericWalls(level, i, j, g, nt, type) if nt.forbid[g9] then g9 = type end end - local id = rng.range(1,100).."genwall:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g3==g5),tostring(g4==g5),tostring(g5==g5),tostring(g6==g5),tostring(g7==g5),tostring(g8==g5),tostring(g9==g5)}, ",") + local id = rng.range(1,NB_VARIATIONS).."genwall:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g3==g5),tostring(g4==g5),tostring(g5==g5),tostring(g6==g5),tostring(g7==g5),tostring(g8==g5),tostring(g9==g5)}, ",") -- Sides if g5 ~= g8 then self:edit(i, j, id, nt[g8.."8"] or nt["default8"]) end @@ -839,7 +841,7 @@ function _M:editTileGenericSandWalls(level, i, j, g, nt, type) if nt.forbid[g9] then g9 = type end end - local id = rng.range(1,100).."sandwall:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g3==g5),tostring(g4==g5),tostring(g5==g5),tostring(g6==g5),tostring(g7==g5),tostring(g8==g5),tostring(g9==g5)}, ",") + local id = rng.range(1,NB_VARIATIONS).."sandwall:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g3==g5),tostring(g4==g5),tostring(g5==g5),tostring(g6==g5),tostring(g7==g5),tostring(g8==g5),tostring(g9==g5)}, ",") -- Sides if g5 ~= g8 and g5 ~= g7 and g5 ~= g9 then @@ -902,7 +904,7 @@ function _M:editTileSingleWall(level, i, j, g, nt, type) local g4 = level.map:checkEntity(i-1, j, Map.TERRAIN, kind) or type local g6 = level.map:checkEntity(i+1, j, Map.TERRAIN, kind) or type - local id = rng.range(1,100).."swv:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g8==g5),tostring(g4==g5),tostring(g6==g5)}, ",") + local id = rng.range(1,NB_VARIATIONS).."swv:"..table.concat({g.define_as or "--",type,tostring(g1==g5),tostring(g2==g5),tostring(g8==g5),tostring(g4==g5),tostring(g6==g5)}, ",") if g5 ~= g4 and g5 == g6 and g5 == g8 and g5 == g2 then self:edit(i, j, id, nt["e_cross"]) elseif g5 == g4 and g5 ~= g6 and g5 == g8 and g5 == g2 then self:edit(i, j, id, nt["w_cross"]) diff --git a/game/modules/tome/data/general/grids/icecave.lua b/game/modules/tome/data/general/grids/icecave.lua index e3940b1c2e5be09de7d2aa1e4d525ee8241a0025..9f7423277326b39618db7d0f78cada03db21cca5 100644 --- a/game/modules/tome/data/general/grids/icecave.lua +++ b/game/modules/tome/data/general/grids/icecave.lua @@ -49,6 +49,37 @@ newEntity{ } for i = 1, 8 do newEntity{ base = "ICECAVEWALL", define_as = "ICECAVEWALL"..i, image = "terrain/icecave/icecavewall_5_"..i..".png"} end +----------------------------------------- +-- Doors +----------------------------------------- +newEntity{ + define_as = "ICECAVE_DOOR", + type = "wall", subtype = "icecave", + name = "breakable ice wall", image = "terrain/icecave/icecave_door1.png", + display = '+', color={r=203,g=189,b=72}, back_color={r=93,g=79,b=22}, + nice_tiler = { method="door3d", north_south="ICECAVE_DOOR_VERT", west_east="ICECAVE_DOOR_HORIZ" }, + door_sound = "ambient/door_creaks/icedoor-break", + notice = true, + always_remember = true, + block_sight = true, + is_door = true, + door_opened = "ICECAVE_DOOR_OPEN", + dig = "FLOOR", +} +newEntity{ + define_as = "ICECAVE_DOOR_OPEN", + type = "wall", subtype = "icecave", + name = "broken ice wall", image="terrain/icecave/icecave_door1_open.png", + display = "'", color_r=238, color_g=154, color_b=77, back_color=colors.DARK_GREY, + always_remember = true, + is_door = true, + door_closed = "ICECAVE_DOOR", +} +newEntity{ base = "ICECAVE_DOOR", define_as = "ICECAVE_DOOR_HORIZ", z=3, image = "terrain/icecave/icecave_door1.png", add_displays = {class.new{image="terrain/icecave/icecavewall_8_2.png", z=18, display_y=-1}}, door_opened = "ICECAVE_DOOR_HORIZ_OPEN"} +newEntity{ base = "ICECAVE_DOOR_OPEN", define_as = "ICECAVE_DOOR_HORIZ_OPEN", image = "terrain/icecave/icecave_door1.png", add_displays = {class.new{image="terrain/icecave/icecave_door1_open.png", z=17}, class.new{image="terrain/icecave/icecavewall_8_2.png", z=18, display_y=-1}}, door_closed = "ICECAVE_DOOR_HORIZ"} +newEntity{ base = "ICECAVE_DOOR", define_as = "ICECAVE_DOOR_VERT", image = "terrain/icecave/icecave_door1.png", add_displays = {class.new{image="terrain/icecave/icecave_door1_vert.png", z=17}, class.new{image="terrain/icecave/icecave_door1_vert_north.png", z=18, display_y=-1}}, door_opened = "ICECAVE_DOOR_OPEN_VERT", dig = "ICECAVE_DOOR_OPEN_VERT"} +newEntity{ base = "ICECAVE_DOOR_OPEN", define_as = "ICECAVE_DOOR_OPEN_VERT", image = "terrain/icecave/icecave_door1.png", add_displays = {class.new{image="terrain/icecave/icecave_door1_open_vert.png", z=17}, class.new{image="terrain/icecave/icecave_door1_open_vert_north.png", z=18, display_y=-1}}, door_closed = "ICECAVE_DOOR_VERT"} + ----------------------------------------- -- Cavy exits ----------------------------------------- diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1.png b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1.png new file mode 100644 index 0000000000000000000000000000000000000000..99652484f2b90344f5b3e6415053fdb65751bc88 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open.png b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open.png new file mode 100644 index 0000000000000000000000000000000000000000..86dedd2a629162459d6eb34443a3ad1f08d90eca Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open_vert.png b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open_vert.png new file mode 100644 index 0000000000000000000000000000000000000000..1a04c9e7ac9dc4ab73edd852905f7643da35fec5 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open_vert.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open_vert_north.png b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open_vert_north.png new file mode 100644 index 0000000000000000000000000000000000000000..2648471efa63ec16728f01a485a67c4a0046a16f Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_open_vert_north.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_vert.png b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_vert.png new file mode 100644 index 0000000000000000000000000000000000000000..505aa408317a2194c292138bc5128db746111658 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_vert.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_vert_north.png b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_vert_north.png new file mode 100644 index 0000000000000000000000000000000000000000..8e43b1181614a3cfad3f9348f2f51769bcebbc2a Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/terrain/icecave/icecave_door1_vert_north.png differ diff --git a/game/modules/tome/data/maps/wilderness/eyal.lua b/game/modules/tome/data/maps/wilderness/eyal.lua index 5199efe644ed2f4689112ce49516c99179c8b029..e7cc6edb07107e0dc72f7ab9e964d08470edf864 100644 --- a/game/modules/tome/data/maps/wilderness/eyal.lua +++ b/game/modules/tome/data/maps/wilderness/eyal.lua @@ -102,6 +102,7 @@ prepareEntitiesList("fareast_encounters", "mod.class.Encounter", "/data/general/ prepareEntitiesList("fareast_encounters_npcs", "mod.class.WorldNPC", "/data/general/encounters/fareast-npcs.lua") addData{ wda = { script="eyal", zones={} }, + auto_placelists = { "maj_eyal_encounters", "fareast_encounters" }, } diff --git a/game/modules/tome/data/sound/ambient/door_creaks/icedoor-break.ogg b/game/modules/tome/data/sound/ambient/door_creaks/icedoor-break.ogg new file mode 100644 index 0000000000000000000000000000000000000000..ff13af2e53eded90c608418b82a66aa2950c6e4f Binary files /dev/null and b/game/modules/tome/data/sound/ambient/door_creaks/icedoor-break.ogg differ diff --git a/game/modules/tome/data/zones/wilderness/zone.lua b/game/modules/tome/data/zones/wilderness/zone.lua index 93d0c28673a37b1857417bb16ad9a44d9785f960..aa030e242ec97c6a16fe7f306b58ad01e205f98c 100644 --- a/game/modules/tome/data/zones/wilderness/zone.lua +++ b/game/modules/tome/data/zones/wilderness/zone.lua @@ -75,8 +75,9 @@ return { end end end - place_list(game.level:getEntitiesList("maj_eyal_encounters")) - place_list(game.level:getEntitiesList("fareast_encounters")) + for i, name in ipairs(level.data.auto_placelists or {}) do + place_list(game.level:getEntitiesList(name)) + end -- Create the glow level.entrance_glow = require("engine.Particles").new("starglow", 1, {})