2021-02-06 22:42:10 +02:00
|
|
|
local Public = {}
|
|
|
|
|
2022-09-30 22:23:37 +02:00
|
|
|
local info =
|
2022-10-15 16:45:49 +02:00
|
|
|
[[This is the wasteland. Who will survive?
|
2021-02-06 22:42:10 +02:00
|
|
|
|
2022-09-28 11:27:58 +02:00
|
|
|
You can either
|
|
|
|
- Found a new town or join an existing one
|
2022-10-15 16:45:49 +02:00
|
|
|
- Stay as outlander and fight towns together with the biters
|
2022-09-28 11:27:58 +02:00
|
|
|
|
2022-10-15 16:45:49 +02:00
|
|
|
Click on the "Info" button for full intro, help and changelog.
|
2021-02-06 22:42:10 +02:00
|
|
|
|
2022-10-15 16:45:49 +02:00
|
|
|
Have fun and be comfy ^.^]]
|
2022-10-09 12:33:58 +02:00
|
|
|
|
2022-10-15 16:45:49 +02:00
|
|
|
local info_adv =
|
|
|
|
[[
|
2022-10-16 13:17:52 +02:00
|
|
|
# Changelog (10th-16th October 2022):
|
|
|
|
- PvP shields now prevent building inside
|
2022-10-15 12:27:16 +02:00
|
|
|
- Combat balance overhaul
|
2022-10-15 13:52:13 +02:00
|
|
|
- Town player limit fixes
|
2022-10-16 13:17:52 +02:00
|
|
|
- Towns have an initial PvP protection shield - size and duration is scaled with the biggest town size
|
2022-10-09 12:33:58 +02:00
|
|
|
- Temporary PvP shield available in market for breaks / AFK
|
|
|
|
- Improved base defenses and offline survivability
|
2022-10-10 12:30:47 +02:00
|
|
|
- Loads of bugfixes including freezes and desyncs
|
2021-02-06 22:42:10 +02:00
|
|
|
|
2022-09-22 20:19:19 +02:00
|
|
|
# Goal of the game
|
|
|
|
Survive as long as you can. Raid other towns. Defend your town.
|
|
|
|
|
|
|
|
# Advanced tips and tricks
|
2022-09-30 22:23:37 +02:00
|
|
|
- It's best to found new towns far from existing towns, as enemies will become aggressive with town's research.
|
|
|
|
Biters and spitters become more aggressive towards towns that are advanced in research.
|
|
|
|
Their evolution will scale around technology progress in any nearby towns and pollution levels.
|
2022-10-08 13:15:01 +02:00
|
|
|
- How to get more ores? Make sure you researched steel processing,
|
2022-09-30 22:23:37 +02:00
|
|
|
then hand mine a few big rocks to find ore patches under them!
|
2022-10-15 16:45:49 +02:00
|
|
|
- How to get more oil? Kill worms - some of them will leave you an oil patch
|
2022-09-30 22:23:37 +02:00
|
|
|
- The town market is the heart of your town. If it is destroyed, you lose everything.
|
2022-10-15 16:45:49 +02:00
|
|
|
So protect it well, repair it whenever possible, and increase its health by purchasing upgrades.
|
2022-09-30 22:23:37 +02:00
|
|
|
- It's possible to automate trading with the town center! How cool is that?!! Try it out.
|
2022-10-08 13:12:29 +02:00
|
|
|
Tip: use filter inserters with to get coins/iron/.. out of the market
|
2022-10-10 13:09:05 +02:00
|
|
|
- Fishes procreate near towns. The more fishes, the quicker they multiply. Automated fish farm, anyone?
|
2022-09-30 22:23:37 +02:00
|
|
|
- Use /rename-town (chat command) to rename your town
|
2022-10-16 13:11:47 +02:00
|
|
|
- PvP shields prevent players from entering and building inside, but they can still shoot inside!
|
|
|
|
- Your town has a AFK PvP shield that you can use to safely take a quick break
|
|
|
|
without other players killing your town. Deploy it from the market.
|
2021-02-06 22:42:10 +02:00
|
|
|
|
2022-10-15 16:45:49 +02:00
|
|
|
# Town members and alliances
|
|
|
|
- Once a town is formed, members may invite other players and teams using a coin. To invite another player, drop a coin
|
2022-09-22 20:19:19 +02:00
|
|
|
on that player (with the Z key). To accept an invite, offer a coin in return to the member. To leave a town, simply drop coal
|
2022-10-15 16:45:49 +02:00
|
|
|
on the market.
|
|
|
|
- To form any alliance with another town, drop a coin on a member or their market. If they agree they can reciprocate with a
|
|
|
|
coin offering.]]
|
2021-02-06 22:42:10 +02:00
|
|
|
|
|
|
|
function Public.toggle_button(player)
|
2021-03-24 17:46:00 +02:00
|
|
|
if player.gui.top['towny_map_intro_button'] then
|
|
|
|
return
|
|
|
|
end
|
2022-09-22 20:19:19 +02:00
|
|
|
local b = player.gui.top.add({type = 'sprite-button', caption = 'Info', name = 'towny_map_intro_button', tooltip = 'Show Info'})
|
2021-03-24 17:46:00 +02:00
|
|
|
b.style.font_color = {r = 0.5, g = 0.3, b = 0.99}
|
|
|
|
b.style.font = 'heading-1'
|
|
|
|
b.style.minimal_height = 38
|
|
|
|
b.style.minimal_width = 80
|
|
|
|
b.style.top_padding = 1
|
|
|
|
b.style.left_padding = 1
|
|
|
|
b.style.right_padding = 1
|
|
|
|
b.style.bottom_padding = 1
|
2021-02-06 22:42:10 +02:00
|
|
|
end
|
|
|
|
|
2022-09-22 20:19:19 +02:00
|
|
|
function Public.show(player, info_type)
|
2021-03-24 17:46:00 +02:00
|
|
|
if player.gui.center['towny_map_intro_frame'] then
|
|
|
|
player.gui.center['towny_map_intro_frame'].destroy()
|
|
|
|
end
|
|
|
|
local frame = player.gui.center.add {type = 'frame', name = 'towny_map_intro_frame'}
|
|
|
|
frame = frame.add {type = 'frame', direction = 'vertical'}
|
|
|
|
|
|
|
|
local t = frame.add {type = 'table', column_count = 2}
|
|
|
|
|
2022-09-28 11:27:58 +02:00
|
|
|
local label = t.add {type = 'label', caption = 'COMFY Towny: Wasteland survival'}
|
2021-03-24 17:46:00 +02:00
|
|
|
label.style.font = 'heading-1'
|
|
|
|
label.style.font_color = {r = 0.85, g = 0.85, b = 0.85}
|
|
|
|
label.style.right_padding = 8
|
|
|
|
|
|
|
|
frame.add {type = 'line'}
|
2022-09-22 20:19:19 +02:00
|
|
|
local cap = info
|
|
|
|
if info_type == 'adv' then
|
|
|
|
cap = info_adv
|
|
|
|
end
|
|
|
|
local l2 = frame.add {type = 'label', caption = cap}
|
2021-03-24 17:46:00 +02:00
|
|
|
l2.style.single_line = false
|
|
|
|
l2.style.font = 'heading-2'
|
|
|
|
l2.style.font_color = {r = 0.8, g = 0.7, b = 0.99}
|
2021-02-06 22:42:10 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function Public.close(event)
|
2021-03-24 17:46:00 +02:00
|
|
|
if not event.element then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if not event.element.valid then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
local parent = event.element.parent
|
|
|
|
for _ = 1, 4, 1 do
|
|
|
|
if not parent then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if parent.name == 'towny_map_intro_frame' then
|
|
|
|
parent.destroy()
|
|
|
|
return
|
|
|
|
end
|
|
|
|
parent = parent.parent
|
|
|
|
end
|
2021-02-06 22:42:10 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function Public.toggle(event)
|
2021-03-24 17:46:00 +02:00
|
|
|
if not event.element then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if not event.element.valid then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if event.element.name == 'towny_map_intro_button' then
|
|
|
|
local player = game.players[event.player_index]
|
|
|
|
if player.gui.center['towny_map_intro_frame'] then
|
|
|
|
player.gui.center['towny_map_intro_frame'].destroy()
|
|
|
|
else
|
2022-09-22 20:19:19 +02:00
|
|
|
Public.show(player, 'adv')
|
2021-03-24 17:46:00 +02:00
|
|
|
end
|
|
|
|
end
|
2021-02-06 22:42:10 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
local function on_gui_click(event)
|
2021-03-24 17:46:00 +02:00
|
|
|
Public.close(event)
|
|
|
|
Public.toggle(event)
|
2021-02-06 22:42:10 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
local Event = require 'utils.event'
|
|
|
|
Event.add(defines.events.on_gui_click, on_gui_click)
|
|
|
|
|
|
|
|
return Public
|