mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2024-12-26 22:56:43 +02:00
update
treasure notifications are now alerts chance & terrain tweaks
This commit is contained in:
parent
bcf2280538
commit
3e35376e50
@ -4,12 +4,12 @@ Public.treasures = {
|
||||
["wooden-chest"] = {
|
||||
tech_bonus = 0.1,
|
||||
amount_multiplier = 1,
|
||||
--description = "an old crate, containing some useful goods.",
|
||||
description = "an old wooden crate.",
|
||||
},
|
||||
["iron-chest"] = {
|
||||
tech_bonus = 0.15,
|
||||
amount_multiplier = 1.5,
|
||||
--description = "an iron crate.",
|
||||
description = "an antique iron crate.",
|
||||
},
|
||||
["steel-chest"] = {
|
||||
tech_bonus = 0.2,
|
||||
|
@ -153,10 +153,15 @@ function Public.loot_crate(surface, position, container_name, player_index)
|
||||
if not description then return end
|
||||
if not player_index then return end
|
||||
local player = game.players[player_index]
|
||||
local text
|
||||
if math_random(1, 2) == 1 then
|
||||
game.print(player.name .. " found " .. description, {200, 200, 200})
|
||||
text = player.name .. " found " .. description
|
||||
else
|
||||
game.print(player.name .. " uncovered " .. description, {200, 200, 200})
|
||||
text = player.name .. " uncovered " .. description
|
||||
end
|
||||
|
||||
for _, player in pairs(game.forces.player.connected_players) do
|
||||
player.add_custom_alert(container, {type = "item", name = container.name}, text, true)
|
||||
end
|
||||
end
|
||||
|
||||
@ -262,7 +267,7 @@ end
|
||||
|
||||
Public.mining_events = {
|
||||
{function(cave_miner, entity, player_index)
|
||||
end, 300000, "Nothing"},
|
||||
end, 320000, "Nothing"},
|
||||
|
||||
{function(cave_miner, entity, player_index)
|
||||
local amount = Public.roll_biter_amount()
|
||||
@ -365,7 +370,7 @@ Public.mining_events = {
|
||||
local surface = entity.surface
|
||||
Public.place_worm(surface, position, 1)
|
||||
Public.unstuck_player(player_index)
|
||||
end, 2048, "Worm"},
|
||||
end, 1024, "Worm"},
|
||||
|
||||
{function(cave_miner, entity, player_index)
|
||||
local position = entity.position
|
||||
@ -375,15 +380,15 @@ Public.mining_events = {
|
||||
Public.unstuck_player(player_index)
|
||||
local difficulty_modifier = Public.get_difficulty_modifier(position)
|
||||
local tick = game.tick
|
||||
for c = 1, math_random(1, 9), 1 do
|
||||
for c = 1, math_random(1, 7), 1 do
|
||||
Esq.add_to_queue(
|
||||
tick + c * 90 + math_random(0, 90),
|
||||
surface,
|
||||
{name = BiterRaffle.roll("worm", difficulty_modifier), position = {position.x + (-5 + math_random(0, 10)), position.y + (-5 + math_random(0, 10))}, force = "enemy"},
|
||||
32
|
||||
{name = BiterRaffle.roll("worm", difficulty_modifier), position = {position.x + (-4 + math_random(0, 8)), position.y + (-4 + math_random(0, 8))}, force = "enemy"},
|
||||
16
|
||||
)
|
||||
end
|
||||
end, 256, "Worms"},
|
||||
end, 128, "Worms"},
|
||||
|
||||
{function(cave_miner, entity, player_index)
|
||||
local position = entity.position
|
||||
|
@ -108,8 +108,8 @@ local function init(cave_miner)
|
||||
Terrain.roll_source_surface()
|
||||
|
||||
local surface = game.surfaces.nauvis
|
||||
surface.min_brightness = 0.01
|
||||
surface.brightness_visual_weights = {0.99, 0.99, 0.99}
|
||||
surface.min_brightness = 0.10
|
||||
surface.brightness_visual_weights = {0.90, 0.90, 0.90}
|
||||
surface.daytime = 0.43
|
||||
surface.freeze_daytime = true
|
||||
surface.solar_power_multiplier = 5
|
||||
|
@ -111,7 +111,7 @@ function biomes.spawn(surface, seed, position, square_distance)
|
||||
if square_distance < 32 then return end
|
||||
local noise = GetNoise("decoratives", position, seed)
|
||||
|
||||
if math_abs(noise) > 0.60 and square_distance < 1250 then
|
||||
if math_abs(noise) > 0.60 and square_distance < 900 then
|
||||
surface.set_tiles({{name = "water", position = position}}, true, false, false, false)
|
||||
if math_random(1, 16) == 1 then surface.create_entity({name = "fish", position = position}) end
|
||||
return
|
||||
@ -171,7 +171,7 @@ function biomes.cave(surface, seed, position, square_distance, noise)
|
||||
|
||||
local noise_rock = GetNoise("small_caves", position, seed)
|
||||
|
||||
if noise_rock < 0.5 then
|
||||
if noise_rock < 0.6 then
|
||||
if math_random(1, 3) > 1 then
|
||||
local a = (-49 + math_random(0, 98)) * 0.01
|
||||
local b = (-49 + math_random(0, 98)) * 0.01
|
||||
@ -190,7 +190,7 @@ end
|
||||
|
||||
local function get_biome(surface, seed, position)
|
||||
local d = position.x ^ 2 + position.y ^ 2
|
||||
if d < 2048 then return biomes.spawn, d end
|
||||
if d < 1024 then return biomes.spawn, d end
|
||||
|
||||
local noise = GetNoise("cave_miner_01", position, seed)
|
||||
local abs_noise = math_abs(noise)
|
||||
|
Loading…
Reference in New Issue
Block a user