mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2025-03-05 14:45:19 +02:00
Tweaking spawns to use new landfill tiles. Tweaks to moats.
This commit is contained in:
parent
68242004e9
commit
3fc4b004d3
@ -226,7 +226,7 @@ function GenerateRocketSiloChunk(event)
|
||||
RemoveDecorationsArea(surface, chunkArea)
|
||||
|
||||
-- Create rocket silo
|
||||
CreateCropOctagon(surface, siloPos, chunkArea, CHUNK_SIZE*2, "grass-1")
|
||||
CreateCropOctagon(surface, siloPos, chunkArea, CHUNK_SIZE*2, "landfill")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -925,8 +925,8 @@ function CreateCropCircle(surface, centerPos, chunkArea, tileRadius, fillTile)
|
||||
end
|
||||
|
||||
-- Create a circle of trees around the spawn point.
|
||||
if ((distVar < tileRadSqr-200) and
|
||||
(distVar > tileRadSqr-400)) then
|
||||
if ((distVar < tileRadSqr-100) and
|
||||
(distVar > tileRadSqr-500)) then
|
||||
surface.create_entity({name="tree-02", amount=1, position={i, j}})
|
||||
end
|
||||
end
|
||||
@ -976,14 +976,19 @@ function CreateMoat(surface, centerPos, chunkArea, tileRadius, fillTile)
|
||||
for i=chunkArea.left_top.x,chunkArea.right_bottom.x,1 do
|
||||
for j=chunkArea.left_top.y,chunkArea.right_bottom.y,1 do
|
||||
|
||||
-- This ( X^2 + Y^2 ) is used to calculate if something
|
||||
-- is inside a circle area.
|
||||
local distVar = math.floor((centerPos.x - i)^2 + (centerPos.y - j)^2)
|
||||
if (j == centerPos.y-1) or (j == centerPos.y) or (j == centerPos.y+1) then
|
||||
|
||||
-- Create a circle of water
|
||||
if ((distVar < tileRadSqr+(1500*global.ocfg.spawn_config.gen_settings.moat_size_modifier)) and
|
||||
(distVar > tileRadSqr)) then
|
||||
table.insert(waterTiles, {name = "water", position ={i,j}})
|
||||
else
|
||||
|
||||
-- This ( X^2 + Y^2 ) is used to calculate if something
|
||||
-- is inside a circle area.
|
||||
local distVar = math.floor((centerPos.x - i)^2 + (centerPos.y - j)^2)
|
||||
|
||||
-- Create a circle of water
|
||||
if ((distVar < tileRadSqr+(1500*global.ocfg.spawn_config.gen_settings.moat_size_modifier)) and
|
||||
(distVar > tileRadSqr)) then
|
||||
table.insert(waterTiles, {name = "water", position ={i,j}})
|
||||
end
|
||||
end
|
||||
|
||||
-- Enforce land inside the edges of the circle to make sure it's
|
||||
|
@ -220,7 +220,7 @@ function SetupAndClearSpawnAreas(surface, chunkArea)
|
||||
RemoveInCircle(surface, chunkArea, "cliff", spawn.pos, global.ocfg.spawn_config.gen_settings.land_area_tiles+5)
|
||||
RemoveDecorationsArea(surface, chunkArea)
|
||||
|
||||
local fill_tile = "grass-1"
|
||||
local fill_tile = "landfill"
|
||||
if (game.active_mods["oarc-restricted-build"]) then
|
||||
fill_tile = global.ocfg.locked_build_area_tile
|
||||
end
|
||||
@ -596,14 +596,18 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
|
||||
|
||||
if (not delayedSpawn.vanilla) then
|
||||
|
||||
-- Generate water strip only if we don't have a moat.
|
||||
if (not delayedSpawn.moat) then
|
||||
local water_data = global.ocfg.spawn_config.water
|
||||
CreateWaterStrip(game.surfaces[GAME_SURFACE_NAME],
|
||||
{x=delayedSpawn.pos.x+water_data.x_offset, y=delayedSpawn.pos.y+water_data.y_offset},
|
||||
water_data.length)
|
||||
CreateWaterStrip(game.surfaces[GAME_SURFACE_NAME],
|
||||
{x=delayedSpawn.pos.x+water_data.x_offset, y=delayedSpawn.pos.y+water_data.y_offset+1},
|
||||
water_data.length)
|
||||
end
|
||||
|
||||
-- Create the spawn resources here
|
||||
local water_data = global.ocfg.spawn_config.water
|
||||
CreateWaterStrip(game.surfaces[GAME_SURFACE_NAME],
|
||||
{x=delayedSpawn.pos.x+water_data.x_offset, y=delayedSpawn.pos.y+water_data.y_offset},
|
||||
water_data.length)
|
||||
CreateWaterStrip(game.surfaces[GAME_SURFACE_NAME],
|
||||
{x=delayedSpawn.pos.x+water_data.x_offset, y=delayedSpawn.pos.y+water_data.y_offset+1},
|
||||
water_data.length)
|
||||
GenerateStartingResources(game.surfaces[GAME_SURFACE_NAME], delayedSpawn.pos)
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user