1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

labyrinth biter attacks

This commit is contained in:
MewMew 2018-11-18 15:27:04 +01:00
parent 97f0836db3
commit a7cb02902d
2 changed files with 19 additions and 0 deletions

View File

@ -983,6 +983,21 @@ local function on_entity_damaged(event)
end
end
local function on_tick(event)
if game.tick % 4000 == 0 then
if math.random(1, 4) ~= 1 then return end
local surface = game.surfaces["labyrinth"]
local area = {{-10000, -10000}, {10000, 0}}
local biters = surface.find_entities_filtered({type = "unit", force = "enemy", area = area})
for _, biter in pairs(biters) do
biter.set_command({type=defines.command.attack_area, destination={x = 16, y = 16}, radius=15, distraction=defines.distraction.by_anything})
end
if #biters > 0 then
game.print("You hear them screeching in the depths. They are trying to reach the entrance!", {r=0.75, g=0, b=0})
end
end
end
function dump_layout()
local surface = game.surfaces["labyrinth"]
game.write_file("layout.lua", "" , false)
@ -1026,6 +1041,7 @@ function dump_layout()
end
end
event.add(defines.events.on_tick, on_tick)
event.add(defines.events.on_robot_built_entity, on_robot_built_entity)
event.add(defines.events.on_entity_damaged, on_entity_damaged)
event.add(defines.events.on_built_entity, on_built_entity)

View File

@ -0,0 +1,3 @@
0.01
loot table adjustments
the dungeon inhabitants will now try to swarm to the entrance sometimes