mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-16 10:19:27 +02:00
3f8be3151a
* Add redmew_surface * Change map_layout to have all maps use redmew_surface * Maps: switch hardcoded nauvis refs to redmew_surface * Features: switch hardcoded nauvis refs to redmew_surface * Per discussion, removal of RSO * Changes to files based on linting warnings/errors * ent_functions: remove functions from global scope, ignore remaining linting warnings (~100 remaining) * borg_planet: ignore linting warnings (88 remaining) * mazes refactored * Changed global.lua so events are run in the order they are registered
31 lines
1020 B
Lua
31 lines
1020 B
Lua
local Event = require 'utils.event'
|
|
|
|
local SetupPlayer = {}
|
|
|
|
global.SetupPlayer = {
|
|
first_player_spawned = false,
|
|
}
|
|
|
|
function SetupPlayer.register(config)
|
|
Event.add(defines.events.on_player_created, function ()
|
|
local redmew_player_create = global.config.player_create
|
|
|
|
if #config.starting_items > 0 then
|
|
redmew_player_create.starting_items = config.starting_items
|
|
end
|
|
|
|
local cheats = config.cheats
|
|
local redmew_cheats = redmew_player_create.cheats
|
|
redmew_cheats.manual_mining_speed_modifier = cheats.manual_mining_speed_modifier
|
|
redmew_cheats.character_inventory_slots_bonus = cheats.character_inventory_slots_bonus
|
|
redmew_cheats.character_running_speed_modifier = cheats.character_running_speed_modifier
|
|
redmew_cheats.character_health_bonus = cheats.character_health_bonus
|
|
|
|
if #cheats.starting_items > 0 then
|
|
redmew_cheats.starting_items = cheats.starting_items
|
|
end
|
|
end)
|
|
end
|
|
|
|
return SetupPlayer
|