mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
More spelling fixes
This commit is contained in:
@@ -142,8 +142,8 @@ local function calculate_total(count, spawner, evolution)
|
||||
end
|
||||
|
||||
---Creates the spawner_request structure required for AlienEvolutionProgress.get_aliens for all
|
||||
---available spawners. If dividing the total spawners by the total aliens causes a fraction, the
|
||||
---fraction will decide a chance to spawn. 1 alien for 2 spawners will have 50% on both.
|
||||
---available spawner's. If dividing the total spawner's by the total aliens causes a fraction, the
|
||||
---fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on both.
|
||||
---@param total_aliens table
|
||||
function AlienEvolutionProgress.create_spawner_request(total_aliens)
|
||||
local per_spawner = total_aliens / memory.spawner_specifications_count
|
||||
|
||||
@@ -27,7 +27,7 @@ local deprecated_command_alternatives = {
|
||||
|
||||
local notify_on_commands = {
|
||||
['version'] = 'RedMew has a version as well, accessible via /redmew-version',
|
||||
['color'] = 'RedMew allows color saving and a color randomizer: check out /redmew-color',
|
||||
['color'] = 'RedMew allows color saving and a color randomiser: check out /redmew-color',
|
||||
['ban'] = 'In case your forgot: please remember to include a message on how to appeal a ban'
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ local option_names = {
|
||||
['description'] = 'A description of the command',
|
||||
['arguments'] = 'A table of arguments, example: {"foo", "bar"} would map the first 2 arguments to foo and bar',
|
||||
['default_values'] = 'A default value for a given argument when omitted, example: {bar = false}',
|
||||
['required_rank'] = 'Set this to determins what rank is required to execute a command',
|
||||
['required_rank'] = 'Set this to determines what rank is required to execute a command',
|
||||
['donator_only'] = 'Set this to true if only donators may execute this command',
|
||||
['debug_only'] = 'Set this to true if it should be registered when _DEBUG is true',
|
||||
['cheat_only'] = 'Set this to true if it should be registered when _CHEATS is true',
|
||||
|
||||
@@ -19,7 +19,7 @@ local hours_to_ticks = 60 * 60 * 60
|
||||
local ticks_to_minutes = 1 / minutes_to_ticks
|
||||
local ticks_to_hours = 1 / hours_to_ticks
|
||||
|
||||
-- local vars
|
||||
-- local variables
|
||||
local Module = {}
|
||||
|
||||
--- Measures distance between pos1 and pos2
|
||||
|
||||
@@ -140,7 +140,7 @@ local function remove(tbl, handler)
|
||||
return
|
||||
end
|
||||
|
||||
-- the handler we are looking for is more likly to be at the back of the array.
|
||||
-- the handler we are looking for is more likely to be at the back of the array.
|
||||
for i = #tbl, 1, -1 do
|
||||
if tbl[i] == handler then
|
||||
table_remove(tbl, i)
|
||||
@@ -272,11 +272,11 @@ function Event.add_removable_function(event_name, func)
|
||||
)
|
||||
end
|
||||
|
||||
local funcs = function_handlers[event_name]
|
||||
if not funcs then
|
||||
local functions = function_handlers[event_name]
|
||||
if not functions then
|
||||
function_handlers[event_name] = {func}
|
||||
else
|
||||
funcs[#funcs + 1] = func
|
||||
functions[#functions + 1] = func
|
||||
end
|
||||
|
||||
if handlers_added then
|
||||
@@ -293,15 +293,15 @@ function Event.remove_removable_function(event_name, func)
|
||||
if _LIFECYCLE == stage_load then
|
||||
error('cannot call during on_load', 2)
|
||||
end
|
||||
local funcs = function_handlers[event_name]
|
||||
local functions = function_handlers[event_name]
|
||||
|
||||
if not funcs then
|
||||
if not functions then
|
||||
return
|
||||
end
|
||||
|
||||
local handlers = event_handlers[event_name]
|
||||
|
||||
remove(funcs, func)
|
||||
remove(functions, func)
|
||||
remove(handlers, func)
|
||||
|
||||
if #handlers == 0 then
|
||||
@@ -382,11 +382,11 @@ function Event.add_removable_nth_tick_function(tick, func)
|
||||
)
|
||||
end
|
||||
|
||||
local funcs = function_nth_tick_handlers[tick]
|
||||
if not funcs then
|
||||
local functions = function_nth_tick_handlers[tick]
|
||||
if not functions then
|
||||
function_nth_tick_handlers[tick] = {func}
|
||||
else
|
||||
funcs[#funcs + 1] = func
|
||||
functions[#functions + 1] = func
|
||||
end
|
||||
|
||||
if handlers_added then
|
||||
@@ -403,15 +403,15 @@ function Event.remove_removable_nth_tick_function(tick, func)
|
||||
if _LIFECYCLE == stage_load then
|
||||
error('cannot call during on_load', 2)
|
||||
end
|
||||
local funcs = function_nth_tick_handlers[tick]
|
||||
local functions = function_nth_tick_handlers[tick]
|
||||
|
||||
if not funcs then
|
||||
if not functions then
|
||||
return
|
||||
end
|
||||
|
||||
local handlers = on_nth_tick_event_handlers[tick]
|
||||
|
||||
remove(funcs, func)
|
||||
remove(functions, func)
|
||||
remove(handlers, func)
|
||||
|
||||
if #handlers == 0 then
|
||||
@@ -427,9 +427,9 @@ local function add_handlers()
|
||||
end
|
||||
end
|
||||
|
||||
for event_name, funcs in pairs(function_handlers) do
|
||||
for i = 1, #funcs do
|
||||
local handler = funcs[i]
|
||||
for event_name, functions in pairs(function_handlers) do
|
||||
for i = 1, #functions do
|
||||
local handler = functions[i]
|
||||
core_add(event_name, handler)
|
||||
end
|
||||
end
|
||||
@@ -441,9 +441,9 @@ local function add_handlers()
|
||||
end
|
||||
end
|
||||
|
||||
for tick, funcs in pairs(function_nth_tick_handlers) do
|
||||
for i = 1, #funcs do
|
||||
local handler = funcs[i]
|
||||
for tick, functions in pairs(function_nth_tick_handlers) do
|
||||
for i = 1, #functions do
|
||||
local handler = functions[i]
|
||||
core_on_nth_tick(tick, handler)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -193,7 +193,7 @@ end
|
||||
--- Returns the flow where top elements can be added and will be effected by google visibility
|
||||
-- For the toggle to work it must be registed with Gui.allow_player_to_toggle_top_element_visibility(element_name)
|
||||
-- @tparam LuaPlayer player pointer to the player who has the gui
|
||||
-- @treturn LuaGuiEelement the top element flow
|
||||
-- @treturn LuaGuiElement the top element flow
|
||||
function Gui.get_top_element_flow(player)
|
||||
player = Game.get_player_from_any(player)
|
||||
return mod_gui.get_button_flow(player)
|
||||
|
||||
@@ -31,8 +31,8 @@ math.clamp = function(num, min, max)
|
||||
end
|
||||
|
||||
--- Takes two points and calculates the slope of a line
|
||||
-- @param x1, y1 numbers - cordinates of a point on a line
|
||||
-- @param x2, y2 numbers - cordinates of a point on a line
|
||||
-- @param x1, y1 numbers - coordinates of a point on a line
|
||||
-- @param x2, y2 numbers - coordinates of a point on a line
|
||||
-- @return number - the slope of the line
|
||||
math.calculate_slope = function(x1, y1, x2, y2)
|
||||
return math.abs((y2 - y1) / (x2 - x1))
|
||||
|
||||
@@ -6,7 +6,7 @@ local tostring = tostring
|
||||
local pairs = pairs
|
||||
local format = string.format
|
||||
|
||||
--- Contains a set of callables that will attempt to sanitize and transform the input
|
||||
--- Contains a set of callable that will attempt to sanitize and transform the input
|
||||
local settings_type = {
|
||||
fraction = function (input)
|
||||
input = tonumber(input)
|
||||
@@ -163,7 +163,7 @@ function Public.get(player_index, name)
|
||||
return player_setting ~= nil and player_setting or setting.default
|
||||
end
|
||||
|
||||
---Returns a table of all settings for a given player in a key => value setup
|
||||
---Returns a table of all settings for a given player in a key => value set-up
|
||||
---@param player_index number
|
||||
function Public.all(player_index)
|
||||
local player_settings = memory[player_index] or {}
|
||||
|
||||
@@ -51,11 +51,11 @@ local function month_length(m, y)
|
||||
end
|
||||
|
||||
local function day_of_year(day, month, year)
|
||||
local yday = months_to_days_cumulative[month]
|
||||
local y_day = months_to_days_cumulative[month]
|
||||
if month > 2 and is_leap(year) then
|
||||
yday = yday + 1
|
||||
y_day = y_day + 1
|
||||
end
|
||||
return yday + day
|
||||
return y_day + day
|
||||
end
|
||||
|
||||
local function leap_years_since(year)
|
||||
@@ -80,7 +80,7 @@ local function normalise(year, month, day, hour, min, sec)
|
||||
|
||||
-- Propagate out of range values up
|
||||
-- e.g. if `min` is 70, `hour` increments by 1 and `min` becomes 10
|
||||
-- This has to happen for all columns after borrowing, as lower radixes may be pushed out of range
|
||||
-- This has to happen for all columns after borrowing, as lower radix's may be pushed out of range
|
||||
min, sec = carry(min, sec, 60) -- TODO: consider leap seconds?
|
||||
hour, min = carry(hour, min, 60)
|
||||
day, hour = carry(day, hour, 24)
|
||||
@@ -119,10 +119,10 @@ local function normalise(year, month, day, hour, min, sec)
|
||||
end
|
||||
|
||||
--- Converts unix epoch timestamp into table {year: number, month: number, day: number, hour: number, min: number, sec: number}
|
||||
-- @param sec<number> unix epoch timestamp
|
||||
-- @param seconds<number> unix epoch timestamp
|
||||
-- @return {year: number, month: number, day: number, hour: number, min: number, sec: number}
|
||||
function Public.to_timetable(secs)
|
||||
return normalise(1970, 1, 1, 0, 0, secs)
|
||||
function Public.to_timetable(seconds)
|
||||
return normalise(1970, 1, 1, 0, 0, seconds)
|
||||
end
|
||||
|
||||
--- Converts timetable into unix epoch timestamp
|
||||
@@ -142,10 +142,10 @@ function Public.from_timetable(timetable)
|
||||
end
|
||||
|
||||
--- Converts unix epoch timestamp into human readable string.
|
||||
-- @param secs<type> unix epoch timestamp
|
||||
-- @param seconds<type> unix epoch timestamp
|
||||
-- @return string
|
||||
function Public.to_string(secs)
|
||||
local tt = normalise(1970, 1, 1, 0, 0, secs)
|
||||
function Public.to_string(seconds)
|
||||
local tt = normalise(1970, 1, 1, 0, 0, seconds)
|
||||
return strformat('%04u-%02u-%02u %02u:%02u:%02d', tt.year, tt.month, tt.day, tt.hour, tt.min, tt.sec)
|
||||
end
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ local tokens = {}
|
||||
|
||||
local counter = 0
|
||||
|
||||
--- Assigns a unquie id for the given var.
|
||||
--- Assigns a unique id for the given var.
|
||||
-- This function cannot be called after on_init() or on_load() has run as that is a desync risk.
|
||||
-- Typically this is used to register functions, so the id can be stored in the global table
|
||||
-- instead of the function. This is becasue closures cannot be safely stored in the global table.
|
||||
-- instead of the function. This is because closures cannot be safely stored in the global table.
|
||||
-- @param var<any>
|
||||
-- @return number the unique token for the variable.
|
||||
function Token.register(var)
|
||||
|
||||
Reference in New Issue
Block a user