1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-18 03:21:36 +02:00

fixes, tweaks

This commit is contained in:
MewMew 2020-05-05 09:11:40 +02:00
parent 300db2d196
commit 97d991e6a0
4 changed files with 17 additions and 18 deletions

View File

@ -141,7 +141,7 @@ local item_worths = {
["low-density-structure"] = 64,
["rocket-fuel"] = 256,
["nuclear-fuel"] = 1024,
["uranium-235"] = 512,
["uranium-235"] = 1024,
["uranium-238"] = 32,
["uranium-fuel-cell"] = 128,
["used-up-uranium-fuel-cell"] = 8,

View File

@ -59,7 +59,7 @@ local function get_target_entity(force_name)
end
end
if not target_entity then print("Unable to get target entity for " .. force_name .. ".") return end
print("Target entity for " .. force_name .. ": " .. target_entity.name .. " at x=" .. target_entity.position.x .. " y=" .. target_entity.position.y)
--print("Target entity for " .. force_name .. ": " .. target_entity.name .. " at x=" .. target_entity.position.x .. " y=" .. target_entity.position.y)
return target_entity
end
@ -318,7 +318,7 @@ local function get_nearby_biter_nest(target_entity)
end
if not spawner then return end
print("Nearby biter nest found at x=" .. spawner.position.x .. " y=" .. spawner.position.y .. ".")
--print("Nearby biter nest found at x=" .. spawner.position.x .. " y=" .. spawner.position.y .. ".")
return spawner
end
@ -407,7 +407,7 @@ Public.wake_up_sleepy_groups = function()
if unit_group.valid then
if unit_group.state == defines.group_state.finished then
send_group(unit_group, force_name)
print("BiterBattles: Woke up Unit Group at x" .. unit_group.position.x .. " y" .. unit_group.position.y .. ".")
--print("BiterBattles: Woke up Unit Group at x" .. unit_group.position.x .. " y" .. unit_group.position.y .. ".")
return
end
end

View File

@ -136,17 +136,16 @@ end
function Public.init_player(player)
local surface = game.surfaces.biter_battles
if player.crafting_queue_size and player.crafting_queue_size > 0 then
for i = 1, #player.crafting_queue, 1 do
if player.crafting_queue_size == 0 then break end
player.cancel_crafting({index = 1, count = 65535})
end
end
if player.character and player.character.valid then
player.character.destroy()
player.set_controller({type = defines.controllers.god})
player.create_character()
end
player.clear_items_inside()
player.spectator = true
player.force = game.forces.spectator
if surface.is_chunk_generated({0,0}) then
player.teleport(surface.find_non_colliding_position("character", {0,0}, 3, 0.5), surface)
player.teleport(surface.find_non_colliding_position("character", {0,0}, 4, 0.5), surface)
else
player.teleport({0,0}, surface)
end

View File

@ -18,12 +18,12 @@ local function init_surface()
map_gen_settings.starting_area = "1"
map_gen_settings.cliff_settings = {cliff_elevation_interval = 0, cliff_elevation_0 = 0}
map_gen_settings.autoplace_controls = {
["coal"] = {frequency = "0.5", size = "1", richness = "0.25"},
["stone"] = {frequency = "0.5", size = "1", richness = "0.25"},
["iron-ore"] = {frequency = "0.5", size = "1", richness = "0.25"},
["copper-ore"] = {frequency = "0.5", size = "1", richness = "0.25"},
["uranium-ore"] = {frequency = "0.5", size = "1", richness = "0.25"},
["crude-oil"] = {frequency = "0.5", size = "1", richness = "1"},
["coal"] = {frequency = "0.55", size = "1", richness = "0.25"},
["stone"] = {frequency = "0.55", size = "1", richness = "0.25"},
["iron-ore"] = {frequency = "0.55", size = "1", richness = "0.25"},
["copper-ore"] = {frequency = "0.55", size = "1", richness = "0.25"},
["uranium-ore"] = {frequency = "0.55", size = "1", richness = "0.25"},
["crude-oil"] = {frequency = "0.75", size = "1", richness = "1"},
["trees"] = {frequency = "1", size = "0.5", richness = "1"},
["enemy-base"] = {frequency = "3", size = "2", richness = "1"}
}
@ -55,7 +55,7 @@ local function place_scrap(surface, position)
end
end
if math_random(1, 128) == 1 then
if math_random(1, 196) == 1 then
local item_stacks = LootRaffle.roll(math_sqrt(position.x ^ 2 + position.y ^ 2) * 2 + 1, 3)
local container = surface.create_entity({name = loot_containers[math_random(1, size_of_loot_containers)], position = position, force = "neutral"})
local inventory = container.get_inventory(defines.inventory.chest)