mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-17 20:58:13 +02:00
tweaks
This commit is contained in:
parent
d50058606e
commit
34d39b00e5
@ -58,8 +58,8 @@ function reset_map()
|
||||
|
||||
local surface = game.surfaces[global.active_surface_index]
|
||||
|
||||
surface.freeze_daytime = true
|
||||
surface.daytime = 0.5
|
||||
--surface.freeze_daytime = true
|
||||
--surface.daytime = 0.5
|
||||
surface.request_to_generate_chunks({0,0}, 2)
|
||||
surface.force_generate_chunk_requests()
|
||||
|
||||
@ -91,9 +91,9 @@ function reset_map()
|
||||
|
||||
global.wave_defense.game_lost = false
|
||||
|
||||
for _, p in pairs(game.connected_players) do
|
||||
if p.character then p.character.disable_flashlight() end
|
||||
end
|
||||
--for _, p in pairs(game.connected_players) do
|
||||
-- if p.character then p.character.disable_flashlight() end
|
||||
--end
|
||||
end
|
||||
|
||||
local function protect_train(event)
|
||||
@ -215,9 +215,17 @@ local function on_research_finished(event)
|
||||
event.research.force.manual_mining_speed_modifier = mining_speed_bonus
|
||||
end
|
||||
|
||||
local function set_difficulty()
|
||||
--20 Players for maximum difficulty
|
||||
global.wave_defense.wave_interval = 3600 - #game.connected_players * 90
|
||||
if global.wave_defense.wave_interval < 1800 then global.wave_defense.wave_interval = 1800 end
|
||||
end
|
||||
|
||||
local function on_player_joined_game(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.character then player.character.disable_flashlight() end
|
||||
--if player.character then player.character.disable_flashlight() end
|
||||
|
||||
set_difficulty()
|
||||
|
||||
local surface = game.surfaces[global.active_surface_index]
|
||||
|
||||
@ -228,10 +236,6 @@ local function on_player_joined_game(event)
|
||||
global.player_modifiers[player.index].character_mining_speed_modifier["mountain_fortress"] = 0.5
|
||||
update_player_modifiers(player)
|
||||
|
||||
--20 Players for maximum difficulty
|
||||
global.wave_defense.wave_interval = 3600 - #game.connected_players * 90
|
||||
if global.wave_defense.wave_interval < 1800 then global.wave_defense.wave_interval = 1800 end
|
||||
|
||||
if player.online_time == 0 then
|
||||
player.teleport(surface.find_non_colliding_position("character", game.forces.player.get_spawn_position(surface), 3, 0.5), surface)
|
||||
for item, amount in pairs(starting_items) do
|
||||
@ -249,12 +253,12 @@ local function on_player_joined_game(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
local function on_player_respawned(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.character then player.character.disable_flashlight() end
|
||||
end
|
||||
|
||||
]]
|
||||
|
||||
local function on_init(surface)
|
||||
global.rocks_yield_ore_maximum_amount = 999
|
||||
@ -299,6 +303,6 @@ event.add(defines.events.on_entity_died, on_entity_died)
|
||||
event.add(defines.events.on_player_mined_entity, on_player_mined_entity)
|
||||
event.add(defines.events.on_research_finished, on_research_finished)
|
||||
event.add(defines.events.on_player_joined_game, on_player_joined_game)
|
||||
event.add(defines.events.on_player_respawned, on_player_respawned)
|
||||
--event.add(defines.events.on_player_respawned, on_player_respawned)
|
||||
|
||||
require "modules.rocks_yield_ore"
|
@ -90,7 +90,7 @@ local function process_rock_chunk_position(p, seed, tiles, entities, markets, tr
|
||||
if noise_cave_ponds < -0.80 then
|
||||
tiles[#tiles + 1] = {name = "grass-" .. math.floor(noise_cave_ponds * 32) % 3 + 1, position = p}
|
||||
if math_random(1,32) == 1 then markets[#markets + 1] = p end
|
||||
if math_random(1,32) == 1 then entities[#entities + 1] = {name = "tree-0" .. math_random(1, 9), position=p} end
|
||||
if math_random(1,16) == 1 then entities[#entities + 1] = {name = "tree-0" .. math_random(1, 9), position=p} end
|
||||
return
|
||||
end
|
||||
|
||||
@ -111,12 +111,17 @@ local function process_rock_chunk_position(p, seed, tiles, entities, markets, tr
|
||||
end
|
||||
end
|
||||
|
||||
--Main Rock Terrain
|
||||
tiles[#tiles + 1] = {name = "dirt-7", position = p}
|
||||
if math_random(1,2048) == 1 then treasure[#treasure + 1] = p end
|
||||
--Main Rock Terrain
|
||||
|
||||
local no_rocks_2 = get_noise("no_rocks_2", p, seed + 75000)
|
||||
if no_rocks_2 > 0.82 then return end
|
||||
if no_rocks_2 < -0.82 then return end
|
||||
if no_rocks_2 > 0.80 or no_rocks_2 < -0.80 then
|
||||
tiles[#tiles + 1] = {name = "dirt-" .. math.floor(no_rocks_2 * 8) % 2 + 5, position = p}
|
||||
if math_random(1,512) == 1 then treasure[#treasure + 1] = p end
|
||||
return
|
||||
end
|
||||
|
||||
if math_random(1,2048) == 1 then treasure[#treasure + 1] = p end
|
||||
tiles[#tiles + 1] = {name = "dirt-7", position = p}
|
||||
if math_random(1,4) > 1 then entities[#entities + 1] = {name = rock_raffle[math_random(1, #rock_raffle)], position = p} end
|
||||
return
|
||||
end
|
||||
|
@ -10,7 +10,7 @@ local valid_entities = {
|
||||
local rock_mining_chance_weights = {
|
||||
{"iron-ore", 25},
|
||||
{"copper-ore",18},
|
||||
{"rainbow",15},
|
||||
{"mixed",15},
|
||||
{"coal",14},
|
||||
{"stone",8},
|
||||
{"uranium-ore",3}
|
||||
@ -23,22 +23,23 @@ for _, t in pairs (rock_mining_chance_weights) do
|
||||
end
|
||||
end
|
||||
|
||||
local rainbow_ores = {"iron-ore", "copper-ore", "stone", "coal"}
|
||||
local mixed_ores = {"iron-ore", "copper-ore", "stone", "coal"}
|
||||
|
||||
local size_raffle = {
|
||||
{"huge", 33, 42},
|
||||
{"giant", 65, 128},
|
||||
{"huge", 33, 64},
|
||||
{"big", 17, 32},
|
||||
{"", 8, 16},
|
||||
{"tiny", 5, 11},
|
||||
{"smol", 9, 16},
|
||||
{"tiny", 4, 8},
|
||||
}
|
||||
|
||||
local ore_prints = {
|
||||
["coal"] = {"dark", "Coal"},
|
||||
["iron-ore"] = {"shiny", "Iron"},
|
||||
["copper-ore"] = {"glimmering", "Copper"},
|
||||
["uranium-ore"] = {"glowing", "Uranium"},
|
||||
["stone"] = {"solid", "Stone"},
|
||||
["rainbow"] = {"glitter", "Rainbow ore"},
|
||||
["coal"] = {"dark", "coal"},
|
||||
["iron-ore"] = {"shiny", "iron"},
|
||||
["copper-ore"] = {"glimmering", "copper"},
|
||||
["uranium-ore"] = {"glowing", "uranium"},
|
||||
["stone"] = {"solid", "stone"},
|
||||
["mixed"] = {"glitter", "mixed ore"},
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +63,7 @@ local function draw_chain(surface, count, ore, ore_entities, ore_positions)
|
||||
position.y = p.y
|
||||
ore_positions[p.x .. "_" .. p.y] = true
|
||||
local name = ore
|
||||
if ore == "rainbow" then name = rainbow_ores[math_random(1, #rainbow_ores)] end
|
||||
if ore == "mixed" then name = mixed_ores[math_random(1, #mixed_ores)] end
|
||||
ore_entities[#ore_entities + 1] = {name = name, position = p, amount = get_amount(position)}
|
||||
break
|
||||
end
|
||||
@ -86,8 +87,8 @@ local function ore_vein(event)
|
||||
end
|
||||
|
||||
local ore_entities = {{name = ore, position = {x = event.entity.position.x, y = event.entity.position.y}, amount = get_amount(event.entity.position)}}
|
||||
if ore == "rainbow" then
|
||||
ore_entities = {{name = rainbow_ores[math_random(1, #rainbow_ores)], position = {x = event.entity.position.x, y = event.entity.position.y}, amount = get_amount(event.entity.position)}}
|
||||
if ore == "mixed" then
|
||||
ore_entities = {{name = mixed_ores[math_random(1, #mixed_ores)], position = {x = event.entity.position.x, y = event.entity.position.y}, amount = get_amount(event.entity.position)}}
|
||||
end
|
||||
|
||||
local ore_positions = {[event.entity.position.x .. "_" .. event.entity.position.y] = true}
|
||||
|
Loading…
x
Reference in New Issue
Block a user