Adds lua support for quick mode

This still needs a bunch of testing
This commit is contained in:
Linus Probert 2018-10-22 09:38:05 +02:00
parent f895fdb35e
commit 97c95dacd4
3 changed files with 12 additions and 3 deletions

View File

@ -50,6 +50,9 @@ local function generate_path ()
local lastDirection = 0
local coridoor_count = 0
local bossLevel = CURRENT_LEVEL % 5 == 0
if QUICK_MODE then
bossLevel = CURRENT_LEVEL % 3 == 0
end
local coverage = 8 + CURRENT_LEVEL
if bossLevel or CURRENT_LEVEL == 1 then
coverage = 5

View File

@ -303,16 +303,16 @@ if(CURRENT_LEVEL > 0) then
enemies = concat(enemies, avian)
enemies = concat(enemies, misc)
enemies = concat(enemies, dogs)
elseif (CURRENT_LEVEL > 15) then
elseif (CURRENT_LEVEL > 15 or (QUICK_MODE and CURRENT_LEVEL > 9)) then
enemies = {}
enemies = concat(enemies, undead)
enemies = concat(enemies, orcs)
enemies = concat(enemies, assassins)
elseif (CURRENT_LEVEL > 10) then
elseif (CURRENT_LEVEL > 10 or (QUICK_MODE and CURRENT_LEVEL > 6)) then
enemies = {}
enemies = concat(enemies, undead)
enemies = concat(enemies, avian)
elseif (CURRENT_LEVEL > 5) then
elseif (CURRENT_LEVEL > 5 or (QUICK_MODE and CURRENT_LEVEL > 3)) then
enemies = {}
enemies = concat(enemies, orcs)
enemies = concat(enemies, avian)
@ -364,6 +364,9 @@ end
function module.add_boss_to_room(room, roomx, roomy)
local boss = bosses[CURRENT_LEVEL / 5]
if QUICK_MODE then
boss = bosses[CURRENT_LEVEL / 3]
end
local success = false
while not success do
local rx = random(13) + 1

View File

@ -526,6 +526,9 @@ generate_map(unsigned int level, const char *file, SDL_Renderer *renderer)
lua_pushinteger(L, level);
lua_setglobal(L, "CURRENT_LEVEL");
lua_pushboolean(L, false);
lua_setglobal(L, "QUICK_MODE");
// Add custom searcher
lua_getglobal(L, "package");
lua_getfield(L, -1, "searchers");