mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-11 14:49:24 +02:00
cave choppy fixes
This commit is contained in:
parent
4d06dbc2cb
commit
b8d9f5bbae
File diff suppressed because it is too large
Load Diff
@ -1,115 +0,0 @@
|
||||
0.21
|
||||
Ore bonus yield limited at the maximum biter difficulty.
|
||||
|
||||
0.20
|
||||
a big part of the lootboxes are now hidden within the rocks
|
||||
|
||||
0.19
|
||||
markets are now also fish bank terminals
|
||||
fish can not be deconstructed anymore
|
||||
|
||||
0.18
|
||||
cargo wagons, tanks and cars can now only detonate with less than 150 health
|
||||
|
||||
0.17
|
||||
explosives are now a new game mechanic
|
||||
loot rebalances
|
||||
ore yield balance
|
||||
|
||||
0.16
|
||||
oil should no longer clutter
|
||||
increased rock destruction performance (maybe)
|
||||
rocks now heal over time
|
||||
|
||||
0.15
|
||||
players in vehicles no longer get hungry
|
||||
faster mining speed but lower ore yield for more exploration
|
||||
new fully staged chest loot
|
||||
|
||||
0.14
|
||||
hunger over time reduced
|
||||
reduced worms
|
||||
ore vein spawn fix
|
||||
|
||||
0.13
|
||||
biter attack events frequency reduced
|
||||
players in vehicles are safe from random biter spawns
|
||||
hunger gain from passing time reduced
|
||||
|
||||
0.12
|
||||
reduced ore spill from rock destruction to reduce lagspike
|
||||
ore veins are usually bigger now and can appear earlier
|
||||
biters have a bit more damage against rocks
|
||||
market adjustments
|
||||
readded worms in main tunnels
|
||||
crude oil is allowed to spawn a bit closer
|
||||
access to the lakes and labyrinth areas should be a bit wider now
|
||||
damage against huge rocks has been increased
|
||||
biter spawn interval adjustments
|
||||
|
||||
0.11
|
||||
mining speed buff
|
||||
ore veins are more common
|
||||
|
||||
0.10
|
||||
difficulty adjustments
|
||||
spawn fixes
|
||||
|
||||
0.09
|
||||
ore veins are more common with more yield
|
||||
added info panel
|
||||
added more worms
|
||||
added extra bases in main mine shafts
|
||||
adjusted running speed modifier
|
||||
adjusted biter attack events
|
||||
modified chest loot tables
|
||||
mining trees now makes you earn fish
|
||||
|
||||
0.08
|
||||
rock "labyrinth" biome
|
||||
periodic biter attack events, the mines have become more dangerous
|
||||
custom spawn trees
|
||||
|
||||
0.07
|
||||
small chance that rocks might reveal an ore vein
|
||||
rocks now always drop stone
|
||||
players are now getting hungry
|
||||
|
||||
0.06
|
||||
added stats gui
|
||||
mining productivity research will now upgrade your backpack to ease your mining
|
||||
fishing is more enjoyable now
|
||||
rebalanced oil spots
|
||||
spawn inventory loadout changes
|
||||
|
||||
0.05
|
||||
biter & worm generation is now completely custom
|
||||
biters claws now have a hard time to dig through the solid rock
|
||||
secret shops spawn now in lake biomes
|
||||
mining productivity research boosts cave rock mining speed for triple the value
|
||||
|
||||
0.04
|
||||
biters no longer instantly surround the player
|
||||
|
||||
0.03
|
||||
market nerf
|
||||
darkness buff
|
||||
mining productivity research now applies to cave rock mining
|
||||
lakes now have fish
|
||||
added cave treasure
|
||||
|
||||
0.02
|
||||
space cleared around enemy spawners
|
||||
fish market adjustments
|
||||
maximum ore spill variable (rest gets inserted directly)
|
||||
biters now also pop out of destroyed rocks
|
||||
adjustments to ore chances
|
||||
noise adjustments
|
||||
different enemies now spawn the deeper you dig
|
||||
enemy spawn pool redone
|
||||
darkness is now a hazard, stay near lamps for survival
|
||||
caves are now permanently dark
|
||||
added lake biomes
|
||||
|
||||
0.01
|
||||
diggy diggy hole
|
File diff suppressed because it is too large
Load Diff
@ -1,36 +1,36 @@
|
||||
local items = {}
|
||||
items.spawn = {
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'rail', count = 4}},
|
||||
{price = {{"raw-fish", 150}}, offer = {type = 'give-item', item = 'infinity-chest', count = 1}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'rail-signal', count = 2}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'rail-chain-signal', count = 2}},
|
||||
{price = {{"raw-fish", 10}}, offer = {type = 'give-item', item = 'train-stop'}},
|
||||
{price = {{"raw-fish", 94}}, offer = {type = 'give-item', item = 'locomotive'}},
|
||||
{price = {{"raw-fish", 35}}, offer = {type = 'give-item', item = 'cargo-wagon'}},
|
||||
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'red-wire', count = 1}},
|
||||
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'green-wire', count = 1}},
|
||||
{price = {{"raw-fish", 4}}, offer = {type = 'give-item', item = 'decider-combinator'}},
|
||||
{price = {{"raw-fish", 4}}, offer = {type = 'give-item', item = 'arithmetic-combinator'}},
|
||||
{price = {{"raw-fish", 2}}, offer = {type = 'give-item', item = 'constant-combinator'}},
|
||||
{price = {{"raw-fish", 4}}, offer = {type = 'give-item', item = 'programmable-speaker'}},
|
||||
{price = {{"raw-fish", 2}}, offer = {type = 'give-item', item = 'small-lamp'}},
|
||||
{price = {{"raw-fish", 2}}, offer = {type = 'give-item', item = 'firearm-magazine'}},
|
||||
{price = {{"raw-fish", 4}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine'}},
|
||||
{price = {{"raw-fish", 3}}, offer = {type = 'give-item', item = 'grenade'}},
|
||||
{price = {{"raw-fish", 2}}, offer = {type = 'give-item', item = 'land-mine'}},
|
||||
{price = {{"raw-fish", 1}}, offer = {type = 'give-item', item = 'explosives', count = 2}},
|
||||
{price = {{"raw-fish", 40}}, offer = {type = 'give-item', item = 'cliff-explosives'}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'wood', count = 25}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'iron-ore', count = 25}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'copper-ore', count = 25}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'stone', count = 25}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'coal', count = 25}},
|
||||
{price = {{"raw-fish", 5}}, offer = {type = 'give-item', item = 'uranium-ore', count = 20}},
|
||||
{price = {{'wood', 25}}, offer = {type = 'give-item', item = "raw-fish", count = 2}},
|
||||
{price = {{'iron-ore', 25}}, offer = {type = 'give-item', item = "raw-fish", count = 2}},
|
||||
{price = {{'copper-ore', 25}}, offer = {type = 'give-item', item = "raw-fish", count = 2}},
|
||||
{price = {{'stone', 25}}, offer = {type = 'give-item', item = "raw-fish", count = 2}},
|
||||
{price = {{'coal', 25}}, offer = {type = 'give-item', item = "raw-fish", count = 2}},
|
||||
{price = {{'uranium-ore', 20}}, offer = {type = 'give-item', item = "raw-fish", count = 2}}
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'rail', count = 4}},
|
||||
{price = {{'raw-fish', 150}}, offer = {type = 'give-item', item = 'infinity-chest', count = 1}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'rail-signal', count = 2}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'rail-chain-signal', count = 2}},
|
||||
{price = {{'raw-fish', 10}}, offer = {type = 'give-item', item = 'train-stop'}},
|
||||
{price = {{'raw-fish', 94}}, offer = {type = 'give-item', item = 'locomotive'}},
|
||||
{price = {{'raw-fish', 35}}, offer = {type = 'give-item', item = 'cargo-wagon'}},
|
||||
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'red-wire', count = 1}},
|
||||
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'green-wire', count = 1}},
|
||||
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'decider-combinator'}},
|
||||
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'arithmetic-combinator'}},
|
||||
{price = {{'raw-fish', 2}}, offer = {type = 'give-item', item = 'constant-combinator'}},
|
||||
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'programmable-speaker'}},
|
||||
{price = {{'raw-fish', 2}}, offer = {type = 'give-item', item = 'small-lamp'}},
|
||||
{price = {{'raw-fish', 2}}, offer = {type = 'give-item', item = 'firearm-magazine'}},
|
||||
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'piercing-rounds-magazine'}},
|
||||
{price = {{'raw-fish', 3}}, offer = {type = 'give-item', item = 'grenade'}},
|
||||
{price = {{'raw-fish', 2}}, offer = {type = 'give-item', item = 'land-mine'}},
|
||||
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'explosives', count = 2}},
|
||||
{price = {{'raw-fish', 40}}, offer = {type = 'give-item', item = 'cliff-explosives'}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'wood', count = 25}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'iron-ore', count = 25}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'copper-ore', count = 25}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'stone', count = 25}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'coal', count = 25}},
|
||||
{price = {{'raw-fish', 5}}, offer = {type = 'give-item', item = 'uranium-ore', count = 20}},
|
||||
{price = {{'wood', 25}}, offer = {type = 'give-item', item = 'raw-fish', count = 2}},
|
||||
{price = {{'iron-ore', 25}}, offer = {type = 'give-item', item = 'raw-fish', count = 2}},
|
||||
{price = {{'copper-ore', 25}}, offer = {type = 'give-item', item = 'raw-fish', count = 2}},
|
||||
{price = {{'stone', 25}}, offer = {type = 'give-item', item = 'raw-fish', count = 2}},
|
||||
{price = {{'coal', 25}}, offer = {type = 'give-item', item = 'raw-fish', count = 2}},
|
||||
{price = {{'uranium-ore', 20}}, offer = {type = 'give-item', item = 'raw-fish', count = 2}}
|
||||
}
|
||||
return items
|
||||
return items
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,68 +1,88 @@
|
||||
local Event = require "utils.event"
|
||||
local Global = require "utils.global"
|
||||
local Event = require 'utils.event'
|
||||
local Global = require 'utils.global'
|
||||
|
||||
local function validate_player(player)
|
||||
if not player then return false end
|
||||
if not player.valid then return false end
|
||||
if not player.character then return false end
|
||||
if not player.connected then return false end
|
||||
if not game.players[player.name] then return false end
|
||||
return true
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
if not player.valid then
|
||||
return false
|
||||
end
|
||||
if not player.character then
|
||||
return false
|
||||
end
|
||||
if not player.connected then
|
||||
return false
|
||||
end
|
||||
if not game.players[player.name] then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local cooldowns = {}
|
||||
local chests = {}
|
||||
local inventories = {}
|
||||
|
||||
Global.register({
|
||||
chests = chests,
|
||||
inventories = inventories
|
||||
}, function(global)
|
||||
chests = global.chests
|
||||
inventories = global.inventories
|
||||
end)
|
||||
|
||||
Global.register({
|
||||
cooldowns = cooldowns
|
||||
}, function(global)
|
||||
cooldowns = global.cooldowns
|
||||
end)
|
||||
|
||||
|
||||
|
||||
local function check_player_ports(event)
|
||||
for _, player in pairs(game.connected_players) do
|
||||
if not validate_player(player) then goto continue end
|
||||
|
||||
if not cooldowns[player.name] then
|
||||
cooldowns[player.name] = game.tick
|
||||
Global.register(
|
||||
{
|
||||
chests = chests,
|
||||
inventories = inventories
|
||||
},
|
||||
function(global)
|
||||
chests = global.chests
|
||||
inventories = global.inventories
|
||||
end
|
||||
|
||||
--if cooldowns[player.name] - game.tick > 0 then goto continue end
|
||||
)
|
||||
|
||||
if player.surface.find_entity("player-port", player.position) then
|
||||
if cooldowns[player.name] > game.tick then
|
||||
player.play_sound{path="utility/armor_insert", volume_modifier=1}
|
||||
if math.random(1,3) == 1 then
|
||||
player.surface.create_entity({
|
||||
name = "flying-text",
|
||||
position = player.position,
|
||||
text = math.ceil((cooldowns[tostring(player.name)] - game.tick)/60),
|
||||
color = {r = math.random(130, 170), g = math.random(130, 170), b = 130}
|
||||
})
|
||||
Global.register(
|
||||
{
|
||||
cooldowns = cooldowns
|
||||
},
|
||||
function(global)
|
||||
cooldowns = global.cooldowns
|
||||
end
|
||||
)
|
||||
|
||||
local function check_player_ports()
|
||||
for _, player in pairs(game.connected_players) do
|
||||
if not validate_player(player) then
|
||||
goto continue
|
||||
end
|
||||
goto continue end
|
||||
local surface_name = player.surface.name == "cave_miner" and "choppy" or "cave_miner"
|
||||
local pos = surface_name == "cave_miner" and global.surface_cave_elevator.position or {1, -4}
|
||||
local safe_pos = game.surfaces[surface_name].find_non_colliding_position("character", pos, 20, 1)
|
||||
if safe_pos then
|
||||
player.teleport(safe_pos, surface_name)
|
||||
else
|
||||
player.teleport({0, -3}, surface_name)
|
||||
end
|
||||
cooldowns[player.name] = game.tick + 900
|
||||
end
|
||||
--[[
|
||||
|
||||
if not cooldowns[player.name] then
|
||||
cooldowns[player.name] = game.tick
|
||||
end
|
||||
|
||||
--if cooldowns[player.name] - game.tick > 0 then goto continue end
|
||||
|
||||
if player.surface.find_entity('player-port', player.position) then
|
||||
if cooldowns[player.name] > game.tick then
|
||||
player.play_sound {path = 'utility/armor_insert', volume_modifier = 1}
|
||||
if math.random(1, 3) == 1 then
|
||||
player.surface.create_entity(
|
||||
{
|
||||
name = 'flying-text',
|
||||
position = player.position,
|
||||
text = math.ceil((cooldowns[tostring(player.name)] - game.tick) / 60),
|
||||
color = {r = math.random(130, 170), g = math.random(130, 170), b = 130}
|
||||
}
|
||||
)
|
||||
end
|
||||
goto continue
|
||||
end
|
||||
local surface_name = player.surface.name == 'cave_miner' and 'choppy' or 'cave_miner'
|
||||
local pos = surface_name == 'cave_miner' and global.surface_cave_elevator.position or {1, -4}
|
||||
local safe_pos = game.surfaces[surface_name].find_non_colliding_position('character', pos, 20, 1)
|
||||
if safe_pos then
|
||||
player.teleport(safe_pos, surface_name)
|
||||
else
|
||||
player.teleport({0, -3}, surface_name)
|
||||
end
|
||||
cooldowns[player.name] = game.tick + 900
|
||||
end
|
||||
--
|
||||
--[[
|
||||
if cooldowns[player.name] > game.tick then
|
||||
local text = rendering.draw_text{
|
||||
text = "Cooldown:" .. math.ceil((cooldowns[player.name] - game.tick)/60) .. " seconds",
|
||||
@ -77,70 +97,73 @@ local function check_player_ports(event)
|
||||
end
|
||||
if math.random(1, 2) == 1 then
|
||||
rendering.destroy(text)
|
||||
]]--
|
||||
::continue::
|
||||
end
|
||||
]] ::continue::
|
||||
end
|
||||
end
|
||||
|
||||
local function built_entity(event)
|
||||
local entity = event.created_entity
|
||||
if not entity or not entity.valid then return end
|
||||
if entity.name ~= "player-port" then return end
|
||||
|
||||
entity.minable = false
|
||||
entity.destructible = false
|
||||
entity.operable = false
|
||||
|
||||
local entity = event.created_entity
|
||||
if not entity or not entity.valid then
|
||||
return
|
||||
end
|
||||
if entity.name ~= 'player-port' then
|
||||
return
|
||||
end
|
||||
|
||||
local surface = entity.surface
|
||||
entity.minable = false
|
||||
entity.destructible = false
|
||||
entity.operable = false
|
||||
end
|
||||
|
||||
local function tick()
|
||||
|
||||
if not chests["cave_miner"] then
|
||||
chests["cave_miner"] = global.surface_cave_chest
|
||||
end
|
||||
|
||||
if not chests["choppy"] then
|
||||
chests["choppy"] = global.surface_choppy_chest
|
||||
end
|
||||
|
||||
local cave = chests["cave_miner"]
|
||||
local tree = chests["choppy"]
|
||||
|
||||
if not cave or not tree then return end
|
||||
if not cave.valid or not tree.valid then return end
|
||||
|
||||
local civ = tree.get_inventory(defines.inventory.chest)
|
||||
local oiv = cave.get_inventory(defines.inventory.chest)
|
||||
|
||||
local ci = civ.get_contents()
|
||||
local oi = oiv.get_contents()
|
||||
for item, count in pairs(ci) do
|
||||
local count2 = oi[item] or 0
|
||||
local diff = count-count2
|
||||
if diff > 1 then
|
||||
local count2 = oiv.insert{name = item, count = math.floor(diff/2)}
|
||||
if count2 > 0 then
|
||||
civ.remove{name = item, count = count2}
|
||||
end
|
||||
elseif diff < -1 then
|
||||
local count2 = civ.insert{name = item, count = math.floor(-diff/2)}
|
||||
if count2 > 0 then
|
||||
oiv.remove{name = item, count = count2}
|
||||
end
|
||||
if not chests['cave_miner'] then
|
||||
chests['cave_miner'] = global.surface_cave_chest
|
||||
end
|
||||
end
|
||||
for item, count in pairs(oi) do
|
||||
if count > 1 and not ci[item] then
|
||||
local count2 = civ.insert{name = item, count = math.floor(count/2)}
|
||||
if count2 > 0 then
|
||||
oiv.remove{name = item, count = count2}
|
||||
end
|
||||
|
||||
if not chests['choppy'] then
|
||||
chests['choppy'] = global.surface_choppy_chest
|
||||
end
|
||||
|
||||
local cave = chests['cave_miner']
|
||||
local tree = chests['choppy']
|
||||
|
||||
if not cave or not tree then
|
||||
return
|
||||
end
|
||||
if not cave.valid or not tree.valid then
|
||||
return
|
||||
end
|
||||
|
||||
local civ = tree.get_inventory(defines.inventory.chest)
|
||||
local oiv = cave.get_inventory(defines.inventory.chest)
|
||||
|
||||
local ci = civ.get_contents()
|
||||
local oi = oiv.get_contents()
|
||||
for item, count in pairs(ci) do
|
||||
local count2 = oi[item] or 0
|
||||
local diff = count - count2
|
||||
if diff > 1 then
|
||||
local count2 = oiv.insert {name = item, count = math.floor(diff / 2)}
|
||||
if count2 > 0 then
|
||||
civ.remove {name = item, count = count2}
|
||||
end
|
||||
elseif diff < -1 then
|
||||
local count2 = civ.insert {name = item, count = math.floor(-diff / 2)}
|
||||
if count2 > 0 then
|
||||
oiv.remove {name = item, count = count2}
|
||||
end
|
||||
end
|
||||
end
|
||||
for item, count in pairs(oi) do
|
||||
if count > 1 and not ci[item] then
|
||||
local count2 = civ.insert {name = item, count = math.floor(count / 2)}
|
||||
if count2 > 0 then
|
||||
oiv.remove {name = item, count = count2}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_tick, tick)
|
||||
Event.on_nth_tick(60, check_player_ports)
|
||||
Event.add(defines.events.on_built_entity, built_entity)
|
||||
Event.add(defines.events.on_built_entity, built_entity)
|
||||
|
Loading…
x
Reference in New Issue
Block a user