Skip to content

Instantly share code, notes, and snippets.

@sandstrand
Last active November 8, 2016 20:48
Show Gist options
  • Save sandstrand/5491b134a44789296bf0382d64afec24 to your computer and use it in GitHub Desktop.
Save sandstrand/5491b134a44789296bf0382d64afec24 to your computer and use it in GitHub Desktop.
local dungeon_styles= {
{
-- tower of hera
-- palette = 'dungeon.tower_of_hera.1';
tier_introduction = 3,
tileset = 'dungeon.tower_of_hera',
floor = {
scope = 'room',
{
high = { 'floor.a.12.high', 'floor.a.6.high' },
low = { 'floor.a.13.low.' },
p = 0.75,
},
{
high = { 'floor.b.12.high', },
low = { 'floor.a.13.low', },
p = 0.25,
},
},
wall_pillars = {
scope = 'room',
{
socket = { 'pillar.4', },
socketless = { 'pillar.4.socketless' },
}
},
drapes = {
scope = 'room',
{ nil },
statues = {
scope = 'room',
{ 'statue.1', p = 0.25 },
{ 'statue.2'},
},
wall_statues = {
scope = 'room',
{ 'wall_statue.6' },
},
barrier = {
scope = 'dungeon',
{ 'barrier.1' },
},
hole = {
scope = 'room',
{ 'hole' },
}
big_barrier = {
scope = 'dungeon',
{ 'big_barrier.3' },
},
stage = {
scope = 'dungeon',
{ 'stage.1' },
},
entrance = {
scope = 'dungeon',
{ 'entrance.1' },
},
entrance_statue = {
scope = 'dungeon',
{ 'entrance_statue.4' },
},
music = {
scope = 'dungeon',
{ 'dungeon_light' },
},
destructibles = {
pot = 'entities/vase',
stone1 = 'entities/stone_white',
stone2 = 'entities/stone_black',
},
},
},
@mattias-p
Copy link

mattias-p commented Nov 2, 2016

Somehow my comment about displacement yesterday got lost, but I managed to recover it from an old tab. Here goes:

The only information that's needed for positioning relative to the placeholder is the sizes of the placeholder and candidate tile pair as well as the direction of one of them. In the case of an east-oriented candidate: positionTopLeft(candidate) = positionTopLeft(placeholder) + vectorTopLeftToMiddleRight(placeholder) - vectorTopLeftToMiddleRight(candidate). If the placeholder and candidate have the same size, the top left corners will overlap. If the candidate is smaller it will be pushed to the right and centered within the placeholder.

No rush with destructibles.

Edit: Fixed math.

@sandstrand
Copy link
Author

Then we need not declare displacements. Updating

@mattias-p
Copy link

How's floor supposed to be interpreted? For each room (or dungeon, depending on scope), choose a candidate. For each room (always, independent of scope), choose a high and a low floor from this candidate? In that case, maybe the floors of most styles should be dungeon scoped? Or is there a better interpretation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment