mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-24 03:47:58 +02:00
commit
98c4beac87
@ -32,10 +32,10 @@ local Public = {}
|
||||
|
||||
local starting_items = {
|
||||
['pistol'] = 1,
|
||||
['firearm-magazine'] = 16,
|
||||
['raw-fish'] = 3,
|
||||
['iron-plate'] = 32,
|
||||
['stone'] = 12
|
||||
['firearm-magazine'] = 20,
|
||||
['raw-fish'] = 5,
|
||||
['iron-plate'] = 40,
|
||||
['stone'] = 20
|
||||
}
|
||||
|
||||
local function shuffle(tbl)
|
||||
@ -1369,24 +1369,37 @@ function Public.reset_game()
|
||||
Session.clear_player(player)
|
||||
end
|
||||
|
||||
--test idea
|
||||
--local spawn_poses = {
|
||||
-- {x = 0, y = 0},
|
||||
-- {x = -512, y = 0},
|
||||
-- {x = -512, y = 192},
|
||||
-- {x = -512, y = -192}
|
||||
--}
|
||||
|
||||
local map_gen_settings = {}
|
||||
map_gen_settings.seed = math_random(10000, 99999)
|
||||
map_gen_settings.starting_area = 1
|
||||
--map_gen_settings.starting_points = spawn_poses
|
||||
|
||||
map_gen_settings.width = 4000
|
||||
map_gen_settings.height = 1800
|
||||
map_gen_settings.water = 0.10
|
||||
map_gen_settings.terrain_segmentation = 3
|
||||
map_gen_settings.cliff_settings = {cliff_elevation_interval = 32, cliff_elevation_0 = 32}
|
||||
map_gen_settings.autoplace_controls = {
|
||||
['coal'] = {frequency = 4, size = 1.5, richness = 2},
|
||||
['stone'] = {frequency = 4, size = 1.5, richness = 2},
|
||||
['copper-ore'] = {frequency = 4, size = 1.5, richness = 2},
|
||||
['iron-ore'] = {frequency = 4, size = 1.5, richness = 2},
|
||||
['coal'] = {frequency = 6, size = 1.2, richness = 1.5},
|
||||
['stone'] = {frequency = 6, size = 1.2, richness = 1.5},
|
||||
['copper-ore'] = {frequency = 6, size = 1.6, richness = 2},
|
||||
['iron-ore'] = {frequency = 6, size = 1.6, richness = 2},
|
||||
['uranium-ore'] = {frequency = 0, size = 0, richness = 0},
|
||||
['crude-oil'] = {frequency = 5, size = 1.25, richness = 2},
|
||||
['trees'] = {frequency = 2, size = 1, richness = 1},
|
||||
['trees'] = {frequency = 3, size = 0.15, richness = 0.5},
|
||||
['enemy-base'] = {frequency = 'none', size = 'none', richness = 'none'}
|
||||
}
|
||||
|
||||
map_gen_settings.property_expression_names = {moisture = math_random(4, 7) * 0.1}
|
||||
|
||||
local active_surface_index = FDT.get('active_surface_index')
|
||||
|
||||
if not active_surface_index then
|
||||
|
@ -49,18 +49,18 @@ function Public.reset_table()
|
||||
this.boss_biters = {}
|
||||
this.acid_lines_delay = {}
|
||||
this.entity_limits = {
|
||||
['gun-turret'] = {placed = 1, limit = 1, str = 'gun turret', slot_price = 75},
|
||||
['gun-turret'] = {placed = 1, limit = 3, str = 'gun turret', slot_price = 70},
|
||||
['laser-turret'] = {placed = 0, limit = 1, str = 'laser turret', slot_price = 300},
|
||||
['artillery-turret'] = {placed = 0, limit = 1, str = 'artillery turret', slot_price = 500},
|
||||
['flamethrower-turret'] = {placed = 0, limit = 0, str = 'flamethrower turret', slot_price = 50000},
|
||||
['land-mine'] = {placed = 0, limit = 1, str = 'mine', slot_price = 20}
|
||||
}
|
||||
this.difficulties_votes = {
|
||||
[1] = {wave_interval = 3800, amount_modifier = 0.92, strength_modifier = 0.85, boss_modifier = 5.0},
|
||||
[1] = {wave_interval = 3800, amount_modifier = 0.90, strength_modifier = 0.90, boss_modifier = 5.0},
|
||||
[2] = {wave_interval = 3600, amount_modifier = 1.00, strength_modifier = 1.00, boss_modifier = 6.0},
|
||||
[3] = {wave_interval = 3400, amount_modifier = 1.08, strength_modifier = 1.25, boss_modifier = 7.0},
|
||||
[4] = {wave_interval = 3100, amount_modifier = 1.24, strength_modifier = 1.75, boss_modifier = 8.0},
|
||||
[5] = {wave_interval = 2700, amount_modifier = 1.48, strength_modifier = 2.50, boss_modifier = 9.0}
|
||||
[3] = {wave_interval = 3400, amount_modifier = 1.10, strength_modifier = 1.30, boss_modifier = 7.0},
|
||||
[4] = {wave_interval = 3200, amount_modifier = 1.20, strength_modifier = 1.60, boss_modifier = 8.0},
|
||||
[5] = {wave_interval = 3000, amount_modifier = 1.40, strength_modifier = 2.20, boss_modifier = 9.0}
|
||||
}
|
||||
this.boss_waves = {
|
||||
[50] = {{name = 'big-biter', count = 3}},
|
||||
|
@ -7,6 +7,15 @@ local math_random = math.random
|
||||
local math_abs = math.abs
|
||||
local math_sqrt = math.sqrt
|
||||
|
||||
--rock spawning code for stone pile
|
||||
local rock_raffle = {'sand-rock-big', 'sand-rock-big', 'rock-big', 'rock-big', 'rock-big', 'rock-huge'}
|
||||
local size_of_rock_raffle = #rock_raffle
|
||||
local function place_rock(surface, position)
|
||||
local a = (math_random(-250, 250)) * 0.05
|
||||
local b = (math_random(-250, 250)) * 0.05
|
||||
surface.create_entity({name = rock_raffle[math_random(1, size_of_rock_raffle)], position = {position.x + a, position.y + b}})
|
||||
end
|
||||
|
||||
local function shuffle(tbl)
|
||||
local size = #tbl
|
||||
for i = size, 1, -1 do
|
||||
@ -191,10 +200,15 @@ local function generate_spawn_area(surface)
|
||||
{x = spawn_position_x - 52, y = _y * -1}
|
||||
}
|
||||
shuffle(ore_positions)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[1], 'copper-ore', surface, 15, 2500)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[2], 'iron-ore', surface, 15, 2500)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[3], 'coal', surface, 15, 1500)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[4], 'stone', surface, 15, 1500)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[1], 'copper-ore', surface, 16, 3500)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[2], 'iron-ore', surface, 16, 3500)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[3], 'coal', surface, 16, 2500)
|
||||
map_functions.draw_smoothed_out_ore_circle(ore_positions[4], 'stone', surface, 16, 2500)
|
||||
|
||||
for _ = 0,10,1 do
|
||||
place_rock(surface, ore_positions[4]) --add rocks to stone area
|
||||
end
|
||||
|
||||
map_functions.draw_noise_tile_circle({x = spawn_position_x - 20, y = 0}, 'water', surface, 16)
|
||||
map_functions.draw_oil_circle(ore_positions[5], 'crude-oil', surface, 8, 200000)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user