-- This file is part of thesixthroc's Pirate Ship softmod, licensed under GPLv3 and stored at https://github.com/danielmartin0/ComfyFactorio-Pirates. local Memory = require 'maps.pirates.memory' local Math = require 'maps.pirates.math' -- local Balance = require 'maps.pirates.balance' local Boats = require 'maps.pirates.structures.boats.boats' local Common = require 'maps.pirates.common' local CoreData = require 'maps.pirates.coredata' local Utils = require 'maps.pirates.utils_local' local _inspect = require 'utils.inspect'.inspect local Public = {} Public.StartingBoats = { { type = Boats.enum.SLOOP, position = {x = Boats[Boats.enum.SLOOP].Data.width - 65, y = -1 - (23 + Boats[Boats.enum.SLOOP].Data.height/2)}, surface_name = CoreData.lobby_surface_name, force_name = 'crew-001', }, { type = Boats.enum.SLOOP, position = {x = Boats[Boats.enum.SLOOP].Data.width - 65, y = -1}, surface_name = CoreData.lobby_surface_name, force_name = 'crew-002', }, { type = Boats.enum.SLOOP, position = {x = Boats[Boats.enum.SLOOP].Data.width - 65, y = -1 + (23 + Boats[Boats.enum.SLOOP].Data.height/2)}, surface_name = CoreData.lobby_surface_name, force_name = 'crew-003', }, -- { -- type = Boats.enum.CUTTER, -- position = {x = Boats[Boats.enum.CUTTER].Data.width - 56, y = (70.5 + Boats[Boats.enum.CUTTER].Data.height/2)}, -- surface_name = CoreData.lobby_surface_name, -- force_name = 'environment', -- speedticker1 = 0, -- speedticker2 = 1/3 * Common.boat_steps_at_a_time, -- speedticker3 = 2/3 * Common.boat_steps_at_a_time, -- }, } Public.Data = {} Public.Data.display_name = {'pirates.location_displayname_lobby_1'} Public.Data.width = 224 Public.Data.height = 128 -- Public.Data.noiseparams = { -- land = { -- type = 'simplex_2d', -- normalised = false, -- params = { -- {wavelength = 128, amplitude = 10/100}, -- {wavelength = 64, amplitude = 10/100}, -- {wavelength = 32, amplitude = 5/100}, -- {wavelength = 12, amplitude = 5/100}, -- }, -- } -- } Public.Data.iconized_map_width = 4 Public.Data.iconized_map_height = 20 function Public.terrain(args) local x, y = args.p.x, args.p.y if Math.distance(args.p, {x = -316, y = 0}) < 230 then args.tiles[#args.tiles + 1] = {name = 'dirt-3', position = args.p} elseif Math.distance(args.p, {x = -264, y = 0}) < 180 then args.tiles[#args.tiles + 1] = {name = 'water-shallow', position = args.p} elseif Math.abs(Common.lobby_spawnpoint.x - x) < 3 and Math.abs(Common.lobby_spawnpoint.y - y) < 3 then args.tiles[#args.tiles + 1] = {name = CoreData.walkway_tile, position = args.p} else args.tiles[#args.tiles + 1] = {name = 'water', position = args.p} end end function Public.chunk_structures() return nil end function Public.create_starting_dock_surface() -- local memory = Memory.get_crew_memory() local starting_dock_name = CoreData.lobby_surface_name local width = Public.Data.width local height = Public.Data.height local map_gen_settings = Common.default_map_gen_settings(width, height) local surface = game.create_surface(starting_dock_name, map_gen_settings) surface.freeze_daytime = true surface.daytime = 0 end function Public.place_starting_dock_showboat(id) local global_memory = Memory.get_global_memory() Memory.set_working_id(id) local boat = Utils.deepcopy(Public.StartingBoats[id]) global_memory.lobby_boats[id] = boat Boats.place_boat(boat, CoreData.static_boat_floor, true, true, false) -- Boats.place_boat(boat, CoreData.static_boat_floor, true, true, false, true) --this final argument is to enable the comfy graphic to be placed on the boat, but that argument is disabled for now, so luacheck forbids this line end function Public.place_lobby_jetty_and_boats() local surface = game.surfaces[CoreData.lobby_surface_name] for id, _ in pairs(Public.StartingBoats) do Public.place_starting_dock_showboat(id) end local offset = {x = -47, y = -1} local tiles = {} for _, p in pairs(Common.tile_positions_from_blueprint(Public.Data.jetty_bp, offset)) do tiles[#tiles + 1] = {name = CoreData.walkway_tile, position = p, force = 'environment'} end surface.set_tiles(tiles, true) -- for y = -3.5, 3.5 do -- local e = surface.create_entity{name = 'stone-wall', position = {x = -68.5, y = y}, force = 'environment'} -- e.destructible = false -- e.minable = false -- e.rotatable = false -- e.operable = false -- end end Public.Data.jetty_bp = [[0eNqV3M2OUNeVBtB3qTGRvP+5vEorAycpRSXZGGHS6iji3dt2h1l3izUEHQp0PnHPN1h7/+vlLz/94/XT57ePX14+/Ovl148/fvrT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