mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Fix CI and remove factorio control (#15)
This commit is contained in:
2
.github/workflows/fmtk.yml
vendored
2
.github/workflows/fmtk.yml
vendored
@@ -59,7 +59,7 @@ jobs:
|
|||||||
endLine: .range.end.line,
|
endLine: .range.end.line,
|
||||||
col: .range.start.character,
|
col: .range.start.character,
|
||||||
endColumn: .range.end.character,
|
endColumn: .range.end.character,
|
||||||
message: .message | gsub("\n"; "\\\\n"; "m"),
|
message: .message | gsub("\n"; "%0A"; "m"),
|
||||||
level: (if .severity <= 1 then "error" else "warning" end)
|
level: (if .severity <= 1 then "error" else "warning" end)
|
||||||
}) |
|
}) |
|
||||||
map("::\(.level) file=\(.file),line=\(.line+1),endLine=\(.line+1),col=\(.col+1),endColumn=\(.endColumn+1),title=\(.title)::\(.message) (\(.title))") | .[]'
|
map("::\(.level) file=\(.file),line=\(.line+1),endLine=\(.line+1),col=\(.col+1),endColumn=\(.endColumn+1),title=\(.title)::\(.message) (\(.title))") | .[]'
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
-- core files should be required by modules and not be present in this list;
|
-- core files should be required by modules and not be present in this list;
|
||||||
-- @config File-Loader
|
-- @config File-Loader
|
||||||
return {
|
return {
|
||||||
-- 'example.file_not_loaded',
|
|
||||||
"modules.factorio-control", -- base factorio free play scenario
|
|
||||||
"expcore.player_data", -- must be loaded first to register event handlers
|
"expcore.player_data", -- must be loaded first to register event handlers
|
||||||
|
|
||||||
--- Addons
|
--- Addons
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ end
|
|||||||
return {
|
return {
|
||||||
skip_intro = true, --- @setting skip_intro skips the intro given in the default factorio free play scenario
|
skip_intro = true, --- @setting skip_intro skips the intro given in the default factorio free play scenario
|
||||||
skip_victory = true, --- @setting skip_victory will skip the victory screen when a rocket is launched
|
skip_victory = true, --- @setting skip_victory will skip the victory screen when a rocket is launched
|
||||||
disable_base_game_silo_script = true, --- @setting disable_base_game_silo_script will not load the silo script at all
|
|
||||||
research_queue_from_start = true, --- @setting research_queue_from_start when true the research queue is useable from the start
|
research_queue_from_start = true, --- @setting research_queue_from_start when true the research queue is useable from the start
|
||||||
friendly_fire = false, --- @setting friendly_fire weather players will be able to attack each other on the same force
|
friendly_fire = false, --- @setting friendly_fire weather players will be able to attack each other on the same force
|
||||||
enemy_expansion = false, --- @setting enemy_expansion a catch all for in case the map settings file fails to load
|
enemy_expansion = false, --- @setting enemy_expansion a catch all for in case the map settings file fails to load
|
||||||
|
|||||||
@@ -1,129 +0,0 @@
|
|||||||
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
|
||||||
local Storage = require("modules/exp_util/storage")
|
|
||||||
local config = require("modules.exp_legacy.config.advanced_start") --- @dep config.advanced_start
|
|
||||||
local use_silo_script = not config.disable_base_game_silo_script
|
|
||||||
|
|
||||||
local util = require("util")
|
|
||||||
local silo_script
|
|
||||||
if use_silo_script then
|
|
||||||
silo_script = require("silo-script")
|
|
||||||
end
|
|
||||||
|
|
||||||
local global = {}
|
|
||||||
Storage.register(global, function(tbl)
|
|
||||||
global = tbl
|
|
||||||
end)
|
|
||||||
|
|
||||||
local created_items = function()
|
|
||||||
return
|
|
||||||
{
|
|
||||||
["iron-plate"] = 8,
|
|
||||||
["wood"] = 1,
|
|
||||||
["pistol"] = 1,
|
|
||||||
["firearm-magazine"] = 10,
|
|
||||||
["burner-mining-drill"] = 1,
|
|
||||||
["stone-furnace"] = 1,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local respawn_items = function()
|
|
||||||
return
|
|
||||||
{
|
|
||||||
["pistol"] = 1,
|
|
||||||
["firearm-magazine"] = 10,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
if use_silo_script then
|
|
||||||
for k, v in pairs(silo_script.get_events()) do
|
|
||||||
Event.add(k, v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Event.add(defines.events.on_player_created, function(event)
|
|
||||||
local player = game.players[event.player_index]
|
|
||||||
--- @diagnostic disable-next-line param-type-mismatch
|
|
||||||
util.insert_safe(player, global.created_items)
|
|
||||||
|
|
||||||
local r = global.chart_distance or 200
|
|
||||||
player.force.chart(player.physical_surface, {
|
|
||||||
{ player.physical_position.x - r, player.physical_position.y - r },
|
|
||||||
{ player.physical_position.x + r, player.physical_position.y + r }
|
|
||||||
})
|
|
||||||
|
|
||||||
if not global.skip_intro then
|
|
||||||
if game.is_multiplayer() then
|
|
||||||
player.print{ "msg-intro" }
|
|
||||||
else
|
|
||||||
game.show_message_dialog{ text = { "msg-intro" } }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if use_silo_script then
|
|
||||||
silo_script.on_event(event)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
Event.add(defines.events.on_player_respawned, function(event)
|
|
||||||
local player = game.players[event.player_index]
|
|
||||||
--- @diagnostic disable-next-line param-type-mismatch
|
|
||||||
util.insert_safe(player, global.respawn_items)
|
|
||||||
if use_silo_script then
|
|
||||||
silo_script.on_event(event)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
if use_silo_script then
|
|
||||||
Event.on_load(function()
|
|
||||||
silo_script.on_load()
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
Event.on_init(function()
|
|
||||||
global.created_items = created_items()
|
|
||||||
global.respawn_items = respawn_items()
|
|
||||||
if use_silo_script then
|
|
||||||
silo_script.on_init()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
if use_silo_script then
|
|
||||||
silo_script.add_remote_interface()
|
|
||||||
silo_script.add_commands()
|
|
||||||
end
|
|
||||||
|
|
||||||
remote.add_interface("freeplay",
|
|
||||||
{
|
|
||||||
get_created_items = function()
|
|
||||||
return global.created_items
|
|
||||||
end,
|
|
||||||
set_created_items = function(map)
|
|
||||||
global.created_items = map
|
|
||||||
end,
|
|
||||||
get_respawn_items = function()
|
|
||||||
return global.respawn_items
|
|
||||||
end,
|
|
||||||
set_respawn_items = function(map)
|
|
||||||
global.respawn_items = map
|
|
||||||
end,
|
|
||||||
set_skip_intro = function(bool)
|
|
||||||
global.skip_intro = bool
|
|
||||||
end,
|
|
||||||
set_chart_distance = function(value)
|
|
||||||
global.chart_distance = tonumber(value)
|
|
||||||
end,
|
|
||||||
set_disable_crashsite = function()
|
|
||||||
end,
|
|
||||||
get_ship_items = function()
|
|
||||||
return {}
|
|
||||||
end,
|
|
||||||
set_ship_items = function()
|
|
||||||
return
|
|
||||||
end,
|
|
||||||
get_debris_items = function()
|
|
||||||
return {}
|
|
||||||
end,
|
|
||||||
set_debris_items = function()
|
|
||||||
return
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user