diff --git a/map_gen/maps/diggy/config.lua b/map_gen/maps/diggy/config.lua index 2172234b..b782c38a 100644 --- a/map_gen/maps/diggy/config.lua +++ b/map_gen/maps/diggy/config.lua @@ -83,6 +83,7 @@ local Config = { collapse_threshold_total_strength = 16, support_beam_entities = { ['market'] = 9, + ['nuclear-reactor'] = 4, ['stone-wall'] = 3, ['sand-rock-big'] = 2, ['rock-big'] = 2, diff --git a/map_gen/maps/diggy/feature/diggy_cave_collapse.lua b/map_gen/maps/diggy/feature/diggy_cave_collapse.lua index 420780cb..45b87e44 100644 --- a/map_gen/maps/diggy/feature/diggy_cave_collapse.lua +++ b/map_gen/maps/diggy/feature/diggy_cave_collapse.lua @@ -117,7 +117,14 @@ local function create_collapse_template(positions, surface) if strength then do_insert = false else - entity.die() + if entity.name ~= 'tank' then + entity.die() + else + entity.health = entity.health - 100 + if entity.health == 0 then + entity.die() + end + end end end ) @@ -288,7 +295,7 @@ local function script_raised_destroy(event) local name = entity.name local strength = support_beam_entities[name] if strength then - stress_map_add(entity.surface, entity.position, strength, false, player_index) -- luacheck: ignore 113 + stress_map_add(entity.surface, entity.position, strength, false) end end diff --git a/map_gen/maps/diggy/feature/diggy_hole.lua b/map_gen/maps/diggy/feature/diggy_hole.lua index f0ce0e53..799d7ad9 100644 --- a/map_gen/maps/diggy/feature/diggy_hole.lua +++ b/map_gen/maps/diggy/feature/diggy_hole.lua @@ -147,6 +147,12 @@ local function on_mined_tile(surface, tiles) Template.insert(surface, new_tiles, {}) end + +--[[-- + diggy-clear-void is a debugging command that can be used in game to clear void area. Arguments: left_top_x left_top_y width height surface_index + Example: /diggy-clear-void -50 -50 100 100 redmew This will clear a square area 100 x 100 centered on the spawn point. + Note: The command will not automatically generate new chunks. +]] Command.add('diggy-clear-void', { description = {'command_description.diggy_clear_void'}, arguments = {'left_top_x', 'left_top_y', 'width', 'height', 'surface_index'}, @@ -209,17 +215,19 @@ function DiggyHole.register(cfg) local entity = event.entity local name = entity.name - if entity.health ~= 0 then - return - end - if not is_diggy_rock(name) then return end - raise_event(defines.events.script_raised_destroy, {entity = entity, cause = "die_faster"}) - destroy_rock(entity.surface.create_particle, 10, entity.position) - entity.destroy() + local cause = event.cause + local health = entity.health + + -- Diggy rock is destroyed if health is zero or less than 1500 when damaged by a tank (tank buff) + if health == 0 or (cause and cause.name == "tank" and health < 1500 and event.damage_type.valid and event.damage_type.name ~= 'fire') then + raise_event(defines.events.script_raised_destroy, {entity = entity, cause = "die_faster"}) + destroy_rock(entity.surface.create_particle, 10, entity.position) + entity.destroy() + end end) Event.add(defines.events.on_robot_mined_entity, function (event) diff --git a/map_gen/maps/diggy/orepattern/tendrils_impure.lua b/map_gen/maps/diggy/orepattern/tendrils_impure.lua index 21309fa0..1adf73e5 100644 --- a/map_gen/maps/diggy/orepattern/tendrils_impure.lua +++ b/map_gen/maps/diggy/orepattern/tendrils_impure.lua @@ -40,9 +40,9 @@ return { } }, weights = { - ['iron-ore'] = 860, - ['coal'] = 85, - ['stone'] = 55, + ['iron-ore'] = 900, + ['coal'] = 61, + ['stone'] = 39, }, distances = { ['coal'] = 16, @@ -51,9 +51,10 @@ return { }, }, { -- tendril medium large impure copper - yield=0.92, + -- 07/09/2000 start with a little less yeild near origin but grow in richness faster with distance + yield=0.85, min_distance=25, - distance_richness=9, + distance_richness=6, color={r=255/255, g=55/255, b=0/255}, noise_settings = { type = "connected_tendril", @@ -66,9 +67,9 @@ return { } }, weights = { - ['copper-ore'] = 860, - ['coal'] = 85, - ['stone'] = 55, + ['copper-ore'] = 900, + ['coal'] = 61, + ['stone'] = 39, }, distances = { ['coal'] = 16, @@ -77,9 +78,9 @@ return { }, }, { -- tendril medium impure coal - yield=0.5, + yield=0.55, min_distance=25, - distance_richness=9, + distance_richness=11, color={r=0/255, g=0/255, b=0/255}, noise_settings = { type = "connected_tendril", @@ -103,9 +104,9 @@ return { }, }, { -- tendril medium impure stone - yield=0.35, + yield=0.38, min_distance=25, - distance_richness=9, + distance_richness=11, color={r=100/255, g=100/255, b=100/255}, noise_settings = { type = "connected_tendril", @@ -130,8 +131,8 @@ return { }, { -- tendril small uranium yield=0.2, - min_distance=86, - distance_richness=9, + min_distance=128, + distance_richness=12, color={r=0/255, g=0/255, b=0/255}, noise_settings = { type = "connected_tendril", @@ -151,9 +152,9 @@ return { }, }, { -- scattered tendril fragments - yield=0.2, + yield=0.22, min_distance=10, - distance_richness=7, + distance_richness=12, color={r=0/255, g=0/255, b=0/255}, noise_settings = { type = "fragmented_tendril", @@ -186,7 +187,7 @@ return { }, }, { -- crude oil - yield=1.7, + yield=1.2, min_distance=57, distance_richness=9, color={r=0/255, g=255/255, b=255/255}, diff --git a/map_gen/maps/diggy/scenario.lua b/map_gen/maps/diggy/scenario.lua index 09ae5dad..d6b2c87c 100644 --- a/map_gen/maps/diggy/scenario.lua +++ b/map_gen/maps/diggy/scenario.lua @@ -73,9 +73,6 @@ function Scenario.register() end ) - local landfill_tiles = {'dirt-1','dirt-2','dirt-3','dirt-4','dirt-5','dirt-6','dirt-7'} - require ('map_gen.shared.change_landfill_tile')(landfill_tiles) - ScenarioInfo.set_map_name('Diggy') ScenarioInfo.set_map_description('Dig your way through!') diff --git a/map_gen/shared/hail_hydra.lua b/map_gen/shared/hail_hydra.lua index 809f79b2..11cac546 100644 --- a/map_gen/shared/hail_hydra.lua +++ b/map_gen/shared/hail_hydra.lua @@ -143,7 +143,7 @@ local on_died = local spawned = create_entity({name = hydra_spawn, force = force, position = position}) if spawned and spawned.type == 'unit' then spawned.set_command(command) - elseif spawned and cause and cause.valid and cause.force then + elseif spawned and cause and cause.valid and cause.force and cause.type ~= "car" then spawned.shooting_target = cause end end