mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-03 13:12:11 +02:00
pirates: port names of rocks
This commit is contained in:
parent
510cececb3
commit
0abc7947ca
@ -555,7 +555,7 @@ local function handle_maze_walls_damage_resistance(event)
|
||||
|
||||
if destination.surface_name ~= entity.surface.name then return end
|
||||
|
||||
if not ((entity.type and entity.type == 'tree') or entity.name == 'rock-huge' or entity.name == 'rock-big' or entity.name == 'sand-rock-big') then return end
|
||||
if not ((entity.type and entity.type == 'tree') or entity.name == 'huge-rock' or entity.name == 'big-rock' or entity.name == 'big-sand-rock') then return end
|
||||
|
||||
if (event.damage_type.name and (event.damage_type.name == 'explosion' or event.damage_type.name == 'poison')) then
|
||||
event.entity.health = event.entity.health + event.final_damage_amount
|
||||
@ -737,7 +737,7 @@ end
|
||||
-- -- local memory = Memory.get_crew_memory()
|
||||
|
||||
-- -- if memory.planet[1].type.id == 11 then --rocky planet
|
||||
-- -- if event.entity.name == 'rock-huge' or event.entity.name == 'rock-big' or event.entity.name == 'sand-rock-big' then
|
||||
-- -- if event.entity.name == 'huge-rock' or event.entity.name == 'big-rock' or event.entity.name == 'big-sand-rock' then
|
||||
-- -- Event_functions.trap(event.entity, false)
|
||||
-- -- event.entity.destroy()
|
||||
-- -- Event_functions.rocky_loot(event)
|
||||
@ -964,7 +964,7 @@ local function player_mined_rock(event)
|
||||
local c2 = {}
|
||||
|
||||
if memory.overworldx >= 0 then --used to be only later levels
|
||||
if entity.name == 'rock-huge' then
|
||||
if entity.name == 'huge-rock' then
|
||||
local a = Math.ceil(1.5 * Balance.coin_amount_from_rock())
|
||||
c2[#c2 + 1] = { name = 'coin', count = a, color = CoreData.colors.coin }
|
||||
memory.playtesting_stats.coins_gained_by_trees_and_rocks = memory.playtesting_stats.coins_gained_by_trees_and_rocks + a
|
||||
@ -1044,7 +1044,7 @@ local function event_on_player_mined_entity(event)
|
||||
elseif entity.name == 'coal' or entity.name == 'stone' or entity.name == 'copper-ore' or entity.name == 'iron-ore' then
|
||||
player_mined_resource(event)
|
||||
event.buffer.clear()
|
||||
elseif entity.name == 'rock-huge' or entity.name == 'rock-big' or entity.name == 'sand-rock-big' then
|
||||
elseif entity.name == 'huge-rock' or entity.name == 'big-rock' or entity.name == 'big-sand-rock' then
|
||||
player_mined_rock(event)
|
||||
event.buffer.clear()
|
||||
end
|
||||
@ -1857,7 +1857,7 @@ function Public.event_on_chunk_generated(event)
|
||||
e.rotatable = false
|
||||
e.destructible = false
|
||||
|
||||
local water_tiles = surface.find_tiles_filtered { position = special.position, radius = 0.1, collision_mask = "water-tile" }
|
||||
local water_tiles = surface.find_tiles_filtered { position = special.position, radius = 0.1, collision_mask = "water_tile" }
|
||||
|
||||
if water_tiles then
|
||||
for _, t in pairs(water_tiles) do
|
||||
|
@ -50,7 +50,7 @@ function Public.try_give_ore(player, realp, source_name)
|
||||
|
||||
local given_amount = Math.ceil(real_amount * Math.random_float_in_range(0.004, 0.006))
|
||||
|
||||
if source_name == 'rock-huge' then
|
||||
if source_name == 'huge-rock' then
|
||||
given_amount = given_amount * 2
|
||||
coin_amount = coin_amount * 2
|
||||
end
|
||||
@ -134,7 +134,7 @@ function Public.try_ore_spawn(surface, realp, source_name, density_bonus, from_t
|
||||
|
||||
local radius_squared = (destination.static_params and destination.static_params.radius_squared_modifier or 1) * (12 + 45 * Math.slopefromto(Common.ore_abstract_to_real(choices[choice]), 800, 20000)) * (0.6 + Math.random()) --tuned
|
||||
|
||||
if source_name == 'rock-huge' then
|
||||
if source_name == 'huge-rock' then
|
||||
radius_squared = radius_squared * 1.5
|
||||
end
|
||||
|
||||
|
@ -351,7 +351,7 @@ function Public.assorted_structures_1(args, spec)
|
||||
end
|
||||
|
||||
function Public.random_rock_1(p)
|
||||
local rock_raffle = { 'sand-rock-big', 'sand-rock-big', 'rock-big', 'rock-big', 'rock-big', 'rock-big', 'rock-huge', 'rock-huge' }
|
||||
local rock_raffle = { 'big-sand-rock', 'big-sand-rock', 'big-rock', 'big-rock', 'big-rock', 'big-rock', 'huge-rock', 'huge-rock' }
|
||||
local s_rock_raffle = #rock_raffle
|
||||
|
||||
return { name = rock_raffle[Math.random(1, s_rock_raffle)], position = p }
|
||||
|
@ -82,11 +82,11 @@ function Public.terrain(args)
|
||||
if rockrng < rockdensity then
|
||||
args.entities[#args.entities + 1] = IslandsCommon.random_rock_1(args.p)
|
||||
elseif rockrng < rockdensity * 1.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-medium', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'medium-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-small', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'small-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-tiny', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'tiny-rock', position = args.p }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -90,11 +90,11 @@ function Public.terrain(args)
|
||||
if rockrng < rockdensity then
|
||||
args.entities[#args.entities + 1] = IslandsCommon.random_rock_1(args.p)
|
||||
elseif rockrng < rockdensity * 1.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-medium', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'medium-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-small', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'small-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-tiny', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'tiny-rock', position = args.p }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -87,11 +87,11 @@ function Public.terrain(args)
|
||||
if rockrng < rockdensity then
|
||||
args.entities[#args.entities + 1] = IslandsCommon.random_rock_1(args.p)
|
||||
elseif rockrng < rockdensity * 1.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-medium', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'medium-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-small', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'small-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-tiny', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'tiny-rock', position = args.p }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -105,11 +105,11 @@ function Public.terrain(args)
|
||||
if rockrng < rockdensity then
|
||||
args.entities[#args.entities + 1] = IslandsCommon.random_rock_1(args.p)
|
||||
elseif rockrng < rockdensity * 1.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-medium', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'medium-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-small', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'small-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-tiny', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'tiny-rock', position = args.p }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -89,11 +89,11 @@ function Public.terrain(args)
|
||||
if rockrng < rockdensity then
|
||||
args.entities[#args.entities + 1] = IslandsCommon.random_rock_1(args.p)
|
||||
elseif rockrng < rockdensity * 1.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-medium', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'medium-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-small', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'small-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-tiny', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'tiny-rock', position = args.p }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -93,11 +93,11 @@ function Public.terrain(args)
|
||||
if rockrng < rockdensity then
|
||||
args.entities[#args.entities + 1] = IslandsCommon.random_rock_1(args.p)
|
||||
elseif rockrng < rockdensity * 1.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-medium', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'medium-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-small', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'small-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-tiny', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'tiny-rock', position = args.p }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -87,11 +87,11 @@ function Public.terrain(args)
|
||||
if rockrng < rockdensity then
|
||||
args.entities[#args.entities + 1] = IslandsCommon.random_rock_1(args.p)
|
||||
elseif rockrng < rockdensity * 1.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-medium', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'medium-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-small', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'small-rock', position = args.p }
|
||||
elseif rockrng < rockdensity * 2.5 then
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'rock-tiny', position = args.p }
|
||||
args.decoratives[#args.decoratives + 1] = { name = 'tiny-rock', position = args.p }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -18,41 +18,41 @@ local map_height = 3840
|
||||
|
||||
local apply_startup_settings_token =
|
||||
Token.register(
|
||||
function(data)
|
||||
local this = ScenarioTable.get_table()
|
||||
local settings = {}
|
||||
function (data)
|
||||
local this = ScenarioTable.get_table()
|
||||
local settings = {}
|
||||
|
||||
if not data or not data.value then
|
||||
if this.shuffle_random_victory_time and math.random(1, 32) == 1 then
|
||||
this.required_time_to_win = 48
|
||||
this.required_time_to_win_in_ticks = 10368000
|
||||
this.surface_terrain = 'forest'
|
||||
end
|
||||
else
|
||||
local value = data.value
|
||||
if value.required_time_to_win == 48 then
|
||||
this.required_time_to_win = 72
|
||||
this.required_time_to_win_in_ticks = 15552000
|
||||
if not data or not data.value then
|
||||
if this.shuffle_random_victory_time and math.random(1, 32) == 1 then
|
||||
this.required_time_to_win = 48
|
||||
this.required_time_to_win_in_ticks = 10368000
|
||||
this.surface_terrain = 'forest'
|
||||
end
|
||||
else
|
||||
this.required_time_to_win = 48
|
||||
this.required_time_to_win_in_ticks = 10368000
|
||||
end
|
||||
if value.surface_terrain == 'forest' then
|
||||
this.surface_terrain = 'desert'
|
||||
else
|
||||
this.surface_terrain = 'forest'
|
||||
local value = data.value
|
||||
if value.required_time_to_win == 48 then
|
||||
this.required_time_to_win = 72
|
||||
this.required_time_to_win_in_ticks = 15552000
|
||||
else
|
||||
this.required_time_to_win = 48
|
||||
this.required_time_to_win_in_ticks = 10368000
|
||||
end
|
||||
if value.surface_terrain == 'forest' then
|
||||
this.surface_terrain = 'desert'
|
||||
else
|
||||
this.surface_terrain = 'forest'
|
||||
end
|
||||
end
|
||||
|
||||
settings.required_time_to_win = this.required_time_to_win
|
||||
settings.required_time_to_win_in_ticks = this.required_time_to_win_in_ticks
|
||||
settings.surface_terrain = this.surface_terrain
|
||||
|
||||
Server.set_data(dataset, dataset_key, settings)
|
||||
end
|
||||
)
|
||||
|
||||
settings.required_time_to_win = this.required_time_to_win
|
||||
settings.required_time_to_win_in_ticks = this.required_time_to_win_in_ticks
|
||||
settings.surface_terrain = this.surface_terrain
|
||||
|
||||
Server.set_data(dataset, dataset_key, settings)
|
||||
end
|
||||
)
|
||||
|
||||
local apply_startup_settings = function(this, server_name_matches)
|
||||
local apply_startup_settings = function (this, server_name_matches)
|
||||
local settings = {}
|
||||
|
||||
if this.required_time_to_win == 48 then
|
||||
@ -85,7 +85,7 @@ function Public.nuke(position)
|
||||
if not map_surface or not map_surface.valid then
|
||||
return
|
||||
end
|
||||
map_surface.create_entity({name = 'atomic-rocket', position = position, target = position, speed = 0.5})
|
||||
map_surface.create_entity({ name = 'atomic-rocket', position = position, target = position, speed = 0.5 })
|
||||
end
|
||||
|
||||
function Public.armageddon()
|
||||
@ -98,10 +98,10 @@ function Public.armageddon()
|
||||
for _ = 1, 5 do
|
||||
local px = market.position.x + math_random(1, 256) - 128
|
||||
local py = market.position.y + math_random(1, 256) - 128
|
||||
targets[offset] = {x = px, y = py}
|
||||
targets[offset] = { x = px, y = py }
|
||||
offset = offset + 1
|
||||
end
|
||||
targets[offset] = {x = market.position.x, y = market.position.y}
|
||||
targets[offset] = { x = market.position.x, y = market.position.y }
|
||||
offset = offset + 1
|
||||
end
|
||||
end
|
||||
@ -111,10 +111,10 @@ function Public.armageddon()
|
||||
for _ = 1, 5 do
|
||||
local px = market.position.x + math_random(1, 256) - 128
|
||||
local py = market.position.y + math_random(1, 256) - 128
|
||||
targets[offset] = {x = px, y = py}
|
||||
targets[offset] = { x = px, y = py }
|
||||
offset = offset + 1
|
||||
end
|
||||
targets[offset] = {x = market.position.x, y = market.position.y}
|
||||
targets[offset] = { x = market.position.x, y = market.position.y }
|
||||
offset = offset + 1
|
||||
end
|
||||
end
|
||||
@ -130,7 +130,7 @@ function Public.armageddon()
|
||||
end
|
||||
this.nuke_tick_schedule[future][#this.nuke_tick_schedule[future] + 1] = {
|
||||
callback = 'nuke',
|
||||
params = {position}
|
||||
params = { position }
|
||||
}
|
||||
end
|
||||
end
|
||||
@ -148,40 +148,40 @@ function Public.initialize(init)
|
||||
local mgs = surface_seed.map_gen_settings
|
||||
mgs.default_enable_all_autoplace_controls = true -- don't mess with this!
|
||||
mgs.autoplace_controls = {
|
||||
coal = {frequency = 2, size = 0.1, richness = 0.2},
|
||||
stone = {frequency = 2, size = 0.1, richness = 0.2},
|
||||
['copper-ore'] = {frequency = 5, size = 0.1, richness = 0.1},
|
||||
['iron-ore'] = {frequency = 5, size = 0.1, richness = 0.1},
|
||||
['uranium-ore'] = {frequency = 0, size = 0.1, richness = 0.2},
|
||||
['crude-oil'] = {frequency = 5, size = 0.05, richness = 0.5},
|
||||
trees = {frequency = 2, size = 1, richness = 1},
|
||||
['enemy-base'] = {frequency = 2, size = 2, richness = 1}
|
||||
coal = { frequency = 2, size = 0.1, richness = 0.2 },
|
||||
stone = { frequency = 2, size = 0.1, richness = 0.2 },
|
||||
['copper-ore'] = { frequency = 5, size = 0.1, richness = 0.1 },
|
||||
['iron-ore'] = { frequency = 5, size = 0.1, richness = 0.1 },
|
||||
['uranium-ore'] = { frequency = 0, size = 0.1, richness = 0.2 },
|
||||
['crude-oil'] = { frequency = 5, size = 0.05, richness = 0.5 },
|
||||
trees = { frequency = 2, size = 1, richness = 1 },
|
||||
['enemy-base'] = { frequency = 2, size = 2, richness = 1 }
|
||||
}
|
||||
mgs.autoplace_settings = {
|
||||
entity = {
|
||||
settings = {
|
||||
['rock-huge'] = {frequency = 2, size = 1, richness = 1},
|
||||
['rock-big'] = {frequency = 2, size = 1, richness = 1},
|
||||
['sand-rock-big'] = {frequency = 2, size = 1, richness = 1}
|
||||
['rock-huge'] = { frequency = 2, size = 1, richness = 1 },
|
||||
['rock-big'] = { frequency = 2, size = 1, richness = 1 },
|
||||
['sand-rock-big'] = { frequency = 2, size = 1, richness = 1 }
|
||||
}
|
||||
},
|
||||
decorative = {
|
||||
settings = {
|
||||
['rock-tiny'] = {frequency = 10, size = 'normal', richness = 'normal'},
|
||||
['rock-small'] = {frequency = 5, size = 'normal', richness = 'normal'},
|
||||
['rock-medium'] = {frequency = 2, size = 'normal', richness = 'normal'},
|
||||
['sand-rock-small'] = {frequency = 10, size = 'normal', richness = 'normal'},
|
||||
['sand-rock-medium'] = {frequency = 5, size = 'normal', richness = 'normal'}
|
||||
['rock-tiny'] = { frequency = 10, size = 'normal', richness = 'normal' },
|
||||
['rock-small'] = { frequency = 5, size = 'normal', richness = 'normal' },
|
||||
['rock-medium'] = { frequency = 2, size = 'normal', richness = 'normal' },
|
||||
['sand-rock-small'] = { frequency = 10, size = 'normal', richness = 'normal' },
|
||||
['sand-rock-medium'] = { frequency = 5, size = 'normal', richness = 'normal' }
|
||||
}
|
||||
},
|
||||
tile = {
|
||||
settings = {
|
||||
['deepwater'] = {frequency = 1, size = 0, richness = 1},
|
||||
['deepwater-green'] = {frequency = 1, size = 0, richness = 1},
|
||||
['water'] = {frequency = 1, size = 0, richness = 1},
|
||||
['water-green'] = {frequency = 1, size = 0, richness = 1},
|
||||
['water-mud'] = {frequency = 1, size = 0, richness = 1},
|
||||
['water-shallow'] = {frequency = 1, size = 0, richness = 1}
|
||||
['deepwater'] = { frequency = 1, size = 0, richness = 1 },
|
||||
['deepwater-green'] = { frequency = 1, size = 0, richness = 1 },
|
||||
['water'] = { frequency = 1, size = 0, richness = 1 },
|
||||
['water-green'] = { frequency = 1, size = 0, richness = 1 },
|
||||
['water-mud'] = { frequency = 1, size = 0, richness = 1 },
|
||||
['water-shallow'] = { frequency = 1, size = 0, richness = 1 }
|
||||
},
|
||||
treat_missing_as_default = true
|
||||
}
|
||||
@ -258,7 +258,7 @@ function Public.initialize(init)
|
||||
surface.freeze_daytime = false
|
||||
-- surface.map_gen_settings.water = 0.5
|
||||
surface.clear(true)
|
||||
surface.regenerate_entity({'rock-huge', 'rock-big', 'sand-rock-big'})
|
||||
surface.regenerate_entity({ 'rock-huge', 'rock-big', 'sand-rock-big' })
|
||||
surface.regenerate_decorative()
|
||||
end
|
||||
|
||||
@ -286,7 +286,7 @@ Event.add(defines.events.on_tick, on_tick)
|
||||
|
||||
Event.add(
|
||||
Server.events.on_server_started,
|
||||
function()
|
||||
function ()
|
||||
local this = ScenarioTable.get_table()
|
||||
if this.settings_applied then
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user