1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-24 03:47:58 +02:00

39 lines
1.1 KiB
Lua
Raw Normal View History

2019-03-14 18:06:39 +01:00
local event = require 'utils.event'
local gui = require "maps.biter_battles_v2.gui"
local ai = require "maps.biter_battles_v2.ai"
2019-03-15 03:59:43 +01:00
local function reveal_team(f)
local m = 32
if f == "north" then
game.forces["south"].chart(
game.surfaces["biter_battles"],
{{x = global.force_area[f].x_top - m, y = global.force_area[f].y_top - m}, {x = global.force_area[f].x_bot + m, y = global.force_area[f].y_bot + m}}
)
else
game.forces["north"].chart(
game.surfaces["biter_battles"],
{{x = global.force_area[f].x_top - m, y = global.force_area[f].y_top - m}, {x = global.force_area[f].x_bot + m, y = global.force_area[f].y_bot + m}}
)
end
end
2019-03-14 18:06:39 +01:00
local function on_tick(event)
2019-03-14 22:50:09 +01:00
if game.tick % 60 ~= 0 then return end
gui()
2019-03-15 03:59:43 +01:00
if game.tick % 300 ~= 0 then return end
if global.spy_fish_timeout["south"] - game.tick > 0 then
reveal_team("north")
else
global.spy_fish_timeout["south"] = 0
end
if global.spy_fish_timeout["north"] - game.tick > 0 then
reveal_team("south")
else
global.spy_fish_timeout["north"] = 0
end
2019-03-14 18:06:39 +01:00
end
event.add(defines.events.on_tick, on_tick)