mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-05-13 21:56:29 +02:00
food tweaks, server auto reset when idle
This commit is contained in:
parent
ae00a20462
commit
1764a215c8
@ -142,7 +142,6 @@ local function init_forces()
|
||||
global.bb_threat_income[force.name] = 0
|
||||
global.bb_threat[force.name] = 0
|
||||
end
|
||||
|
||||
global.game_lobby_active = true
|
||||
end
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
local food_values = {
|
||||
["automation-science-pack"] = {value = 0.001, name = "automation science"},
|
||||
["logistic-science-pack"] = {value = 0.00292, name = "logistic science"},
|
||||
["military-science-pack"] = {value = 0.01225, name = "military science"},
|
||||
["chemical-science-pack"] = {value = 0.02392, name = "chemical science"},
|
||||
["production-science-pack"] = {value = 0.080, name = "production science"},
|
||||
["utility-science-pack"] = {value = 0.13875, name = "utility science"},
|
||||
["space-science-pack"] = {value = 0.420, name = "space science"},
|
||||
["logistic-science-pack"] = {value = 0.0025, name = "logistic science"},
|
||||
["military-science-pack"] = {value = 0.0096, name = "military science"},
|
||||
["chemical-science-pack"] = {value = 0.0264, name = "chemical science"},
|
||||
["production-science-pack"] = {value = 0.08874, name = "production science"},
|
||||
["utility-science-pack"] = {value = 0.09943, name = "utility science"},
|
||||
["space-science-pack"] = {value = 0.28957, name = "space science"},
|
||||
}
|
||||
|
||||
local force_translation = {
|
||||
@ -81,7 +81,7 @@ local function feed_biters(player, food)
|
||||
|
||||
--ADD INSTANT THREAT
|
||||
local diminishing_modifier = 1 / (0.2 + (e2 * 0.018))
|
||||
global.bb_threat[biter_force_name] = global.bb_threat[biter_force_name] + (food_values[food].value * 175 * diminishing_modifier)
|
||||
global.bb_threat[biter_force_name] = global.bb_threat[biter_force_name] + (food_values[food].value * 200 * diminishing_modifier)
|
||||
global.bb_threat[biter_force_name] = math_round(global.bb_threat[biter_force_name], decimals)
|
||||
end
|
||||
|
||||
|
@ -125,7 +125,7 @@ local function create_main_gui(player)
|
||||
frame.add { type = "table", name = "biter_battle_table", column_count = 4 }
|
||||
local t = frame.biter_battle_table
|
||||
local foods = {"automation-science-pack","logistic-science-pack","military-science-pack","chemical-science-pack","production-science-pack","utility-science-pack","space-science-pack","raw-fish"}
|
||||
local food_tooltips = {"1 Mutagen strength","3 Mutagen strength", "12 Mutagen strength", "24 Mutagen strength", "80 Mutagen strength", "138 Mutagen strength", "420 Mutagen strength", "Send spy"}
|
||||
local food_tooltips = {"10 Mutagen strength","25 Mutagen strength", "96 Mutagen strength", "264 Mutagen strength", "887 Mutagen strength", "994 Mutagen strength", "2895 Mutagen strength", "Send spy"}
|
||||
local x = 1
|
||||
for _, f in pairs(foods) do
|
||||
local s = t.add { type = "sprite-button", name = f, sprite = "item/" .. f }
|
||||
|
@ -29,6 +29,15 @@ local function clear_corpses()
|
||||
end
|
||||
end
|
||||
|
||||
local function restart_idle_map()
|
||||
if game.tick < 216000 then return end
|
||||
if #game.connected_players ~= 0 then global.restart_idle_map_countdown = 2 return end
|
||||
if not global.restart_idle_map_countdown then global.restart_idle_map_countdown = 2 end
|
||||
global.restart_idle_map_countdown = global.restart_idle_map_countdown - 1
|
||||
if global.restart_idle_map_countdown ~= 0 then return end
|
||||
server_commands.start_scenario('Biter_Battles')
|
||||
end
|
||||
|
||||
local function on_tick(event)
|
||||
if game.tick % 30 ~= 0 then return end
|
||||
chunk_pregen()
|
||||
@ -51,6 +60,7 @@ local function on_tick(event)
|
||||
|
||||
if game.tick % 3600 ~= 0 then return end
|
||||
clear_corpses()
|
||||
restart_idle_map()
|
||||
end
|
||||
|
||||
event.add(defines.events.on_tick, on_tick)
|
||||
|
@ -126,7 +126,7 @@ local function refresh_market_offers()
|
||||
global.market.add_market_item({price = {{"coin", 15000}}, offer = {type = 'nothing', effect_description = special_descriptions["vehicle-nanobots"]}})
|
||||
end
|
||||
if not global.crumbly_walls_unlocked then
|
||||
global.market.add_market_item({price = {{"coin", 25000}}, offer = {type = 'nothing', effect_description = special_descriptions["crumbly-walls"]}})
|
||||
global.market.add_market_item({price = {{"coin", 35000}}, offer = {type = 'nothing', effect_description = special_descriptions["crumbly-walls"]}})
|
||||
end
|
||||
if not global.ultra_mines_unlocked then
|
||||
global.market.add_market_item({price = {{"coin", 45000}}, offer = {type = 'nothing', effect_description = special_descriptions["ultra-mines"]}})
|
||||
|
@ -9,7 +9,6 @@ local strings = {
|
||||
"chomp", "chomp",
|
||||
"chow", "chow",
|
||||
"nibble", "nibble",
|
||||
"munch",
|
||||
"nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom", "nom"
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ local projectile_types = {
|
||||
["explosive-rocket"] = {name = "explosive-rocket", count = 1, max_range = 48, tick_speed = 1},
|
||||
["rocket"] = {name = "rocket", count = 1, max_range = 48, tick_speed = 1},
|
||||
|
||||
["flamethrower-ammo"] = {name = "flamethrower-fire-stream", count = 4, max_range = 32, tick_speed = 1},
|
||||
["flamethrower-ammo"] = {name = "flamethrower-fire-stream", count = 4, max_range = 28, tick_speed = 1},
|
||||
["crude-oil-barrel"] = {name = "flamethrower-fire-stream", count = 3, max_range = 24, tick_speed = 1},
|
||||
["petroleum-gas-barrel"] = {name = "flamethrower-fire-stream", count = 4, max_range = 24, tick_speed = 1},
|
||||
["light-oil-barrel"] = {name = "flamethrower-fire-stream", count = 4, max_range = 24, tick_speed = 1},
|
||||
|
Loading…
x
Reference in New Issue
Block a user