From be42981ff3972e1eaa468ce4dfe53b37b252b687 Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Sun, 27 May 2018 15:13:03 +0200 Subject: [PATCH] Fixed errors and adapted to new vim 8.1 --- .vimrc | 8 +++++--- data/maproombuilder.lua | 8 +++++--- data/monstergen.lua | 26 +++++++++++++------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.vimrc b/.vimrc index 9ece217..93f1473 100644 --- a/.vimrc +++ b/.vimrc @@ -1,6 +1,8 @@ nnoremap :Make -nnoremap :Make clean -nnoremap :Make lint test -nnoremap :!./_build/breakhack +nnoremap :Make lint test +nnoremap :Termdebug _build/breakhack +nnoremap :ter _build/breakhack +packadd termdebug +let g:termdebug_wide = 1 let g:syntastic_c_include_dirs = [ '_build', '/usr/include/SDL2' ] diff --git a/data/maproombuilder.lua b/data/maproombuilder.lua index 7343fbc..fab6b90 100644 --- a/data/maproombuilder.lua +++ b/data/maproombuilder.lua @@ -155,7 +155,7 @@ end local function add_pits_to_room(map) - if CURRENT_LEVEL < 2 then + if CURRENT_LEVEL < 3 then return elseif random(5) ~= 1 then return @@ -171,7 +171,6 @@ local function add_pits_to_room(map) end end - local matrix = {} for i=0, #cleanData-1 do local c = cleanData:sub(i, i) @@ -183,11 +182,14 @@ local function add_pits_to_room(map) if not matrix[layout][col] then matrix[layout][col] = {} end if c == "#" then matrix[layout][col][row] = true - elseif c == "-" then + else matrix[layout][col][row] = false end end + -- Chose a random layout + matrix = matrix[random(#matrix)] + for i=2,13 do for j=2,10 do if not tile_occupied(map, (i), (j)) and matrix[i][j] then diff --git a/data/monstergen.lua b/data/monstergen.lua index 7d6a15e..b116c4f 100644 --- a/data/monstergen.lua +++ b/data/monstergen.lua @@ -150,7 +150,7 @@ local dogs = { { stats.dog, 16, 16, "An Angry Rabid Dog", behaviour.hostile }; } for i=1,#dogs do - dogs[i] = concat({ texturePaths.dogs0, texturePaths.dogs1 }, dogs[i]) + dogs[i] = concat({ texturePaths.dog0, texturePaths.dog1 }, dogs[i]) end local reptile = { @@ -165,18 +165,6 @@ for i=1,#reptile do reptile[i] = concat({ texturePaths.reptile0, texturePaths.reptile1 }, reptile[i]) end -local platino = { - { - texturePaths.reptile0, - texturePaths.reptile1, - stats.platino, - 48, - 12*16, - "Platino", - behaviour.sentinel - } -} - local demon = { { stats.default, 0, 0, "A Demon", behaviour.hostile }; { stats.default, 16, 0, "A Demon", behaviour.hostile }; @@ -191,6 +179,18 @@ for i=1,#demon do demon[i] = concat({ texturePaths.demon0, texturePaths.demon1 }, demon[i]) end +local platino = { + { + texturePaths.reptile0, + texturePaths.reptile1, + stats.platino, + 48, + 12*16, + "Platino", + behaviour.sentinel + } +} + local function repack(data) return { texturePath1 = data[1],