Skip to content
Snippets Groups Projects
Commit 77b7890d authored by DarkGod's avatar DarkGod
Browse files

transfered psicave to main game assets

new mapscript lib to add a subvault easily
parent 009517d1
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing
with 153 additions and 8 deletions
...@@ -42,7 +42,15 @@ end ...@@ -42,7 +42,15 @@ end
function _M:resolve(c, list, force) function _M:resolve(c, list, force)
if force then return Generator.resolve(self, c, list, force) end if force then return Generator.resolve(self, c, list, force) end
if self.self_tiles[c] then if self.self_tiles[c] then
return Generator.resolve(self, self.self_tiles[c].grid or '.', list, true) if type(self.self_tiles[c].grid) == "table" and self.self_tiles[c].grid.__ATOMIC then
local res = self.self_tiles[c].grid
if res.force_clone then res = res:clone() end
res:resolve()
res:resolve(nil, true)
return res
else
return Generator.resolve(self, self.self_tiles[c].grid or '.', list, true)
end
else else
return Generator.resolve(self, c, list, force) return Generator.resolve(self, c, list, force)
end end
......
...@@ -3123,11 +3123,15 @@ function _M:dynamicZoneEntry(g, id, zone_def, zone_lists, zone_alter) ...@@ -3123,11 +3123,15 @@ function _M:dynamicZoneEntry(g, id, zone_def, zone_lists, zone_alter)
def.__embed_lists_def = self.dynamic_zone.lists def.__embed_lists_def = self.dynamic_zone.lists
if self.dynamic_zone.alter then if self.dynamic_zone.alter then
def.__alter_back_def = {short_name=game.zone.short_name, name=game.zone.name} def.__alter_back_def = {short_name=game.zone.short_name, name=game.zone.name}
def.__alter_back_fct = function(backdef, name, base_terrain) def.__alter_back_fct = function(zone, backdef, name, base_terrain)
base_terrain.change_level_shift_back = true local terrain = base_terrain:cloneFull()
base_terrain.change_zone_auto_stairs = true terrain.change_level_shift_back = true
base_terrain.name = name:format(backdef.name) terrain.change_zone_auto_stairs = true
base_terrain.change_zone = backdef.short_name terrain.name = name:format(backdef.name)
terrain.change_zone = backdef.short_name
terrain.define_as = "DYNAMIC_ZONE_EXIT"
terrain:altered()
zone.grid_list.DYNAMIC_ZONE_EXIT = terrain
end end
def.__alter_back_custom = self.dynamic_zone.alter def.__alter_back_custom = self.dynamic_zone.alter
end end
...@@ -3153,7 +3157,7 @@ function _M:dynamicZoneEntry(g, id, zone_def, zone_lists, zone_alter) ...@@ -3153,7 +3157,7 @@ function _M:dynamicZoneEntry(g, id, zone_def, zone_lists, zone_alter)
-- Alter whatever we need. Most likely the exit, so we provide an easy function for that -- Alter whatever we need. Most likely the exit, so we provide an easy function for that
if zone.__alter_back_fct then if zone.__alter_back_fct then
zone.__alter_back_custom(zone, function(name, base_terrain) zone.__alter_back_fct(zone.__alter_back_def, name, base_terrain) end) zone.__alter_back_custom(zone, function(name, base_terrain) zone:__alter_back_fct(zone.__alter_back_def, name, base_terrain) end)
end end
end end
return mod.class.Zone.new(self.dynamic_zone.id, def) return mod.class.Zone.new(self.dynamic_zone.id, def)
......
...@@ -1221,6 +1221,30 @@ grass_wm = { method="borders", type="grass", forbid={lava=true, rock=true}, ...@@ -1221,6 +1221,30 @@ grass_wm = { method="borders", type="grass", forbid={lava=true, rock=true},
default7i={add_mos={{image="terrain/grass_worldmap/grass_inner_7_%02d.png", display_x=-1, display_y=-1}}, min=1, max=2}, default7i={add_mos={{image="terrain/grass_worldmap/grass_inner_7_%02d.png", display_x=-1, display_y=-1}}, min=1, max=2},
default9i={add_mos={{image="terrain/grass_worldmap/grass_inner_9_%02d.png", display_x=1, display_y=-1}}, min=1, max=2}, default9i={add_mos={{image="terrain/grass_worldmap/grass_inner_9_%02d.png", display_x=1, display_y=-1}}, min=1, max=2},
}, },
psitechwall = { method="walls", type="psitechwall", forbid={}, use_type=true, extended=true, consider_diagonal_doors=true,
default8={add_displays={{image="terrain/psicave/psitechwall_8_%d.png", display_y=-1, z=16}}, min=1, max=1},
default8p={add_displays={{image="terrain/psicave/psitech_V3_pillar_top_0%d.png", display_y=-1, z=16}}, min=1, max=1},
default7={add_displays={{image="terrain/psicave/psitech_V3_inner_7_01.png", display_y=-1, z=16}}, min=1, max=1},
default9={add_displays={{image="terrain/psicave/psitech_V3_inner_9_01.png", display_y=-1, z=16}}, min=1, max=1},
default7i={add_displays={{image="terrain/psicave/psitech_V3_3_01.png", display_y=-1, z=16}}, min=1, max=1},
default8i={add_displays={{image="terrain/psicave/psitechwall_8h_1.png", display_y=-1, z=16}}, min=1, max=1},
default9i={add_displays={{image="terrain/psicave/psitech_V3_1_01.png", display_y=-1, z=16}}, min=1, max=1},
default73i={add_displays={{image="terrain/psicave/psitechwall_91d_1.png", display_y=-1, z=16}}, min=1, max=1},
default91i={add_displays={{image="terrain/psicave/psitechwall_73d_1.png", display_y=-1, z=16}}, min=1, max=1},
default2={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_V3_8_0%d.png"}}, min=1, max=3},
default2p={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_V3_pillar_bottom_0%d.png"}}, min=1, max=3},
default1={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_V3_inner_1_01.png"}}, min=1, max=1},
default3={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_V3_inner_3_01.png"}}, min=1, max=1},
default1i={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_V3_7_01.png"}}, min=1, max=1},
default2i={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitechwall_2h_1.png"}}, min=1, max=1},
default3i={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_V3_9_01.png"}}, min=1, max=1},
default19i={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitechwall_19d_1.png"}}, min=1, max=1},
default37i={image="terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitechwall_37d_1.png"}}, min=1, max=1},
default4={add_displays={{image="terrain/psicave/psitech_ver_edge_left_01.png", display_x=-1}}, min=1, max=1},
default6={add_displays={{image="terrain/psicave/psitech_ver_edge_right_01.png", display_x=1}}, min=1, max=1},
},
} }
_M.generic_borders_defs = defs _M.generic_borders_defs = defs
......
...@@ -47,7 +47,7 @@ local g = game.state:dynamicZoneEntry(game.level.map(x, y, engine.Map.TERRAIN):c ...@@ -47,7 +47,7 @@ local g = game.state:dynamicZoneEntry(game.level.map(x, y, engine.Map.TERRAIN):c
min_floor = 1200, min_floor = 1200,
floor = "CAVEFLOOR", floor = "CAVEFLOOR",
wall = "CAVEWALL", wall = "CAVEWALL",
up = "CAVE_LADDER_UP_WILDERNESS", up = "DYNAMIC_ZONE_EXIT",
door = "CAVEFLOOR", door = "CAVEFLOOR",
}, },
actor = { actor = {
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2019 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
local psitech_wall_editer = { method="sandWalls_def", def="psitechwall"}
newEntity{
define_as = "PSYCAVEFLOOR",
type = "floor", subtype = "psitech",
name = "psitech floor", image = "terrain/psicave/psitech_floor_1_01.png",
display = '.', color=colors.SANDY_BROWN, back_color=colors.DARK_UMBER,
grow = "PSYCAVEWALL",
nice_tiler = { method="replace", base={"PSYCAVEFLOOR", 100, 1, 5}},
}
for i = 1, 5 do newEntity{ base = "PSYCAVEFLOOR", define_as = "PSYCAVEFLOOR"..i, image = "terrain/psicave/psitech_floor_"..i.."_01.png"} end
newEntity{
define_as = "PSYCAVEWALL",
type = "wall", subtype = "psitech",
name = "psitech walls", image = "terrain/psicave/psitechwall_5_1.png",
display = '#', color={r=203,g=189,b=72}, back_color={r=93,g=79,b=22},
always_remember = true,
can_pass = {pass_wall=1},
does_block_move = true,
block_sight = true,
air_level = -10,
dig = "PSYCAVEFLOOR",
nice_editer = psitech_wall_editer,
nice_tiler = { method="replace", base={"PSYCAVEWALL", 100, 1, 9}},
}
for i = 1, 9 do newEntity{ base = "PSYCAVEWALL", define_as = "PSYCAVEWALL"..i, image = "terrain/psicave/psitechwall_5_"..i..".png"} end
-----------------------------------------
-- Doors
-----------------------------------------
newEntity{
define_as = "PSYCAVE_DOOR",
type = "wall", subtype = "psitech",
name = "psitech door", image = "terrain/psicave/psitech_door1.png",
display = '+', color={r=203,g=189,b=72}, back_color={r=93,g=79,b=22},
nice_tiler = { method="door3d", north_south="PSYCAVE_DOOR_VERT", west_east="PSYCAVE_DOOR_HORIZ" },
door_sound = "ambient/door_creaks/icedoor-break",
notice = true,
always_remember = true,
block_sight = true,
is_door = true,
door_opened = "PSYCAVE_DOOR_OPEN",
dig = "FLOOR",
}
newEntity{
define_as = "PSYCAVE_DOOR_OPEN",
type = "wall", subtype = "psitech",
name = "psitech door (open)", image="terrain/psicave/psitech_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 = "PSYCAVE_DOOR",
}
newEntity{ base = "PSYCAVE_DOOR", define_as = "PSYCAVE_DOOR_HORIZ", z=3, image = "terrain/psicave/psitech_door1.png", add_displays = {class.new{image="terrain/psicave/psitechwall_8_1.png", z=18, display_y=-1}}, door_opened = "PSYCAVE_DOOR_HORIZ_OPEN"}
newEntity{ base = "PSYCAVE_DOOR_OPEN", define_as = "PSYCAVE_DOOR_HORIZ_OPEN", image = "terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_door1_open_backg.png"}}, add_displays = {class.new{image="terrain/psicave/psitech_door1_open.png", z=17}, class.new{image="terrain/psicave/psitechwall_8_1.png", z=18, display_y=-1}}, door_closed = "PSYCAVE_DOOR_HORIZ"}
newEntity{ base = "PSYCAVE_DOOR", define_as = "PSYCAVE_DOOR_VERT", image = "terrain/psicave/psitech_floor_1_01.png", add_displays = {class.new{image="terrain/psicave/psitech_door1_vert.png", z=17}, class.new{image="terrain/psicave/psitech_door1_vert_north.png", z=18, display_y=-1}}, door_opened = "PSYCAVE_DOOR_OPEN_VERT", dig = "PSYCAVE_DOOR_OPEN_VERT"}
newEntity{ base = "PSYCAVE_DOOR_OPEN", define_as = "PSYCAVE_DOOR_OPEN_VERT", z=3, image = "terrain/psicave/psitech_floor_1_01.png", add_mos={{image="terrain/psicave/psitech_door1_open_vert_backg.png"}}, add_displays = {class.new{image="terrain/psicave/psitech_door1_open_vert.png", z=17, add_mos={{image="terrain/psicave/psitech_door1_open_vert_north_backg.png", display_y=-1}}}, class.new{image="terrain/psicave/psitech_door1_open_vert_north.png", z=18, display_y=-1}}, door_closed = "PSYCAVE_DOOR_VERT"}
-----------------------------------------
-- Cavy exits
-----------------------------------------
newEntity{
define_as = "PSYCAVE_LADDER_DOWN",
type = "floor", subtype = "psitech",
name = "ladder to the next level", image = "terrain/psicave/psitech_floor_1_01.png", add_displays = {class.new{image="terrain/psicave/psitech_stairs_down_1_01.png"}},
display = '>', color_r=255, color_g=255, color_b=0,
notice = true,
always_remember = true,
change_level = 1,
}
newEntity{
define_as = "PSYCAVE_LADDER_UP",
type = "floor", subtype = "psitech",
name = "ladder to the previous level", image = "terrain/psicave/psitech_floor_1_01.png", add_displays = {class.new{image="terrain/psicave/psitech_stairs_up_1_01.png"}},
display = '<', color_r=255, color_g=255, color_b=0,
notice = true,
always_remember = true,
change_level = -1,
}
newEntity{
define_as = "PSYCAVE_LADDER_UP_WILDERNESS",
type = "floor", subtype = "psitech",
name = "ladder to worldmap", image = "terrain/psicave/psitech_floor_1_01.png", add_displays = {class.new{image="terrain/psicave/psitech_stairs_exit_1_01.png"}},
display = '<', color_r=255, color_g=255, color_b=0,
notice = true,
change_level = 1,
change_zone = "wilderness",
}
game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_1_01.png

32.4 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_3_01.png

32.6 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_7_01.png

33.4 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_8_01.png

39.6 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_8_02.png

39.5 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_8_03.png

39.6 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_8_04.png

39.6 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_8_05.png

39.6 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_9_01.png

33.5 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_inner_1_01.png

31.2 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_inner_3_01.png

31.3 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_inner_7_01.png

33.9 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_inner_9_01.png

33.9 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_pillar_bottom_01.png

31.1 KiB

game/modules/tome/data/gfx/shockbolt/terrain/psicave/psitech_V3_pillar_bottom_02.png

31.2 KiB

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