1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-10 00:43:27 +02:00
ComfyFactorio/maps/fish_defender_map_intro.lua

70 lines
2.3 KiB
Lua
Raw Normal View History

2018-11-02 23:37:58 +02:00
local event = require 'utils.event'
2018-11-09 10:34:19 +02:00
local main_caption = " --Fish Defender-- "
2018-11-06 01:07:35 +02:00
local sub_caption = " *blb blubby blub* "
2018-11-02 23:37:58 +02:00
local info = [[
2018-11-09 10:34:19 +02:00
The biters have catched the scent of fish in the market.
Fend them off as long as possible!
2018-11-12 05:11:06 +02:00
2018-11-21 14:38:48 +02:00
The Market will gladly take any coin you might find.
2018-12-03 19:02:20 +02:00
2018-12-19 22:20:39 +02:00
Buy slots for your team,
to increase the maximum number of turrets/mines that can be placed.
The railgun has been enhanced greatly.
The shotgun has recieved a damage buff.
Researching Tanks will unlock the artillery tech early
to allow you to produce shells.
2018-11-02 23:37:58 +02:00
]]
local function create_map_intro(player)
if player.gui.left["map_intro_frame"] then player.gui.left["map_intro_frame"].destroy() end
2018-11-02 23:37:58 +02:00
local frame = player.gui.left.add {type = "frame", name = "map_intro_frame", direction = "vertical"}
local t = frame.add {type = "table", column_count = 1}
local tt = t.add {type = "table", column_count = 3}
local l = tt.add {type = "label", caption = main_caption}
l.style.font = "default-frame"
l.style.font_color = {r=0.11, g=0.8, b=0.44}
l.style.top_padding = 6
l.style.bottom_padding = 6
local l = tt.add {type = "label", caption = sub_caption}
l.style.font = "default"
l.style.font_color = {r=0.33, g=0.66, b=0.9}
l.style.minimal_width = 280
local b = tt.add {type = "button", caption = "X", name = "close_map_intro_frame", align = "right"}
b.style.font = "default"
b.style.minimal_height = 30
b.style.minimal_width = 30
b.style.top_padding = 2
b.style.left_padding = 4
b.style.right_padding = 4
b.style.bottom_padding = 2
local tt = t.add {type = "table", column_count = 1}
local frame = t.add {type = "frame"}
local l = frame.add {type = "label", caption = info}
l.style.single_line = false
l.style.font_color = {r=0.95, g=0.95, b=0.95}
end
local function on_player_joined_game(event)
local player = game.players[event.player_index]
if player.online_time < 36000 then
create_map_intro(player)
end
end
local function on_gui_click(event)
if not event then return end
if not event.element then return end
if not event.element.valid then return end
local player = game.players[event.element.player_index]
if event.element.name == "close_map_intro_frame" then player.gui.left["map_intro_frame"].destroy() end
end
event.add(defines.events.on_player_joined_game, on_player_joined_game)
event.add(defines.events.on_gui_click, on_gui_click)