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

Greater Checkerboard vault has had a revolution! It now features a new sort of...

Greater Checkerboard vault has had a revolution! It now features a new sort of incredible new mechanical contraptions: doors!
parent f6473201
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ specialList("actor", {
})
border = 0
defineTile('.', "FLOOR")
defineTile('#', "WALL")
defineTile('#', "DOOR")
defineTile('X', "HARDWALL")
defineTile('8', "FLOOR", {random_filter={add_levels=15, tome_mod="gvault"}}, {random_filter={add_levels=50}})
......
......@@ -25,8 +25,8 @@ load("/data/general/grids/mountain.lua")
newEntity{ base = "GENERIC_LEVER",
define_as = "GENERIC_LEVER_SAND",
subtype = "sand",
image = "terrain/sandfloor.png",
subtype = "floor",
image = "terrain/bamboo/hut_dirt_floor_01.png",
}
newEntity{
......@@ -96,6 +96,7 @@ newEntity{
always_remember = true,
block_sight = true,
is_door = true,
is_roost_entrance = true,
door_opened = "FENCE_DOOR_OPEN",
dig = "FLOOR",
}
......@@ -112,3 +113,39 @@ newEntity{ base = "FENCE_DOOR", define_as = "FENCE_DOOR_HORIZ", add_displays = {
newEntity{ base = "FENCE_DOOR_OPEN", define_as = "FENCE_DOOR_HORIZ_OPEN", add_displays = {class.new{image="terrain/bamboo/hut_door_hor_open_door_palm_leaves_01.png"}, class.new{image="terrain/bamboo/hut_door_hor_open_door_01.png", z=17}, class.new{image="terrain/bamboo/hut_wall_top_hor_01.png", z=18, display_y=-1}}, door_closed = "FENCE_DOOR_HORIZ"}
newEntity{ base = "FENCE_DOOR", define_as = "FENCE_DOOR_VERT", add_displays = {class.new{image="terrain/bamboo/palm_door_closed_ver_01.png"}, class.new{image="terrain/bamboo/hut_wall_full_hor_01.png", z=18}}, door_opened = "FENCE_DOOR_OPEN_VERT", dig = "FENCE_DOOR_OPEN_VERT"}
newEntity{ base = "FENCE_DOOR_OPEN", define_as = "FENCE_DOOR_OPEN_VERT", add_displays = {class.new{image="terrain/bamboo/palm_door_open_bottom_ver_01.png"}, class.new{image="terrain/bamboo/palm_door_open_top_ver_01.png", z=18, display_y=-1, add_mos={{image="terrain/bamboo/hut_wall_full_hor_01.png"}, {image="terrain/bamboo/palm_door_open_bottom_ver_door_01.png"}}}}, door_closed = "FENCE_DOOR_VERT"}
newEntity{
define_as = "ROCK_LEVER_DOOR",
type = "wall", subtype = "sand",
name = "huge loose rock", image = "terrain/sandfloor.png", add_displays = {class.new{z=18, image="terrain/huge_rock.png"}},
display = '+', color=colors.GREY, back_color={r=44,g=95,b=43},
notice = true,
always_remember = true,
block_sight = true,
block_sense = true,
block_esp = true,
door_player_stop = "This rock seems to have been sealed off. You need to find a way to open it.",
is_door = true,
door_opened = "FLOOR",
on_lever_change = function(self, x, y, who, val, oldval)
local toggle = game.level.map.attrs(x, y, "lever_toggle")
local trigger = game.level.map.attrs(x, y, "lever_action") or 1
if toggle or (val > oldval and val >= trigger) then
game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened])
game.log("#VIOLET#You hear a rock crumbling opening.")
return true
end
end,
}
newEntity{
define_as = "ROCK_DOOR",
type = "wall", subtype = "sand",
name = "huge loose rock", image = "terrain/sandfloor.png", add_displays = {class.new{z=18, image="terrain/huge_rock.png"}},
display = '+', color=colors.GREY, back_color={r=44,g=95,b=43},
notice = true,
always_remember = true,
block_sight = true,
is_door = true,
door_opened = "FLOOR",
}
......@@ -18,17 +18,18 @@
-- darkgod@te4.org
self:defineTile("|", "FENCE_WALL")
self:defineTile(":", "FENCE_FLOOR")
self:defineTile(":", "FENCE_FLOOR", nil, nil, nil, {special="roost"})
self:defineTile("!", "FENCE_DOOR")
self:defineTile("/", "ROCK_DOOR")
self:defineTile("-", "FLOOR", nil, nil, nil, {no_teleport=true})
self:defineTile("o", "FLOOR", nil, {entity_mod=function(e) e.make_escort = nil return e end, random_filter={type='humanoid', subtype='orc', special=function(e) return e.pride == mapdata.pride end}})
if level.level == zone.max_level then self:defineTile(">", 'FLOOR') else self:defineTile(">", "FLAT_DOWN4", nil, nil, nil, {no_teleport=true}) end
self:defineTile("O", "FLOOR", nil, {random_filter={type='humanoid', subtype='orc', special=function(e) return e.pride == mapdata.pride end, random_boss={nb_classes=1, loot_quality="store", loot_quantity=3, ai_move="move_complex", rank=4,}}})
self:defineTile("X", "FLOOR", nil, {entity_mod=function(e) e.make_escort = nil return e end, random_filter={type='humanoid', subtype='orc', special=function(e) return e.pride == mapdata.pride end, random_boss={nb_classes=1, loot_quality="store", loot_quantity=1, no_loot_randart=true, ai_move="move_complex", rank=3}}}, nil, {no_teleport=true})
self:defineTile("D", "FENCE_FLOOR", nil, {entity_mod=function(e) e.make_escort = nil return e end, random_filter={type='dragon', random_boss={nb_classes=1, loot_quality="store", loot_quantity=1, no_loot_randart=true, ai_move="move_complex", rank=3.5}}}, nil, {no_teleport=true})
self:defineTile('&', "GENERIC_LEVER", nil, nil, nil, {lever=1, lever_kind="pride-doors", lever_spot={type="lever", subtype="door", check_connectivity="entrance"}}, {type="lever", subtype="lever", check_connectivity="entrance"})
self:defineTile('*', "GENERIC_LEVER_DOOR", nil, nil, nil, {lever_action=2, lever_action_value=0, lever_action_kind="pride-doors"}, {type="lever", subtype="door", check_connectivity="entrance"})
self:defineTile("d", "FENCE_FLOOR", nil, {random_filter={special_rarity="drake_rarity"}}, nil, {special="roost"})
self:defineTile("D", "FENCE_FLOOR", nil, {entity_mod=function(e) e.make_escort = nil return e end, random_filter={special_rarity="drake_rarity", special=function(e) return e.rank == 3 end, random_boss={nb_classes=1, loot_quality="store", loot_quantity=1, no_loot_randart=true, ai_move="move_complex", rank=3.5}}}, nil, {special="roost"})
self:defineTile('&', "GENERIC_LEVER_SAND", nil, nil, nil, {special="roost", lever=1, lever_kind="pride-doors", lever_spot={type="lever", subtype="door", check_connectivity="entrance"}}, {type="lever", subtype="lever", check_connectivity="entrance"})
self:defineTile('*', "ROCK_LEVER_DOOR", nil, nil, nil, {lever_action=2, lever_action_value=0, lever_action_kind="pride-doors"}, {type="lever", subtype="door", check_connectivity="entrance"})
local wfc = WaveFunctionCollapse.new{
mode="overlapping",
......@@ -36,21 +37,40 @@ local wfc = WaveFunctionCollapse.new{
size={34, 34},
n=3, symmetry=8, periodic_out=false, periodic_in=false, has_foundation=false
}
local outer = Static.new(self:getFile("pride-outer.lua", "mapscripts/maps"))
local outer = Static.new(self:getFile("!gorbat-outer.lua", "samples"))
tm:merge(1, 1, outer, merge_order)
tm:merge(8, 8, wfc, merge_order)
tm:merge(8, 4, wfc, merge_order)
-- Find rooms
local levers_placed = 0
local rooms = tm:findGroupsOf{':'}
tm:applyOnGroups(rooms, function(room, idx)
-- tm:fillGroup(room, '.')
local border = tm:getBorderGroup(room)
tm:fillGroup(border, '|') -- Make sure we have walls all around
local door = border:pickSpot("inside-wall", "straight", function(p) return tm:isA(p, '#', '|') end)
if door then tm:put(door, '!') end
local drake = room:pickSpot("any")
if drake then tm:put(drake, 'D') end
local lever = room:pickSpot("any")
if lever and levers_placed < 2 then
levers_placed = levers_placed + 1
tm:put(lever, '&')
end
-- Drakes are not out in the wild in gorbat, they are in the roosts; sometimes there is one more powerful too
local had_boss = false
for i = 1, rng.range(1, 5) do
local drake = room:pickSpot("any")
if drake then
local boss = rng.percent(25) and not had_boss
tm:put(drake, boss and 'D' or 'd')
room:remove(drake)
if boss then had_boss = true end
else
break
end
end
end)
if levers_placed < 2 then return self:regenerate() end
-- Complete the map by putting wall in all the remaining blank spaces
tm:fillAll()
......
......@@ -19,11 +19,12 @@
load("/data/general/npcs/orc.lua", rarity(3))
load("/data/general/npcs/orc-gorbat.lua", rarity(0))
load("/data/general/npcs/cold-drake.lua", rarity(5))
load("/data/general/npcs/storm-drake.lua", rarity(5))
load("/data/general/npcs/fire-drake.lua", rarity(5))
load("/data/general/npcs/venom-drake.lua", rarity(5))
load("/data/general/npcs/multihued-drake.lua", rarity(8))
load("/data/general/npcs/cold-drake.lua", function(e) e.drake_rarity, e.rarity = e.rarity, nil end)
load("/data/general/npcs/storm-drake.lua", function(e) e.drake_rarity, e.rarity = e.rarity, nil end)
load("/data/general/npcs/fire-drake.lua", function(e) e.drake_rarity, e.rarity = e.rarity, nil end)
load("/data/general/npcs/venom-drake.lua", function(e) e.drake_rarity, e.rarity = e.rarity, nil end)
load("/data/general/npcs/multihued-drake.lua", function(e) e.drake_rarity, e.rarity = e.rarity, nil end)
load("/data/general/npcs/wild-drake.lua", function(e) e.drake_rarity, e.rarity = e.rarity, nil end)
load("/data/general/npcs/all.lua", rarity(4, 35))
......
......@@ -24,7 +24,7 @@ return {
max_level = 3,
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 = 50, height = 50,
width = 50, height = 40,
persistent = "zone",
-- all_remembered = true,
all_lited = true,
......@@ -37,14 +37,14 @@ return {
map = {
class = "engine.generator.map.MapScript",
['<'] = "FLAT_UP6", ['>'] = "FLAT_DOWN4",
['.'] = "FLOOR", ['+'] = "DOOR", ['#'] = "WALL",
['.'] = "FLOOR", ['+'] = "DOOR", ['#'] = "HARDMOUNTAIN_WALL",
['_'] = "SAND",
[';'] = "SAND",
['^'] = "MOUNTAIN_WALL",
['='] = "DEEP_WATER",
door = "DOOR",
mapscript = "!main",
pride = "vor",
pride = "gorbat",
},
actor = {
class = "mod.class.generator.actor.Random",
......
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