1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-08 00:39:30 +02:00

Merge pull request #44 from M3wM3w/master

update from main
This commit is contained in:
hanakocz 2021-01-05 15:40:27 +01:00 committed by GitHub
commit 9ade0b7293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 1983 additions and 749 deletions

View File

@ -48,7 +48,7 @@ local STD_BASE_CONTROL = 'lua52c+factorio+factorio_control+factorio_defines+fact
--[Assume Factorio Control stage as default]--
-------------------------------------------------------------------------------
std = STD_CONTROL
globals = {'print', '_DEBUG', '_CHEATS', '_DUMP_ENV', 'ServerCommands', 'Debug', '_LIFECYCLE', '_STAGE', 'get_game_version'}
globals = {'print', '_DEBUG', '_CHEATS', '_DUMP_ENV', 'ServerCommands', 'Debug', '_LIFECYCLE', '_STAGE', 'get_game_version', 'is_loaded'}
max_line_length = LINE_LENGTH
not_globals = NOT_GLOBALS

View File

@ -158,6 +158,9 @@ commands.add_command(
local function process_bot_answers(event)
local player = game.players[event.player_index]
if player.admin then
return
end
local message = event.message
message = string.lower(message)
for word in string.gmatch(message, '%g+') do

View File

@ -160,7 +160,7 @@ local poll_function = {
end
end,
['comfy_panel_poll_no_notify_toggle'] = function(event)
local poll = package.loaded['comfy_panel.poll']
local poll = is_loaded('comfy_panel.poll')
local poll_table = poll.get_no_notify_players()
if event.element.switch_state == 'left' then
poll_table[event.player_index] = false
@ -186,7 +186,7 @@ local antigrief_functions = {
local fortress_functions = {
['comfy_panel_disable_fullness'] = function(event)
local Fullness = package.loaded['modules.check_fullness']
local Fullness = is_loaded('modules.check_fullness')
local this = Fullness.get()
if event.element.switch_state == 'left' then
this.fullness_enabled = true
@ -197,7 +197,7 @@ local fortress_functions = {
end
end,
['comfy_panel_offline_players'] = function(event)
local WPT = package.loaded['maps.mountain_fortress_v3.table']
local WPT = is_loaded('maps.mountain_fortress_v3.table')
local this = WPT.get()
if event.element.switch_state == 'left' then
this.offline_players_enabled = true
@ -208,7 +208,7 @@ local fortress_functions = {
end
end,
['comfy_panel_collapse_grace'] = function(event)
local WPT = package.loaded['maps.mountain_fortress_v3.table']
local WPT = is_loaded('maps.mountain_fortress_v3.table')
local this = WPT.get()
if event.element.switch_state == 'left' then
this.collapse_grace = true
@ -219,7 +219,7 @@ local fortress_functions = {
end
end,
['comfy_panel_spill_items_to_surface'] = function(event)
local WPT = package.loaded['maps.mountain_fortress_v3.table']
local WPT = is_loaded('maps.mountain_fortress_v3.table')
local this = WPT.get()
if event.element.switch_state == 'left' then
this.spill_items_to_surface = true
@ -230,7 +230,7 @@ local fortress_functions = {
end
end,
['comfy_panel_void_or_tile'] = function(event)
local WPT = package.loaded['maps.mountain_fortress_v3.table']
local WPT = is_loaded('maps.mountain_fortress_v3.table')
local this = WPT.get()
if event.element.switch_state == 'left' then
this.void_or_tile = 'out-of-map'
@ -241,7 +241,7 @@ local fortress_functions = {
end
end,
['comfy_panel_trusted_only_car_tanks'] = function(event)
local WPT = package.loaded['maps.mountain_fortress_v3.table']
local WPT = is_loaded('maps.mountain_fortress_v3.table')
local this = WPT.get()
if event.element.switch_state == 'left' then
this.trusted_only_car_tanks = true
@ -337,8 +337,8 @@ local build_config_gui = (function(player, frame)
scroll_pane.add({type = 'line'})
end
if package.loaded['comfy_panel.poll'] then
local poll = package.loaded['comfy_panel.poll']
local poll = is_loaded('comfy_panel.poll')
if poll then
local poll_table = poll.get_no_notify_players()
switch_state = 'right'
if not poll_table[player.index] then
@ -380,7 +380,7 @@ local build_config_gui = (function(player, frame)
'Disables the Logistic System research.\nRequester, buffer or active-provider containers can not be built.'
)
if package.loaded['comfy_panel.poll'] then
if poll then
scroll_pane.add({type = 'line'})
switch_state = 'right'
if global.comfy_panel_config.poll_trusted then
@ -407,7 +407,7 @@ local build_config_gui = (function(player, frame)
add_switch(scroll_pane, switch_state, 'comfy_panel_disable_antigrief', 'Antigrief', 'Left = Enables antigrief / Right = Disables antigrief')
scroll_pane.add({type = 'line'})
if package.loaded['maps.biter_battles_v2.main'] then
if is_loaded('maps.biter_battles_v2.main') then
label = scroll_pane.add({type = 'label', caption = 'Biter Battles Settings'})
label.style.font = 'default-bold'
label.style.padding = 0
@ -450,7 +450,7 @@ local build_config_gui = (function(player, frame)
scroll_pane.add({type = 'line'})
end
if package.loaded['maps.mountain_fortress_v3.main'] then
if is_loaded('maps.mountain_fortress_v3.main') then
label = scroll_pane.add({type = 'label', caption = 'Mountain Fortress Settings'})
label.style.font = 'default-bold'
label.style.padding = 0
@ -460,7 +460,7 @@ local build_config_gui = (function(player, frame)
label.style.vertical_align = 'bottom'
label.style.font_color = Color.green
local Fullness = package.loaded['modules.check_fullness']
local Fullness = is_loaded('modules.check_fullness')
local full = Fullness.get()
switch_state = 'right'
if full.fullness_enabled then
@ -470,7 +470,7 @@ local build_config_gui = (function(player, frame)
scroll_pane.add({type = 'line'})
local WPT = package.loaded['maps.mountain_fortress_v3.table']
local WPT = is_loaded('maps.mountain_fortress_v3.table')
local this = WPT.get()
switch_state = 'right'
if this.offline_players_enabled then
@ -576,7 +576,7 @@ local function on_gui_switch_state_changed(event)
end
fortress_functions[event.element.name](event)
return
elseif package.loaded['comfy_panel.poll'] then
elseif is_loaded('comfy_panel.poll') then
local is_spamming = SpamProtection.is_spamming(player)
if is_spamming then
return

View File

@ -10,6 +10,8 @@ draw_map_scores would be a function with the player and the frame as arguments
]]
local Event = require 'utils.event'
local Server = require 'utils.server'
local CommandFrame = require 'commands.misc'
local SpamProtection = require 'utils.spam_protection'
comfy_panel_tabs = {}
@ -34,7 +36,9 @@ end
function Public.comfy_panel_clear_screen_gui(player)
for _, child in pairs(player.gui.screen.children) do
child.destroy()
if child.name ~= CommandFrame.bottom_guis_frame then
child.visible = false
end
end
end
@ -83,7 +87,18 @@ local function main_frame(player)
local tabbed_pane = frame.add({type = 'tabbed-pane', name = 'tabbed_pane'})
for name, func in pairs(tabs) do
if func.admin == true then
if func.only_server_sided then
local secs = Server.get_current_time()
if secs then
local tab = tabbed_pane.add({type = 'tab', caption = name})
local frame = tabbed_pane.add({type = 'frame', name = name, direction = 'vertical'})
frame.style.minimal_height = 480
frame.style.maximal_height = 480
frame.style.minimal_width = 800
frame.style.maximal_width = 800
tabbed_pane.add_tab(tab, frame)
end
elseif func.admin == true then
if player.admin then
local tab = tabbed_pane.add({type = 'tab', caption = name})
local frame = tabbed_pane.add({type = 'frame', name = name, direction = 'vertical'})
@ -155,6 +170,7 @@ local function on_gui_click(event)
if player.gui.left.comfy_panel then
player.gui.left.comfy_panel.destroy()
Public.comfy_panel_restore_left_gui(player)
Public.comfy_panel_restore_screen_gui(player)
return
else
Public.comfy_panel_clear_screen_gui(player)

View File

@ -29,16 +29,33 @@ function Public.get_table()
return this
end
function Public.init_player_table(player)
function Public.reset_tbl()
this.score_table['player'] = {
players = {}
}
end
function Public.init_player_table(player, reset)
if not player then
return
end
if reset then
this.score_table[player.force.name].players[player.name] = {
built_entities = 0,
deaths = 0,
killscore = 0,
mined_entities = 0
}
end
if not this.score_table[player.force.name] then
this.score_table[player.force.name] = {}
end
if not this.score_table[player.force.name].players then
this.score_table[player.force.name].players = {}
end
if not this.score_table[player.force.name].players[player.name] then
this.score_table[player.force.name].players[player.name] = {
built_entities = 0,

View File

@ -4,9 +4,13 @@ local Server = require 'utils.server'
local Color = require 'utils.color_presets'
local Event = require 'utils.event'
local Global = require 'utils.global'
local Gui = require 'utils.gui'
local this = {
players = {}
players = {},
activate_custom_buttons = false,
bottom_right = false,
bottom_quickbar_button = {}
}
Global.register(
@ -18,6 +22,10 @@ Global.register(
local Public = {}
local bottom_guis_frame = Gui.uid_name()
local clear_corpse_button_name = Gui.uid_name()
local bottom_quickbar_button_name = Gui.uid_name()
commands.add_command(
'spaghetti',
'Does spaghett.',
@ -340,13 +348,17 @@ commands.add_command(
end
)
commands.add_command(
'clear-corpses',
'Clears all the biter corpses..',
function(cmd)
local player = game.player
local function clear_corpses(cmd)
local player
local trusted = Session.get_trusted_table()
local param = tonumber(cmd.parameter)
local param
if cmd and cmd.player then
player = cmd.player
param = 50
elseif cmd then
player = game.player
param = tonumber(cmd.parameter)
end
if not player or not player.valid then
return
@ -372,19 +384,37 @@ commands.add_command(
end
local pos = player.position
local i = 0
local radius = {{x = (pos.x + -param), y = (pos.y + -param)}, {x = (pos.x + param), y = (pos.y + param)}}
for _, entity in pairs(player.surface.find_entities_filtered {area = radius, type = 'corpse'}) do
if entity.corpse_expires then
entity.destroy()
i = i + 1
end
end
player.print('Cleared biter-corpses.', Color.success)
local corpse = 'corpse'
if i > 1 then
corpse = 'corpses'
end
if i == 0 then
player.print('[color=blue][Cleaner][/color] No corpses to clear!', Color.warning)
else
player.print('[color=blue][Cleaner][/color] Cleared ' .. i .. ' ' .. corpse .. '!', Color.success)
end
end
commands.add_command(
'clear-corpses',
'Clears all the biter corpses..',
function(cmd)
clear_corpses(cmd)
end
)
local on_player_joined_game = function(event)
local player = game.players[event.player_index]
local on_player_joined_game = function(player)
if this.creative_enabled then
if not this.players[player.index] then
Public.insert_all_items(player)
@ -447,6 +477,17 @@ function Public.get(key)
end
end
function Public.set(key, value)
if key and (value or value == false) then
this[key] = value
return this[key]
elseif key then
return this[key]
else
return this
end
end
Event.on_init(
function()
this.creative_are_you_sure = false
@ -464,6 +505,169 @@ function Public.reset()
this.players = {}
end
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
----! Gui Functions ! ----
local function create_frame(player, rebuild)
local gui = player.gui
local frame = gui.screen[bottom_guis_frame]
if frame and frame.valid then
if rebuild then
frame.destroy()
else
return frame
end
end
frame =
player.gui.screen.add {
type = 'frame',
name = bottom_guis_frame,
direction = 'vertical'
}
frame.style.padding = 3
frame.style.minimal_height = 96
frame.style.top_padding = 4
local inner_frame =
frame.add {
type = 'frame',
direction = 'vertical'
}
inner_frame.style = 'quick_bar_inner_panel'
inner_frame.add {
type = 'sprite-button',
sprite = 'entity/behemoth-biter',
name = clear_corpse_button_name,
tooltip = {'commands.clear_corpse'},
style = 'quick_bar_page_button'
}
local bottom_quickbar_button =
inner_frame.add {
type = 'sprite-button',
name = bottom_quickbar_button_name,
style = 'quick_bar_page_button'
}
this.bottom_quickbar_button[player.index] = {name = bottom_quickbar_button_name, frame = bottom_quickbar_button}
if this.bottom_quickbar_button.sprite and this.bottom_quickbar_button.tooltip then
bottom_quickbar_button.sprite = this.bottom_quickbar_button.sprite
bottom_quickbar_button.tooltip = this.bottom_quickbar_button.tooltip
end
return frame
end
local function set_location(player)
local frame = create_frame(player)
local resolution = player.display_resolution
local scale = player.display_scale
if this.bottom_right then
frame.location = {
x = (resolution.width / 2) - ((54 + -528) * scale),
y = (resolution.height - (96 * scale))
}
else
local experimental = get_game_version()
if experimental then
frame.location = {
x = (resolution.width / 2) - ((54 + 445) * scale),
y = (resolution.height - (96 * scale))
}
else
frame.location = {
x = (resolution.width / 2) - ((54 + 258) * scale),
y = (resolution.height - (96 * scale))
}
end
end
end
--- Activates the custom buttons
---@param boolean
function Public.activate_custom_buttons(value)
if value then
this.activate_custom_buttons = value
else
this.activate_custom_buttons = false
end
end
--- Sets the buttons to be aligned bottom right
---@param boolean
function Public.bottom_right(value)
if value then
this.bottom_right = value
else
this.bottom_right = false
end
end
Gui.on_click(
clear_corpse_button_name,
function(event)
clear_corpses(event)
end
)
Event.add(
defines.events.on_player_joined_game,
function(event)
local player = game.players[event.player_index]
on_player_joined_game(player)
if this.activate_custom_buttons then
set_location(player)
end
end
)
Event.add(
defines.events.on_player_display_resolution_changed,
function(event)
local player = game.get_player(event.player_index)
if this.activate_custom_buttons then
set_location(player)
end
end
)
Event.add(
defines.events.on_player_respawned,
function(event)
local player = game.get_player(event.player_index)
if this.activate_custom_buttons then
set_location(player)
end
end
)
Event.add(
defines.events.on_player_died,
function(event)
local player = game.get_player(event.player_index)
if this.activate_custom_buttons then
local frame = player.gui.screen[bottom_guis_frame]
if frame and frame.valid then
frame.destroy()
end
end
end
)
Event.add(
defines.events.on_player_display_scale_changed,
function(event)
local player = game.get_player(event.player_index)
if this.activate_custom_buttons then
set_location(player)
end
end
)
Public.bottom_guis_frame = bottom_guis_frame
return Public

View File

@ -15,6 +15,7 @@ require 'utils.datastore.jail_data'
require 'utils.datastore.quickbar_data'
require 'utils.datastore.message_on_join_data'
require 'utils.datastore.player_tag_data'
require 'utils.profiler'
require 'chatbot'
require 'commands'
require 'antigrief'
@ -216,6 +217,7 @@ require 'modules.autostash'
---------------------------------------------------------------
---------------- MOSTLY TERRAIN LAYOUTS HERE ----------------
--require 'terrain_layouts.winter'
--require 'terrain_layouts.caves'
--require 'terrain_layouts.cone_to_east'
--require 'terrain_layouts.biters_and_resources_east'

2
locale/de/commands.cfg Normal file
View File

@ -0,0 +1,2 @@
[commands]
clear_corpse=Klicken Sie hier, um Leichen zu löschen!

View File

@ -1,107 +0,0 @@
[mountain_fortress_v3]
map_info_main_caption=M O U N T A I N F O R T R E S S V3
map_info_sub_caption= ~~ diggy diggy choo choo ~~
map_info_text=The biters have caught the scent of fish in the cargo wagon.\nGuide the choo into the mountain and protect it as long as possible!\nThis however will not be an easy task,\nsince their strength and numbers increase over time.\n\nIn additon, the southern grounds collapse over time.\n\nDelve deep for greater treasures, but also face increased dangers.\nMining productivity research, will overhaul your mining equipment,\nreinforcing your pickaxe as well as increasing the size of your backpack.\n\nAs you dig, you will encounter impassable dark chasms or rivers.\nArtillery will try to shoot you down! Dig fast, dig north!\n\nSome explosives may cause parts of the ceiling to crumble, filling the void, creating new ways.\nAll they need is a container and a well aimed shot.\n\nEnter the cargo wagon to reveal the wagon surface!\n\nRandom buildings that generate resources can be found throughout the world.\n\nPlacing steel-chests near cargo-wagons enables you to quickly move content.\n\nStaying inside the locomotive aura prevents biters from spawning when mining entities.\n\nRPG GUI is disabled inside the locomotive.\nDisconnecting wagons is disabled.\nYou can´t cancel crafting when standing inside the locomotive aura.\n\nDon't try to run north with your Spidertron if the train is not near you.\nYou have been warned.\n\nGood luck on your journey!
[breached_wall]
collapse_start=[color=blue]Mapkeeper:[/color]\nWarning, Collapse has begun!
spidertron_unlocked=[color=blue]Mapkeeper:[/color]\nAttention! Spidertron has been unlocked at the main market!
wall_breached=[color=blue]Mapkeeper:[/color]\nSurvivor! Well done. You have completed zone __1__!
first_to_reach=[color=blue]Mapkeeper:[/color]\n__1__ was the first to reach zone __2__.
artillery_warning=[color=blue]Mapkeeper:[/color]\nWarning, Artillery have been spotted north!
cheating_through=__1__ tried to cheat their way north with their spidertron!
[entity]
treasure_1=You notice an old crate within the rubble. It's filled with treasure!
treasure_2=You find a chest underneath the broken rocks. It's filled with goodies!
treasure_3=We has found the precious!
treasure_rare_1=Your magic improves. You have found a chest that is filled with rare treasures!
treasure_rare_2=Oh how wonderful. You found a chest underneath the broken rocks. It's filled with rare goodies!
treasure_rare_3=You're a wizard! We have found the rare precious!
defeated_1=[color=blue]Mapkeeper:[/color]\nOh no, the biters nom'ed the train away!\nBetter luck next time.
defeated_2=[color=blue]Mapkeeper:[/color]\nI'm not 100% sure, but - apparently the train was chewed away.\nBetter luck next time.
defeated_3=[color=blue]Mapkeeper:[/color]\nYou had one objective - defend the train *-*\nBetter luck next time.
defeated_4=[color=blue]Mapkeeper:[/color]\nLooks like we're resetting cause you did not defend the train ._.\nBetter luck next time.
reset_game=*** Soft-reset is disabled! Server will restart from scenario to load new changes. ***
notify_restart=Soft-reset is disabled! Server will restart from scenario to load new changes.
shutdown_game=*** Soft-reset is disabled! Server will shutdown. Most likely because of updates. ***
notify_shutdown=Soft-reset is disabled! Server will shutdown. Most likely because of updates.
train_taking_damage=[color=blue]Comfylatron:[/color]\nTrain is taking heavy damage.\nDeploying defense mechanisms.
entity_limit_reached=__1__ limit reached. Purchase more slots at the market!
found_car=__1__ has found a car underneath the rumble!
[gui]
global_pool_tooltip=Dig, handcraft or run to increase the pool!
global_pool_amount=Amount of XP that is stored inside the global xp pool.\nRaw Value: __1__
amount_harvested=Amount of trees/rocks harvested.
biters_killed=Amount of biters killed.
land_mine_placed=Amount of land-mines that can be built.
chest_placed=Amount of chests that can be placed near train.
flamethrowers_placed=Amount of flamethrower-turrets that can be built.
train_upgrades=Amount of train upgrades.
info_tooltip=Shows statistics!
hide_minimap=Hide locomotive minimap!
current_pickaxe_tier=The team currently has the __1__ pickaxe tier.\nBonus speed is: __2__%
[locomotive]
upgrades=Upgrades:
items=Items:
shoo=^-^ Please don´t shoo at me ^-^
not_trusted=You need to be trusted to purchase this.
coins_left=Coins left: __1__
market_name=Market
search_text=Search:
quantity_text=Quantity:
limit_reached=Max limit reached!
chests_full=You can't purchase more chests.
chest_bought_info=__1__ __2__ has bought the chest limit upgrade for __3__ coins.
health_bought_info=__1__ __2__ has bought the locomotive health modifier for __3__ coins.
aura_bought_info=__1__ __2__ has bought the locomotive xp aura modifier for __3__ coins.
xp_bought_info=__1__ __2__ has bought the XP points modifier for __3__ coins.
reroll_bought_info=__1__ __2__ has rerolled the market items for __3__ coins.
pickaxe_bought_info=__1__ __2__ has upgraded the teams pickaxe to tier __3__ for __4__ coins.
explosive_bullet_bought_info=__1__ __2__ has bought the explosive bullet modifier for __3__ coins.
one_flamethrower_bought_info=__1__ __2__ has bought a flamethrower-turret slot for __3__ coins.
multiple_flamethrower_bought_info=__1__ __2__ has bought __3__ flamethrower-turret slot for __4__ coins.
landmine_bought_info=__1__ __2__ has bought a landmine slot for __3__ coins.
rpg_reset_bought_info=__1__ __2__ decided to recycle their RPG skills and start over for __3__ coins.
full_inventory=Your pockets are now filled to the brim. So you've only bought __1__ __2__(s).
change_returned=Shopkeeper has returned your change, for which you are infinitely grateful.
notify_full_inventory_1=Your inventory is full. Try to stash your loot somewhere first.
notify_full_inventory_2=Your inventory is full. Join the warrior club today! Pump that STR stat some more!
new_items_at_market=New items have been unlocked at the locomotive market!
[main_market]
chest=Upgrades the amount of chests that can be placed outside.\nCan be purchased multiple times.
locomotive_max_health=Upgrades the train health.\nCan be purchased multiple times.
locomotive_xp_aura=Upgrades the XP aura that is around the train.
xp_points_boost=Upgrades the amount of XP points you get inside the XP aura
explosive_bullets=Upgrades ordinary SMG ammo to explosive bullets.
reroll_market_items=Will reroll the items in the market and shuffle prices.
purchase_pickaxe=Upgrade the teams Pickaxe to tier: __1__
sold_out=Sold out!
flamethrower_turret=Upgrades the amount of flamethrowers that can be placed.
land_mine=Upgrades the amount of landmines that can be placed.
skill_reset=For when you have picked the wrong RPG path and want to start over.\nPoints will be kept.
car=Portable Car Surface\nCan be killed easily.
tank=Portable Tank Surface\nChonk tank, can resist heavy damage.
tank_cannon_na=Tank Cannon\nAvailable after wave 650.
tank_machine_gun_na=Tank Machine Gun\nAvailable after wave 400.
vehicle_machine_gun_na=Car Machine Gun\nAvailable after wave 200.
[main]
death_message_1=__1__ should have watched where they walked!
death_message_2=__1__ was not careful enough!
death_message_3=__1__ angered the overlords!
death_message_4=__1__ tried to walk the simple path!
death_message_5=__1__ melted away!
death_message_6=__1__ got obliterated!
death_message_7=__1__ tried to cheat their way north!
forcefield=Forcefield does not approve.
greeting=[color=blue]Comfylatron:[/color]\nGreetings, __1__!\nPlease read the map info.
cleaner=[color=blue]Cleaner:[/color]\n__1__ has left his goodies! Be quick and fetch them!
reset_in=Game will __1__ in __2__ seconds!
diff_set=Difficulty has been set! Game has been set to: [color=green]__1__[/color]
diff_tooltip=Wave Defense is based on amount of players.\nXP Extra reward points: __1__.\nMining speed boosted: __2__.\nRunning speed boosted: __3__.\nCrafting speed boosted: __4__.\nCoin amount per harvest: __5__.\nFlame Turret limit: __6__.\nLandmine limit: __7__.\nLocomotive health: __8__.\nHidden Treasure has __9__ chance to spawn.\nGrace period: __10__ minutes\nSpidertrons unlocks at zone __11__.

View File

@ -1,103 +0,0 @@
[rpg_main]
no_valid_surface=No surface name given
flame_boots_worn_out=Your flame boots have worn out.
flame_mana_remaining=Mana remaining: __1__
one_punch_text=ONE PUNCH
mana_casting_too_fast=There was a lot more to magic, as __1__ quickly found out, than waving their wand and saying a few funny words.
low_level=You lack the level to cast this spell.
not_inside_pos=You wave your wand but realize that it´s out of reach.
no_mana=You don´t have enough mana to cast this spell.
suicidal_comfylatron=You wave your wand and __1__ is on the run!
warped_ok=Warped home with minor bruises.
object_spawned=You wave your wand and __1__ appears.
out_of_reach=Can´t create entity at given location.
[rpg_functions]
max_level=[color=blue]Level Limit:[/color]\nYou have hit the max level for the current zone.
pool_reward=[color=blue]Global Pool Reward:[/color]\n __1__ received nothing. Reason: AFK
[rpg_gui]
gain_info_tooltip=XP gain from mining, moving, crafting, repairing and combat.
allocate_info=Right-click to allocate __1__ points.\nShift + click to allocate all points.
player_name=Hello __1__!
class_info=You're a __1__.
settings_frame=Configure your RPG player-settings here!
level_limit=Current max level limit for this zone is: __1__\nIncreases by breaching walls/zones.
settings_name=SETTINGS
level_name=LEVEL
experience_name=EXPERIENCE
next_level_name=NEXT LEVEL
strength_name=STRENGTH
strength_tooltip=Increases inventory slots, mining speed.\nIncreases melee damage and amount of robot followers.
magic_name=MAGIC
magic_tooltip=Increases reach distance.\nIncreases repair speed. Enables spawning entities.
dexterity_name=DEXTERITY
dexterity_tooltip=Increases running and crafting speed.
vitality_name=VITALITY
vitality_tooltip=Increases health.\nIncreases melee life on-hit.
points_to_dist=POINTS TO\nDISTRIBUTE
life_name=LIFE
life_tooltip=Your current health
life_increase=Current life. Increase it by adding vitality.
life_maximum=This is your maximum life.
shield_name=SHIELD
shield_no_shield=You don't have any shield.
shield_no_armor=This is your current shield. You aren't wearing any armor.
shield_tooltip=Shield protects you and heightens your resistance.
shield_current=Current shield value of the equipment.
shield_max=Maximum shield value.
mana_name=MANA
mana_bonus=MANA\nBONUS
mana_regen_bonus=Mana regen bonus: __1__
mana_tooltip=Mana lets you spawn entities by eating fish.
mana_regen_current=This is your current mana. You can increase the regen by increasing your magic skills.
mana_max_limit=This is your max mana. You have reached the max mana limit.
mana_max=This is your max mana. You can increase the regen by increasing your magic skills.
mining_name=MINING\nSPEED
slot_name=SLOT\nBONUS
melee_name=MELEE\nDAMAGE
one_punch_chance=Life on-hit: __1__\nOne punch chance: __2__ %
one_punch_disabled=One Punch is disabled.
bonus_tooltip=Reach distance bonus: __1__\nBuild distance bonus: __2__\nItem drop distance bonus: __3__\nLoot pickup distance bonus: __4__\nItem pickup distance bonus: __5__\nResource reach distance bonus: __6__\nRepair speed: __7__
reach_distance=REACH\nDISTANCE
crafting_speed=CRAFTING\nSPEED
running_speed=RUNNING\nSPEED
health_bonus_name=HEALTH\nBONUS
health_tooltip=Health regen bonus: __1__
[rpg_settings]
name=RPG Settings
save_changes=Save changes
discard_changes=Discard changes
not_trusted=Not trusted.\nChecked: true\nUnchecked: false
low_level=Level requirement: __1__
used_up=All used up!
no_mana=Not enough mana!
mana_label=Mana Settings:
tooltip_check=Checked: true\nUnchecked: false
info_text_label=Common RPG settings. These settings are per player basis.
health_text_label=Show health/mana bar?
health_only_text_label=Show health bar?
reset_text_label=Reset your skillpoints?
reset_tooltip=ONE-TIME reset if you picked the wrong path (this will keep your points)
reach_text_label=Enable reach bonus?
reach_text_tooltip=Don´t feeling like picking up others people loot?\nYou can toggle it here.
movement_text_label=Enable movement speed bonus?
movement_text_tooltip=Don´t feeling like running like the flash?\nYou can toggle it here.
stone_path_label=Enable stone-path when mining?
stone_path_tooltip=Enabling this will automatically create stone-path when you mine.
one_punch_label=Enable one-punch?
one_punch_tooltip=Enabling this will have a chance of one-punching biters.
one_punch_globally=Enabled globally.
flameboots_label=Enable flame boots?
flameboots_tooltip=When the bullets simply don´t bite.
magic_label=Enable spawning with raw-fish?
magic_tooltip=When simply constructing items is not enough.\nNOTE! Use Raw-fish to cast spells.
magic_spell=Select what entity to spawn
magic_item_requirement=__1__ [item=__2__] requires __3__ mana to cast. Level: __4__\n
magic_entity_requirement=__1__ [entity=__2__] requires __3__ mana to cast. Level: __4__\n
magic_special_requirement=__1__ __2__ requires __3__ mana to cast. Level: __4__\n
allocation_settings_label=Allocations Settings:
allocation_label=Select what skill to auto-allocate.
allocation_tooltip=This will automatically allocate all available points to the given node.

2
locale/en/commands.cfg Normal file
View File

@ -0,0 +1,2 @@
[commands]
clear_corpse=Click to clear corpses!

View File

@ -43,6 +43,8 @@ train_upgrades=Amount of train upgrades.
info_tooltip=Shows statistics!
hide_minimap=Hide locomotive minimap!
current_pickaxe_tier=The team currently has the __1__ pickaxe tier.\nBonus speed is: __2__%
map_on=Automatically show map ON
map_off=OFF
[locomotive]
upgrades=Upgrades:

View File

@ -101,3 +101,20 @@ magic_special_requirement=__1__ __2__ requires __3__ mana to cast. Level: __4__\
allocation_settings_label=Allocations Settings:
allocation_label=Select what skill to auto-allocate.
allocation_tooltip=This will automatically allocate all available points to the given node.
[spells]
acid_stream=Bitter Spew
railgun_beam=Shoop Da Whoop!!
raw_fish=Conjure Raw-fish
comfylatron=Suicidal Comfylatron
distractor=Distractor Capsule
warp=Warp Gate
[allocations]
deactivated=Deactivated
str=Strength
mag=Magicka
dex=Dexterity
vit=Vitality

2
locale/ru/commands.cfg Normal file
View File

@ -0,0 +1,2 @@
[commands]
clear_corpse=Нажмите, чтобы убрать трупы!

View File

@ -1,108 +0,0 @@
[mountain_fortress_v3]
map_info_main_caption=M O U N T A I N F O R T R E S S V3
map_info_sub_caption= ~~ diggy diggy choo choo ~~
map_info_text=The biters have caught the scent of fish in the cargo wagon.\nGuide the choo into the mountain and protect it as long as possible!\nThis however will not be an easy task,\nsince their strength and numbers increase over time.\n\nIn additon, the southern grounds collapse over time.\n\nDelve deep for greater treasures, but also face increased dangers.\nMining productivity research, will overhaul your mining equipment,\nreinforcing your pickaxe as well as increasing the size of your backpack.\n\nAs you dig, you will encounter impassable dark chasms or rivers.\nArtillery will try to shoot you down! Dig fast, dig north!\n\nSome explosives may cause parts of the ceiling to crumble, filling the void, creating new ways.\nAll they need is a container and a well aimed shot.\n\nEnter the cargo wagon to reveal the wagon surface!\n\nRandom buildings that generate resources can be found throughout the world.\n\nPlacing steel-chests near cargo-wagons enables you to quickly move content.\n\nStaying inside the locomotive aura prevents biters from spawning when mining entities.\n\nRPG GUI is disabled inside the locomotive.\nDisconnecting wagons is disabled.\nYou can´t cancel crafting when standing inside the locomotive aura.\n\nDon't try to run north with your Spidertron if the train is not near you.\nYou have been warned.\n\nGood luck on your journey!
[breached_wall]
collapse_start=[color=blue]Mapkeeper:[/color]\nWarning, Collapse has begun!
spidertron_unlocked=[color=blue]Mapkeeper:[/color]\nAttention! Spidertron has been unlocked at the main market!
wall_breached=[color=blue]Mapkeeper:[/color]\nSurvivor! Well done. You have completed zone __1__!
first_to_reach=[color=blue]Mapkeeper:[/color]\n__1__ was the first to reach zone __2__.
artillery_warning=[color=blue]Mapkeeper:[/color]\nWarning, Artillery have been spotted north!
cheating_through=__1__ tried to cheat their way north with their spidertron!
[entity]
treasure_1=You notice an old crate within the rubble. It's filled with treasure!
treasure_2=You find a chest underneath the broken rocks. It's filled with goodies!
treasure_3=We has found the precious!
treasure_rare_1=Your magic improves. You have found a chest that is filled with rare treasures!
treasure_rare_2=Oh how wonderful. You found a chest underneath the broken rocks. It's filled with rare goodies!
treasure_rare_3=You're a wizard! We have found the rare precious!
defeated_1=[color=blue]Mapkeeper:[/color]\nOh no, the biters nom'ed the train away!\nBetter luck next time.
defeated_2=[color=blue]Mapkeeper:[/color]\nI'm not 100% sure, but - apparently the train was chewed away.\nBetter luck next time.
defeated_3=[color=blue]Mapkeeper:[/color]\nYou had one objective - defend the train *-*\nBetter luck next time.
defeated_4=[color=blue]Mapkeeper:[/color]\nLooks like we're resetting cause you did not defend the train ._.\nBetter luck next time.
reset_game=*** Soft-reset is disabled! Server will restart from scenario to load new changes. ***
notify_restart=Soft-reset is disabled! Server will restart from scenario to load new changes.
shutdown_game=*** Soft-reset is disabled! Server will shutdown. Most likely because of updates. ***
notify_shutdown=Soft-reset is disabled! Server will shutdown. Most likely because of updates.
train_taking_damage=[color=blue]Comfylatron:[/color]\nTrain is taking heavy damage.\nDeploying defense mechanisms.
entity_limit_reached=__1__ limit reached. Purchase more slots at the market!
found_car=__1__ has found a car underneath the rumble!
[gui]
global_pool_tooltip=Dig, handcraft or run to increase the pool!
global_pool_amount=Amount of XP that is stored inside the global xp pool.\nRaw Value: __1__
amount_harvested=Amount of trees/rocks harvested.
biters_killed=Amount of biters killed.
land_mine_placed=Amount of land-mines that can be built.
chest_placed=Amount of chests that can be placed near train.
flamethrowers_placed=Amount of flamethrower-turrets that can be built.
train_upgrades=Amount of train upgrades.
info_tooltip=Shows statistics!
hide_minimap=Hide locomotive minimap!
current_pickaxe_tier=The team currently has the __1__ pickaxe tier.\nBonus speed is: __2__%
[locomotive]
upgrades=Upgrades:
items=Items:
shoo=^-^ Please don´t shoo at me ^-^
not_trusted=You need to be trusted to purchase this.
coins_left=Coins left: __1__
market_name=Market
search_text=Search:
quantity_text=Quantity:
limit_reached=Max limit reached!
chests_full=You can't purchase more chests.
chest_bought_info=__1__ __2__ has bought the chest limit upgrade for __3__ coins.
health_bought_info=__1__ __2__ has bought the locomotive health modifier for __3__ coins.
aura_bought_info=__1__ __2__ has bought the locomotive xp aura modifier for __3__ coins.
xp_bought_info=__1__ __2__ has bought the XP points modifier for __3__ coins.
reroll_bought_info=__1__ __2__ has rerolled the market items for __3__ coins.
pickaxe_bought_info=__1__ __2__ has upgraded the teams pickaxe to tier __3__ for __4__ coins.
explosive_bullet_bought_info=__1__ __2__ has bought the explosive bullet modifier for __3__ coins.
one_flamethrower_bought_info=__1__ __2__ has bought a flamethrower-turret slot for __3__ coins.
multiple_flamethrower_bought_info=__1__ __2__ has bought __3__ flamethrower-turret slot for __4__ coins.
landmine_bought_info=__1__ __2__ has bought a landmine slot for __3__ coins.
rpg_reset_bought_info=__1__ __2__ decided to recycle their RPG skills and start over for __3__ coins.
full_inventory=Your pockets are now filled to the brim. So you've only bought __1__ __2__(s).
change_returned=Shopkeeper has returned your change, for which you are infinitely grateful.
notify_full_inventory_1=Your inventory is full. Try to stash your loot somewhere first.
notify_full_inventory_2=Your inventory is full. Join the warrior club today! Pump that STR stat some more!
new_items_at_market=New items have been unlocked at the locomotive market!
[main_market]
chest=Upgrades the amount of chests that can be placed outside.\nCan be purchased multiple times.
locomotive_max_health=Upgrades the train health.\nCan be purchased multiple times.
locomotive_xp_aura=Upgrades the XP aura that is around the train.
xp_points_boost=Upgrades the amount of XP points you get inside the XP aura
explosive_bullets=Upgrades ordinary SMG ammo to explosive bullets.
reroll_market_items=Will reroll the items in the market and shuffle prices.
purchase_pickaxe=Upgrade the teams Pickaxe to tier: __1__
sold_out=Sold out!
flamethrower_turret=Upgrades the amount of flamethrowers that can be placed.
land_mine=Upgrades the amount of landmines that can be placed.
skill_reset=For when you have picked the wrong RPG path and want to start over.\nPoints will be kept.
car=Portable Car Surface\nCan be killed easily.
tank=Portable Tank Surface\nChonk tank, can resist heavy damage.
tank_cannon_na=Tank Cannon\nAvailable after wave 650.
tank_machine_gun_na=Tank Machine Gun\nAvailable after wave 400.
vehicle_machine_gun_na=Car Machine Gun\nAvailable after wave 200.
[main]
death_message_1=__1__ should have watched where they walked!
death_message_2=__1__ was not careful enough!
death_message_3=__1__ angered the overlords!
death_message_4=__1__ tried to walk the simple path!
death_message_5=__1__ melted away!
death_message_6=__1__ got obliterated!
death_message_7=__1__ tried to cheat their way north!
forcefield=Forcefield does not approve.
greeting=[color=blue]Comfylatron:[/color]\nGreetings, __1__!\nPlease read the map info.
cleaner=[color=blue]Cleaner:[/color]\n__1__ has left his goodies! Be quick and fetch them!
reset_in=Game will __1__ in __2__ seconds!
diff_set=Difficulty has been set! Game has been set to: [color=green]__1__[/color]
diff_tooltip=Wave Defense is based on amount of players.\nXP Extra reward points: __1__.\nMining speed boosted: __2__.\nRunning speed boosted: __3__.\nCrafting speed boosted: __4__.\nCoin amount per harvest: __5__.\nFlame Turret limit: __6__.\nLandmine limit: __7__.\nLocomotive health: __8__.\nHidden Treasure has __9__ chance to spawn.\nGrace period: __10__ minutes\nSpidertrons unlocks at zone __11__.

View File

@ -1,103 +0,0 @@
[rpg_main]
no_valid_surface=No surface name given
flame_boots_worn_out=Your flame boots have worn out.
flame_mana_remaining=Mana remaining: __1__
one_punch_text=ONE PUNCH
mana_casting_too_fast=There was a lot more to magic, as __1__ quickly found out, than waving their wand and saying a few funny words.
low_level=You lack the level to cast this spell.
not_inside_pos=You wave your wand but realize that it´s out of reach.
no_mana=You don´t have enough mana to cast this spell.
suicidal_comfylatron=You wave your wand and __1__ is on the run!
warped_ok=Warped home with minor bruises.
object_spawned=You wave your wand and __1__ appears.
out_of_reach=Can´t create entity at given location.
[rpg_functions]
max_level=[color=blue]Level Limit:[/color]\nYou have hit the max level for the current zone.
pool_reward=[color=blue]Global Pool Reward:[/color]\n __1__ received nothing. Reason: AFK
[rpg_gui]
gain_info_tooltip=XP gain from mining, moving, crafting, repairing and combat.
allocate_info=Right-click to allocate __1__ points.\nShift + click to allocate all points.
player_name=Hello __1__!
class_info=You're a __1__.
settings_frame=Configure your RPG player-settings here!
level_limit=Current max level limit for this zone is: __1__\nIncreases by breaching walls/zones.
settings_name=SETTINGS
level_name=LEVEL
experience_name=EXPERIENCE
next_level_name=NEXT LEVEL
strength_name=STRENGTH
strength_tooltip=Increases inventory slots, mining speed.\nIncreases melee damage and amount of robot followers.
magic_name=MAGIC
magic_tooltip=Increases reach distance.\nIncreases repair speed. Enables spawning entities.
dexterity_name=DEXTERITY
dexterity_tooltip=Increases running and crafting speed.
vitality_name=VITALITY
vitality_tooltip=Increases health.\nIncreases melee life on-hit.
points_to_dist=POINTS TO\nDISTRIBUTE
life_name=LIFE
life_tooltip=Your current health
life_increase=Current life. Increase it by adding vitality.
life_maximum=This is your maximum life.
shield_name=SHIELD
shield_no_shield=You don't have any shield.
shield_no_armor=This is your current shield. You aren't wearing any armor.
shield_tooltip=Shield protects you and heightens your resistance.
shield_current=Current shield value of the equipment.
shield_max=Maximum shield value.
mana_name=MANA
mana_bonus=MANA\nBONUS
mana_regen_bonus=Mana regen bonus: __1__
mana_tooltip=Mana lets you spawn entities by eating fish.
mana_regen_current=This is your current mana. You can increase the regen by increasing your magic skills.
mana_max_limit=This is your max mana. You have reached the max mana limit.
mana_max=This is your max mana. You can increase the regen by increasing your magic skills.
mining_name=MINING\nSPEED
slot_name=SLOT\nBONUS
melee_name=MELEE\nDAMAGE
one_punch_chance=Life on-hit: __1__\nOne punch chance: __2__ %
one_punch_disabled=One Punch is disabled.
bonus_tooltip=Reach distance bonus: __1__\nBuild distance bonus: __2__\nItem drop distance bonus: __3__\nLoot pickup distance bonus: __4__\nItem pickup distance bonus: __5__\nResource reach distance bonus: __6__\nRepair speed: __7__
reach_distance=REACH\nDISTANCE
crafting_speed=CRAFTING\nSPEED
running_speed=RUNNING\nSPEED
health_bonus_name=HEALTH\nBONUS
health_tooltip=Health regen bonus: __1__
[rpg_settings]
name=RPG Settings
save_changes=Save changes
discard_changes=Discard changes
not_trusted=Not trusted.\nChecked: true\nUnchecked: false
low_level=Level requirement: __1__
used_up=All used up!
no_mana=Not enough mana!
mana_label=Mana Settings:
tooltip_check=Checked: true\nUnchecked: false
info_text_label=Common RPG settings. These settings are per player basis.
health_text_label=Show health/mana bar?
health_only_text_label=Show health bar?
reset_text_label=Reset your skillpoints?
reset_tooltip=ONE-TIME reset if you picked the wrong path (this will keep your points)
reach_text_label=Enable reach bonus?
reach_text_tooltip=Don´t feeling like picking up others people loot?\nYou can toggle it here.
movement_text_label=Enable movement speed bonus?
movement_text_tooltip=Don´t feeling like running like the flash?\nYou can toggle it here.
stone_path_label=Enable stone-path when mining?
stone_path_tooltip=Enabling this will automatically create stone-path when you mine.
one_punch_label=Enable one-punch?
one_punch_tooltip=Enabling this will have a chance of one-punching biters.
one_punch_globally=Enabled globally.
flameboots_label=Enable flame boots?
flameboots_tooltip=When the bullets simply don´t bite.
magic_label=Enable spawning with raw-fish?
magic_tooltip=When simply constructing items is not enough.\nNOTE! Use Raw-fish to cast spells.
magic_spell=Select what entity to spawn
magic_item_requirement=__1__ [item=__2__] requires __3__ mana to cast. Level: __4__\n
magic_entity_requirement=__1__ [entity=__2__] requires __3__ mana to cast. Level: __4__\n
magic_special_requirement=__1__ __2__ requires __3__ mana to cast. Level: __4__\n
allocation_settings_label=Allocations Settings:
allocation_label=Select what skill to auto-allocate.
allocation_tooltip=This will automatically allocate all available points to the given node.

View File

@ -0,0 +1,2 @@
[commands]
clear_corpse=点击删除尸体!

View File

@ -0,0 +1,45 @@
[crab_defender]
map_info_main_caption=-- Crab Defender --
map_info_sub_caption= ~~ the battle for crab-earth ~~
map_info_text=The biters are trying to take over the crab world.\nFend them off as long as possible!\nThis however will not be an easy task,\nsince their strength and resistance increases constantly over time.\n\nYour ultimate goal is to evacuate all the fishes that are in the crab-y lakes to crab planet!\nPut them in your rocket's cargo and launch them into space.\nDon't worry, you will still get space science.\n\nThe Market will gladly take any coin you might find.\nAdditional turret slots can be bought at the market.\nSeveral unique upgrades are available too.\nResearching tanks will unlock the artillery technology early.\nAny container bearing dangerous goods, like ammo, grenades or barrels,\ncauses heavy explosions when it breaks.\nMaybe this can be used to our advantage.\n\nBiters will only attack from both sides of the crab claws, be fast with the defenses!\n\nBiters are intelligent,\nthey have placed some sort of anti-inhabitant system so walking on the white-colored tile hurts you.
boss_message=Boss Wave __1__ - - __2__
50=The Big Anti-crab Gang
100=Crabzilla
150=The Spitter Squad
200=The Wall Nibblers
250=Conveyor Munchers
300=Furnace Freezers
350=Crabby Cabel Chewers
400=Power Pole Thieves
450=Assembler Annihilators
500=Inserter Crunchers
550=Crab Engineer Eaters
600=Belt Unbalancers
650=Turret Devourers
700=Pipe Perforators
750=Desync Bros
800=Ratio Randomizers
850=Wire Chompers
900=The Bus Mixers
950=Roundabout Deadlockers
1000=Happy Tree Friends
1050=Uranium Digesters
1100=Bot Banishers
1150=Chest Crushers
1200=Cargo Wagon Scratchers
1250=Transport Belt Surfers
1300=Pumpjack Pulverizers
1350=Radar Ravagers
1400=Mall Deconstrutors
1450=Lamp Dimmers
1500=Roboport Disablers
1550=Signal Spammers
1600=Brick Tramplers
1650=Drill Destroyers
1700=Gearwheel Grinders
1750=Crab Inhabitant Seekers
1800=Circuit Breakers
1850=Bullet Absorbers
1900=Oil Guzzlers
1950=Belt Rotators
2000=Bluescreen Factor

View File

@ -0,0 +1,45 @@
[fish_defender_v2]
map_info_main_caption=--Fish Defender v2--
map_info_sub_caption= ~~blb blubby blub~~
map_info_text=The biters have caught the scent of fish in the market.\nFend them off as long as possible!\nThis however will not be an easy task,\nsince their strength and resistance increases constantly over time.\n\nYour ultimate goal is to evacuate all the fish to cat planet!\nPut them in your rocket's cargo and launch them into space.\nDon't worry, you will still get space science.\n\nThe Market will gladly take any coin you might find.\nAdditional turret slots can be bought at the market.\nSeveral unique upgrades are available too.\nResearching tanks will unlock the artillery technology early.\nAny container bearing dangerous goods, like ammo, grenades or barrels,\ncauses heavy explosions when it breaks.\nMaybe this can be used to our advantage.\n\nBiters will only attack in the middle until wave is greater than 80.
boss_message=Boss Wave __1__ - - __2__
50=The Big Biter Gang
100=Biterzilla
150=The Spitter Squad
200=The Wall Nibblers
250=Conveyor Munchers
300=Furnace Freezers
350=Cable Chewers
400=Power Pole Thieves
450=Assembler Annihilators
500=Inserter Crunchers
550=Engineer Eaters
600=Belt Unbalancers
650=Turret Devourers
700=Pipe Perforators
750=Desync Bros
800=Ratio Randomizers
850=Wire Chompers
900=The Bus Mixers
950=Roundabout Deadlockers
1000=Happy Tree Friends
1050=Uranium Digesters
1100=Bot Banishers
1150=Chest Crushers
1200=Cargo Wagon Scratchers
1250=Transport Belt Surfers
1300=Pumpjack Pulverizers
1350=Radar Ravagers
1400=Mall Deconstrutors
1450=Lamp Dimmers
1500=Roboport Disablers
1550=Signal Spammers
1600=Brick Tramplers
1650=Drill Destroyers
1700=Gearwheel Grinders
1750=Silo Seekers
1800=Circuit Breakers
1850=Bullet Absorbers
1900=Oil Guzzlers
1950=Belt Rotators
2000=Bluescreen Factor

313
locale/zh-CN/locale.cfg Normal file
View File

@ -0,0 +1,313 @@
description=一个以不同地图的整体编辑为特色的古怪场景,来自不同的创作者。\n\n如何激活地图:\n1. 选项卡放入场景的文件夹中。 (..\Factorio\scenarios\ComfyFactorio)\n2. 用文本编辑器打开文件 "control.lua"\n3. 搜索 ---- enable maps here ----\n4. 移除 -- 你要激活的地图前的注释。\n5. 如果场景是从多人服务器下载或保存的,请删除 "blueprint.zip"\n6. 回到游戏中,放松一下。
[biter_battles]
map_info= - - 虫子大作战 - -\n\n 虫子注意到你在火箭发射井里秘密囤鱼。\n 你的任务是保护你的火箭发射井, 同时击败其他团队。\n\n 高科技发展将生产很强的进化因子,它会随着时间,增强你对面的虫子\n 带领你的团队胜利。\n\n 这里没有直接pvp战斗。\n 水平界面的液体是抵御虫子的。\n 那一边是不可以被探建设机器人开发。\n 随机地图布局,以提供公平竞争。\n\n 东西方向没有虫巢,\n 为工厂扩建和基地建设留下空间。\n 南北方向是虫子的领地。\n\n 图形用户界面主要是为每个团队的虫子统计两种不一样的主要信息。--这句话原英文难翻译,就这样理解了。\n\n - 进化 -\n 当它们有足够的进化因子。虫子会进化 --原文都是食物,我统一理解为进化因子\n 选择游戏难度可以提升到100%以上,\n 增强他们更多的伤害和生命。\n\n - 危险 -\n 阻碍虫子攻击。当虫子被杀时减少。\n 攻击虫子能带来持续的“危险收益”,同时也能产生即时的危险。\n 高难度会导致更强的攻击。值为零或以下不会主动攻击。
[cave_miner]
map_info_main_caption= - - C A V E M I N E R - -
map_info_sub_caption=~diggy diggy hole~
map_info_text=Delve deep for greater treasures, but also face increased dangers.\n\nThe team's pickaxe and backpack can be upgraded at the market.\nThe prices may be rerolled by spending some fish.\nBiter evolution scales with depth.\n\nBreaking rocks is exhausting and might make you hungry.\nSo don´t forget to eat some fish once in a while to stay well fed.\nBe careful, eating too much might have it´s consequences too.\n\nAs you dig, you will encounter impassable dark chasms or rivers.\nSome explosives may cause parts of the ceiling to crumble, filling the void, creating new ways.\nAll they need is a container and a well aimed shot.\n\nDarkness is a hazard in the mines, stay near your lamps..
[desert_oasis]
map_info_main_caption=--Desert Oasis--
map_info_sub_caption=Survival in the dry sands.
map_info_text=This is a harsh world, the heat is unbearable and the sand is sharp like diamonds.\nMake sure to stay properly hydrated.\nDrink some water from a pond, or sip it out of a barrel to stay refreshed.\n\nWe shall not attempt to travel without a proper vehicle.\nMany building foundations are not possible to be set up outside of the oasis.\nRailways between them however should be possible.\n\nLuckily the ship's moisture meter module did survive the crash.\nIt may come in handy!
[expanse]
map_info_main_caption=-- E x p a n s e --
map_info_sub_caption=
map_info_text=The blue chests are hungry.\nFeed them and they will reward you with more land.\n\nThe friendly infini tree will provide you with all the wood you ever wanted.\nThe everlasting rock with be happy to provide resources for you.\n\nIf you find yourself stuck, put a reroll token, the small plane toy, in the chest to get a new offer.\nUnlocking chests may drop additional tokens.
[fish_defender]
map_info_main_caption=--Fish Defender--
map_info_sub_caption= *blb blubby blub*
map_info_text=The biters have caught the scent of fish in the market.\nFend them off as long as possible!\nThis however will not be an easy task,\nsince their strength and resistance increases constantly over time.\n\nYour ultimate goal is to evacuate all the fish to cat planet!\nPut them in your rocket's cargo and launch them into space.\nDon't worry, you will still get space science.\n\nThe Market will gladly take any coin you might find.\nAdditional turret slots can be bought at the market.\nSeveral unique upgrades are available too.\nResearching tanks will unlock the artillery technology early.\nAny container bearing dangerous goods, like ammo, grenades or barrels,\ncauses heavy explosions when it breaks.\nMaybe this can be used to our advantage.
boss_message=Boss Wave __1__ - - __2__
50=The Big Biter Gang
100=Biterzilla
150=The Spitter Squad
200=The Wall Nibblers
250=Conveyor Munchers
300=Furnace Freezers
350=Cable Chewers
400=Power Pole Thieves
450=Assembler Annihilators
500=Inserter Crunchers
550=Engineer Eaters
600=Belt Unbalancers
650=Turret Devourers
700=Pipe Perforators
750=Desync Bros
800=Ratio Randomizers
850=Wire Chompers
900=The Bus Mixers
950=Roundabout Deadlockers
1000=Happy Tree Friends
1050=Uranium Digesters
1100=Bot Banishers
1150=Chest Crushers
1200=Cargo Wagon Scratchers
1250=Transport Belt Surfers
1300=Pumpjack Pulverizers
1350=Radar Ravagers
1400=Mall Deconstrutors
1450=Lamp Dimmers
1500=Roboport Disablers
1550=Signal Spammers
1600=Brick Tramplers
1650=Drill Destroyers
1700=Gearwheel Grinders
1750=Silo Seekers
1800=Circuit Breakers
1850=Bullet Absorbers
1900=Oil Guzzlers
1950=Belt Rotators
2000=Bluescreen Factor
[dungeons]
map_info_main_caption=D U N G E O N S
map_info_sub_caption= ~You put your robe and wizard hat on. You are still in a dungeon.~
map_info_text=Expand into the depths for treasure.\nEverytime a new room is discovered, the depth-meter in your left top will increase.\n\nEnemies get more chonky.\nResources yield more ore.\nLoot gets more shiny.\n\nYou can use the green smelly dungeon sewers for long range transports.\n\nHow far can you make it?
depth=~ Depth __1__ ~
depth_tooltip=Evolution: __1__%\nEnemy Health: __2__%\nEnemy Damage: __3__%
[dungeons_tiered]
map_info_main_caption=D U N G E O N S
map_info_sub_caption= ~You put your robe and wizard hat on. You are still in a dungeon.~
map_info_text=Expand into the depths for treasure.\nEverytime a new room is discovered, the depth-meter in your left top will increase.\n\nEnemies get more chonky.\nResources yield more ore.\nLoot gets more shiny.\n\nBut for real challenge and real shinies, you need to go also deeper.\nUse arrow buttons on top to change floors!\n\nHow far can you make it?
descend=Descend to lower floor.\nEach floor has stronger enemies and better treasure.\nRIGHT-CLICK: Descend 5 floors.\nSHIFT-CLICK: Desscend to lowest accessible Floor.
ascend=Ascend to higher floor.\nRIGHT-CLICK: Ascend 5 floors.\nSHIFT-CLICK: Ascend to Floor 0.
depth=~ Floor __1__ | Depth __2__ ~
depth_tooltip=Evolution: __1__%\nEnemy Health: __2__%\nEnemy Damage: __3__%\nLoot Value: __4__\nTreasure rooms found: __5__ / 5\nHidden Technologies: __6__
max_depth=You are on deepest level already!
min_depth=You are on highest level already!
only_on_spawn=You can change floors only on spawn.
level_required=You need level __1__ for travelling to next floor!
floor_size_required=You need to explore at least 60 rooms on this floor to access next floor!
travel_down=You have descended to deeper part of dungeon.
travel_up=You have ascended to previous part of dungeon.
first_visit=__1__ [lvl __2__] was first to reach Floor __3__!
too_small=The dungeon needs to be bigger for continuing in this direction.
treasure_room=Treasure room was found on Floor __1__!
tech_unlock=__1__ unlock was found on Floor __2__!
boss_arena=!!Dungeon Bosses!!\nRequires level 5 to join.\n\nCurrent boss level: __1__\nBoss bonus HP: __2__%\nBoss bonus damage: __3__%\nRewards: cca __4__ XP\n\nUp to four players can fight at once.
arena_occupied=Arena is in use! Wait for previous player to end his fight!
arena_level_needed=You need level 5 to join the arena!
robots_following=You cannot enter arena with robots following you!
arena_level_max=You defeated all the bosses already!
player_lost=[ARENA]: __1__ lost his battle to Boss lvl __2__!
player_won=[ARENA]: __1__ defeated the Boss lvl __2__!
spidertron_not_allowed=Spidertrons are not allowed in first 20 floors!
[mountain_fortress]
map_info_main_caption=M O U N T A I N F O R T R E S S
map_info_sub_caption= ..diggy diggy choo choo..
map_info_text=The biters have caught the scent of fish in the cargo wagon.\nGuide the choo into the mountain and protect it as long as possible!\nThis however will not be an easy task,\nsince their strength and numbers increase over time.\n\nIn additon, the southern grounds collapse over time.\n\nDelve deep for greater treasures, but also face increased dangers.\nMining productivity research, will overhaul your mining equipment,\nreinforcing your pickaxe as well as increasing the size of your backpack.\n\nAs you dig, you will encounter impassable dark chasms or rivers.\nSome explosives may cause parts of the ceiling to crumble, filling the void, creating new ways.\nAll they need is a container and a well aimed shot.\n\nYou may find some supply goods, if you enter the wagon.\nGood luck on your journey!
[chronosphere]
map_info_main_caption=C H R O N O S P H E R E
map_info_sub_caption= ..Comfylatron gone wild..
map_info_text=Comfylatron has seized the Fish Train and turned it into a time machine.\n Your job as his slave is:\n\n[1] Keep train alive at all costs.\n[2] Gather resources while travelling through different locations.\n[3a] Press enter on cargo wagons to enter the insides of train.\n[3b] Press enter on cars to exit the train.\n[4] Charging the accumulators inside the train speeds up the jump, but creates HUGE pollution, aggravating the biters.\n[5] Items inserted into the blue chests get teleported into the train.\n[6] Some planets are poor, some are rich, and some are just too dangerous.\n\nLoot, but also evolution, grows with jumps performed.\n During jump, personnel and their inventories will be teleported in, but anything left behind outside won't.\nEarly jumps award 25 硬币 per minute spared (until the 25th jump).\nObtaining mining productivity research grants inventory space and hand-mining speed.\n\nGood luck. Don't let biters ruin the show!
planet_jump=Destination: __1__, Ore richness: __2__, Daynight cycle: __3__
message_danger1=Comfylatron: We have a problem! We got disrupted in mid-jump, only part of energy got used, and here we landed. It might have been a trap!
message_danger2=Comfylatron: Battery is unstable, we need to survive until it gets full without additional charging.
message_danger3=Robot voice: INTRUDER ALERT! Lifeforms detected!! Must eliminate!!
message_danger4=Robot voice: Nuclear missiles armed. Launch countdown enabled.
message_rampup50=Comfylatron: Biters start to adapt to our presence, getting stronger every second...
message_overstay=Comfylatron: We took so long to get off that planet, our future destinations have evolved a little...
message_jump180=Comfylatron: Train is fully charged! Countdown sequence enabled. 180 seconds 'till jump!
message_jump60=Comfylatron: Nearly there! Grab what you can, we're leaving in 60 seconds!
message_jump30=Comfylatron: You'd better hurry up! 30 seconds remaining!!
message_jump10=Comfylatron: Jump in __1__ seconds!
message_jump=Comfylatron: Wheeee! Time jump underway! This is Jump number __1__
message_poison_defense=Comfylatron: Triggering poison defense. Let's kill everything!
message_nuke=Warning: Nuclear missiles launched.
message_accident=Comfylatron: Offline player had an accident, and their corpse fell to the ground near the locomotive.
message_silo=Nuclear silo destroyed. You looted __1__ atomic bombs. Comfylatron seized them for your own safety.
message_game_won_restart=Comfylatron: WAIT whaat? Looks like we did not fixed the train properly and it teleported us back in time...sigh...so let's do this again, and now properly.
message_fishmarket1=Comfylatron: So here we are. Fish Market. When they ordered the fish, they told us this location was safe. Guess we'll have to make it so.
message_fishmarket2=Comfylatron: I hope you have enough nukes. That satellite gave us some space knowledge!
message_fishmarket3=Comfylatron: Hey I found these nukes we looted before... you can take them.
message_lava=Comfylatron: OOF this one is a bit hot. Better keep your distance! Or try some bricks to protect from lava? And have seen those biters? They BATHE in fire!
message_choppy=Comfylatron: OwO what are those strange trees?!? They have ore fruits! WTF!
message_game_lost1=The Chronotrain was destroyed!
message_game_lost2=Comfylatron is going to kill you for that... he has a time machine after all!
message_evolve=Comfylatron: Biters start to adapt to us. And they appear to have some hive mind system to share it. If we stay too long, biters elsewhere will be stronger, waiting on us!
message_quest1=Comfylatron: You know...I have big quest. Deliver fish to fish market. But this train is broken. Please help me fix the train computer!
message_quest3=Comfylatron: Ah, we need to give this machine more power and better navigation chipset. Please bring me some additional things.
message_quest5=Comfylatron: Finally found the main issue. We will need to rebuild whole processor. Exactly what I feared of. Just a few more things...
message_quest6=Comfylatron: And, I've got the last part of the CPU brain done. Now we just need to synchronize our time correctly and we are done! Bring me satellite and rocket silo.
message_game_won1=Comfylatron: Thank you all for helping me with fish delivery. It was tough ride. And now that the biters are dead, the fish will be safe here forever...
message_comfylatron_desync=Comfylatron: I got you that time! Back to work, __1__!
difficulty1=Too easy!Low pollution, less enemies, etc...
difficulty2=Still easy!Low pollution, less enemies, etc...
difficulty3=Nearly easy!Low pollution, less enemies, etc...
difficulty4=Normal. Everything just about right...
difficulty5=A bit hard. More pollution, more enemies, etc...
difficulty6=Just about hard. More pollution, more enemies, etc...
difficulty7=Perfectly playable. Maybe. More pollution, more enemies, etc...
map_1=Terra Ferrata
map_2=Malachite Hills
map_3=Granite Plains
map_4=Petroleum Basin
map_5=Pitchblende Mountain
map_6=Mixed Deposits
map_7=Biter Homelands
map_8=Gangue Dumps
map_9=Antracite Valley
map_10=Ancient Battlefield
map_11=Cave Systems
map_12=Strange Forest
map_13=Riverlands
map_14=Burning Hell
map_15=Starting Area
map_16=Hedge Maze
map_17=Fish Market
map_18=Methane Swamps
map_19=ERROR DESTINATION NOT FOUND
ore_richness_very_rich=Very Rich
ore_richness_rich=Rich
ore_richness_normal=Normal
ore_richness_poor=Poor
ore_richness_very_poor=Very Poor
ore_richness_none=None
daynight_static=Static
daynight_normal=Normal
daynight_slow=Slow
daynight_superslow=Super slow
daynight_fast=Fast
daynight_superfast=Super fast
upgrade_train_armor=Train Armor
upgrade_train_armor_message=Comfylatron: Train's max HP upgraded.
upgrade_train_armor_tooltip=+2500 Train Max HP. Max level: __1__ Current Max HP: __2__
upgrade_filter=Pollution Filter
upgrade_filter_message=Comfylatron: Train's pollution filter upgraded.
upgrade_filter_tooltip=Train Pollution Filter. Dampens pollution from machines inside the train and from charging the chrono engine.\nCurrent pollution transfer factor: __1__%
upgrade_accumulators=Accumulators
upgrade_accumulators_message=Comfylatron: Train's accumulator capacity upgraded.
upgrade_accumulators_tooltip=Add an additional row of accumulators to the Chronotrain, increasing the maximum charging rate.
upgrade_loot_pickup=Loot Pickup Range
upgrade_loot_pickup_message=Comfylatron: Players install additional red inserters on their shoulders. Item pickup range increased.
upgrade_loot_pickup_tooltip=Add loot pickup distance to players. Current: +__1__ tiles range
upgrade_inventory_size=Character Inventory Size
upgrade_inventory_size_message=Comfylatron: Players can now carry more trash in their unsorted inventories.
upgrade_inventory_size_tooltip=Add +10 inventory slots to all players.
upgrade_repair=Train Repair Speed
upgrade_repair_message=Comfylatron: The Chronotrain can now repair with an additional repair kit at once.
upgrade_repair_tooltip=Train now gets repaired with more tools at once from the Repair Chest. Current: +__1__
upgrade_water=Piping System
upgrade_water_message=Comfylatron: Train now has a piping system for additional water sources in each wagon.
upgrade_water_tooltip=Add piping through wagon sides to create water sources for each wagon.
upgrade_output=Output System
upgrade_output_message=Comfylatron: Train has been upgraded with output chests.
upgrade_output_tooltip=Adds output chests to wagons 2 and 3 which send items to the external wagon storage.
upgrade_storage=Train Storage
upgrade_storage_message=Comfylatron: The inside of the train has upgraded storage.
upgrade_storage_tooltip=Add or upgrade storage chests to line the edges of the insides of the Chronotrain.
upgrade_poison=Poison Defense
upgrade_poison_message=Comfylatron: I don't believe in your defensive skills. I loaded another emergency poison defense into the locomotive...
upgrade_poison_tooltip=Emergency poison defense. Triggers automatically when the Chronotrain has low HP.\nMax charges : 4. Recharge timer for next use: __1__ min.
upgrade_fusion=Fusion Reactor
upgrade_fusion_message=Comfylatron: One personal fusion reactor ready.
upgrade_fusion_tooltip=Creates one Fusion Reactor.
upgrade_mk2=Power Armor MK2
upgrade_mk2_message=Comfylatron: I upgraded an armor to MK2.
upgrade_mk2_tooltip=Creates one Power Armor MK2
upgrade_computer1=Comfylatron's Quest 1
upgrade_computer1_tooltip=Progresses main quest.\nNext destinations won't ever have "very poor" ore distribution.
upgrade_computer1_message=Comfylatron: OK, now I can fix the train navigation... This should get rid of very poor worlds at least. It still needs more work, though. I'll come back later.
upgrade_computer2=Comfylatron's Quest 2
upgrade_computer2_message=Comfylatron: Perfect! Now we have train reactor, and happily for you all, we should be able to avoid poor worlds altogether! Find out what's next after the jump ;)
upgrade_computer2_tooltip=Progresses main quest.\nNext destinations won't ever have "poor" ore distribution.
upgrade_computer3=Comfylatron's Quest 3
upgrade_computer3_message=Comfylatron: That's __1__ / 10 processor parts done!
upgrade_computer3_tooltip=Progresses main quest.\nAfter completing 10th part, the final map can be unlocked.
upgrade_computer4=Comfylatron's Final Quest
upgrade_computer4_message=Comfylatron: TIME SYNCHRONIZED... CALCULATING SPACETIME DESTINATION... Done! Power up the chrono engines once more and let me deliver the fish finally. This trip is getting long.
upgrade_computer4_tooltip=Progresses main quest.\nBy unlocking this, the next destination is Fish Market.\nBe sure to be ready, there's no way back!
gui_1=ChronoJumps:
gui_2=Charge:
gui_3=Charged in:
gui_3_1=Best Case:
gui_3_2=Nuclear missiles launched in:
gui_3_3=JUMP IN:
gui_4=Local Evolution:
gui_planet_button=Area Info
gui_upgrades_button=Upgrades
gui_upgrades_1=Purchase upgrades by placing items in the chests at the top of the train interior.
gui_upgrades_2=Upgrading can take a few seconds.
gui_upgrades_switch_left=Upgrades
gui_upgrades_switch_right=Quests
gui_upgrades_jumps=Required minimal jump number
gui_planet_0=Name: __1__
gui_planet_1=Detected ore distribution:
gui_planet_2=Ore Amounts: __1__
gui_planet_3=Local evolution: __1__%
gui_planet_4=Global evolution bonuses:
gui_planet_4_1=+__1__% evolution, +__2__% damage
gui_planet_5=Day/night cycle: __1__
gui_planet_6=Overstay in: __1__ min, __2__s
gui_planet_7=Overstay applies after jump __1__
gui_overstayed=Overstayed!
gui_not_overstayed=Avoided overstay.
minimap=Outside View
minimap_button_tooltip=Open or close Outside View window.
minimap_tooltip=LMB: Increase zoom level.\nRMB: Decrease zoom level.\nMMB: Toggle camera size.\nMap button on top to hide/show
map_on=Automatically show map ON
map_off=OFF
[rocks_yield_ore_veins]
coal=
iron-ore=
copper-ore=
uranium-ore=
stone=
mixed=混合
angels-ore1=saphirite
angels-ore2=jivolite
angels-ore3=stiratite
angels-ore4=crotinnium
angels-ore5=rubyte
angels-ore6=bobmonium
giant=巨大
huge=庞大
big=大量
small=少量
tiny=微少
player_print=你发现一些__1__的东西在石堆下. 是一片__2__的__3__矿脉!! __4__
game_print= __1__发现了一片__2__的__3__矿脉! __4__
[rocks_yield_ore_veins_colors]
coal=乌黑
iron-ore=闪亮
copper-ore=闪光
uranium-ore=灼热
stone=坚硬
mixed=闪烁
angels-ore1=蓝色
angels-ore2=黄色
angels-ore3=奇怪
angels-ore4=闪亮
angels-ore5=深红色
angels-ore6=棕土色
[wave_defense]
gui_1=第一波次
gui_2=波次:
gui_3=危险:
tooltip_1=高难度会增强虫子.\n虫子强度: __1__%\n开始: __2__~
tooltip_2=增加 / 一会儿
[native_war]
map_info= - - N A T I V E W A R - -\n\n Defeat the enemy team Market !\n\nFeed your market with science to spawn waves of native biters and spitters !\nThey will soon after swarm to the opposing team Market !\n\nThe corridor is stewn with worms.\nRebuy dead worms and upgrade them to stem the opposing waves !\n\nExcess energy will activate a beam.\nBeam will progress with more excess energy.\nNatives will spawn according to the beam position.\n\nUse radars to spy opponent's base.\nUse your experience to improve damage and resistance of your biters.\nSpace science packs give extra life to your biters.\nConstruction robots may not build over the wall.\n
[territorial_control]
map_info_main_caption=T E R R I T O R I A L C O N T R O L
map_info_sub_caption= ..alone in the darkness..
map_info_text=Citizen Log #468-2A-3287, Freelancer Trent. \n\nTo whoever is reading this message, \nAny natural resources are rare and the ones worth while are too hard for me to reach. \nLuckily, the wrecks yield all kinds of useful scraps, but also various dangers. \nAlmost lost half a leg some days ago while digging out some scrap. \nThe wildlife is extremely aggressive, especially at the time of night. \nMost of these insect appearing like creatures seem to live underground. \nStay near your light sources, if you want to have a chance of surviving here! \n\n###Log End###

2
locale/zh-CN/modules.cfg Normal file
View File

@ -0,0 +1,2 @@
[modules]
charging_station_tooltip=从附近的蓄电池为装甲设备充电!\n仅对功率超过3MJ的装甲才有效。

View File

@ -0,0 +1,108 @@
[mountain_fortress_v3]
map_info_main_caption==山地要塞V3
map_info_sub_caption= ..……呜~呜~,框哧~框哧~框哧……..
map_info_text=\n 汉化有限,大部分靠词典翻译,跟个人理解。。请勿吐槽!!!!\n\n。。~~~~~~~~~~~~~~~~汉化作者KK_KK~~~~~~~~~~~~~~~~~\n\n虫子已经发现了火车,它们正在集结\n 引导火车向山里前进,保护它直到你倒下\n 虫子的属性跟数量会随着时间而增加\n 进行科技研究,升级你的装备\n 提升团队矿镐等级以及背包大小\n 继续向深处挖,里面有很多宝藏,也会有危险,\n 悬崖跟河流可以用炸药和箱子,可以填补空白\n 火车里有市场这是主要的物品来源,包括团队升级都在里面\n 地图的各地都有随机生产资源的建筑\n 祝你旅游愉快\n 虫子波数总共1000波,(不一定准确,翻译大概是这意思)\n\n~~~~~~~~~~~~~~~~持续汉化中~~~~~~~~~~~~~~~~
[breached_wall]
collapse_start= [color=blue] 地图管理员:[/color] \n警告,已经开始!
spidertron_unlocked=[color=blue]地图管理员:[/color]\注意! 机器蜘蛛已在主要市场解锁!
wall_breached=[color=blue]Mapkeeper:[/color]\n! 幸存者!做得好.您已完成 __1__区!
first_to_reach=[color=blue]Mapkeeper:[/color]\n__1__是第一个到达区域__2__的人.
artillery_warning=[color=blue]Mapkeeper:[/color]\n警告,北部已发现火炮!
cheating_through=__1__ 他们试图作弊用机器蜘蛛向北前进!
[entity]
treasure_1=您注意到废墟中有一个旧箱子.它充满了宝藏!
treasure_2=您在破碎的岩石下面找到一个箱子.它充满了好吃的东西!
treasure_3=我们已经找到了珍贵的东西!
treasure_rare_1=您的魔力提高了.您已经发现一个装满稀有珍宝的箱子!
treasure_rare_2=哦,太好了.您在破碎的岩石下面发现了一个箱子.它充满了稀有的东西!
treasure_rare_3=您是魔法师!我们发现了稀有的珍贵!
defeated_1=[color=blue]Mapkeeper:[/color]\n哦,不,这些虫子打坏了火车轨道!\n下次运气更好.
defeated_2=[color=blue]Mapkeeper:[/color]\n我不确定100%,但是-显然火车被击毁了.\n下次运气更好.away.
defeated_3=[color=blue]Mapkeeper:[/color]\n您有一个目标-保卫火车 *-*\n下次运气更好.
defeated_4=[color=blue]Mapkeeper:[/color]\n看起来我们正在重置,因为您没有捍卫火车._.\n下次运气更好.
reset_game=***禁用软重置!服务器将从方案重新启动以加载新更改. ***
notify_restart=禁用软件重置!服务器将从方案重新启动以加载新更改.
shutdown_game=***禁用软重置!服务器将关闭.最有可能是因为更新. ***
notify_shutdown=禁用软件重置!服务器将关闭.最有可能是因为更新.
train_taking_damage=[color=blue]Comfylatron:[/color]\n火车正遭受严重伤害.\n部署防御机制.
entity_limit_reached=__1__ 已达到限制.在市场上购买更多插槽!
found_car=__1__ 在隆隆声中发现了一辆汽车!\n
[gui]
global_pool_tooltip=挖掘,手工制作或运行增加资源!
global_pool_amount=存储经验在全局经验池里.\n当前值: __1__
amount_harvested=得到的树木/岩石数量.
biters_killed=杀死虫子的数量.
land_mine_placed=制造的地雷数量.
chest_placed=可以放在火车附近箱子的数量.
flamethrowers_placed=火焰喷射器跟炮塔的数量.
train_upgrades=列车等级.
info_tooltip=显示数值!
hide_minimap=隐藏火车迷你地图!
current_pickaxe_tier=团队当前 __1__ 斧头等级.\n奖励速度是: __2__%
[locomotive]
upgrades=提升:
items=物品:
shoo=^-^ 请不要对我开枪 ^-^
not_trusted=您需要被信任才能购买.
coins_left=剩余硬币: __1__
market_name=市场
search_text=搜索:
quantity_text=数量:
limit_reached=已达到最大限制!
chests_full=您不能购买更多的箱子.
chest_bought_info=__1__ __2__ 购买护甲的极限提升 __3__ 硬币.
health_bought_info=__1__ __2__ 购买火车生命恢复道具 __3__ 硬币.
aura_bought_info=__1__ __2__ 购买火车经验光环升级 __3__ 硬币.
xp_bought_info=__1__ __2__ 购买经验值升级 __3__ 硬币.
reroll_bought_info=__1__ __2__ 重置市场物品 __3__ 硬币.
pickaxe_bought_info=__1__ __2__ 升级矿镐等级__3__ 给 __4__ 硬币.
explosive_bullet_bought_info=__1__ __2__ 购买火焰弹升级 __3__ 硬币.
one_flamethrower_bought_info=__1__ __2__ 购买火焰喷射器-炮塔 __3__ 硬币.
multiple_flamethrower_bought_info=__1__ __2__ 购买 __3__ 火焰喷射器-炮塔 __4__ 硬币.
landmine_bought_info=__1__ __2__ 购买地雷 __3__ 硬币.
rpg_reset_bought_info=__1__ __2__ 重置玩家技能点 __3__ 硬币.
full_inventory=你的背包现在装满了。所以你只买了 __1__ __2__(s).
change_returned=店主已退回您的零钱,对此我们深表感谢.\n
notify_full_inventory_1=您的库存已满.试着先把你的战利品放在某个地方.
notify_full_inventory_2=您的库存已满. 立即加入战士团队!力量蓄力会更多!
new_items_at_market=火车市场已经解锁了新物品!
[main_market]
chest=提高了可以在外面放置的箱子数量.\n可以多次购买.
locomotive_max_health=升级火车生命.\n可以多次购买
locomotive_xp_aura=升级火车周围的经验光环。
xp_points_boost=升级您在经验光环中获得的经验值
explosive_bullets=将普通的SMG弹药升级为爆炸子弹.
reroll_market_items=重置市场的商品并调整价格.
purchase_pickaxe=将团队镐升级到等级:__1__
sold_out=售罄!
flamethrower_turret=升级可以放置的火焰喷射器的数量.
land_mine=升级可以放置的地雷数量.
skill_reset=重置玩家技能点.\n将保留积分.
car=便携汽车操作\n可以更容易打死.
tank=便携坦克操作\n大坦克, 可以抵抗严重伤害.
tank_cannon_na=坦克炮\n在650波之后可用.
tank_machine_gun_na=坦克机枪\n在4000波之后可用.
vehicle_machine_gun_na=汽车机枪\n在200波后可用.
[main]
death_message_1=__1__ 应该看着他们走的地方!
death_message_2=__1__ 不够小心!
death_message_3=__1__ 激怒了领主!
death_message_4=__1__ 试图走作弊路径!
death_message_5=__1__ 消失了!
death_message_6=__1__ 被淘汰了!
death_message_7=__1__ 试图向北作弊!
forcefield=强制不通过.
greeting=[color=blue]Comfylatron:[/color]\n你好, __1__!\n请阅读地图信息.
cleaner=[color=blue]Cleaner:[/color]\n__1__ 留下了他的好东西!快取走它们!
reset_in=游戏将 __1__ 在 __2__ 秒!
diff_set=设置了难度! 游戏已设置为: [color=green]__1__[/color]
diff_tooltip=防守波次根据玩家数量.\n额外奖励经验:__1__.\n提升采矿速度:__2__.\n运行速度提升:__3__.\n提升生产速度:__4__.\n每次收获的硬币数量:__5__.\n火焰炮塔极限:__6__.\n地雷极限:__7__.\n机车健康:__8__.\n隐藏宝藏有__9__几率产生.\n宽限期:__10__分钟\n机器蜘蛛在__11__区域解锁.

119
locale/zh-CN/rpg.cfg Normal file
View File

@ -0,0 +1,119 @@
[rpg_main]
no_valid_surface=无指定操作名
flame_boots_worn_out=你的火焰鞋穿坏.
flame_mana_remaining=剩余魔法:__1__
one_punch_text=暴击
mana_casting_too_fast= __1__ 魔法还有很多, 像 __1__ 迅速创建出, 然后挥舞着他们的魔杖,说一些难以理解的词.
low_level=等级不够.
not_inside_pos=你挥动你的魔杖, 但意识到它不能达到.
no_mana=你没有足够的魔力.
suicidal_comfylatron=您挥舞着魔杖,__1__在运行!
warped_ok=有轻微伤害自己的行为.
object_spawned=__1__正在制造.\n 你挥动你的魔杖和 __1__ 出现.
out_of_reach=无法在给制定位置创建物体.
[rpg_functions]
max_level=[color=blue]等级限制:[/color]\n 您已达到当前区域的最大级别。
pool_reward=[color=blue]全局池奖励:[/color]\n __1__什么也没收到.原因:挂机
[rpg_gui]
gain_info_tooltip=经验从采矿,移动,制作,修理和战斗中获得的收益。
allocate_info=鼠标右键分配 __1__ 技能点.\nShift + 鼠标单击可分配所有点。
player_name=你好 __1__ !
class_info=您是__1__.!
settings_frame=在这里改变你的角色配置!
level_limit=此区域的当前最大级别限制为:__1__ 通过突破墙壁/区域来增加。
settings_name=设置
level_name=等级
experience_name=经验
next_level_name=下一个级别
strength_name=力量
strength_tooltip=增加库存数量,挖掘速度.\n增加近战伤害和机器人追随者数量。
magic_name=魔法
magic_tooltip=距离增加。\n提高修复速度。启用实体生成。
dexterity_name=敏捷
dexterity_tooltip=提高运行和制作速度。
vitality_name=耐力
vitality_tooltip=增加生命值。\n增加命中时的近战生命。
points_to_dist=分配\n技能点
life_name=生命
life_tooltip=当前的健康状况
life_increase=现在的生命值。通过增加活力来增加它。
life_maximum=这是你最大的生命。
shield_name=护盾
shield_no_shield=你没有护盾。
shield_no_armor=这是你现在的护盾。你没有穿护甲。
shield_tooltip=护甲保护你,提高你的抵抗力。
shield_current=人物当前护甲值。
shield_max=最大护甲值。
mana_name=魔力
mana_bonus=魔力\n加成
mana_regen_bonus=魔力恢复加成: __1__
mana_tooltip=可以通过吃鱼来恢复魔力
mana_regen_current=这是你现在的魔力。你可以通过增加你的魔法技能来增加恢复。
mana_max_limit=这是你的最大魔力值。你已经达到了最大法力极限。
mana_max=这是你的最大魔力值。你可以通过增加你的魔法技能来增加恢复。
mining_name=挖掘\n速度
slot_name=背包\n加成
melee_name=近战\n伤害
one_punch_chance=命中生命: __1__\n暴击几率: __2__ %
one_punch_disabled=暴击被禁用
bonus_tooltip=到达距离加成: __1__\n建筑距离加成: __2__\n物品投掷距离加成: __3__\n拾取战利品距离加成: __4__\n物品拾取距离加成: __5__\n资源到达距离加成: __6__\n修理速度: __7__
reach_distance=到达\n距离
crafting_speed=制作\n速度
running_speed=跑路\n速度
health_bonus_name=生命\n加成
health_tooltip=生命回复加成: __1__
[rpg_settings]
name=RPG settings
save_changes=保存更改
discard_changes=放弃更改
not_trusted=不可选.
low_level=等级要求: __1__
used_up=全部用完!
no_mana=魔法不足!
mana_label=魔力设置:
tooltip_check=选中: true\n未选中: false
info_text_label=通用RPG设置。玩家的基本设置。
health_text_label=显示生命/魔力条?
health_only_text_label=显示生命条?
reset_text_label=重置技能点?
reset_tooltip=重置-如果您选择了错误的路径(这将保留你的技能点)
reach_text_label=启用到达加成?
reach_text_tooltip=不想捡别人抢的东西吗?\n你可以在这里切换。
movement_text_label=启用移动速度加成?
movement_text_tooltip=不想像闪电一样奔跑吗?\n你可以在这里切换。
stone_path_label=采矿时启用石路?
stone_path_tooltip=启用此选项将在您挖掘时自动创建石头路径。
one_punch_label=启用暴击?
one_punch_tooltip=启用此选项将有一次击打敌人的机会。
one_punch_globally=启用全局。
flameboots_label=启用火焰靴?
flameboots_tooltip=当子弹未击中。
magic_label=启用鲜鱼大量刷出?
magic_tooltip=当简单的建设项目不够。\ n注意!用生鱼施法。
magic_spell=选择要生成的物体
magic_item_requirement=__1__ [item=__2__] 需要 __3__ 施展魔法。 等级: __4__\n
magic_entity_requirement=__1__ [entity=__2__] 需要 __3__ 施展魔法. 等级: __4__\n
magic_special_requirement=__1__ __2__ 需要 __3__ 施展魔法. 等级: __4__\n
allocation_settings_label=分配设置:
allocation_label=选择要自动分配的技能。
allocation_tooltip=这将自动将所有可用的点分配给给定的节点。
[spells]
acid_stream=Bitter Spew
railgun_beam=Shoop Da Whoop!!
raw_fish=Conjure Raw-fish
comfylatron=Suicidal Comfylatron
distractor=Distractor Capsule
warp=Warp Gate
[allocations]
deactivated=Deactivated
str=Strength
mag=Magicka
dex=Dexterity
vit=Vitality

View File

@ -20,7 +20,7 @@ end
local function floaty_hearts(entity, c)
local position = {x = entity.position.x - 0.75, y = entity.position.y - 1}
local b = 1.35
for a = 1, c, 1 do
for _ = 1, c, 1 do
local p = {
(position.x + 0.4) + (b * -1 + random(0, b * 20) * 0.1),
position.y + (b * -1 + random(0, b * 20) * 0.1)

View File

@ -36,9 +36,7 @@ commands.add_command(
if not this.reset_are_you_sure then
this.reset_are_you_sure = true
p(
'[WARNING] This command will disable the soft-reset feature, run this command again if you really want to do this!'
)
p('[WARNING] This command will disable the soft-reset feature, run this command again if you really want to do this!')
return
end
@ -61,7 +59,6 @@ commands.add_command(
end
elseif param == 'restartnow' then
this.reset_are_you_sure = nil
p(player.name .. ' has restarted the game.')
Server.start_scenario('Mountain_Fortress_v3')
return
elseif param == 'shutdown' then

View File

@ -17,7 +17,9 @@ local ExplosiveBullets = require 'maps.mountain_fortress_v3.explosive_gun_bullet
local Collapse = require 'modules.collapse'
local Alert = require 'utils.alert'
local Task = require 'utils.task'
local Score = require 'comfy_panel.score'
local Token = require 'utils.token'
local HS = require 'maps.mountain_fortress_v3.highscore'
-- tables
local WPT = require 'maps.mountain_fortress_v3.table'
@ -76,7 +78,6 @@ local protect_types = {
['fluid-wagon'] = true,
['locomotive'] = true,
['reactor'] = true,
['car'] = true,
['spidertron'] = true
}
@ -86,26 +87,41 @@ local reset_game =
local this = data.this
local Reset_map = data.reset_map
if this.soft_reset then
HS.set_scores()
this.game_reset_tick = nil
Reset_map()
return
end
if this.restart then
HS.set_scores()
local message = ({'entity.reset_game'})
Server.to_discord_bold(message)
Server.to_discord_bold(message, true)
Server.start_scenario('Mountain_Fortress_v3')
this.announced_message = true
return
end
if this.shutdown then
HS.set_scores()
local message = ({'entity.shutdown_game'})
Server.to_discord_bold(message)
Server.to_discord_bold(message, true)
Server.stop_scenario()
return
end
end
)
local function exists()
local carriages = WPT.get('carriages')
local t = {}
for i = 1, #carriages do
local e = carriages[i]
if (e and e.valid) then
t[e.unit_number] = true
end
end
return t
end
local function get_random_weighted(weighted_table, item_index, weight_index)
local total_weight = 0
item_index = item_index or 1
@ -261,19 +277,6 @@ local function protect_entities(event)
return false
end
local function exists()
local carriages = WPT.get('carriages')
local t = {}
for i = 1, #carriages do
local e = carriages[i]
if not (e and e.valid) then
return
end
t[e.unit_number] = true
end
return t
end
local units = exists()
if is_protected(entity) then
if (event.cause and event.cause.valid) then
@ -853,8 +856,9 @@ local function on_player_repaired_entity(event)
return
end
local entity = event.entity
local locomotive = WPT.get('locomotive')
if entity == locomotive then
local units = exists()
if units[entity.unit_number] then
local player = game.players[event.player_index]
local repair_speed = Functions.get_magicka(player)
if repair_speed <= 0 then
@ -971,6 +975,123 @@ local function on_entity_died(event)
end
end
local function get_sorted_list(column_name, score_list)
for _ = 1, #score_list, 1 do
for y = 1, #score_list, 1 do
if not score_list[y + 1] then
break
end
if score_list[y][column_name] < score_list[y + 1][column_name] then
local key = score_list[y]
score_list[y] = score_list[y + 1]
score_list[y + 1] = key
end
end
end
return score_list
end
local function get_mvps(force)
local get_score = Score.get_table().score_table
if not get_score[force] then
return false
end
local score = get_score[force]
local score_list = {}
for _, p in pairs(game.players) do
if score.players[p.name] then
local killscore = 0
if score.players[p.name].killscore then
killscore = score.players[p.name].killscore
end
local built_entities = 0
if score.players[p.name].built_entities then
built_entities = score.players[p.name].built_entities
end
local mined_entities = 0
if score.players[p.name].mined_entities then
mined_entities = score.players[p.name].mined_entities
end
table.insert(score_list, {name = p.name, killscore = killscore, built_entities = built_entities, mined_entities = mined_entities})
end
end
local mvp = {}
score_list = get_sorted_list('killscore', score_list)
mvp.killscore = {name = score_list[1].name, score = score_list[1].killscore}
score_list = get_sorted_list('mined_entities', score_list)
mvp.mined_entities = {name = score_list[1].name, score = score_list[1].mined_entities}
score_list = get_sorted_list('built_entities', score_list)
mvp.built_entities = {name = score_list[1].name, score = score_list[1].built_entities}
return mvp
end
local function show_mvps(player)
local get_score = Score.get_table().score_table
local wave_defense_table = WD.get_table()
if not get_score then
return
end
if player.gui.left['mvps'] then
return
end
local frame = player.gui.left.add({type = 'frame', name = 'mvps', direction = 'vertical'})
local l = frame.add({type = 'label', caption = 'MVPs:'})
l.style.font = 'default-listbox'
l.style.font_color = {r = 0.55, g = 0.55, b = 0.99}
local t = frame.add({type = 'table', column_count = 2})
local mvp = get_mvps('player')
if mvp then
local wave_defense = t.add({type = 'label', caption = 'Highest Wave >> '})
wave_defense.style.font = 'default-listbox'
wave_defense.style.font_color = {r = 0.22, g = 0.77, b = 0.44}
local wave_defense_text = t.add({type = 'label', caption = 'This rounds highest wave was: ' .. wave_defense_table.wave_number})
wave_defense_text.style.font = 'default-bold'
wave_defense_text.style.font_color = {r = 0.33, g = 0.66, b = 0.9}
local defender_label = t.add({type = 'label', caption = 'Defender >> '})
defender_label.style.font = 'default-listbox'
defender_label.style.font_color = {r = 0.22, g = 0.77, b = 0.44}
local defender_label_text = t.add({type = 'label', caption = mvp.killscore.name .. ' with a killing score of ' .. mvp.killscore.score .. ' kills!'})
defender_label_text.style.font = 'default-bold'
defender_label_text.style.font_color = {r = 0.33, g = 0.66, b = 0.9}
local builder_label = t.add({type = 'label', caption = 'Builder >> '})
builder_label.style.font = 'default-listbox'
builder_label.style.font_color = {r = 0.22, g = 0.77, b = 0.44}
local builder_label_text = t.add({type = 'label', caption = mvp.built_entities.name .. ' built ' .. mvp.built_entities.score .. ' things!'})
builder_label_text.style.font = 'default-bold'
builder_label_text.style.font_color = {r = 0.33, g = 0.66, b = 0.9}
local miners_label = t.add({type = 'label', caption = 'Miners >> '})
miners_label.style.font = 'default-listbox'
miners_label.style.font_color = {r = 0.22, g = 0.77, b = 0.44}
local miners_label_text = t.add({type = 'label', caption = mvp.mined_entities.name .. ' mined a total of ' .. mvp.mined_entities.score .. ' entities!'})
miners_label_text.style.font = 'default-bold'
miners_label_text.style.font_color = {r = 0.33, g = 0.66, b = 0.9}
local sent_to_discord = WPT.get('sent_to_discord')
if not sent_to_discord then
local result = {}
table.insert(result, 'HIGHEST WAVE: \\n')
table.insert(result, wave_defense_table.wave_number .. '\\n')
table.insert(result, '\\n')
table.insert(result, 'MVP Defender: \\n')
table.insert(result, mvp.killscore.name .. ' with a killing score of ' .. mvp.killscore.score .. ' kills!\\n')
table.insert(result, '\\n')
table.insert(result, 'MVP Builder: \\n')
table.insert(result, mvp.built_entities.name .. ' built ' .. mvp.built_entities.score .. ' things!\\n')
table.insert(result, '\\n')
table.insert(result, 'MVP Miners: \\n')
table.insert(result, mvp.mined_entities.name .. ' mined a total of ' .. mvp.mined_entities.score .. ' entities!\\n')
local message = table.concat(result)
Server.to_discord_embed(message)
WPT.set('sent_to_discord', true)
end
end
end
function Public.unstuck_player(index)
local player = game.get_player(index)
local surface = player.surface
@ -990,6 +1111,7 @@ function Public.loco_died()
return
end
Collapse.start_now(false)
if not locomotive.valid then
local this = WPT.get()
if this.announced_message then
@ -1054,6 +1176,7 @@ function Public.loco_died()
position = this.locomotive.position
}
Alert.alert_all_players_location(pos, msg)
Server.to_discord_bold(msg, true)
game.forces.enemy.set_friend('player', true)
game.forces.player.set_friend('enemy', true)
@ -1074,6 +1197,7 @@ function Public.loco_died()
this.game_reset_tick = 5400
for _, player in pairs(game.connected_players) do
player.play_sound {path = 'utility/game_lost', volume_modifier = 0.75}
show_mvps(player)
end
end

View File

@ -763,6 +763,25 @@ function Public.remove_offline_players()
end
end
local function calc_players()
local players = game.connected_players
local check_afk_players = WPT.get('check_afk_players')
if not check_afk_players then
return #players
end
local total = 0
for i = 1, #players do
local player = players[i]
if player.afk_time < 36000 then
total = total + 1
end
end
if total <= 0 then
total = 1
end
return total
end
function Public.set_difficulty()
local game_lost = WPT.get('game_lost')
if game_lost then
@ -772,7 +791,9 @@ function Public.set_difficulty()
local wave_defense_table = WD.get_table()
local collapse_amount = WPT.get('collapse_amount')
local collapse_speed = WPT.get('collapse_speed')
local player_count = #game.connected_players
local difficulty = WPT.get('difficulty')
local player_count = calc_players()
if not Diff.difficulty_vote_value then
Diff.difficulty_vote_value = 0.1
end
@ -786,10 +807,11 @@ function Public.set_difficulty()
-- threat gain / wave
wave_defense_table.threat_gain_multiplier = 1.2 + player_count * Diff.difficulty_vote_value * 0.1
local amount = player_count * 0.40 + 2
-- local amount = player_count * 0.40 + 2 -- too high?
local amount = player_count * difficulty.multiply + 2
amount = floor(amount)
if amount > 20 then
amount = 20
if amount > difficulty.highest then
amount = difficulty.highest -- lowered from 20 to 15
end
wave_defense_table.wave_interval = 3600 - player_count * 60
@ -806,11 +828,13 @@ function Public.set_difficulty()
if collapse_speed then
Collapse.set_speed(collapse_speed)
else
if player_count >= 8 and player_count <= 12 then
if player_count >= 1 and player_count <= 8 then
Collapse.set_speed(9)
elseif player_count > 8 and player_count <= 20 then
Collapse.set_speed(8)
elseif player_count >= 20 and player_count <= 24 then
elseif player_count > 20 and player_count <= 35 then
Collapse.set_speed(6)
elseif player_count >= 35 then
elseif player_count > 35 then
Collapse.set_speed(5)
end
end
@ -818,9 +842,14 @@ end
function Public.render_direction(surface)
local counter = WPT.get('soft_reset_counter')
local winter_mode = WPT.get('winter_mode')
local text = 'Welcome to Mountain Fortress v3!'
if winter_mode then
text = 'Welcome to Wintery Mountain Fortress v3!'
end
if counter then
rendering.draw_text {
text = 'Welcome to Mountain Fortress v3!\nRun: ' .. counter,
text = text .. '\nRun: ' .. counter,
surface = surface,
target = {-0, 10},
color = {r = 0.98, g = 0.66, b = 0.22},
@ -831,7 +860,7 @@ function Public.render_direction(surface)
}
else
rendering.draw_text {
text = 'Welcome to Mountain Fortress v3!',
text = text,
surface = surface,
target = {-0, 10},
color = {r = 0.98, g = 0.66, b = 0.22},
@ -1139,6 +1168,13 @@ function Public.is_creativity_mode_on()
end
end
function Public.disable_creative()
local creative_enabled = Commands.get('creative_enabled')
if creative_enabled then
Commands.set('creative_enabled', false)
end
end
function Public.on_pre_player_left_game(event)
local offline_players_enabled = WPT.get('offline_players_enabled')
if not offline_players_enabled then

View File

@ -15,6 +15,14 @@ local queue_task = Task.queue_task
local tiles_per_call = 8
local total_calls = ceil(1024 / tiles_per_call)
local regen_decoratives = false
local wintery_type = {
['simple-entity'] = true,
['tree'] = true,
['fish'] = true,
['market'] = true,
['locomotive'] = true,
['cargo-wagon'] = true
}
-- Set to false by modules that want to control the on_chunk_generated event themselves.
Public.enable_register_events = true
@ -266,6 +274,44 @@ local function do_place_buildings(data)
end
end
local function wintery(ent, extra_lights)
local winter_mode = WPT.get('winter_mode')
if not winter_mode then
return false
end
local colors = {{255, 0, 0}, {0, 255, 0}, {0, 0, 255}}
local function add_light(e)
local color = colors[math.random(1, 3)]
local scale = extra_lights or 1
rendering.draw_light(
{
sprite = 'utility/light_small',
orientation = 1,
scale = scale,
intensity = 1,
minimum_darkness = 0,
oriented = false,
color = color,
target = e,
target_offset = {0, -0.5},
surface = e.surface
}
)
end
if not (ent and ent.valid) then
return
end
if wintery_type[ent.type] then
if ent.type == 'simple-entity' then
if random(1, 8) ~= 1 then
return
end
end
add_light(ent)
end
return true
end
local function do_place_entities(data)
local surface = data.surface
local entity
@ -274,6 +320,7 @@ local function do_place_entities(data)
if e.collision then
if surface.can_place_entity(e) then
entity = surface.create_entity(e)
wintery(entity)
if entity and e.direction then
entity.direction = e.direction
end
@ -297,6 +344,7 @@ local function do_place_entities(data)
end
else
entity = surface.create_entity(e)
wintery(entity)
if entity and e.direction then
entity.direction = e.direction
end
@ -528,4 +576,6 @@ end
Event.add(defines.events.on_chunk_generated, on_chunk)
Public.wintery = wintery
return Public

View File

@ -3,9 +3,13 @@ local Global = require 'utils.global'
local Server = require 'utils.server'
local Token = require 'utils.token'
local Tabs = require 'comfy_panel.main'
local Score = require 'comfy_panel.score'
local WPT = require 'maps.mountain_fortress_v3.table'
local WD = require 'modules.wave_defense.table'
local Core = require 'utils.core'
local score_dataset = 'highscores'
local score_key = 'mountain_fortress_v3_scores'
local set_data = Server.set_data
local try_get_data = Server.try_get_data
@ -34,6 +38,247 @@ local biters = {
'big-spitter',
'behemoth-spitter'
}
local function get_lowest(tbl, column_name)
local t = {}
for _, value in pairs(tbl) do
insert(t, value[column_name])
end
table.sort(
t,
function(a, b)
return a < b
end
)
if t[1] then
return t[1]
else
return 100
end
end
local function get_highest(tbl, column_name)
local t = {}
for _, value in pairs(tbl) do
insert(t, value[column_name])
end
table.sort(
t,
function(a, b)
return a > b
end
)
if t[1] then
return t[1]
else
return 10
end
end
local function contains(tbl, key, string, rtn)
for index, value in pairs(tbl) do
if value[key] and value[key] == string then
if rtn then
return index
else
return true
end
end
end
return false
end
local function sort_list(method, column_name, score_list)
local comparators = {
['ascending'] = function(a, b)
return a[column_name] < b[column_name]
end,
['descending'] = function(a, b)
return a[column_name] > b[column_name]
end
}
table.sort(score_list, comparators[method])
return score_list
end
local function get_sorted_list(column_name, score_list)
local sl = {}
local i = 0
score_list = sort_list('descending', column_name, score_list)
for key, player in ipairs(score_list) do
sl[key] = player
i = i + 1
if i == 20 then
return sl
end
end
return sl
end
local function get_mvps()
local new_score_table = Score.get_table().score_table
if not new_score_table['player'] then
return false
end
local old_score = this.score_table['player']
local score = new_score_table['player']
local score_list = {}
local mvp = old_score.players
for _, p in pairs(game.players) do
if score.players[p.name] then
local killscore = 0
if score.players[p.name].killscore then
killscore = score.players[p.name].killscore
end
local built_entities = 0
if score.players[p.name].built_entities then
built_entities = score.players[p.name].built_entities
end
local mined_entities = 0
if score.players[p.name].mined_entities then
mined_entities = score.players[p.name].mined_entities
end
local deaths = 0
if score.players[p.name].deaths then
deaths = score.players[p.name].deaths
end
insert(score_list, {name = p.name, killscore = killscore, built_entities = built_entities, deaths = deaths, mined_entities = mined_entities})
end
end
local score_list_k = get_sorted_list('killscore', score_list)
local score_list_m = get_sorted_list('mined_entities', score_list)
local score_list_b = get_sorted_list('built_entities', score_list)
local score_list_d = get_sorted_list('deaths', score_list)
local lowest_k = get_lowest(mvp, 'killscore')
local lowest_m = get_lowest(mvp, 'mined_entities')
local lowest_b = get_lowest(mvp, 'built_entities')
local highest_d = get_highest(mvp, 'deaths')
for i = 1, 30 do
local kill_list = score_list_k[i]
local mined_list = score_list_m[i]
local build_list = score_list_b[i]
local death_list = score_list_d[i]
if kill_list then
if not contains(mvp, 'name', kill_list.name) then
if kill_list.killscore >= lowest_k then
if death_list and death_list.deaths < highest_d then
insert(
mvp,
{
name = kill_list.name,
killscore = kill_list.killscore,
deaths = death_list.deaths
}
)
else
insert(
mvp,
{
name = kill_list.name,
killscore = kill_list.killscore
}
)
end
end
else
local index = contains(mvp, 'name', kill_list.name, true)
if index then
if mvp[index].killscore and kill_list.killscore > mvp[index].killscore then
mvp[index].killscore = kill_list.killscore
end
if death_list and mvp[index].deaths and death_list.deaths < mvp[index].deaths then
mvp[index].deaths = death_list.deaths
end
end
end
end
if mined_list then
if not contains(mvp, 'name', mined_list.name) then
if mined_list.mined_entities >= lowest_m then
if death_list and death_list.deaths < highest_d then
insert(
mvp,
{
name = mined_list.name,
mined_entities = mined_list.mined_entities,
deaths = death_list.deaths
}
)
else
insert(
mvp,
{
name = mined_list.name,
mined_entities = mined_list.mined_entities
}
)
end
end
else
local index = contains(mvp, 'name', mined_list.name, true)
if index then
if mvp[index].mined_entities and mined_list.mined_entities > mvp[index].mined_entities then
mvp[index].mined_entities = mined_list.mined_entities
end
if death_list and mvp[index].deaths and death_list.deaths < mvp[index].deaths then
mvp[index].deaths = death_list.deaths
end
end
end
end
if build_list then
if not contains(mvp, 'name', build_list.name) then
if build_list.built_entities >= lowest_b then
if death_list and death_list.deaths < highest_d then
insert(
mvp,
{
name = build_list.name,
built_entities = build_list.built_entities,
deaths = death_list.deaths
}
)
else
insert(
mvp,
{
name = build_list.name,
built_entities = build_list.built_entities
}
)
end
end
else
local index = contains(mvp, 'name', build_list.name, true)
if index then
if mvp[index].built_entities and build_list.built_entities > mvp[index].built_entities then
mvp[index].built_entities = build_list.built_entities
end
if death_list and mvp[index].deaths and death_list.deaths < mvp[index].deaths then
mvp[index].deaths = death_list.deaths
end
end
end
end
if mvp['GodGamer'] then
mvp['GodGamer'] = nil
end
end
if #mvp <= 0 then
return false
end
return mvp
end
local function get_total_biter_killcount(force)
local count = 0
for _, biter in pairs(biters) do
@ -42,24 +287,61 @@ local function get_total_biter_killcount(force)
return count
end
local function get_additional_stats(key)
if not this.score_table['player'] then
this.score_table['player'] = {}
end
local function write_additional_stats(key)
local player = game.forces.player
local breached_zone = WPT.get('breached_wall')
local c = get_total_biter_killcount(player)
local new_breached_zone = WPT.get('breached_wall')
local new_wave_number = WD.get('wave_number')
local new_biters_killed = get_total_biter_killcount(player)
local new_rockets_launched = player.rockets_launched
local new_total_time = game.ticks_played
local t = this.score_table['player']
t.rockets_launched = player.rockets_launched
t.biters_killed = c
if breached_zone == 1 then
t.breached_zone = breached_zone
if this.score_table['player'] then
local old_wave = this.score_table['player'].wave_number
local old_biters_killed = this.score_table['player'].biters_killed
local old_breached_zone = this.score_table['player'].breached_zone
local old_rockets_launched = this.score_table['player'].rockets_launched
local old_total_time = this.score_table['player'].total_time
local old_players = this.score_table['player'].players
if new_wave_number > old_wave then
t.wave_number = new_wave_number
else
t.breached_zone = breached_zone - 1
t.wave_number = old_wave
end
if new_biters_killed > old_biters_killed then
t.biters_killed = new_biters_killed
else
t.biters_killed = old_biters_killed
end
if new_breached_zone > old_breached_zone then
t.breached_zone = new_breached_zone
else
t.breached_zone = old_breached_zone
end
if new_rockets_launched > old_rockets_launched then
t.rockets_launched = new_rockets_launched
else
t.rockets_launched = old_rockets_launched
end
if new_total_time > old_total_time then
t.total_time = new_total_time
else
t.total_time = old_total_time
end
local new_stats = get_mvps()
if new_stats then
t.players = new_stats
else
t.players = old_players
end
end
this.score_table['player'] = t
if key then
set_data(score_dataset, key, t)
end
end
local get_scores =
@ -76,21 +358,27 @@ local get_scores =
function Public.get_scores()
local secs = Server.get_current_time()
local key = 'mountain_fortress_v3_scores'
if not secs then
return
else
try_get_data(score_dataset, key, get_scores)
try_get_data(score_dataset, score_key, get_scores)
end
end
function Public.set_scores(key)
function Public.set_scores()
local secs = Server.get_current_time()
key = tostring(key)
if not secs then
return
else
get_additional_stats(key)
write_additional_stats(score_key)
end
end
local function on_init()
local secs = Server.get_current_time()
if not secs then
write_additional_stats()
return
end
end
@ -110,33 +398,18 @@ local function get_score_list()
return score_list
end
for p, _ in pairs(score_force.players) do
if score_force.players[p] then
local score = score_force.players[p]
insert(
score_list,
{
name = p,
killscore = score.killscore or 0,
deaths = score.deaths or 0,
built_entities = score.built_entities or 0,
mined_entities = score.mined_entities or 0
name = score and score.name,
killscore = score and score.killscore or 0,
deaths = score and score.deaths or 20,
built_entities = score and score.built_entities or 0,
mined_entities = score and score.mined_entities or 0
}
)
end
end
return score_list
end
local function get_sorted_list(method, column_name, score_list)
local comparators = {
['ascending'] = function(a, b)
return a[column_name] < b[column_name]
end,
['descending'] = function(a, b)
return a[column_name] > b[column_name]
end
}
table.sort(score_list, comparators[method])
return score_list
end
@ -145,15 +418,15 @@ local function add_global_stats(frame)
local t = frame.add {type = 'table', column_count = 6}
local l = t.add {type = 'label', caption = 'Rockets launched: '}
local l = t.add {type = 'label', caption = 'Rockets: '}
l.style.font = 'default-game'
l.style.font_color = {r = 175, g = 75, b = 255}
l.style.minimal_width = 140
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = score.rockets_launched}
l.style.font = 'default-listbox'
l.style.font = 'heading-2'
l.style.font_color = {r = 0.9, g = 0.9, b = 0.9}
l.style.minimal_width = 123
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = 'Dead bugs: '}
l.style.font = 'default-game'
@ -161,19 +434,42 @@ local function add_global_stats(frame)
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = score.biters_killed}
l.style.font = 'default-listbox'
l.style.font = 'heading-2'
l.style.font_color = {r = 0.9, g = 0.9, b = 0.9}
l.style.minimal_width = 145
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = 'Breached zones: '}
l.style.font = 'default-game'
l.style.font_color = {r = 0, g = 128, b = 0}
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = score.breached_zone - 1}
l.style.font = 'default-listbox'
local zone = score.breached_zone - 1
if score.breached_zone == 0 then
zone = 0
end
local l = t.add {type = 'label', caption = zone}
l.style.font = 'heading-2'
l.style.font_color = {r = 0.9, g = 0.9, b = 0.9}
l.style.minimal_width = 145
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = 'Highest wave: '}
l.style.font = 'default-game'
l.style.font_color = {r = 128, g = 128, b = 0.9}
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = score.wave_number}
l.style.font = 'heading-2'
l.style.font_color = {r = 0.9, g = 0.9, b = 0.9}
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = 'Last run total time: '}
l.style.font = 'default-game'
l.style.font_color = {r = 0.9, g = 128, b = 128}
l.style.minimal_width = 100
local l = t.add {type = 'label', caption = Core.format_time(score.total_time)}
l.style.font = 'heading-2'
l.style.font_color = {r = 0.9, g = 0.9, b = 0.9}
l.style.minimal_width = 100
end
local show_score = (function(player, frame)
@ -185,7 +481,7 @@ local show_score = (function(player, frame)
sFlow.horizontal_align = 'center'
sFlow.vertical_align = 'center'
local stats = flow.add {type = 'label', caption = 'Previous game statistics!'}
local stats = flow.add {type = 'label', caption = 'Highest score so far:'}
local s_stats = stats.style
s_stats.font = 'heading-1'
s_stats.font_color = {r = 0.98, g = 0.66, b = 0.22}
@ -238,9 +534,7 @@ local show_score = (function(player, frame)
-- Score list
local score_list = get_score_list()
if #game.connected_players > 1 then
score_list = get_sorted_list(sorting_pref.method, sorting_pref.column, score_list)
end
score_list = sort_list(sorting_pref.method, sorting_pref.column, score_list)
-- New pane for scores (while keeping headers at same position)
local scroll_pane =
@ -273,12 +567,18 @@ local show_score = (function(player, frame)
b = p.color.b * 0.6 + 0.4,
a = 1
}
local k = entry.killscore > 0 and entry.killscore or 'Not MVP'
local d = entry.deaths < 10 and entry.deaths or 'Not MVP'
local b = entry.built_entities > 0 and entry.built_entities or 'Not MVP'
local m = entry.mined_entities > 0 and entry.mined_entities or 'Not MVP'
local line = {
{caption = entry.name, color = special_color},
{caption = tostring(entry.killscore)},
{caption = tostring(entry.deaths)},
{caption = tostring(entry.built_entities)},
{caption = tostring(entry.mined_entities)}
{caption = tostring(k)},
{caption = tostring(d)},
{caption = tostring(b)},
{caption = tostring(m)}
}
local default_color = {r = 0.9, g = 0.9, b = 0.9}
@ -297,8 +597,6 @@ local show_score = (function(player, frame)
end -- foreach entry
end) -- show_score
comfy_panel_tabs['HighScore'] = {gui = show_score, admin = false}
local function on_gui_click(event)
if not event then
return
@ -315,18 +613,12 @@ local function on_gui_click(event)
if not frame then
return
end
if frame.name ~= 'HighScore' then
if frame.name ~= 'Highscore' then
return
end
local name = event.element.name
-- Handles click on the checkbox, for floating score
if name == 'show_floating_killscore_texts' then
global.show_floating_killscore[player.name] = event.element.state
return
end
-- Handles click on a score header
local element_to_column = {
['score_killscore'] = 'killscore',
@ -362,6 +654,20 @@ local function on_player_left_game(event)
end
end
Server.on_data_set_changed(
score_dataset,
function(data)
if data.key == score_key then
if data.value then
this.score_table['player'] = data.value
end
end
end
)
comfy_panel_tabs['Highscore'] = {gui = show_score, admin = false, only_server_sided = true}
Event.on_init(on_init)
Event.add(defines.events.on_player_left_game, on_player_left_game)
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
Event.add(defines.events.on_gui_click, on_gui_click)

View File

@ -3,6 +3,7 @@ local Color = require 'utils.color_presets'
local Task = require 'utils.task'
local Token = require 'utils.token'
local IC_Gui = require 'maps.mountain_fortress_v3.ic.gui'
local WPT = require 'maps.mountain_fortress_v3.table'
local Public = {}
local main_tile_name = 'black-refined-concrete'
@ -517,10 +518,14 @@ local function get_player_data(ic, player)
if ic.players[player.index] then
return player_data
end
local fallback = WPT.get('active_surface_index')
if not fallback then
fallback = 1
end
ic.players[player.index] = {
surface = 1,
fallback_surface = 1,
fallback_surface = tonumber(fallback),
notified = false
}
return ic.players[player.index]

View File

@ -305,10 +305,16 @@ local function get_player_data(icw, player)
return player_data
end
local fallback = WPT.get('active_surface_index')
if not fallback then
fallback = 1
end
icw.players[player.index] = {
surface = 1,
fallback_surface = 1,
fallback_surface = tonumber(fallback),
zoom = 0.30,
auto = true,
map_size = 360
}
return icw.players[player.index]
@ -960,17 +966,30 @@ function Public.item_transfer(icw)
end
end
function Public.toggle_auto(icw, player)
local player_data = get_player_data(icw, player)
local switch = player.gui.left.icw_main_frame['icw_auto_switch']
if switch.switch_state == 'left' then
player_data.auto = true
elseif switch.switch_state == 'right' then
player_data.auto = false
end
end
function Public.draw_minimap(icw, player, surface, position)
if not (surface and surface.valid) then
return
end
local player_data = get_player_data(icw, player)
local frame = player.gui.left.icw_main_frame
if not frame then
frame = player.gui.left.add({type = 'frame', direction = 'vertical', name = 'icw_main_frame', caption = 'Minimap'})
end
local element = frame['icw_sub_frame']
if not frame.icw_auto_switch then
frame.add({type = 'switch', name = 'icw_auto_switch', allow_none_state = false, left_label_caption = {'gui.map_on'}, right_label_caption = {'gui.map_off'}})
end
if not element then
local player_data = get_player_data(icw, player)
element =
player.gui.left.icw_main_frame.add(
{
@ -987,14 +1006,16 @@ function Public.draw_minimap(icw, player, surface, position)
element.style.minimal_width = player_data.map_size
return
end
element.position = position
end
function Public.update_minimap(icw)
for k, player in pairs(game.connected_players) do
local player_data = get_player_data(icw, player)
if player.character and player.character.valid then
local wagon = get_wagon_for_entity(icw, player.character)
if wagon then
if wagon and player_data.auto then
Public.draw_minimap(icw, player, wagon.entity.surface, wagon.entity.position)
end
end
@ -1069,4 +1090,6 @@ function Public.on_player_or_robot_built_tile(event)
end
end
Public.get_player_data = get_player_data
return Public

View File

@ -116,6 +116,23 @@ local function on_init()
Public.reset()
end
local function on_gui_switch_state_changed(event)
local element = event.element
local player = game.players[event.player_index]
if not (player and player.valid) then
return
end
if not element.valid then
return
end
if element.name == 'icw_auto_switch' then
local icw = ICW.get()
Functions.toggle_auto(icw, player)
end
end
function Public.register_wagon(wagon_entity)
local icw = ICW.get()
return Functions.create_wagon(icw, wagon_entity)
@ -135,5 +152,6 @@ Event.add(defines.events.on_gui_closed, on_gui_closed)
Event.add(defines.events.on_gui_opened, on_gui_opened)
Event.add(defines.events.on_player_built_tile, on_player_or_robot_built_tile)
Event.add(defines.events.on_robot_built_tile, on_player_or_robot_built_tile)
Event.add(defines.events.on_gui_switch_state_changed, on_gui_switch_state_changed)
return Public

View File

@ -1,6 +1,7 @@
local Event = require 'utils.event'
--local Power = require 'maps.mountain_fortress_v3.power'
local Market = require 'maps.mountain_fortress_v3.basic_markets'
local Generate = require 'maps.mountain_fortress_v3.generate'
local ICW = require 'maps.mountain_fortress_v3.icw.main'
local WPT = require 'maps.mountain_fortress_v3.table'
local WD = require 'modules.wave_defense.table'
@ -200,6 +201,12 @@ function Public.add_player_to_permission_group(player, group, forced)
return
end
local gulag = game.permissions.get_group('gulag')
local tbl = gulag and gulag.players
if tbl[player.index] then
return
end
if player.admin then
return
end
@ -560,6 +567,10 @@ local function redraw_market_items(gui, player, search_text)
local inventory = player.get_main_inventory()
local player_item_count
if not (gui and gui.valid) then
return
end
gui.add(
{
type = 'label',
@ -1380,6 +1391,8 @@ local function create_market(data, rebuild)
this.market = surface.create_entity {name = 'market', position = center_position, force = 'player'}
Generate.wintery(this.market, 5.5)
rendering.draw_text {
text = 'Market',
surface = surface,
@ -1473,7 +1486,7 @@ local function on_built_entity(event)
if linked_to == chest_limit_outside_upgrades then
return
end
outside_chests[entity.unit_number] = entity
outside_chests[entity.unit_number] = {chest = entity, position = entity.position, linked = train.unit_number}
if not increased then
chests_linked_to[train.unit_number].count = linked_to + 1
@ -1482,7 +1495,7 @@ local function on_built_entity(event)
goto continue
end
else
outside_chests[entity.unit_number] = entity
outside_chests[entity.unit_number] = {chest = entity, position = entity.position, linked = train.unit_number}
chests_linked_to[train.unit_number] = {count = 1}
end
@ -1505,7 +1518,7 @@ local function on_built_entity(event)
end
if next(outside_chests) == nil then
outside_chests[entity.unit_number] = entity
outside_chests[entity.unit_number] = {chest = entity, position = entity.position, linked = train.unit_number}
chests_linked_to[train.unit_number] = {count = 1}
chests_linked_to[train.unit_number][entity.unit_number] = true
@ -1550,22 +1563,47 @@ end
local function divide_contents()
local outside_chests = WPT.get('outside_chests')
local chests_linked_to = WPT.get('chests_linked_to')
local target_chest
for key, chest in pairs(outside_chests) do
if not chest or not chest.valid then
return
if not next(outside_chests) then
goto final
end
for key, data in pairs(outside_chests) do
local chest = data.chest
local area = {
left_top = {x = chest.position.x - 4, y = chest.position.y - 4},
right_bottom = {x = chest.position.x + 4, y = chest.position.y + 4}
left_top = {x = data.position.x - 4, y = data.position.y - 4},
right_bottom = {x = data.position.x + 4, y = data.position.y + 4}
}
if not (chest and chest.valid) then
if chests_linked_to[data.linked] then
if chests_linked_to[data.linked][key] then
chests_linked_to[data.linked][key] = nil
chests_linked_to[data.linked].count = chests_linked_to[data.linked].count - 1
if chests_linked_to[data.linked].count <= 0 then
chests_linked_to[data.linked] = nil
end
end
end
outside_chests[key] = nil
goto continue
end
local success, entity = contains_positions(area)
if success then
target_chest = entity
else
return
if chests_linked_to[data.linked] then
if chests_linked_to[data.linked][key] then
chests_linked_to[data.linked][key] = nil
chests_linked_to[data.linked].count = chests_linked_to[data.linked].count - 1
if chests_linked_to[data.linked].count <= 0 then
chests_linked_to[data.linked] = nil
end
end
end
goto continue
end
local chest1 = chest.get_inventory(defines.inventory.chest)
@ -1578,7 +1616,9 @@ local function divide_contents()
chest1.remove({name = item, count = c})
end
end
::continue::
end
::final::
end
local function place_market()
@ -1840,6 +1880,8 @@ function Public.locomotive_spawn(surface, position)
this.locomotive_cargo = surface.create_entity({name = 'cargo-wagon', position = {position.x, position.y + 3}, force = 'player'})
this.locomotive_cargo.get_inventory(defines.inventory.cargo_wagon).insert({name = 'raw-fish', count = 8})
local winter_mode_locomotive = Generate.wintery(this.locomotive, 5.5)
if not winter_mode_locomotive then
rendering.draw_light(
{
sprite = 'utility/light_medium',
@ -1854,7 +1896,11 @@ function Public.locomotive_spawn(surface, position)
only_in_alt_mode = false
}
)
end
local winter_mode_cargo = Generate.wintery(this.locomotive_cargo, 5.5)
if not winter_mode_cargo then
rendering.draw_light(
{
sprite = 'utility/light_medium',
@ -1869,6 +1915,7 @@ function Public.locomotive_spawn(surface, position)
only_in_alt_mode = false
}
)
end
local data = {
surface = surface,

View File

@ -3,7 +3,7 @@ require 'modules.rpg.main'
local Functions = require 'maps.mountain_fortress_v3.functions'
local BuriedEnemies = require 'maps.mountain_fortress_v3.buried_enemies'
-- local HS = require 'maps.mountain_fortress_v3.highscore'
local HS = require 'maps.mountain_fortress_v3.highscore'
local IC = require 'maps.mountain_fortress_v3.ic.table'
local Autostash = require 'modules.autostash'
local Group = require 'comfy_panel.group'
@ -31,6 +31,7 @@ local Token = require 'utils.token'
local Alert = require 'utils.alert'
local AntiGrief = require 'antigrief'
local Commands = require 'commands.misc'
local Modifiers = require 'player_modifiers'
require 'maps.mountain_fortress_v3.rocks_yield_ore_veins'
require 'maps.mountain_fortress_v3.generate'
@ -102,8 +103,11 @@ function Public.reset_map()
Autostash.insert_into_furnace(true)
Autostash.insert_into_wagon(true)
Autostash.bottom_button(true)
BuriedEnemies.reset()
Commands.reset()
Commands.activate_custom_buttons(true)
Commands.bottom_right(false)
Poll.reset()
ICW.reset()
@ -134,6 +138,10 @@ function Public.reset_map()
local surface = game.surfaces[this.active_surface_index]
if this.winter_mode then
surface.daytime = 0.45
end
Explosives.set_surface_whitelist({[surface.name] = true})
game.forces.player.set_spawn_position({-27, 25}, surface)
@ -151,11 +159,17 @@ function Public.reset_map()
PL.show_roles_in_list(true)
Score.reset_tbl()
local players = game.connected_players
for i = 1, #players do
local player = players[i]
Score.init_player_table(player)
Score.init_player_table(player, true)
Commands.insert_all_items(player)
Modifiers.reset_player_modifiers(player)
if player.gui.left['mvps'] then
player.gui.left['mvps'].destroy()
end
end
Difficulty.reset_difficulty_poll({difficulty_poll_closing_timeout = game.tick + 36000})
@ -192,6 +206,7 @@ function Public.reset_map()
WD.set_disable_threat_below_zero(true)
Functions.set_difficulty()
Functions.disable_creative()
if not surface.is_chunk_generated({-20, 22}) then
surface.request_to_generate_chunks({-20, 22}, 0.1)
@ -203,6 +218,8 @@ function Public.reset_map()
Task.start_queue()
Task.set_queue_speed(16)
HS.get_scores()
this.chunk_load_tick = game.tick + 1200
this.game_lost = false
end
@ -253,13 +270,16 @@ local has_the_game_ended = function()
game.print(({'main.reset_in', cause_msg, this.game_reset_tick / 60}), {r = 0.22, g = 0.88, b = 0.22})
end
if this.soft_reset and this.game_reset_tick == 0 then
this.game_reset_tick = nil
HS.set_scores()
Public.reset_map()
return
end
if this.restart and this.game_reset_tick == 0 then
if not this.announced_message then
HS.set_scores()
game.print(({'entity.notify_restart'}), {r = 0.22, g = 0.88, b = 0.22})
local message = 'Soft-reset is disabled! Server will restart from scenario to load new changes.'
Server.to_discord_bold(table.concat {'*** ', message, ' ***'})
@ -270,6 +290,7 @@ local has_the_game_ended = function()
end
if this.shutdown and this.game_reset_tick == 0 then
if not this.announced_message then
HS.set_scores()
game.print(({'entity.notify_shutdown'}), {r = 0.22, g = 0.88, b = 0.22})
local message = 'Soft-reset is disabled! Server will shutdown. Most likely because of updates.'
Server.to_discord_bold(table.concat {'*** ', message, ' ***'})
@ -327,7 +348,7 @@ local compare_collapse_and_train = function()
local collapse_pos = Collapse.get_position()
local locomotive = WPT.get('locomotive')
local carriages = WPT.get('carriages')
if not locomotive or not locomotive.valid then
if not (locomotive and locomotive.valid) then
return
end
@ -342,12 +363,10 @@ local compare_collapse_and_train = function()
if c_y - t_y <= gap_between_zones.gap then
Functions.set_difficulty()
gap_between_zones.set = false
return
end
else
Collapse.set_speed(1)
Collapse.set_amount(4)
end
end
local collapse_after_wave_100 = function()

View File

@ -193,6 +193,13 @@ function Public.reset_table()
-- this.void_or_tile = 'lab-dark-2'
this.void_or_tile = 'out-of-map'
this.validate_spider = {}
this.check_afk_players = true
this.winter_mode = false
this.sent_to_discord = false
this.difficulty = {
multiply = 0.25,
highest = 10
}
--!reset player tables
for _, player in pairs(this.players) do

View File

@ -2427,6 +2427,11 @@ Event.add(
return
end
local winter_mode = WPT.get('winter_mode')
if winter_mode then
rendering.draw_sprite({sprite = "tile/lab-white", x_scale = 32, y_scale = 32, target = left_top, surface = surface, tint = {r = 0.6, g = 0.6, b = 0.6, a = 0.6}, render_layer = "ground"})
end
if left_top.y == -128 and left_top.x == -128 then
local pl = WPT.get().locomotive.position
for _, entity in pairs(surface.find_entities_filtered({area = {{pl.x - 5, pl.y - 6}, {pl.x + 5, pl.y + 10}}, type = 'simple-entity'})) do

View File

@ -3,6 +3,7 @@
local Global = require 'utils.global'
local Event = require 'utils.event'
local Misc = require 'commands.misc'
local math_floor = math.floor
local print_color = {r = 120, g = 255, b = 0}
@ -11,6 +12,7 @@ local this = {
whitelist = {},
insert_into_furnace = false,
insert_into_wagon = false,
bottom_button = false,
small_radius = 2
}
@ -439,6 +441,20 @@ local function create_gui_button(player)
else
tooltip = 'Sort your inventory into nearby chests.\nLMB: Everything, excluding quickbar items.\nRMB: Only ores to nearby chests.'
end
if this.bottom_button then
local data = Misc.get('bottom_quickbar_button')
-- save it for later use
data.tooltip = tooltip
data.sprite = 'item/wooden-chest'
if data[player.index] then
data = data[player.index]
if data.frame and data.frame.valid then
data.frame.sprite = 'item/wooden-chest'
data.frame.tooltip = tooltip
end
end
else
local b =
player.gui.top.add(
{
@ -456,6 +472,7 @@ local function create_gui_button(player)
b.style.maximal_height = 38
b.style.padding = 1
b.style.margin = 0
end
end
local function do_whitelist()
@ -485,8 +502,18 @@ local function on_gui_click(event)
if not event.element.valid then
return
end
if event.element.name == 'auto_stash' then
auto_stash(game.players[event.player_index], event)
local player = game.players[event.player_index]
local name = 'auto_stash'
if this.bottom_button then
local data = Misc.get('bottom_quickbar_button')
if data[player.index] then
data = data[player.index]
name = data.name
end
end
if event.element.name == name then
auto_stash(player, event)
end
end
@ -506,6 +533,14 @@ function Public.insert_into_wagon(value)
end
end
function Public.bottom_button(value)
if value then
this.bottom_button = value
else
this.bottom_button = false
end
end
Event.on_configuration_changed = function()
do_whitelist()
log('[Autostash] on_configuration_changed was called, rebuilding resource whitelist.')

View File

@ -12,7 +12,7 @@ local entity_types = {
["unit-spawner"] = true,
}
if package.loaded['maps.biter_hatchery.terrain'] then entity_types["unit-spawner"] = nil end
if is_loaded('maps.biter_hatchery.terrain') then entity_types["unit-spawner"] = nil end
local function clean_table()
--Perform a table cleanup every 1000 boosts

View File

@ -7,7 +7,7 @@ local function on_console_chat(event)
if not player.character then return end
local y_offset = -4
if package.loaded['modules.rpg'] then y_offset = -4.5 end
if is_loaded('modules.rpg') then y_offset = -4.5 end
if global.player_floaty_chat[player.index] then
rendering.destroy(global.player_floaty_chat[player.index])

View File

@ -100,8 +100,8 @@ end
local function level_up(player)
local rpg_t = RPG.get('rpg_t')
local RPG_GUI = package.loaded['modules.rpg.gui']
local names = RPG.auto_allocate_nodes
local RPG_GUI = is_loaded('modules.rpg.gui')
local names = RPG.auto_allocate_nodes_func
local distribute_points_gain = 0
for i = rpg_t[player.index].level + 1, #experience_levels, 1 do
@ -173,8 +173,7 @@ function Public.suicidal_comfylatron(pos, surface)
text = text
}
)
local nearest_player_unit =
surface.find_nearest_enemy({position = e.position, max_distance = 512, force = 'player'})
local nearest_player_unit = surface.find_nearest_enemy({position = e.position, max_distance = 512, force = 'player'})
if nearest_player_unit and nearest_player_unit.active and nearest_player_unit.force.name ~= 'player' then
e.set_command(
@ -337,11 +336,7 @@ function Public.update_health(player)
if rpg_extra.enable_health_and_mana_bars then
if rpg_t[player.index].show_bars then
local max_life =
math.floor(
player.character.prototype.max_health + player.character_health_bonus +
player.force.character_health_bonus
)
local max_life = math.floor(player.character.prototype.max_health + player.character_health_bonus + player.force.character_health_bonus)
if not rpg_t[player.index].health_bar then
rpg_t[player.index].health_bar = create_healthbar(player, 0.5)
elseif not rendering.is_valid(rpg_t[player.index].health_bar) then
@ -395,36 +390,28 @@ end
function Public.level_up_effects(player)
local position = {x = player.position.x - 0.75, y = player.position.y - 1}
player.surface.create_entity(
{name = 'flying-text', position = position, text = '+LVL ', color = level_up_floating_text_color}
)
player.surface.create_entity({name = 'flying-text', position = position, text = '+LVL ', color = level_up_floating_text_color})
local b = 0.75
for _ = 1, 5, 1 do
local p = {
(position.x + 0.4) + (b * -1 + math.random(0, b * 20) * 0.1),
position.y + (b * -1 + math.random(0, b * 20) * 0.1)
}
player.surface.create_entity(
{name = 'flying-text', position = p, text = '', color = {255, math.random(0, 100), 0}}
)
player.surface.create_entity({name = 'flying-text', position = p, text = '', color = {255, math.random(0, 100), 0}})
end
player.play_sound {path = 'utility/achievement_unlocked', volume_modifier = 0.40}
end
function Public.xp_effects(player)
local position = {x = player.position.x - 0.75, y = player.position.y - 1}
player.surface.create_entity(
{name = 'flying-text', position = position, text = '+XP', color = level_up_floating_text_color}
)
player.surface.create_entity({name = 'flying-text', position = position, text = '+XP', color = level_up_floating_text_color})
local b = 0.75
for _ = 1, 5, 1 do
local p = {
(position.x + 0.4) + (b * -1 + math.random(0, b * 20) * 0.1),
position.y + (b * -1 + math.random(0, b * 20) * 0.1)
}
player.surface.create_entity(
{name = 'flying-text', position = p, text = '', color = {255, math.random(0, 100), 0}}
)
player.surface.create_entity({name = 'flying-text', position = p, text = '', color = {255, math.random(0, 100), 0}})
end
player.play_sound {path = 'utility/achievement_unlocked', volume_modifier = 0.40}
end
@ -489,7 +476,7 @@ function Public.rpg_reset_player(player, one_time_reset)
player.set_controller({type = defines.controllers.god})
player.create_character()
end
local RPG_GUI = package.loaded['modules.rpg.gui']
local RPG_GUI = is_loaded('modules.rpg.gui')
local rpg_t = RPG.get('rpg_t')
local rpg_extra = RPG.get('rpg_extra')
if one_time_reset then

View File

@ -962,7 +962,6 @@ local function on_player_used_capsule(event)
return
end
local object_name = object.name
local obj_name = object.obj_to_create
local position = event.position
@ -1009,7 +1008,7 @@ local function on_player_used_capsule(event)
end
if object.obj_to_create == 'suicidal_comfylatron' then
Functions.suicidal_comfylatron(position, surface)
p(({'rpg_main.suicidal_comfylatron', object_name}), Color.success)
p(({'rpg_main.suicidal_comfylatron', 'Suicidal Comfylatron'}), Color.success)
rpg_t[player.index].mana = rpg_t[player.index].mana - object.mana_cost
elseif object.obj_to_create == 'warp-gate' then
player.teleport(surface.find_non_colliding_position('character', game.forces.player.get_spawn_position(surface), 3, 0, 5), surface)
@ -1057,7 +1056,7 @@ local function on_player_used_capsule(event)
end
end
local msg = player.name .. ' casted ' .. object.name .. '. '
local msg = player.name .. ' casted ' .. object.obj_to_create .. '. '
rpg_t[player.index].last_spawned = game.tick + object.tick
Functions.update_mana(player)

View File

@ -123,7 +123,7 @@ function Public.extra_settings(player)
reset_gui_input.tooltip = ({'rpg_settings.not_trusted'})
goto continue
end
if rpg_t[player.index].level <= 50 then
if rpg_t[player.index].level < 50 then
reset_gui_input.enabled = false
reset_gui_input.tooltip = ({'rpg_settings.low_level', 50})
reset_label.tooltip = ({'rpg_settings.low_level', 50})
@ -157,10 +157,7 @@ function Public.extra_settings(player)
magic_pickup_input_style.height = 35
magic_pickup_input_style.vertical_align = 'center'
local reach_mod
if
player_modifiers.disabled_modifier[player.index] and
player_modifiers.disabled_modifier[player.index].character_item_pickup_distance_bonus
then
if player_modifiers.disabled_modifier[player.index] and player_modifiers.disabled_modifier[player.index].character_item_pickup_distance_bonus then
reach_mod = not player_modifiers.disabled_modifier[player.index].character_item_pickup_distance_bonus
else
reach_mod = true
@ -187,10 +184,7 @@ function Public.extra_settings(player)
movement_speed_input_style.height = 35
movement_speed_input_style.vertical_align = 'center'
local speed_mod
if
player_modifiers.disabled_modifier[player.index] and
player_modifiers.disabled_modifier[player.index].character_running_speed_modifier
then
if player_modifiers.disabled_modifier[player.index] and player_modifiers.disabled_modifier[player.index].character_running_speed_modifier then
speed_mod = not player_modifiers.disabled_modifier[player.index].character_running_speed_modifier
else
speed_mod = true
@ -232,7 +226,7 @@ function Public.extra_settings(player)
end
stone_path_gui_input = create_input_element(stone_path_input, 'boolean', stone_path)
if rpg_t[player.index].level <= 20 then
if rpg_t[player.index].level < 20 then
stone_path_gui_input.enabled = false
stone_path_gui_input.tooltip = ({'rpg_settings.low_level', 20})
stone_path_label.tooltip = ({'rpg_settings.low_level', 20})
@ -274,7 +268,7 @@ function Public.extra_settings(player)
one_punch_gui_input.enabled = false
one_punch_gui_input.tooltip = ({'rpg_settings.one_punch_globally'})
else
if rpg_t[player.index].level <= 30 then
if rpg_t[player.index].level < 30 then
one_punch_gui_input.enabled = false
one_punch_gui_input.tooltip = ({'rpg_settings.low_level', 30})
else
@ -312,7 +306,7 @@ function Public.extra_settings(player)
flame_boots_gui_input = create_input_element(flame_boots_input, 'boolean', flame_mod)
if rpg_t[player.index].mana > 50 then
if rpg_t[player.index].level <= 100 then
if rpg_t[player.index].level < 100 then
flame_boots_gui_input.enabled = false
flame_boots_gui_input.tooltip = ({'rpg_settings.low_level', 100})
flame_boots_label.tooltip = ({'rpg_settings.low_level', 100})

View File

@ -4,7 +4,7 @@ function Public.conjure_items()
local spells = {}
spells[#spells + 1] = {
name = 'Stone Wall',
name = {'entity-name.stone-wall'},
obj_to_create = 'stone-wall',
level = 10,
type = 'item',
@ -14,7 +14,7 @@ function Public.conjure_items()
}
spells[#spells + 1] = {
name = 'Wooden Chest',
name = {'entity-name.wooden-chest'},
obj_to_create = 'wooden-chest',
level = 2,
type = 'item',
@ -23,7 +23,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Iron Chest',
name = {'entity-name.iron-chest'},
obj_to_create = 'iron-chest',
level = 10,
type = 'item',
@ -32,7 +32,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Steel Chest',
name = {'entity-name.steel-chest'},
obj_to_create = 'steel-chest',
level = 15,
type = 'item',
@ -41,7 +41,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Transport Belt',
name = {'entity-name.transport-belt'},
obj_to_create = 'transport-belt',
level = 3,
type = 'item',
@ -50,7 +50,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Fast Transport Belt',
name = {'entity-name.fast-transport-belt'},
obj_to_create = 'fast-transport-belt',
level = 20,
type = 'item',
@ -59,7 +59,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Express Transport Belt',
name = {'entity-name.express-transport-belt'},
obj_to_create = 'express-transport-belt',
level = 60,
type = 'item',
@ -68,7 +68,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Underground Belt',
name = {'entity-name.underground-belt'},
obj_to_create = 'underground-belt',
level = 3,
type = 'item',
@ -77,7 +77,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Fast Underground Belt',
name = {'entity-name.fast-underground-belt'},
obj_to_create = 'fast-underground-belt',
level = 20,
type = 'item',
@ -86,7 +86,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Express Underground Belt',
name = {'entity-name.express-underground-belt'},
obj_to_create = 'express-underground-belt',
level = 60,
type = 'item',
@ -95,7 +95,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Sandy Rock',
name = {'entity-name.sand-rock-big'},
obj_to_create = 'sand-rock-big',
level = 80,
type = 'entity',
@ -104,7 +104,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Smol Biter',
name = {'entity-name.small-biter'},
obj_to_create = 'small-biter',
level = 50,
biter = true,
@ -114,7 +114,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Smol Spitter',
name = {'entity-name.small-spitter'},
obj_to_create = 'small-spitter',
level = 50,
biter = true,
@ -124,7 +124,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Medium Biter',
name = {'entity-name.medium-biter'},
obj_to_create = 'medium-biter',
level = 70,
biter = true,
@ -134,7 +134,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Medium Spitter',
name = {'entity-name.medium-spitter'},
obj_to_create = 'medium-spitter',
level = 70,
type = 'entity',
@ -143,7 +143,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Bitter Spawner',
name = {'entity-name.biter-spawner'},
obj_to_create = 'biter-spawner',
level = 100,
biter = true,
@ -153,7 +153,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Spitter Spawner',
name = {'entity-name.spitter-spawner'},
obj_to_create = 'spitter-spawner',
level = 100,
biter = true,
@ -163,7 +163,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'AOE Grenade',
name = {'item-name.grenade'},
obj_to_create = 'grenade',
target = true,
amount = 1,
@ -176,7 +176,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Big AOE Grenade',
name = {'item-name.cluster-grenade'},
obj_to_create = 'cluster-grenade',
target = true,
amount = 2,
@ -189,7 +189,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Pointy Rocket',
name = {'item-name.rocket'},
obj_to_create = 'rocket',
range = 240,
target = true,
@ -203,7 +203,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Bitter Spew',
name = {'spells.acid_stream'},
obj_to_create = 'acid-stream-spitter-big',
target = true,
amount = 2,
@ -217,7 +217,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Shoop Da Whoop!!',
name = {'spells.railgun_beam'},
obj_to_create = 'railgun-beam',
target = false,
amount = 3,
@ -231,7 +231,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Conjure Raw-fish',
name = {'spells.raw_fish'},
obj_to_create = 'fish',
target = false,
amount = 4,
@ -245,7 +245,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Suicidal Comfylatron',
name = {'spells.comfylatron'},
obj_to_create = 'suicidal_comfylatron',
target = false,
amount = 4,
@ -259,7 +259,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Distractor Capsule',
name = {'spells.distractor'},
obj_to_create = 'distractor-capsule',
target = true,
amount = 1,
@ -273,7 +273,7 @@ function Public.conjure_items()
enabled = true
}
spells[#spells + 1] = {
name = 'Warp Gate',
name = {'spells.warp'},
obj_to_create = 'warp-gate',
target = true,
force = 'player',

View File

@ -59,6 +59,14 @@ Public.classes = {
}
Public.auto_allocate_nodes = {
{'allocations.deactivated'},
{'allocations.str'},
{'allocations.mag'},
{'allocations.dex'},
{'allocations.vit'}
}
Public.auto_allocate_nodes_func = {
'Deactivated',
'Strength',
'Magicka',

View File

@ -485,10 +485,10 @@ end
local function increase_biter_damage()
local Difficulty
if package.loaded['modules.difficulty_vote_by_amount'] then
Difficulty = require 'modules.difficulty_vote_by_amount'
elseif package.loaded['modules.difficulty_vote'] then
Difficulty = require 'modules.difficulty_vote'
if is_loaded('modules.difficulty_vote_by_amount') then
Difficulty = is_loaded('modules.difficulty_vote_by_amount')
elseif is_loaded('modules.difficulty_vote') then
Difficulty = is_loaded('modules.difficulty_vote')
end
if not Difficulty then
return

View File

@ -51,15 +51,26 @@ function Public.update_player_modifiers(player)
end
end
function Public.reset_player_modifiers(player)
if player and player.valid then
this[player.index] = {}
if this.disabled_modifier[player.index] then
this.disabled_modifier[player.index] = {}
end
for _, modifier in pairs(modifiers) do
this[player.index][modifier] = {}
end
Public.update_player_modifiers(player)
end
end
local function on_player_joined_game(event)
if this[event.player_index] then
Public.update_player_modifiers(game.players[event.player_index])
local player = game.get_player(event.player_index)
if this[player.index] then
Public.update_player_modifiers(player)
return
end
this[event.player_index] = {}
for _, modifier in pairs(modifiers) do
this[event.player_index][modifier] = {}
end
Public.reset_player_modifiers(player)
end
local function on_player_respawned(event)

View File

@ -0,0 +1,36 @@
local colors = {{255, 0, 0}, {0, 255, 0}, {0, 0, 255}}
local function add_light(e)
local color = colors[math.random(1, 3)]
local light_nr = rendering.draw_light({sprite="utility/light_small", orientation=1, scale=1, intensity=1, minimum_darkness=0, oriented=false, color=color, target=e, target_offset={0, -0.5}, surface=e.surface})
end
local function on_chunk_generated(event)
local surface = event.surface
local seed = surface.map_gen_settings.seed
local left_top_x = event.area.left_top.x
local left_top_y = event.area.left_top.y
local set_tiles = surface.set_tiles
local get_tile = surface.get_tile
local entities = surface.find_entities_filtered({type = {"simple-entity", "tree", "fish"}, area = event.area})
if #entities > 1 then table.shuffle_table(entities) end
for k, e in pairs(entities) do
add_light(e)
if k > 7 then break end
end
rendering.draw_sprite({sprite = "tile/lab-white", x_scale = 32, y_scale = 32, target = event.area.left_top, surface = surface, tint = {r = 0.6, g = 0.6, b = 0.6, a = 0.6}, render_layer = "ground"})
end
local function on_init()
local surface = game.surfaces.nauvis
surface.daytime = 0.43
surface.freeze_daytime = true
end
local Event = require 'utils.event'
Event.on_init(on_init)
Event.add(defines.events.on_chunk_generated, on_chunk_generated)
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
Event.add(defines.events.on_player_mined_entity, on_player_mined_entity)
Event.add(defines.events.on_entity_died, on_entity_died)

View File

@ -23,3 +23,12 @@ function get_game_version()
return false
end
end
function is_loaded(module)
local res = package.loaded[module]
if res then
return res
else
return false
end
end

View File

@ -41,8 +41,7 @@ function Public.show(container)
for name, file in pairs(loaded) do
if not ignore[name] then
local file_label =
left_panel.add({type = 'flow'}).add {type = 'label', name = file_label_name, caption = name}
local file_label = left_panel.add({type = 'flow'}).add {type = 'label', name = file_label_name, caption = name}
Gui.set_data(file_label, file)
end
end
@ -107,8 +106,7 @@ Gui.on_click(
if file_type == 'table' then
for k, v in pairs(file) do
local label =
top_panel.add({type = 'flow'}).add {type = 'label', name = variable_label_name, caption = k}
local label = top_panel.add({type = 'flow'}).add {type = 'label', name = variable_label_name, caption = k}
Gui.set_data(label, v)
end
elseif file_type == 'function' then
@ -134,8 +132,7 @@ Gui.on_click(
if variable_type == 'table' then
Gui.clear(top_panel)
for k, v in pairs(variable) do
local label =
top_panel.add({type = 'flow'}).add {type = 'label', name = variable_label_name, caption = k}
local label = top_panel.add({type = 'flow'}).add {type = 'label', name = variable_label_name, caption = k}
Gui.set_data(label, v)
end
return

View File

@ -2,6 +2,7 @@ local table_sort = table.sort
local string_rep = string.rep
local string_format = string.format
local debug_getinfo = debug.getinfo
local Color = require 'utils.color_presets'
local Profiler = {
-- Call
@ -9,6 +10,13 @@ local Profiler = {
IsRunning = false
}
-- we can have this on runtime,
-- but never ever can a player run this without notifying us.
local allowed = {
['Gerkiz'] = true,
['mewmew'] = true
}
local ignoredFunctions = {
[debug.sethook] = true
}
@ -18,10 +26,40 @@ local namedSources = {
}
local function startCommand(command)
local player = game.player
if player then
if player ~= nil then
if not player.admin then
local p = player.print
p('[ERROR] Only admins are allowed to run this command!', Color.fail)
return
else
if allowed[player.name] then
Profiler.Start(command.parameter ~= nil)
elseif _DEBUG then
Profiler.Start(command.parameter ~= nil)
end
end
end
end
end
local function stopCommand(command)
local player = game.player
if player then
if player ~= nil then
if not player.admin then
local p = player.print
p('[ERROR] Only admins are allowed to run this command!', Color.fail)
return
else
if allowed[player.name] then
Profiler.Stop(command.parameter ~= nil, nil)
elseif _DEBUG then
Profiler.Stop(command.parameter ~= nil, nil)
end
end
end
end
end
ignoredFunctions[startCommand] = true
ignoredFunctions[stopCommand] = true
@ -167,8 +205,7 @@ local function DumpTree(averageMs)
call.profiler.divide(call.calls)
end
str[line + 1] =
string_format('\n%s%dx %s. %s ', string_rep('\t', depth), call.calls, call.name, averageMs and 'Average' or 'Total')
str[line + 1] = string_format('\n%s%dx %s. %s ', string_rep('\t', depth), call.calls, call.name, averageMs and 'Average' or 'Total')
str[line + 2] = call.profiler
line = line + 2

View File

@ -33,7 +33,11 @@ end
function Public.is_spamming(player, value_to_compare)
if not this.prevent_spam[player.index] then
return
return false
end
if game.tick_paused then
return false -- game is paused - shoo
end
local tick = game.tick