1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-06 00:23:49 +02:00
ComfyFactorio/maps/mountain_fortress_v3/stateful/blueprints.lua
2024-05-28 10:43:10 +02:00

73 lines
6.4 KiB
Lua

local Public = require 'maps.mountain_fortress_v3.stateful.table'
local bp =
'0eNrtXdtu4zgS/Rc9LuwG75dgdoCe6ef9gcXAkB0lEcaWDFnunmwj/76UnLZpWyWyaCWTxm6ABPFFRxTrkFV1WJS+Z8v1vtg2ZdVmd9+zclVXu+zu39+zXflY5evuvfZ5W2R3WdkWm2yWVfmme7Vr66qYf8vX6+xllpXVffFXdkdfZsED74tVeV8081W9WZZV3taNB8Be/phlRdWWbVkcmtG/eF5U+82yaNwZhhowy7b1zh1SV91ZHczcqE9ylj27/yj7JF+6Zl0AsUggEQLikUAyBCQigVgISEYC8RCQigQiISAdCURDQCYOSJsQkI0EsiEgSiKRgoykkdzWOogUSW4dJDeNZLcOsptG0lsH6U0j+a2D/KaRBNdBgtNIhusgw2kkxVWQ4jSS4yrIcRbJcRWedSM5roIcZ5EcV0GOs0iOqyDHWSTHVZCZTKL9HAWQFNrRQUga7ekgJIN2dRCSRfs6AIkTtLODkCja20FIDO3uICSO9ncQkkD7OwhJov0dhKTQ/g5C0mh/ByEZtL+DkCza3wFIgqD9HYRE0f4OQmJofwchcbS/g5AE2t9BSBLt7yAkhfZ3BEDSaCSoTQbtOSEki/acwNVJgkYC2iQptp8MAIQOVSwAxLHXBrUIHahALZLYS1MAEJreGgDS2EuDWmSwQFCL7Jj2MRaJiZdZtqqrtqnXi2XxlH8t3QHuW68wC/fZfX/ornv3oWx27eJKfflaNu0+X3vKTf+N+WNTFFV2OMOuzTv5R3QvNtu86Vt2l/3THVTv2+0eAVt8LZrn9qmsHg/Y22fXzH3VLh6aerMoKweW3bXNvng5nLoqVscroN2fQ7s86ae8z+60Y/6qbFb7su1fM6+fu9fWXn7+h4NnHV5T3F+iKeo+HhQ8TpPHtqkfm3yzyZfrYr7bFv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SDmBQ09AFUgg8FGqEikngC1SSCCwRVhN8/iQSPG2xYKhaBEbczLMarONrbVkWOlLQHbA3oq4B3K5RT/G7rznbs8yl5/v+kOYoUJbpt0UZ6URLy//BRwxr+g='
function Public.blueprint()
local position = {x = -500, y = 503}
local active_surface_index = Public.get('active_surface_index')
local surface = game.get_surface(active_surface_index)
if not surface or not surface.valid then
return
end
surface.daytime = 0.5
surface.freeze_daytime = true
surface.min_brightness = 0.3
surface.brightness_visual_weights = {1, 1, 1}
surface.request_to_generate_chunks(position, 1)
surface.request_to_generate_chunks({0, 0}, 1)
surface.force_generate_chunk_requests()
local ents = surface.find_entities_filtered({area = {{position.x - 70, position.y - 70}, {position.x + 70, position.y + 70}}})
if #ents == 0 then
return
end
for _, e in pairs(ents) do
if e and e.valid then
e.destroy()
end
end
local item = surface.create_entity {name = 'item-on-ground', position = position, stack = {name = 'blueprint', count = 1}}
if not item then
return
end
local success = item.stack.import_stack(bp)
if success <= 0 then
local ghosts = item.stack.build_blueprint {surface = surface, force = 'player', position = position, force_build = true}
for _, ghost in pairs(ghosts) do
local _, ent = ghost.silent_revive({raise_revive = true})
if ent and ent.valid then
ent.destructible = false
ent.minable = false
end
end
end
if item.valid then
item.destroy()
end
end
function Public.nuke_blueprint()
local position = {x = -500, y = 503}
local active_surface_index = Public.get('active_surface_index')
local surface = game.get_surface(active_surface_index)
if not surface or not surface.valid then
return
end
local radius = 512
local area = {{position.x - radius, position.y - radius}, {position.x + radius, position.y + radius}}
for _, entity in pairs(surface.find_entities_filtered {area = area, name = 'programmable-speaker'}) do
if entity and entity.valid then
entity.destroy()
end
end
end
return Public