mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-05 13:15:03 +02:00
Luacheck fix
This commit is contained in:
parent
bff896b057
commit
93bc1c3477
@ -1,4 +1,3 @@
|
||||
local Utils = require 'utils.core'
|
||||
local Color = require 'utils.color_presets'
|
||||
local Alert = require 'utils.alert'
|
||||
local Task = require 'utils.task_token'
|
||||
|
@ -1396,81 +1396,6 @@ local apply_settings_token =
|
||||
end
|
||||
)
|
||||
|
||||
local function apply_startup_dev_settings(settings)
|
||||
local current_date = {
|
||||
year = 2023,
|
||||
month = 10,
|
||||
day = 30
|
||||
}
|
||||
if not current_date then
|
||||
return
|
||||
end
|
||||
|
||||
local current_time = 1600509719
|
||||
if not current_time then
|
||||
return
|
||||
end
|
||||
|
||||
current_date = round(Utils.convert_date(current_date.year, current_date.month, current_date.day))
|
||||
|
||||
local server_name_matches = true
|
||||
|
||||
settings = settings or {}
|
||||
local stored_date = this.current_date
|
||||
if not stored_date then
|
||||
return
|
||||
end
|
||||
local stored_date_raw = Server.get_current_date(false, true, stored_date)
|
||||
local converted_stored_date = round(Utils.convert_date(stored_date_raw.year, stored_date_raw.month, stored_date_raw.day))
|
||||
|
||||
local time_to_reset = (current_date - converted_stored_date)
|
||||
this.time_to_reset = this.reset_after - time_to_reset
|
||||
if time_to_reset and time_to_reset > this.reset_after then
|
||||
settings.current_date = current_time
|
||||
settings.test_mode = false
|
||||
settings.rounds_survived = 0
|
||||
settings.buffs = {}
|
||||
this.buffs = {}
|
||||
this.buffs_collected = {}
|
||||
this.rounds_survived = 0
|
||||
this.season = this.season + 1
|
||||
this.current_date = current_time
|
||||
settings.season = this.season
|
||||
this.time_to_reset = this.reset_after
|
||||
local message = ({'stateful.reset'})
|
||||
local message_discord = ({'stateful.reset_discord'})
|
||||
Task.set_timeout_in_ticks_text(60, {text = message})
|
||||
Server.to_discord_embed(message_discord, true)
|
||||
|
||||
if server_name_matches then
|
||||
Server.set_data(dataset, dataset_key, settings)
|
||||
else
|
||||
Server.set_data(dataset, dataset_key_dev, settings)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
local apply_settings_dev_token =
|
||||
Task.register(
|
||||
function(data)
|
||||
local settings = data and data.value or nil
|
||||
local current_time = 1700509719
|
||||
if not current_time then
|
||||
return
|
||||
end
|
||||
|
||||
this.current_date = settings.current_date
|
||||
this.buffs = settings.buffs
|
||||
|
||||
apply_startup_dev_settings(settings)
|
||||
|
||||
this.rounds_survived = settings.rounds_survived
|
||||
|
||||
Public.increase_enemy_damage_and_health()
|
||||
end
|
||||
)
|
||||
|
||||
local function grant_non_limit_reached_buff()
|
||||
local all_buffs = get_random_buff(true)
|
||||
local starting_items = Public.get_func('starting_items')
|
||||
|
Loading…
x
Reference in New Issue
Block a user