Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #186 from hanakocz/master
Browse files Browse the repository at this point in the history
MultiDungeons
  • Loading branch information
Gerkiz authored Jul 31, 2020
2 parents 3e92eb9 + 6716201 commit 586ad17
Show file tree
Hide file tree
Showing 18 changed files with 1,602 additions and 264 deletions.
1 change: 1 addition & 0 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ require 'modules.autostash'
--require 'maps.mountain_fortress_v2.main'
--require 'maps.lumberjack.main'
--require 'maps.dungeons.main'
--require 'maps.dungeons.tiered_dungeon'
--require 'maps.expanse.main'
--require 'maps.island_troopers.main'
--require 'maps.biter_hatchery.main'
Expand Down
29 changes: 29 additions & 0 deletions locale/en/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,35 @@ boss_message=Boss Wave __1__ - - __2__
map_info_main_caption=D U N G E O N S
map_info_sub_caption= ~You put your robe and wizard hat on. You are still in a dungeon.~
map_info_text=Expand into the depths for treasure.\nEverytime a new room is discovered, the depth-meter in your left top will increase.\n\nEnemies get more chonky.\nResources yield more ore.\nLoot gets more shiny.\n\nYou can use the green smelly dungeon sewers for long range transports.\n\nHow far can you make it?
depth=~ Depth __1__ ~
depth_tooltip=Evolution: __1__%\nEnemy Health: __2__%\nEnemy Damage: __3__%
[dungeons_tiered]
map_info_main_caption=D U N G E O N S
map_info_sub_caption= ~You put your robe and wizard hat on. You are still in a dungeon.~
map_info_text=Expand into the depths for treasure.\nEverytime a new room is discovered, the depth-meter in your left top will increase.\n\nEnemies get more chonky.\nResources yield more ore.\nLoot gets more shiny.\n\nBut for real challenge and real shinies, you need to go also deeper.\nUse arrow buttons on top to change floors!\n\nHow far can you make it?
descend=Descend to lower floor.\nEach floor has stronger enemies and better treasure.\nRIGHT-CLICK: Descend 5 floors.\nSHIFT-CLICK: Desscend to lowest accessible Floor.
ascend=Ascend to higher floor.\nRIGHT-CLICK: Ascend 5 floors.\nSHIFT-CLICK: Ascend to Floor 0.
depth=~ Floor __1__ | Depth __2__ ~
depth_tooltip=Evolution: __1__%\nEnemy Health: __2__%\nEnemy Damage: __3__%\nLoot Value: __4__\nTreasure rooms found: __5__ / 5\nHidden Technologies: __6__
max_depth=You are on deepest level already!
min_depth=You are on highest level already!
only_on_spawn=You can change floors only on spawn.
level_required=You need level __1__ for travelling to next floor!
floor_size_required=You need to explore at least 60 rooms on this floor to access next floor!
travel_down=You have descended to deeper part of dungeon.
travel_up=You have ascended to previous part of dungeon.
first_visit=__1__ [lvl __2__] was first to reach Floor __3__!
too_small=The dungeon needs to be bigger for continuing in this direction.
treasure_room=Treasure room was found on Floor __1__!
tech_unlock=__1__ unlock was found on Floor __2__!
boss_arena=!!Dungeon Bosses!!\nRequires level 5 to join.\n\nCurrent boss level: __1__\nBoss bonus HP: __2__%\nBoss bonus damage: __3__%\nRewards: cca __4__ XP\n\nUp to four players can fight at once.
arena_occupied=Arena is in use! Wait for previous player to end his fight!
arena_level_needed=You need level 5 to join the arena!
robots_following=You cannot enter arena with robots following you!
arena_level_max=You defeated all the bosses already!
player_lost=[ARENA]: __1__ lost his battle to Boss lvl __2__!
player_won=[ARENA]: __1__ defeated the Boss lvl __2__!
[mountain_fortress]
map_info_main_caption=M O U N T A I N F O R T R E S S
Expand Down
30 changes: 15 additions & 15 deletions maps/dungeons/biome_acid_zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@ local math_floor = math.floor
local function add_enemy_units(surface, room)
for _, tile in pairs(room.room_tiles) do
if math_random(1, 2) == 1 then
local name = BiterRaffle.roll("spitter", Functions.get_dungeon_evolution_factor() * 1.5)
local unit = surface.create_entity({name = name, position = tile.position, force = "enemy"})
local name = BiterRaffle.roll("spitter", Functions.get_dungeon_evolution_factor(surface.index) * 1.5)
local unit = surface.create_entity({name = name, position = tile.position, force = global.enemy_forces[surface.index]})
end
end
end
end

local function acid_zone(surface, room)
for _, tile in pairs(room.path_tiles) do
surface.set_tiles({{name = "concrete", position = tile.position}}, true)
end

if not room.room_border_tiles[1] then return end

table_shuffle_table(room.room_tiles)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "green-refined-concrete", position = tile.position}}, true)
if math_random(1, 16) == 1 then
surface.create_entity({name = "uranium-ore", position = tile.position, amount = Functions.get_common_resource_amount()})
surface.create_entity({name = "uranium-ore", position = tile.position, amount = Functions.get_common_resource_amount(surface.index)})
end
if math_random(1, 96) == 1 then
surface.create_entity({name = Functions.roll_worm_name(), position = tile.position})
surface.create_entity({name = Functions.roll_worm_name(surface.index), position = tile.position, force = global.enemy_forces[surface.index]})
end
if math_random(1, 128) == 1 then
Functions.crash_site_chest(surface, tile.position)
end
end
if key % 128 == 1 and math_random(1, 3) == 1 then
Functions.set_spawner_tier(surface.create_entity({name = "spitter-spawner", position = tile.position, force = "enemy"}))
Functions.set_spawner_tier(surface.create_entity({name = "spitter-spawner", position = tile.position, force = global.enemy_forces[surface.index]}), surface.index)
end
end

if room.center then
if math_random(1, 4) == 1 then
local r = math_floor(math_sqrt(#room.room_tiles) * 0.125) + 1
Expand All @@ -54,21 +54,21 @@ local function acid_zone(surface, room)
end
end
end
end
end
end

table_shuffle_table(room.room_border_tiles)
for key, tile in pairs(room.room_border_tiles) do
surface.set_tiles({{name = "refined-hazard-concrete-left", position = tile.position}}, true)
end

for key, tile in pairs(room.room_border_tiles) do
if key % 8 == 1 then
Functions.place_border_rock(surface, tile.position)
end
end

add_enemy_units(surface, room)
end

return acid_zone
return acid_zone
28 changes: 14 additions & 14 deletions maps/dungeons/biome_concrete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,55 @@ local math_floor = math.floor
local function add_enemy_units(surface, room)
for _, tile in pairs(room.room_tiles) do
if math_random(1, 2) == 1 then
local name = BiterRaffle.roll("biter", Functions.get_dungeon_evolution_factor() * 1.5)
local unit = surface.create_entity({name = name, position = tile.position, force = "enemy"})
local name = BiterRaffle.roll("biter", Functions.get_dungeon_evolution_factor(surface.index) * 1.5)
local unit = surface.create_entity({name = name, position = tile.position, force = global.enemy_forces[surface.index]})
end
end
end
end

local function concrete(surface, room)
for _, tile in pairs(room.path_tiles) do
surface.set_tiles({{name = "concrete", position = tile.position}}, true)
for _, tile in pairs(room.path_tiles) do
surface.set_tiles({{name = "concrete", position = tile.position}}, true)
end

if not room.room_border_tiles[1] then return end

table_shuffle_table(room.room_tiles)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "stone-path", position = tile.position}}, true)
if math_random(1, 16) == 1 then
surface.create_entity({name = "iron-ore", position = tile.position, amount = Functions.get_common_resource_amount()})
surface.create_entity({name = "iron-ore", position = tile.position, amount = Functions.get_common_resource_amount(surface.index)})
end
if math_random(1, 128) == 1 then
Functions.crash_site_chest(surface, tile.position)
end
if key % 128 == 1 and math_random(1, 3) == 1 then
Functions.set_spawner_tier(surface.create_entity({name = "biter-spawner", position = tile.position, force = "enemy"}))
Functions.set_spawner_tier(surface.create_entity({name = "biter-spawner", position = tile.position, force = global.enemy_forces[surface.index]}), surface.index)
end
end

table_shuffle_table(room.room_border_tiles)
for key, tile in pairs(room.room_border_tiles) do
surface.set_tiles({{name = "refined-concrete", position = tile.position}}, true)
end

for key, tile in pairs(room.room_border_tiles) do
if key % 8 == 1 then
Functions.place_border_rock(surface, tile.position)
else
surface.create_entity({name = "stone-wall", position = tile.position, force = "dungeon"})
end
end

if room.entrance_tile then
local p = room.entrance_tile.position
local area = {{p.x - 1, p.y - 1}, {p.x + 1.5, p.y + 1.5}}
for _, entity in pairs(surface.find_entities_filtered({area = area})) do
entity.destroy()
end
end

add_enemy_units(surface, room)
end

return concrete
return concrete
60 changes: 30 additions & 30 deletions maps/dungeons/biome_deepblue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ local function horizontal_water_barrier(surface, room)
local a = room.radius * 2
local left_top = {x = room.center.x - room.radius, y = room.center.y - room.radius}
local center_position = room.center

for x = 0, a , 1 do
for y = 0, a, 1 do
local p = {x = left_top.x + x, y = left_top.y + y}
local p = {x = left_top.x + x, y = left_top.y + y}
if math_abs(p.y - center_position.y) < room.radius * 0.4 then
surface.set_tiles({{name = "water", position = p}})
if math_random(1, 16) == 1 then surface.create_entity({name = "fish", position = p}) end
Expand All @@ -29,10 +29,10 @@ local function vertical_water_barrier(surface, room)
local a = room.radius * 2
local left_top = {x = room.center.x - room.radius, y = room.center.y - room.radius}
local center_position = room.center

for x = 0, a , 1 do
for y = 0, a, 1 do
local p = {x = left_top.x + x, y = left_top.y + y}
local p = {x = left_top.x + x, y = left_top.y + y}
if math_abs(p.x - center_position.x) < room.radius * 0.4 then
surface.set_tiles({{name = "water", position = p}})
if math_random(1, 16) == 1 then surface.create_entity({name = "fish", position = p}) end
Expand All @@ -45,10 +45,10 @@ local function vertical_bridge(surface, room)
local a = room.radius * 2
local left_top = {x = room.center.x - room.radius, y = room.center.y - room.radius}
local center_position = room.center

for x = 0, a , 1 do
for y = 0, a, 1 do
local p = {x = left_top.x + x, y = left_top.y + y}
local p = {x = left_top.x + x, y = left_top.y + y}
if math_abs(p.x - center_position.x) > room.radius * 0.4 then
surface.set_tiles({{name = "water", position = p}})
if math_random(1, 16) == 1 then surface.create_entity({name = "fish", position = p}) end
Expand All @@ -61,10 +61,10 @@ local function horizontal_bridge(surface, room)
local a = room.radius * 2
local left_top = {x = room.center.x - room.radius, y = room.center.y - room.radius}
local center_position = room.center

for x = 0, a , 1 do
for y = 0, a, 1 do
local p = {x = left_top.x + x, y = left_top.y + y}
local p = {x = left_top.x + x, y = left_top.y + y}
if math_abs(p.y - center_position.y) > room.radius * 0.4 then
surface.set_tiles({{name = "water", position = p}})
if math_random(1, 16) == 1 then surface.create_entity({name = "fish", position = p}) end
Expand All @@ -77,10 +77,10 @@ local function island(surface, room)
local a = room.radius * 2
local left_top = {x = room.center.x - room.radius, y = room.center.y - room.radius}
local center_position = room.center

for x = 0, a , 1 do
for y = 0, a, 1 do
local p = {x = left_top.x + x, y = left_top.y + y}
local p = {x = left_top.x + x, y = left_top.y + y}
if math_abs(p.x - center_position.x) < room.radius * 0.6 and math_abs(p.y - center_position.y) < room.radius * 0.6 then
else
surface.set_tiles({{name = "water", position = p}})
Expand All @@ -94,10 +94,10 @@ local function cross(surface, room)
local a = room.radius * 2
local left_top = {x = room.center.x - room.radius, y = room.center.y - room.radius}
local center_position = room.center

for x = 0, a , 1 do
for y = 0, a, 1 do
local p = {x = left_top.x + x, y = left_top.y + y}
local p = {x = left_top.x + x, y = left_top.y + y}
if math_abs(p.x - center_position.x) > room.radius * 0.33 and math_abs(p.y - center_position.y) > room.radius * 0.33 then
surface.set_tiles({{name = "water", position = p}})
if math_random(1, 16) == 1 then surface.create_entity({name = "fish", position = p}) end
Expand All @@ -110,10 +110,10 @@ local function cross_inverted(surface, room)
local a = room.radius * 2
local left_top = {x = room.center.x - room.radius, y = room.center.y - room.radius}
local center_position = room.center

for x = 0, a , 1 do
for y = 0, a, 1 do
local p = {x = left_top.x + x, y = left_top.y + y}
local p = {x = left_top.x + x, y = left_top.y + y}
if math_abs(p.x - center_position.x) > room.radius * 0.33 and math_abs(p.y - center_position.y) > room.radius * 0.33 then
else
surface.set_tiles({{name = "water", position = p}})
Expand All @@ -127,15 +127,15 @@ local function squares(surface, room)
local r_min = 0
local r_max = room.radius * 2
local center_position = room.center

local tiles = {}
for _, tile in pairs(room.room_border_tiles) do table_insert(tiles, tile) end
for _, tile in pairs(room.room_tiles) do table_insert(tiles, tile) end

for _ = 1, math_random(1, 6), 1 do
local a = math_random(r_min, r_max)
local b = math_random(r_min, r_max)
local square_left_top = tiles[math_random(1, #tiles)].position
local square_left_top = tiles[math_random(1, #tiles)].position
for x = 0, a , 1 do
for y = 0, b, 1 do
local p = {x = square_left_top.x + x, y = square_left_top.y + y}
Expand All @@ -144,7 +144,7 @@ local function squares(surface, room)
surface.set_tiles({{name = "water", position = p}})
else
surface.set_tiles({{name = "deepwater", position = p}})
end
end
if math_random(1, 16) == 1 then surface.create_entity({name = "fish", position = p}) end
end
end
Expand All @@ -167,44 +167,44 @@ local function biome(surface, room)
for _, tile in pairs(room.path_tiles) do
surface.set_tiles({{name = "concrete", position = tile.position}}, true)
end

if not room.room_border_tiles[1] then return end

table_shuffle_table(room.room_tiles)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "blue-refined-concrete", position = tile.position}}, true)
end

table_shuffle_table(room.room_border_tiles)
for key, tile in pairs(room.room_border_tiles) do
surface.set_tiles({{name = "cyan-refined-concrete", position = tile.position}}, true)
end

water_shapes[math_random(1, #water_shapes)](surface, room)

for key, tile in pairs(room.room_tiles) do
local tile = surface.get_tile(tile.position)
if not tile.collides_with("resource-layer") then
if not tile.collides_with("resource-layer") then
if math_random(1, 10) == 1 then
surface.create_entity({name = "stone", position = tile.position, amount = Functions.get_common_resource_amount()})
surface.create_entity({name = "stone", position = tile.position, amount = Functions.get_common_resource_amount(surface.index)})
end
if math_random(1, 320) == 1 then
Functions.crash_site_chest(surface, tile.position)
end
end
if key % 64 == 1 and math_random(1, 2) == 1 then
Functions.set_spawner_tier(surface.create_entity({name = Functions.roll_spawner_name(), position = tile.position, force = "enemy"}))
Functions.set_spawner_tier(surface.create_entity({name = Functions.roll_spawner_name(), position = tile.position, force = global.enemy_forces[surface.index]}), surface.index)
end
if math_random(1, 64) == 1 then
surface.create_entity({name = Functions.roll_worm_name(), position = tile.position})
surface.create_entity({name = Functions.roll_worm_name(surface.index), position = tile.position, force = global.enemy_forces[surface.index]})
end
end
end

for key, tile in pairs(room.room_border_tiles) do
if key % 8 == 1 then
Functions.place_border_rock(surface, tile.position)
end
end
end

return biome
return biome
Loading

0 comments on commit 586ad17

Please sign in to comment.