1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-05-13 21:56:29 +02:00
This commit is contained in:
MewMew 2020-04-04 19:07:08 +02:00
parent b1e74c3cc4
commit 59933837b0
10 changed files with 69 additions and 19 deletions

View File

@ -52,6 +52,11 @@ boss_message=Boss Wave __1__ - - __2__
1950=Belt Rotators
2000=Bluescreen Factor
[dungeons]
map_info_main_caption=D U N G E O N S
map_info_sub_caption= ~wizards and warriors~
map_info_text=You are in a dungeon.\nYou put on your wizard robes.\nYou are still in a dungeon.\n\nExpand into the depths for greater treasures, but also face increased dangers.\nSpawners will increase in tiers, making biters more chonky.\nDungeon resource amount also increases with depth.\nOverall loot quality will increase.\n\nImpassable walls may be destroyed with explosives, making way for rails and logistics.\nTo trigger them, all that is needed is a container and a well aimed shot.\nBe careful, not to use too many at once. Chains explosions, using many chests may proof more efficient.
[mountain_fortress]
map_info_main_caption=M O U N T A I N F O R T R E S S
map_info_sub_caption= ..diggy diggy choo choo..

View File

@ -1,3 +1,5 @@
local Functions = require "maps.dungeons.functions"
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove

View File

@ -1,3 +1,5 @@
local Functions = require "maps.dungeons.functions"
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
@ -35,14 +37,14 @@ local function desert(surface, room)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "sand-3", position = tile.position}}, true)
if math_random(1, 64) == 1 then
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 3})
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 10})
else
if math_random(1, 128) == 1 then
surface.create_entity({name = trees[math_random(1, size_of_trees)], position = tile.position})
end
end
if key % 128 == 0 and math_random(1, 3) == 1 then
surface.create_entity({name = "biter-spawner", position = tile.position, force = "enemy"})
surface.create_entity({name = Functions.roll_spawner_name(), position = tile.position, force = "enemy"})
end
if math_random(1, 128) == 1 then
local turret_name = worms[math_random(1, size_of_worms)] .. "-worm-turret"
@ -72,7 +74,7 @@ local function desert(surface, room)
surface.create_entity({name = "crude-oil", position = room.center, amount = math_random(200000, 400000)})
end
if math_random(1, 2) == 1 then
surface.create_entity({name = "biter-spawner", position = room.center})
surface.create_entity({name = Functions.roll_spawner_name(), position = room.center})
end
end
end

View File

@ -1,3 +1,5 @@
local Functions = require "maps.dungeons.functions"
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
@ -32,14 +34,14 @@ local function dirtlands(surface, room)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "dirt-7", position = tile.position}}, true)
if math_random(1, 64) == 1 then
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 3})
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 10})
else
if math_random(1, 128) == 1 then
surface.create_entity({name = trees[math_random(1, size_of_trees)], position = tile.position})
end
end
if key % 128 == 0 and math_random(1, 2) == 1 then
surface.create_entity({name = "biter-spawner", position = tile.position, force = "enemy"})
surface.create_entity({name = Functions.roll_spawner_name(), position = tile.position, force = "enemy"})
end
if math_random(1, 320) == 1 then
local turret_name = worms[math_random(1, size_of_worms)] .. "-worm-turret"
@ -69,7 +71,7 @@ local function dirtlands(surface, room)
surface.create_entity({name = "crude-oil", position = room.center, amount = math_random(200000, 400000)})
end
if math_random(1, 2) == 1 then
surface.create_entity({name = "biter-spawner", position = room.center})
surface.create_entity({name = Functions.roll_spawner_name(), position = room.center})
end
end
end

View File

@ -1,3 +1,5 @@
local Functions = require "maps.dungeons.functions"
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
@ -25,12 +27,12 @@ local function doom(surface, room)
if math_random(1, 480) == 1 then
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = 99999999})
end
if math_random(1, 32) == 1 then
if math_random(1, 16) == 1 then
local turret_name = worms[math_random(1, size_of_worms)] .. "-worm-turret"
surface.create_entity({name = turret_name, position = tile.position})
end
if key % 16 == 0 and math_random(1, 2) == 1 then
surface.create_entity({name = "biter-spawner", position = tile.position})
if key % 10 == 0 and math_random(1, 2) == 1 then
surface.create_entity({name = Functions.roll_spawner_name(), position = tile.position})
end
end

View File

@ -1,3 +1,5 @@
local Functions = require "maps.dungeons.functions"
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
@ -31,7 +33,7 @@ local function glitch(surface, room)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "lab-dark-1", position = tile.position}}, true)
if math_random(1, 4) == 1 then
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 750) + global.dungeons.depth * 5})
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 750) + global.dungeons.depth * 10})
end
if math_random(1, 16) == 1 then
local turret_name = worms[math_random(1, size_of_worms)] .. "-worm-turret"

View File

@ -1,3 +1,5 @@
local Functions = require "maps.dungeons.functions"
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
@ -25,7 +27,7 @@ local function grasslands(surface, room)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "grass-2", position = tile.position}}, true)
if math_random(1, 64) == 1 then
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 3})
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 10})
else
if math_random(1, 24) == 1 then
surface.create_entity({name = trees[math_random(1, size_of_trees)], position = tile.position})
@ -41,7 +43,7 @@ local function grasslands(surface, room)
end
if room.center then
if math_random(1, 3) == 1 then
if math_random(1, 4) == 1 then
local r = math_floor(math_sqrt(#room.room_tiles) * 0.25) + 1
for x = r * -1, r, 1 do
for y = r * -1, r, 1 do
@ -54,7 +56,7 @@ local function grasslands(surface, room)
end
else
if math_random(1, 3) == 1 then
surface.create_entity({name = "biter-spawner", position = room.center})
surface.create_entity({name = Functions.roll_spawner_name(), position = room.center})
end
end
end

View File

@ -1,3 +1,5 @@
local Functions = require "maps.dungeons.functions"
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
@ -6,7 +8,7 @@ local math_abs = math.abs
local math_sqrt = math.sqrt
local math_floor = math.floor
local ores = {"iron-ore", "iron-ore", "coal"}
local ores = {"iron-ore", "iron-ore", "iron-ore", "iron-ore", "copper-ore", "copper-ore", "copper-ore","coal", "coal","stone", "stone","uranium-ore"}
local trees = {"dead-dry-hairy-tree", "dead-grey-trunk", "dead-tree-desert", "dry-hairy-tree", "dry-tree"}
local size_of_trees = #trees
local worms = {}
@ -25,14 +27,14 @@ local function red_desert(surface, room)
for key, tile in pairs(room.room_tiles) do
surface.set_tiles({{name = "dry-dirt", position = tile.position}}, true)
if math_random(1, 32) == 1 then
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 2})
surface.create_entity({name = ores[math_random(1, #ores)], position = tile.position, amount = math_random(250, 500) + global.dungeons.depth * 10})
else
if math_random(1, 8) == 1 and surface.can_place_entity({name = trees[math_random(1, size_of_trees)], position = tile.position}) then
surface.create_entity({name = trees[math_random(1, size_of_trees)], position = tile.position})
end
end
if key % 16 == 0 and math_random(1, 32) == 1 then
surface.create_entity({name = "biter-spawner", position = tile.position, force = "enemy"})
surface.create_entity({name = Functions.roll_spawner_name(), position = tile.position, force = "enemy"})
end
if math_random(1, 256) == 1 then
local turret_name = worms[math_random(1, size_of_worms)] .. "-worm-turret"

View File

@ -0,0 +1,16 @@
local Public = {}
local table_insert = table.insert
local table_remove = table.remove
local math_random = math.random
local math_abs = math.abs
local math_floor = math.floor
function Public.roll_spawner_name()
if math_random(1, 3) == 1 then
return "spitter-spawner"
end
return "biter-spawner"
end
return Public

View File

@ -3,9 +3,12 @@
require "modules.mineable_wreckage_yields_scrap"
require "modules.biters_yield_ore"
require "modules.rpg"
require "modules.explosives"
local MapInfo = require "modules.map_info"
local Room_generator = require "functions.room_generator"
local BiterHealthBooster = require "modules.biter_health_booster"
local BiterRaffle = require "functions.biter_raffle"
local Biomes = {}
Biomes.dirtlands = require "maps.dungeons.biome_dirtlands"
@ -50,7 +53,7 @@ end
local function draw_depth_gui()
for _, player in pairs(game.connected_players) do
if player.gui.top.dungeon_depth then player.gui.top.dungeon_depth.destroy() end
local element = player.gui.top.add({type = "sprite-button", name = "dungeon_depth", caption = "Depth: " .. global.dungeons.depth, tooltip = "Delve deep and face increased dangers."})
local element = player.gui.top.add({type = "sprite-button", name = "dungeon_depth", caption = "Depth: " .. global.dungeons.depth, tooltip = "Delve deep and face increased dangers.\nIncreases whenever a new room is discovered."})
local style = element.style
style.minimal_height = 38
style.maximal_height = 38
@ -166,8 +169,11 @@ local function on_entity_died(event)
if not entity.valid then return end
if entity.type == "unit" and entity.spawner then
entity.spawner.damage(16, game.forces[1])
entity.spawner.damage(20, game.forces[1])
end
if entity.name ~= "rock-big" then return end
expand(entity.surface, entity.position)
end
local function on_marked_for_deconstruction(event)
@ -202,7 +208,7 @@ local function on_init()
surface.delete_chunk({chunk.x, chunk.y})
end
game.forces.player.manual_mining_speed_modifier = 20
--game.forces.player.manual_mining_speed_modifier = 0
global.dungeons = {}
global.dungeons.depth = 0
@ -210,6 +216,15 @@ local function on_init()
global.rocks_yield_ore_base_amount = 50
global.rocks_yield_ore_distance_modifier = 0.001
global.explosion_cells_destructible_tiles = {
["out-of-map"] = 2500,
}
local T = MapInfo.Pop_info()
T.localised_category = "dungeons"
T.main_caption_color = {r = 0, g = 0, b = 0}
T.sub_caption_color = {r = 75, g = 0, b = 0}
end
local Event = require 'utils.event'