1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00

Merge pull request #1072 from BlueRock2/develop

Various Diggy enhancements and updates
This commit is contained in:
BlueRock (on discord) 2020-08-12 15:25:13 -04:00 committed by GitHub
commit 52c7b82ab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 30 deletions

View File

@ -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,

View File

@ -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

View File

@ -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)

View File

@ -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},

View File

@ -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!')

View File

@ -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