1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00
RedMew/map_gen/maps/diggy/feature/setup_player.lua

31 lines
1020 B
Lua
Raw Normal View History

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