Compare commits
1
Commits
1ff7ef7e83
...
ver_GPT
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc6c45409d |
No files matched your search
+557
-218
@@ -13,8 +13,9 @@ Config.Worlds = {
|
|||||||
{
|
{
|
||||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
desc = "Уютное лесное озеро: прозрачная бирюзовая вода, солнечный причал и водопад среди сосен.",
|
||||||
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
|
clock = 16.2, water = Color3.fromRGB(40, 170, 165),
|
||||||
|
waterTransparency = 0.6,
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
||||||
},
|
},
|
||||||
@@ -1005,26 +1006,35 @@ terrain.WaterWaveSpeed = 12
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
||||||
|
|
||||||
local W = V(0, 0, 1500) -- центр Мира 1
|
local W = Config.Worlds[1].center
|
||||||
local GROUND_Y = 4 -- верх земли
|
local GROUND_Y, WATER_Y = 4, 0
|
||||||
local WATER_Y = 0 -- поверхность воды
|
|
||||||
|
|
||||||
-- озеро из нескольких кругов: { x, z, радиус }
|
|
||||||
local LAKES = Config.Worlds[1].lakes
|
local LAKES = Config.Worlds[1].lakes
|
||||||
|
local WORLD1_TRAIL = {
|
||||||
|
V(-104, 4.3, -34), V(-117, 7, -62), V(-108, 12, -90),
|
||||||
|
V(-83, 19, -110), V(-62, 25, -96), V(-43, 32, -119),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Лесистый берег, холм с вышкой и скала справа от озера.
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
||||||
-- холмы по краям
|
|
||||||
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
||||||
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
||||||
end
|
end
|
||||||
-- порядок важен: песок → выемка → ил → вода
|
terrain:FillBall(W + V(-48, -7, -121), 42, Enum.Material.Grass)
|
||||||
|
terrain:FillBall(W + V(-89, -7, -101), 30, Enum.Material.Grass)
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(-43, 29, -119)), 6, 17, Enum.Material.Grass)
|
||||||
|
for _, p in ipairs(WORLD1_TRAIL) do
|
||||||
|
terrain:FillBall(W + p - V(0, 9, 0), 10, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 15, -78)), V(40, 30, 52), Enum.Material.Rock)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(67, 9, -83)), V(18, 18, 39), Enum.Material.Slate)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 29, -86)), V(40, 2, 35), Enum.Material.Grass)
|
||||||
|
|
||||||
|
-- Чаша озера: песок, выемка, дно, вода; круги совпадают с FishConfig.
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
||||||
end
|
|
||||||
for _, l in ipairs(LAKES) do
|
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
@@ -1033,34 +1043,39 @@ end
|
|||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||||
end
|
end
|
||||||
-- то же самое напрямую по вокселям: вода ниже WATER_Y, воздух выше.
|
|
||||||
-- Fill* с Air иногда оставляет песок над водой, и озеро выглядит сухим.
|
-- Мелководье вычисляется по объединению кругов: на пересечениях нет песчаных стенок.
|
||||||
local function carveLake(l)
|
local function carveLake(l)
|
||||||
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 12, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 16, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
||||||
local mats, occ = terrain:ReadVoxels(region, 4)
|
local mats, occ = terrain:ReadVoxels(region, 4)
|
||||||
local size = mats.Size
|
local size, corner = mats.Size, region.CFrame.Position - region.Size / 2
|
||||||
local corner = region.CFrame.Position - region.Size / 2
|
|
||||||
local center = W + V(l[1], 0, l[2])
|
|
||||||
for x = 1, size.X do
|
for x = 1, size.X do
|
||||||
for y = 1, size.Y do
|
|
||||||
for z = 1, size.Z do
|
for z = 1, size.Z do
|
||||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
local px, pz = corner.X + (x - 0.5) * 4 - W.X, corner.Z + (z - 0.5) * 4 - W.Z
|
||||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
if (px - l[1]) ^ 2 + (pz - l[2]) ^ 2 <= l[3] ^ 2 then
|
||||||
local water = c.Y < WATER_Y
|
local inland = 0
|
||||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
for _, lake in ipairs(LAKES) do
|
||||||
occ[x][y][z] = water and 1 or 0
|
inland = math.max(inland, lake[3] - math.sqrt((px - lake[1]) ^ 2 + (pz - lake[2]) ^ 2))
|
||||||
|
end
|
||||||
|
local floor = -3 - math.min(inland / 18, 1) * 8
|
||||||
|
for y = 1, size.Y do
|
||||||
|
local py = corner.Y + (y - 0.5) * 4
|
||||||
|
local mat = Enum.Material.Air
|
||||||
|
if py < floor then mat = inland < 20 and Enum.Material.Sand or Enum.Material.Mud
|
||||||
|
elseif py < WATER_Y then mat = Enum.Material.Water end
|
||||||
|
mats[x][y][z], occ[x][y][z] = mat, mat == Enum.Material.Air and 0 or 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
terrain:WriteVoxels(region, 4, mats, occ)
|
terrain:WriteVoxels(region, 4, mats, occ)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do carveLake(l) end
|
||||||
carveLake(l)
|
|
||||||
end
|
-- Прибытие и короткий подход к главному причалу.
|
||||||
-- дорожка от точки прибытия к причалу и площадка
|
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(12, 4, 14), Enum.Material.Ground)
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(8, 4, 14), Enum.Material.Ground)
|
terrain:FillCylinder(CFrame.new(W + V(0, 2, 94)), 4, 13, Enum.Material.Cobblestone)
|
||||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 96)), 4, 12, Enum.Material.Cobblestone)
|
|
||||||
|
|
||||||
---------------------------------------------------------------- точка появления в лобби
|
---------------------------------------------------------------- точка появления в лобби
|
||||||
|
|
||||||
@@ -1732,236 +1747,472 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
||||||
|
|
||||||
local function inLake(x, z, extra)
|
do
|
||||||
for _, l in ipairs(LAKES) do
|
local previous = {}
|
||||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
for _, child in ipairs(map:GetChildren()) do previous[child] = true end
|
||||||
return true
|
local sharedRng = rng
|
||||||
|
local rng = sharedRng:Clone()
|
||||||
|
local scenery = Instance.new("Model")
|
||||||
|
scenery.Name = "World1Scenery"
|
||||||
|
scenery:SetAttribute("WorldId", "World1")
|
||||||
|
scenery.Parent = map
|
||||||
|
local C = {
|
||||||
|
wood = Color3.fromRGB(190, 135, 85), dark = Color3.fromRGB(120, 80, 50),
|
||||||
|
rope = Color3.fromRGB(215, 180, 125), roof = Color3.fromRGB(60, 100, 75),
|
||||||
|
pine = Color3.fromRGB(45, 105, 60), pineDark = Color3.fromRGB(35, 85, 50),
|
||||||
|
grass = Color3.fromRGB(125, 180, 75), rock = Color3.fromRGB(140, 138, 150),
|
||||||
|
moss = Color3.fromRGB(95, 130, 70), warm = Color3.fromRGB(255, 200, 120),
|
||||||
|
}
|
||||||
|
local function part(props)
|
||||||
|
props.Parent = props.Parent or scenery
|
||||||
|
if props.CanCollide == nil then props.CanCollide = false end
|
||||||
|
if props.CanQuery == nil then props.CanQuery = props.CanCollide end
|
||||||
|
props.CanTouch = false
|
||||||
|
if props.CastShadow == nil then props.CastShadow = props.CanCollide end
|
||||||
|
return P(props)
|
||||||
end
|
end
|
||||||
|
local function block(name, size, cf, color, material, solid)
|
||||||
|
return part({ Name = name, Size = size, CFrame = cf, Color = color, Material = material or Enum.Material.SmoothPlastic, CanCollide = solid or false })
|
||||||
|
end
|
||||||
|
local function cylA(a, b, diameter, props)
|
||||||
|
props = props or {}
|
||||||
|
props.Shape, props.Size = Enum.PartType.Cylinder, V((b - a).Magnitude, diameter, diameter)
|
||||||
|
props.CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
return part(props)
|
||||||
|
end
|
||||||
|
local function sphere(pos, size, color, material)
|
||||||
|
return part({ Name = "ShoreDetail", Shape = Enum.PartType.Ball, Size = size, Position = pos, Color = color, Material = material or Enum.Material.SmoothPlastic })
|
||||||
|
end
|
||||||
|
local function inLake(x, z, margin)
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
if (x - l[1]) ^ 2 + (z - l[2]) ^ 2 < (l[3] + (margin or 0)) ^ 2 then return true end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
local function light(parent, range, brightness)
|
||||||
-- прибытие
|
local obj = Instance.new("PointLight")
|
||||||
-- всё рядом с главным причалом: прибытие → арка → причал, по бокам портал, скупка и дед
|
obj.Color, obj.Range, obj.Brightness, obj.Shadows = C.warm, range, brightness, false
|
||||||
local arrive = W + V(0, GROUND_Y, 94)
|
obj.Parent = parent
|
||||||
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
|
||||||
arch(CFrame.new(W + V(0, GROUND_Y, 82)), 14, 11, "🌊 ТИХОЕ ОЗЕРО", Color3.fromRGB(80, 200, 255))
|
|
||||||
portal(CFrame.lookAt(W + V(-22, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
|
||||||
-- точки для линии-подсказки: конец главного причала и место перед скупкой
|
|
||||||
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.5, 42)))
|
|
||||||
marker("GuideSell", CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive) * CFrame.new(0, 0, -10))
|
|
||||||
local w1Counter = stall(CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive), {
|
|
||||||
title = "💰 СКУПКА",
|
|
||||||
titleColor = Color3.fromRGB(150, 255, 160),
|
|
||||||
wall = Color3.fromRGB(150, 115, 80),
|
|
||||||
stripeA = Color3.fromRGB(50, 150, 80),
|
|
||||||
stripeB = Color3.fromRGB(245, 240, 230),
|
|
||||||
glow = Color3.fromRGB(80, 230, 120),
|
|
||||||
action = "Sell",
|
|
||||||
promptText = "Продать всю рыбу",
|
|
||||||
promptObject = "Скупка",
|
|
||||||
npcName = "Скупщик Гриша",
|
|
||||||
npcColors = { skin = Color3.fromRGB(200, 150, 110), shirt = Color3.fromRGB(70, 130, 80), pants = Color3.fromRGB(60, 50, 40), hat = Color3.fromRGB(200, 170, 110) },
|
|
||||||
})
|
|
||||||
w1Counter:SetAttribute("GuideTarget", "Sell") -- прилавок подсвечивается на шаге обучения
|
|
||||||
|
|
||||||
-- доска «Кто водится в озере»
|
|
||||||
do
|
|
||||||
local pos = W + V(-15, GROUND_Y, 80)
|
|
||||||
local cf = CFrame.lookAt(pos, arrive)
|
|
||||||
for _, x in ipairs({ -6, 6 }) do
|
|
||||||
P({ Size = V(0.8, 11, 0.8), CFrame = cf * CFrame.new(x, 5.5, 0.3), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 40) })
|
|
||||||
end
|
end
|
||||||
local board = P({ Size = V(13, 10, 0.5), CFrame = cf * CFrame.new(0, 7, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(70, 48, 32) })
|
local function lantern(cf)
|
||||||
local lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
local bulb = block("Lantern", V(0.8, 1.15, 0.8), cf, C.warm, Enum.Material.Neon)
|
||||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
light(bulb, 14, 0.8)
|
||||||
local r = Config.Rarities[f.rarity]
|
for _, y in ipairs({ -0.7, 0.7 }) do block("LanternCap", V(1.25, 0.2, 1.25), cf * CFrame.new(0, y, 0), C.dark, Enum.Material.Metal) end
|
||||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
for _, x in ipairs({ -0.48, 0.48 }) do
|
||||||
|
for _, z in ipairs({ -0.48, 0.48 }) do block("LanternFrame", V(0.1, 1.4, 0.1), cf * CFrame.new(x, 0, z), C.dark, Enum.Material.Metal) end
|
||||||
end
|
end
|
||||||
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
|
||||||
end
|
end
|
||||||
|
local function lanternPost(pos)
|
||||||
-- костёр с брёвнами
|
cylA(pos, pos + V(0, 5, 0), 0.4, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
do
|
lantern(CFrame.new(pos + V(0, 5.4, 0)))
|
||||||
local c = W + V(-8, GROUND_Y, 110)
|
end
|
||||||
|
local function ropeRing(pos, radius)
|
||||||
for i = 0, 7 do
|
for i = 0, 7 do
|
||||||
local a = i / 8 * math.pi * 2
|
local a, b = i * math.pi / 4, (i + 1) * math.pi / 4
|
||||||
ball(c + V(math.cos(a) * 2.2, 0.3, math.sin(a) * 2.2), 1, { Color = Color3.fromRGB(120, 120, 125), Material = Enum.Material.Rock })
|
cylA(pos + V(math.cos(a) * radius, 0, math.sin(a) * radius), pos + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.16, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
end
|
|
||||||
for i = 0, 2 do
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(3, 0.6, 0.6), CFrame = CFrame.new(c + V(0, 0.4, 0)) * CFrame.Angles(0, i * math.pi / 3, 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 35) })
|
|
||||||
end
|
|
||||||
local fireBase = P({ Size = V(1, 1, 1), Position = c + V(0, 0.8, 0), Transparency = 1, CanCollide = false })
|
|
||||||
local fire = Instance.new("Fire")
|
|
||||||
fire.Size = 5
|
|
||||||
fire.Heat = 9
|
|
||||||
fire.Parent = fireBase
|
|
||||||
local light = Instance.new("PointLight")
|
|
||||||
light.Color = Color3.fromRGB(255, 160, 80)
|
|
||||||
light.Range = 20
|
|
||||||
light.Brightness = 2
|
|
||||||
light.Parent = fireBase
|
|
||||||
for _, a in ipairs({ 0, 2.1, 4.2 }) do
|
|
||||||
local p = c + V(math.cos(a) * 6, 0.6, math.sin(a) * 6)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 1.4, 1.4), CFrame = CFrame.lookAt(p, c) * CFrame.Angles(0, math.rad(90), 0) * CFrame.Angles(0, math.rad(90), 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(115, 80, 50) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function pier(center, size, primary)
|
||||||
-- дед-рыбак с подсказками
|
local cf = CFrame.new(center)
|
||||||
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 86), arrive + V(0, 3, 0)), {
|
local deck = block("PierDeck", size, cf, C.wood, Enum.Material.WoodPlanks, true)
|
||||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
if primary then deck:SetAttribute("GuideTarget", "Pier") end
|
||||||
}, "Talk", "Поговорить")
|
|
||||||
|
|
||||||
-- домик рыбака
|
|
||||||
do
|
|
||||||
local cf = CFrame.lookAt(W + V(-44, GROUND_Y, 98), W + V(0, GROUND_Y, 98))
|
|
||||||
local logC = Color3.fromRGB(130, 90, 55)
|
|
||||||
P({ Size = V(14, 1, 12), CFrame = cf * CFrame.new(0, 0.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(110, 80, 50) })
|
|
||||||
P({ Size = V(14, 8, 1), CFrame = cf * CFrame.new(0, 5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(1, 8, 12), CFrame = cf * CFrame.new(s * 6.5, 5, 0), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(5, 8, 1), CFrame = cf * CFrame.new(s * 4.5, 5, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(16, 1, 8.8), CFrame = cf * CFrame.new(0, 11.2, s * 3.4) * CFrame.Angles(math.rad(-s * 38), 0, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 60, 45) })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 2, 1), CFrame = cf * CFrame.new(0, 8, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(2.2, 2, 0.3), CFrame = cf * CFrame.new(-4.5, 5.5, -6.05), Material = Enum.Material.Glass, Color = Color3.fromRGB(255, 225, 150), Transparency = 0.2 })
|
|
||||||
P({ Size = V(14, 3, 1), CFrame = cf * CFrame.new(0, 10.5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- причалы
|
|
||||||
local function pier(center, size)
|
|
||||||
local deck = P({ Size = size, Position = center, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 110, 70) })
|
|
||||||
local alongZ = size.Z > size.X
|
local alongZ = size.Z > size.X
|
||||||
local len = alongZ and size.Z or size.X
|
local length, width = alongZ and size.Z or size.X, alongZ and size.X or size.Z
|
||||||
local wid = alongZ and size.X or size.Z
|
for d = -length / 2 + 1, length / 2 - 0.5, 2 do
|
||||||
for d = -len / 2 + 1, len / 2 - 1, 6 do
|
local offset = alongZ and V(0, 0.34, d) or V(d, 0.34, 0)
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
local boardSize = alongZ and V(width, 0.16, 1.88) or V(1.88, 0.16, width)
|
||||||
local off = alongZ and V(s * (wid / 2 - 0.4), 0, d) or V(d, 0, s * (wid / 2 - 0.4))
|
block("IndividualPlank", boardSize, cf + offset, C.wood:Lerp(C.dark, rng:NextNumber(0, 0.12)), Enum.Material.WoodPlanks)
|
||||||
vcyl(center + off + V(0, -6, 0), 13, 0.9, { Color = Color3.fromRGB(100, 70, 45), Material = Enum.Material.Wood })
|
end
|
||||||
|
for d = -length / 2 + 1, length / 2 - 1, 8 do
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
local p = center + (alongZ and V(side * (width / 2 - 0.4), 0, d) or V(d, 0, side * (width / 2 - 0.4)))
|
||||||
|
cylA(p - V(0, 7, 0), p + V(0, 1.8, 0), 1.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
ropeRing(p + V(0, 0.8, 0), 0.7)
|
||||||
|
ropeRing(p + V(0, 1.05, 0), 0.7)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return deck
|
return deck
|
||||||
end
|
end
|
||||||
-- { центр от W, размер }
|
local function fishSign(cf, width, height, color)
|
||||||
local PIERS = {
|
local panel = block("FishSign", V(width, height, 0.22), cf, color, Enum.Material.WoodPlanks)
|
||||||
{ V(0, GROUND_Y + 0.2, 58), V(8, 0.6, 42) },
|
for _, face in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||||
{ V(-86, GROUND_Y + 0.2, 15), V(34, 0.6, 7) },
|
local sg = Instance.new("SurfaceGui")
|
||||||
{ V(86, GROUND_Y + 0.2, -10), V(34, 0.6, 7) },
|
sg.Face, sg.LightInfluence, sg.PixelsPerStud = face, 0, 30
|
||||||
}
|
sg.SizingMode, sg.Parent = Enum.SurfaceGuiSizingMode.PixelsPerStud, panel
|
||||||
for i, p in ipairs(PIERS) do
|
local body = Instance.new("Frame")
|
||||||
local deck = pier(W + p[1], p[2])
|
body.Size, body.Position = UDim2.fromScale(0.5, 0.4), UDim2.fromScale(0.2, 0.3)
|
||||||
if i == 1 then
|
body.BackgroundColor3, body.BorderSizePixel, body.Parent = Color3.fromRGB(245, 239, 214), 0, sg
|
||||||
deck:SetAttribute("GuideTarget", "Pier") -- главный причал подсвечивается на шаге обучения
|
local curve = Instance.new("UICorner")
|
||||||
|
curve.CornerRadius, curve.Parent = UDim.new(1, 0), body
|
||||||
|
local tail = Instance.new("TextLabel")
|
||||||
|
tail.Size, tail.Position, tail.BackgroundTransparency = UDim2.fromScale(0.3, 0.65), UDim2.fromScale(0.59, 0.175), 1
|
||||||
|
tail.Text, tail.TextScaled, tail.TextColor3, tail.Parent = "◀", true, body.BackgroundColor3, sg
|
||||||
|
local eye = Instance.new("Frame")
|
||||||
|
eye.Size, eye.Position, eye.BorderSizePixel = UDim2.fromScale(0.045, 0.08), UDim2.fromScale(0.26, 0.43), 0
|
||||||
|
eye.BackgroundColor3, eye.Parent = color, sg
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function smoke(chimney)
|
||||||
|
local effect = Instance.new("ParticleEmitter")
|
||||||
|
effect.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
effect.Rate, effect.Lifetime, effect.Speed = 3, NumberRange.new(3, 5), NumberRange.new(1.5, 2.5)
|
||||||
|
effect.Acceleration, effect.SpreadAngle = V(0.7, 0.5, 0), Vector2.new(10, 10)
|
||||||
|
effect.Color = ColorSequence.new(Color3.fromRGB(220, 223, 219))
|
||||||
|
effect.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.8), NumberSequenceKeypoint.new(1, 4) })
|
||||||
|
effect.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.3), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
effect.Parent = chimney
|
||||||
|
end
|
||||||
|
local function pine(pos, height)
|
||||||
|
cylA(pos, pos + V(0, height * 0.8, 0), height * 0.075, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
local tint = C.pine:Lerp(C.pineDark, rng:NextNumber())
|
||||||
|
for i = 0, 3 do
|
||||||
|
local width = height * (0.6 - i * 0.115)
|
||||||
|
local p = pos + V(0, height * (0.38 + i * 0.18), 0)
|
||||||
|
local lower = block("PineCanopy", V(width, height * 0.26, width), CFrame.new(p) * CFrame.Angles(0, math.pi / 4, 0), tint)
|
||||||
|
lower.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function cabin(pos, lookAt, scale)
|
||||||
|
local cf = CFrame.lookAt(pos, lookAt)
|
||||||
|
local function at(x, y, z) return cf * CFrame.new(x * scale, y * scale, z * scale) end
|
||||||
|
block("CabinFloor", V(21, 0.6, 19) * scale, at(0, 0.3, 0), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for row = 0, 7 do
|
||||||
|
local y = 1 + row * 0.95
|
||||||
|
cylA(at(-9, y, 7).Position, at(9, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(at(side * 8.5, y, -6).Position, at(side * 8.5, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
cylA(at(side * 2, y, -6).Position, at(side * 9, y, -6).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("GreenGableRoof", V(11.6, 0.65, 18) * scale, at(side * 4.7, 10.2, 0.5) * CFrame.Angles(0, 0, -side * 0.53), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
block("RoofTrim", V(12, 0.5, 0.5) * scale, at(side * 4.7, 10.2, -8.5) * CFrame.Angles(0, 0, -side * 0.53), C.dark, Enum.Material.Wood)
|
||||||
|
local window = block("GoldenWindow", V(3.1, 3, 0.2) * scale, at(side * 5.1, 4.7, -6.55), C.warm, Enum.Material.Neon)
|
||||||
|
if side == -1 then light(window, 12, 0.55) end
|
||||||
|
block("WindowMullion", V(0.18, 3.2, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
block("WindowMullion", V(3.3, 0.18, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
cylA(at(side * 9, -5, -7).Position, at(side * 9, 0, -7).Position, 0.8 * scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do block("PorchStep", V(5, 0.3 + i * 0.25, 1) * scale, at(0, -0.3 + i * 0.1, -11 + i), C.wood, Enum.Material.WoodPlanks, true) end
|
||||||
|
lantern(at(-7.3, 3, -8.3))
|
||||||
|
block("StoneChimney", V(2.3, 7, 2.3) * scale, at(4, 12.5, 4), C.rock, Enum.Material.Cobblestone, true)
|
||||||
|
local outlet = block("SmokeOutlet", V(1, 0.1, 1), at(4, 16, 4), C.rock)
|
||||||
|
outlet.Transparency = 1
|
||||||
|
smoke(outlet)
|
||||||
|
end
|
||||||
|
local function crate(cf)
|
||||||
|
block("WoodenCrate", V(2.5, 2.5, 2.5), cf, C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, y in ipairs({ -0.9, 0.9 }) do block("CrateBand", V(2.6, 0.22, 2.6), cf * CFrame.new(0, y, 0), C.wood, Enum.Material.Wood) end
|
||||||
|
end
|
||||||
|
|
||||||
lamp(W + V(-3.5, GROUND_Y + 0.5, 40), Color3.fromRGB(255, 220, 160))
|
-- Прибытие: всё необходимое находится в пределах 25 studs.
|
||||||
lamp(W + V(-70, GROUND_Y + 0.5, 18), Color3.fromRGB(255, 220, 160))
|
local arrive = W + V(0, GROUND_Y, 94)
|
||||||
lamp(W + V(70, GROUND_Y + 0.5, -13), Color3.fromRGB(255, 220, 160))
|
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
||||||
|
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.65, 40)))
|
||||||
|
portal(CFrame.lookAt(W + V(20, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
||||||
|
local shopCF = CFrame.lookAt(W + V(-18, GROUND_Y, 84), arrive)
|
||||||
|
marker("GuideSell", shopCF * CFrame.new(0, 0, -10))
|
||||||
|
local counter = stall(shopCF, {
|
||||||
|
title = "🐟 СКУПКА", titleColor = Color3.fromRGB(240, 230, 200),
|
||||||
|
wall = C.dark, stripeA = Color3.fromRGB(45, 105, 70), stripeB = Color3.fromRGB(240, 230, 200),
|
||||||
|
glow = C.warm, action = "Sell", promptText = "Продать всю рыбу", promptObject = "Скупка",
|
||||||
|
npcName = "Скупщик Гриша",
|
||||||
|
npcColors = { skin = Color3.fromRGB(220, 175, 133), shirt = C.roof, pants = Color3.fromRGB(80, 74, 52), hat = Color3.fromRGB(215, 180, 110) },
|
||||||
|
decor = function(at)
|
||||||
|
for i, color in ipairs({ Color3.fromRGB(110, 190, 60), Color3.fromRGB(245, 211, 64), Color3.fromRGB(241, 140, 55), Color3.fromRGB(70, 160, 219) }) do
|
||||||
|
local p = at(-5 + i * 2, 8.3, 6.7).Position
|
||||||
|
sphere(p, V(0.65, 1.6, 0.45), color)
|
||||||
|
cylA(p + V(0, 0.7, 0), p + V(0, 2.2, 0), 0.05, { Color = C.rope })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local p = at(-5 + i * 1.4, 5.9, -4).Position
|
||||||
|
sphere(p, V(0.75, 0.75, 0.75), Color3.fromRGB(240, 234, 219))
|
||||||
|
sphere(p + V(0, 0.3, 0), V(0.62, 0.5, 0.62), Color3.fromRGB(214, 66, 53))
|
||||||
|
end
|
||||||
|
block("CounterBox", V(3, 1, 2), at(5, 5.9, -4), C.wood, Enum.Material.WoodPlanks)
|
||||||
|
fishSign(at(0, 21.2, -9.2), 7, 2.6, C.roof)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
counter:SetAttribute("GuideTarget", "Sell")
|
||||||
|
lantern(shopCF * CFrame.new(-10, 7.3, -10))
|
||||||
|
crate(shopCF * CFrame.new(-13, 1.25, -11))
|
||||||
|
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 83), arrive + V(0, 3, 0)), {
|
||||||
|
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = C.roof,
|
||||||
|
}, "Talk", "Поговорить")
|
||||||
|
local boardCF = CFrame.lookAt(W + V(15, GROUND_Y, 74), arrive)
|
||||||
|
for _, x in ipairs({ -4.6, 4.6 }) do cylA((boardCF * CFrame.new(x, 0, 0)).Position, (boardCF * CFrame.new(x, 10, 0)).Position, 0.6, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
local board = block("World1Bestiary", V(10, 8, 0.4), boardCF * CFrame.new(0, 6, 0), C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
local lines = { "<font color=\"#FFE3A9\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||||
|
for _, fish in ipairs(Config.Zones.World1.fish) do
|
||||||
|
local rarity = Config.Rarities[fish.rarity]
|
||||||
|
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(rarity.color:ToHex(), fish.name, rarity.name))
|
||||||
|
end
|
||||||
|
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
||||||
|
|
||||||
-- лодка у западного причала
|
-- Дощатые причалы, кнехты с канатом и снасти на переднем плане.
|
||||||
|
pier(W + V(0, 4.2, 58), V(12, 0.6, 42), true)
|
||||||
|
pier(W + V(86, 4.2, -10), V(34, 0.6, 8))
|
||||||
|
pier(W + V(-86, 4.2, 15), V(34, 0.6, 8))
|
||||||
|
for _, p in ipairs({ V(-5, 4.7, 40), V(5, 4.7, 72), V(72, 4.7, -13) }) do lanternPost(W + p) end
|
||||||
|
crate(CFrame.new(W + V(-3.8, 5.9, 67)))
|
||||||
|
local tackle = CFrame.new(W + V(3.7, 5.4, 61))
|
||||||
|
block("TackleBox", V(2.6, 1.5, 1.6), tackle, Color3.fromRGB(91, 111, 101), Enum.Material.Metal)
|
||||||
|
block("TackleLid", V(2.8, 0.25, 1.8), tackle * CFrame.new(0, 0.85, 0), Color3.fromRGB(116, 130, 114), Enum.Material.Metal)
|
||||||
|
block("TackleLatch", V(0.3, 0.65, 0.12), tackle * CFrame.new(0, 0.3, -0.85), C.rope, Enum.Material.Metal)
|
||||||
|
for _, x in ipairs({ -0.45, 0.45 }) do block("HandleLeg", V(0.15, 0.4, 0.15), tackle * CFrame.new(x, 1.12, 0), C.dark, Enum.Material.Metal) end
|
||||||
|
block("TackleHandle", V(1, 0.15, 0.15), tackle * CFrame.new(0, 1.35, 0), C.dark, Enum.Material.Metal)
|
||||||
|
local boat = CFrame.new(W + V(19, 0.5, 44)) * CFrame.Angles(0, -0.3, 0)
|
||||||
|
block("BoatHull", V(4.5, 0.5, 10), boat, C.dark, Enum.Material.WoodPlanks)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("BoatGunwale", V(0.35, 1.5, 10), boat * CFrame.new(side * 2.2, 0.7, 0), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatEnd", V(4.5, 1.5, 0.4), boat * CFrame.new(0, 0.7, side * 4.8), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatSeat", V(4.3, 0.3, 1), boat * CFrame.new(0, 1, side * 2.1), C.dark, Enum.Material.WoodPlanks)
|
||||||
|
cylA((boat * CFrame.new(side * 0.8, 1.4, -2)).Position, (boat * CFrame.new(side * 3.6, 2.3, 2.4)).Position, 0.18, { Color = C.wood, Material = Enum.Material.Wood })
|
||||||
|
block("OarBlade", V(0.7, 0.15, 1.8), boat * CFrame.new(side * 3.8, 2.4, 2.7) * CFrame.Angles(0, side * 0.5, 0), C.wood, Enum.Material.Wood)
|
||||||
|
end
|
||||||
|
cylA(W + V(14, -5, 44), W + V(14, 3.3, 44), 0.9, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
cylA(W + V(14, 2, 44), (boat * CFrame.new(-2.2, 1, 0)).Position, 0.12, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
|
|
||||||
|
-- Домики и вывеска с рыбой вдоль левого берега.
|
||||||
|
cabin(W + V(-49, 5, 66), W + V(0, 5, 45), 1)
|
||||||
|
cabin(W + V(-91, 5, -30), W + V(-25, 5, 0), 0.75)
|
||||||
|
cylA(W + V(-78, 4, -42), W + V(-78, 16, -42), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
block("BannerArm", V(5, 0.4, 0.4), CFrame.new(W + V(-76, 15, -42)), C.dark, Enum.Material.Wood)
|
||||||
|
fishSign(CFrame.new(W + V(-75.5, 12, -42)), 3.5, 5, C.roof)
|
||||||
|
|
||||||
|
-- Подъём на холм: пологие отрезки дорожки и ограждение с одной стороны.
|
||||||
|
for i = 1, #WORLD1_TRAIL - 1 do
|
||||||
|
local a, b = W + WORLD1_TRAIL[i], W + WORLD1_TRAIL[i + 1]
|
||||||
|
local cf = CFrame.lookAt((a + b) / 2, b)
|
||||||
|
block("HillTrail", V(7, 0.5, (b - a).Magnitude + 1), cf, Color3.fromRGB(184, 148, 102), Enum.Material.Ground, true)
|
||||||
|
local side = cf.RightVector * 4.2
|
||||||
|
for _, p in ipairs({ a + side, b + side }) do cylA(p, p + V(0, 3, 0), 0.35, { Color = C.dark, Material = Enum.Material.Wood }) end
|
||||||
|
for _, h in ipairs({ 1.2, 2.5 }) do cylA(a + side + V(0, h, 0), b + side + V(0, h, 0), 0.22, { Color = C.wood, Material = Enum.Material.Wood }) end
|
||||||
|
if i < 5 then lanternPost(a - side) end
|
||||||
|
end
|
||||||
|
local top = W + V(-43, 32, -119)
|
||||||
|
for _, x in ipairs({ -5, 5 }) do
|
||||||
|
for _, z in ipairs({ -5, 5 }) do cylA(top + V(x, 0, z), top + V(x, 19, z), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
block("LookoutDeck", V(13, 0.65, 13), CFrame.new(top + V(0, 11, 0)), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("LookoutRoof", V(8, 0.6, 15), CFrame.new(top + V(side * 3.2, 21, 0)) * CFrame.Angles(0, 0, -side * 0.45), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
if side == 1 then
|
||||||
|
for _, x in ipairs({ -1, 1 }) do cylA(top + V(x * 1.8, 14, 5), top + V(x * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
else
|
||||||
|
cylA(top + V(-5, 14, -5), top + V(5, 14, -5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
cylA(top + V(side * 5, 14, -5), top + V(side * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 12 do block("LookoutSteps", V(3, 0.6 + i * 0.85, 1.3), CFrame.new(top + V(0, (0.6 + i * 0.85) / 2, 22 - i * 1.25)), C.dark, Enum.Material.WoodPlanks, true) end
|
||||||
|
cylA(top + V(5, 18, 0), top + V(5, 28, 0), 0.25, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
fishSign(CFrame.new(top + V(8, 26, 0)), 6, 3, C.roof)
|
||||||
|
lantern(CFrame.new(top + V(-4, 16, 4)))
|
||||||
|
|
||||||
|
-- Водопад: движущиеся ленты, пена и тихий встроенный звук воды.
|
||||||
|
for i = 0, 3 do
|
||||||
|
local x = 35 + i * 7
|
||||||
|
block("WaterfallRockFace", V(9, 28 + (i % 2) * 4, 7), CFrame.new(W + V(x, 14, -56)) * CFrame.Angles(0, i * 0.15, 0.04), C.rock, Enum.Material.Slate, true)
|
||||||
|
block("MossyLedge", V(9, 0.8, 8), CFrame.new(W + V(x, 29 + (i % 2) * 2, -57)), C.moss, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local x = 39 + i * 5
|
||||||
|
local sheet = block("WaterfallSheet", V(4.8, 30, 0.35), CFrame.new(W + V(x, 15.2, -50.7)), Color3.fromRGB(162, 224, 223), Enum.Material.Glass)
|
||||||
|
sheet.Transparency = 0.4
|
||||||
|
local upper, lower = Instance.new("Attachment"), Instance.new("Attachment")
|
||||||
|
upper.Position, lower.Position = V(0, 14.8, 0), V(0, -14.8, 0)
|
||||||
|
upper.Parent, lower.Parent = sheet, sheet
|
||||||
|
local beam = Instance.new("Beam")
|
||||||
|
beam.Attachment0, beam.Attachment1, beam.Width0, beam.Width1 = upper, lower, 4.8, 5.4
|
||||||
|
beam.Texture, beam.TextureSpeed, beam.TextureLength = "rbxasset://textures/particles/smoke_main.dds", 1.4, 6
|
||||||
|
beam.FaceCamera, beam.Color, beam.LightEmission = true, ColorSequence.new(Color3.fromRGB(224, 248, 242)), 0.15
|
||||||
|
beam.Transparency, beam.Parent = NumberSequence.new(0.35), sheet
|
||||||
|
local foam = sphere(W + V(x, 0.3, -48), V(7, 0.3, 5), Color3.fromRGB(231, 247, 235))
|
||||||
|
foam.Transparency = 0.35
|
||||||
|
local mist = Instance.new("ParticleEmitter")
|
||||||
|
mist.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
mist.Rate, mist.Lifetime, mist.Speed = 4, NumberRange.new(1, 2), NumberRange.new(1, 2.5)
|
||||||
|
mist.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.7), NumberSequenceKeypoint.new(1, 3) })
|
||||||
|
mist.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.6), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
mist.Color, mist.SpreadAngle, mist.Parent = ColorSequence.new(Color3.fromRGB(235, 249, 244)), Vector2.new(40, 40), foam
|
||||||
|
end
|
||||||
|
local soundAnchor = block("WaterfallSound", V(1, 1, 1), CFrame.new(W + V(45, 5, -48)), C.rock)
|
||||||
|
soundAnchor.Transparency = 1
|
||||||
|
local waterSound = Instance.new("Sound")
|
||||||
|
waterSound.Name, waterSound.SoundId = "WaterfallAmbience", "rbxasset://sounds/action_swim.mp3"
|
||||||
|
waterSound.Looped, waterSound.Volume, waterSound.PlaybackSpeed = true, 0.12, 0.65
|
||||||
|
waterSound.RollOffMinDistance, waterSound.RollOffMaxDistance = 10, 120
|
||||||
|
waterSound.Parent = soundAnchor
|
||||||
|
waterSound:Play()
|
||||||
|
for ring = 0, 2 do
|
||||||
|
local ripple = Instance.new("Model")
|
||||||
|
ripple.Name = "WaterfallRipple"
|
||||||
|
ripple:SetAttribute("RippleCenter", W + V(45, 0.16, -42))
|
||||||
|
ripple:SetAttribute("RipplePhase", ring / 3)
|
||||||
|
ripple.Parent = scenery
|
||||||
|
for segment = 0, 11 do
|
||||||
|
local a, b = segment * math.pi / 6, (segment + 1) * math.pi / 6
|
||||||
|
local p = W + V(45, 0.16, -42)
|
||||||
|
local radius = 2 + ring * 2
|
||||||
|
local line = cylA(p + V(math.cos(a) * radius, 0, math.sin(a) * radius), p + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.07, { Color = Color3.fromRGB(218, 242, 228), Transparency = 0.75, Parent = ripple })
|
||||||
|
line:SetAttribute("RippleSegment", segment)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local creek = block("NarrowFeederStream", V(5, 0.15, 48), CFrame.new(W + V(45, 30.2, -77)), Color3.fromRGB(62, 168, 165), Enum.Material.Glass)
|
||||||
|
creek.Transparency = 0.3
|
||||||
|
for _, x in ipairs({ 41.7, 48.3 }) do block("CreekBank", V(1.5, 0.7, 48), CFrame.new(W + V(x, 30.2, -77)), C.moss, Enum.Material.Grass, true) end
|
||||||
|
local previousBridge
|
||||||
|
for i = 0, 16 do
|
||||||
|
local t = i / 16
|
||||||
|
local pos = W + V(29 + t * 32, 30.7 + math.sin(t * math.pi) * 3.2, -77)
|
||||||
|
local slope = math.atan(math.cos(t * math.pi) * 3.2 * math.pi / 32)
|
||||||
|
block("ArchedBridgePlank", V(2.05, 0.45, 7), CFrame.new(pos) * CFrame.Angles(0, 0, slope), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(pos + V(0, 0, side * 3.3), pos + V(0, 3.2, side * 3.3), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
if previousBridge then cylA(previousBridge + V(0, 2.8, side * 3.3), pos + V(0, 2.8, side * 3.3), 0.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
previousBridge = pos
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(29, 30, -82), V(61, 30, -82) }) do lanternPost(W + p) end
|
||||||
|
|
||||||
|
-- Кувшинки и камыш стоят у внешнего берега, вдали от проходов.
|
||||||
|
for _, lake in ipairs(LAKES) do
|
||||||
|
for i = 1, 8 do
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local d = lake[3] - rng:NextNumber(3, 9)
|
||||||
|
local p = W + V(lake[1] + math.cos(a) * d, 0.13, lake[2] + math.sin(a) * d)
|
||||||
|
if not (math.abs(p.X - W.X) < 8 and p.Z - W.Z > 30) then
|
||||||
|
part({ Name = "LilyPad", Shape = Enum.PartType.Cylinder, Size = V(0.12, 2.6, 2.6), CFrame = CFrame.new(p) * CFrame.Angles(0, 0, math.pi / 2), Color = Color3.fromRGB(79, 147, 68) })
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for petal = 0, 4 do sphere(p + V(math.cos(petal * 1.26) * 0.3, 0.18, math.sin(petal * 1.26) * 0.3), V(0.55, 0.22, 0.4), Color3.fromRGB(239, 151, 177)) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 0, 9 do
|
||||||
|
local a = i * math.pi / 5
|
||||||
|
local x, z = lake[1] + math.cos(a) * (lake[3] + 2), lake[2] + math.sin(a) * (lake[3] + 2)
|
||||||
|
if not inLake(x, z, 0) and not (math.abs(x) < 15 and z > 30) and z < 73 then
|
||||||
|
for j = 1, 4 do
|
||||||
|
local h = rng:NextNumber(2.5, 4.8)
|
||||||
|
local p = W + V(x + rng:NextNumber(-1, 1), 0, z + rng:NextNumber(-1, 1))
|
||||||
|
cylA(p, p + V(0, h, 0), 0.12, { Color = Color3.fromRGB(105, 139, 60) })
|
||||||
|
cylA(p + V(0, h - 0.8, 0), p + V(0, h, 0), 0.3, { Color = Color3.fromRGB(120, 78, 43) })
|
||||||
|
end
|
||||||
|
local p = W + V(x, 0, z)
|
||||||
|
sphere(p, V(4, 2.5, 3.3), C.rock, Enum.Material.Rock)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 1, 8 do
|
||||||
|
local lake = LAKES[(i - 1) % #LAKES + 1]
|
||||||
|
local fish = Instance.new("Model")
|
||||||
|
fish.Name = "AmbientFish"
|
||||||
|
fish:SetAttribute("SwimCenter", W + V(lake[1], -1.8, lake[2]))
|
||||||
|
fish:SetAttribute("SwimRadius", 8 + (i % 3) * 4)
|
||||||
|
fish:SetAttribute("SwimPhase", i * 1.7)
|
||||||
|
fish:SetAttribute("SwimSpeed", 0.08 + i * 0.008)
|
||||||
|
fish.Parent = scenery
|
||||||
|
local cf = CFrame.new(W + V(lake[1], -1.8, lake[2]))
|
||||||
|
local body = part({ Name = "FishShadow", Shape = Enum.PartType.Ball, Size = V(0.7, 0.22, 2), CFrame = cf, Color = Color3.fromRGB(29, 85, 83), Transparency = 0.35, Parent = fish })
|
||||||
|
fish.PrimaryPart = body
|
||||||
|
part({ Name = "TailShadow", Size = V(1, 0.12, 0.7), CFrame = cf * CFrame.new(0, 0, 1.2) * CFrame.Angles(0, math.pi / 4, 0), Color = body.Color, Transparency = 0.4, Parent = fish })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Пояс сосен, отдельные деревья у воды и горы за границей мира.
|
||||||
|
for i = 0, 83 do
|
||||||
|
local a = i / 84 * math.pi * 2
|
||||||
|
local distance = rng:NextNumber(130, 230)
|
||||||
|
local x, z = math.cos(a) * distance, math.sin(a) * distance
|
||||||
|
if not (z < -65 and z > -145 and x > -125 and x < 85) then
|
||||||
|
pine(W + V(x, groundY(W.X + x, W.Z + z), z), rng:NextNumber(14, 24))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(-72, 4, 68), V(-101, 4, 41), V(96, 4, 30), V(108, 4, -48), V(-85, 25, -133), V(-20, 27, -139), V(35, 30, -94), V(61, 30, -98) }) do pine(W + p, rng:NextNumber(14, 20)) end
|
||||||
|
for _, p in ipairs({ V(-29, 4, 103), V(42, 4, 73), V(-72, 4, 49) }) do
|
||||||
|
cylA(W + p, W + p + V(0, 11, 0), 1, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for i = 0, 2 do sphere(W + p + V((i - 1) * 3, 11 + (i % 2) * 2, 0), V(9, 7, 8), C.grass) end
|
||||||
|
end
|
||||||
|
for i = 0, 6 do
|
||||||
|
local mountain = block("DistantMountain", V(85, 90 + (i % 3) * 22, 85), CFrame.new(W + V(-240 + i * 80, 30, -300)) * CFrame.Angles(0.2, i * 0.5, 0.15), Color3.fromRGB(131, 157, 168), Enum.Material.Slate)
|
||||||
|
mountain.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
for i = 0, 3 do
|
||||||
|
local cloud = sphere(W + V(-120 + i * 83, 115 + (i % 2) * 12, -210), V(40, 12, 22), Color3.fromRGB(245, 245, 231))
|
||||||
|
cloud.Name = "CumulusCloud"
|
||||||
|
sphere(cloud.Position + V(10, 4, 0), V(22, 15, 18), cloud.Color)
|
||||||
|
end
|
||||||
|
for _, wall in ipairs({ { V(0, 40, 245), V(500, 120, 2) }, { V(0, 40, -245), V(500, 120, 2) }, { V(245, 40, 0), V(2, 120, 500) }, { V(-245, 40, 0), V(2, 120, 500) } }) do
|
||||||
|
part({ Name = "WorldBoundary", Position = W + wall[1], Size = wall[2], Transparency = 1, CanCollide = true, CanQuery = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Сохраняем прежнюю последовательность rng для неизменённых Миров 2 и 3.
|
||||||
do
|
do
|
||||||
local cf = CFrame.new(W + V(-74, WATER_Y + 0.3, 24)) * CFrame.Angles(0, math.rad(15), 0)
|
local rng = sharedRng
|
||||||
local hull = Color3.fromRGB(170, 70, 50)
|
|
||||||
P({ Size = V(4, 0.5, 9), CFrame = cf, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(0.4, 1.4, 9), CFrame = cf * CFrame.new(s * 2, 0.7, 0), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
P({ Size = V(4.4, 1.4, 0.4), CFrame = cf * CFrame.new(0, 0.7, s * 4.5), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 0.3, 1.2), CFrame = cf * CFrame.new(0, 1, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- кувшинки и камыши
|
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 7 do
|
for _ = 1, 7 do rng:NextNumber(0, math.pi * 2); rng:NextNumber(6, l[3] - 5); rng:NextNumber(2, 3.5); rng:NextNumber() end
|
||||||
local a, d = rng:NextNumber(0, math.pi * 2), rng:NextNumber(6, l[3] - 5)
|
|
||||||
local x, z = l[1] + math.cos(a) * d, l[2] + math.sin(a) * d
|
|
||||||
local size = rng:NextNumber(2, 3.5)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(0.15, size, size), CFrame = CFrame.new(W + V(x, WATER_Y + 0.28, z)) * CFrame.Angles(0, 0, math.rad(90)), Color = Color3.fromRGB(70, 150, 60), CanCollide = false })
|
|
||||||
if rng:NextNumber() < 0.4 then
|
|
||||||
ball(W + V(x + 0.3, WATER_Y + 0.55, z), 0.7, { Color = Color3.fromRGB(255, 150, 190), CanCollide = false })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for _ = 1, 9 do
|
for _ = 1, 9 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
||||||
local inOther = false
|
local other = false
|
||||||
for _, o in ipairs(LAKES) do
|
for _, o in ipairs(LAKES) do if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then other = true end end
|
||||||
if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then
|
if not other and not (math.abs(x) < 6 and z > 30) then for _ = 1, 5 do rng:NextNumber(3, 5); rng:NextNumber(-1.2, 1.2); rng:NextNumber(-1.2, 1.2) end end
|
||||||
inOther = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not inOther and not (math.abs(x) < 6 and z > 30) then
|
local function free(x, z)
|
||||||
for _ = 1, 5 do
|
return not inLake(x, z, 14) and (V(x, 0, z) - V(0, 0, 94)).Magnitude >= 36
|
||||||
local h = rng:NextNumber(3, 5)
|
and not (math.abs(x) < 9 and z > 60 and z < 125) and (V(x, 0, z) - V(-44, 0, 98)).Magnitude >= 14
|
||||||
local p = W + V(x + rng:NextNumber(-1.2, 1.2), WATER_Y + h / 2 - 0.5, z + rng:NextNumber(-1.2, 1.2))
|
|
||||||
P({ Size = V(0.18, h, 0.18), Position = p, Color = Color3.fromRGB(85, 130, 50), CanCollide = false })
|
|
||||||
P({ Size = V(0.35, 0.9, 0.35), Position = p + V(0, h / 2 - 0.3, 0), Color = Color3.fromRGB(110, 70, 40), CanCollide = false })
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- деревья, кусты, камни
|
|
||||||
local function freeSpot(x, z)
|
|
||||||
if inLake(x, z, 14) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(0, 0, 94)).Magnitude < 36 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if math.abs(x) < 9 and z > 60 and z < 125 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(-44, 0, 98)).Magnitude < 14 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
local placed = 0
|
local placed = 0
|
||||||
for _ = 1, 400 do
|
for _ = 1, 400 do
|
||||||
if placed >= 110 then
|
if placed >= 110 then break end
|
||||||
break
|
|
||||||
end
|
|
||||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
local y = groundY(W.X + x, W.Z + z)
|
|
||||||
local roll = rng:NextNumber()
|
local roll = rng:NextNumber()
|
||||||
tree(W + V(x, y - 0.5, z), roll < 0.35 and "pine" or (roll < 0.5 and "birch" or "round"))
|
if roll < 0.35 then rng:NextNumber(8, 12)
|
||||||
|
else rng:NextNumber(7, 10); if roll >= 0.5 then rng:NextInteger(135, 165) end; rng:NextNumber(9, 12) end
|
||||||
placed += 1
|
placed += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _ = 1, 60 do
|
for _ = 1, 60 do
|
||||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
bush(W + V(x, groundY(W.X + x, W.Z + z) - 0.6, z))
|
rng:NextInteger(120, 150)
|
||||||
|
for _ = 1, 3 do rng:NextNumber(-1.5, 1.5); rng:NextNumber(-1.5, 1.5); rng:NextNumber(2.5, 4) end
|
||||||
|
if rng:NextNumber() < 0.5 then
|
||||||
|
for _ = 1, 4 do rng:NextNumber(-1.8, 1.8); rng:NextNumber(1.5, 2.6); rng:NextNumber(-1.8, 1.8); rng:NextInteger(1, 3) end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 4 do
|
for _ = 1, 4 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
||||||
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then
|
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then rng:NextNumber(2.5, 5); rng:NextNumber(0, 1); rng:NextNumber(0, 6); rng:NextNumber(0, 1) end
|
||||||
local s = rng:NextNumber(2.5, 5)
|
|
||||||
P({ Size = V(s, s * 0.7, s * 0.9), CFrame = CFrame.new(W + V(x, groundY(W.X + x, W.Z + z), z)) * CFrame.Angles(rng:NextNumber(0, 1), rng:NextNumber(0, 6), rng:NextNumber(0, 1)), Material = Enum.Material.Rock, Color = Color3.fromRGB(125, 125, 130) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- фонари вдоль дорожки
|
-- Счётчики позволяют быстро проверить бюджет локации в Studio.
|
||||||
lamp(W + V(6, GROUND_Y, 90))
|
local parts, lights, emitters = 0, 0, 0
|
||||||
lamp(W + V(-6, GROUND_Y, 90))
|
for _, child in ipairs(map:GetChildren()) do
|
||||||
|
if not previous[child] then
|
||||||
-- невидимые стены по краю мира
|
local instances = child:GetDescendants()
|
||||||
for _, w in ipairs({
|
table.insert(instances, child)
|
||||||
{ V(0, 0, 245), V(500, 120, 2) },
|
for _, obj in ipairs(instances) do
|
||||||
{ V(0, 0, -245), V(500, 120, 2) },
|
if obj:IsA("BasePart") then parts += 1
|
||||||
{ V(245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("PointLight") or obj:IsA("SpotLight") then lights += 1
|
||||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("ParticleEmitter") then emitters += 1 end
|
||||||
}) do
|
|
||||||
P({ Size = w[2], Position = W + w[1] + V(0, 40, 0), Transparency = 1 })
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
scenery:SetAttribute("PartCount", parts)
|
||||||
|
scenery:SetAttribute("LightCount", lights)
|
||||||
|
scenery:SetAttribute("EmitterCount", emitters)
|
||||||
|
if parts > 3000 or lights > 25 or emitters > 10 then warn("[World1] Превышен бюджет деталей или эффектов", parts, lights, emitters) end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------- помощники для новых миров
|
---------------------------------------------------------------- помощники для новых миров
|
||||||
|
|
||||||
@@ -2428,7 +2679,7 @@ do
|
|||||||
below, above = lakeState(l)
|
below, above = lakeState(l)
|
||||||
if not lakeOk(below, above) then
|
if not lakeOk(below, above) then
|
||||||
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
||||||
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, Color3.fromRGB(30, 120, 150))
|
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, w1.water)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -5372,21 +5623,109 @@ local lastWorldId = "none"
|
|||||||
local terrain = workspace.Terrain
|
local terrain = workspace.Terrain
|
||||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||||
|
|
||||||
|
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
||||||
|
local lakeDefaults
|
||||||
|
|
||||||
local function applyAmbience(world)
|
local function applyAmbience(world)
|
||||||
local clock = (world and world.clock) or 14.5
|
local lake = world and world.id == "World1"
|
||||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
|
||||||
terrain.WaterColor = (world and world.water) or defaultWater
|
|
||||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||||
|
local bloom = Lighting:FindFirstChildOfClass("BloomEffect")
|
||||||
|
local grade = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||||
|
local rays = Lighting:FindFirstChildOfClass("SunRaysEffect")
|
||||||
|
if not lakeDefaults then
|
||||||
|
lakeDefaults = {
|
||||||
|
ambient = Lighting.Ambient, outdoor = Lighting.OutdoorAmbient,
|
||||||
|
brightness = Lighting.Brightness, exposure = Lighting.ExposureCompensation,
|
||||||
|
latitude = Lighting.GeographicLatitude, reflectance = terrain.WaterReflectance,
|
||||||
|
haze = atm and atm.Haze or 0.6, decay = atm and atm.Decay or Color3.fromRGB(110, 140, 175),
|
||||||
|
bloom = bloom and bloom.Intensity or 0.5, threshold = bloom and bloom.Threshold or 1.4,
|
||||||
|
tint = grade and grade.TintColor or Color3.new(1, 1, 1),
|
||||||
|
contrast = grade and grade.Contrast or 0.06, rays = rays and rays.Intensity or 0.05,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
local base = lakeDefaults
|
||||||
|
TweenService:Create(Lighting, TweenInfo.new(2), {
|
||||||
|
ClockTime = (world and world.clock) or 14.5,
|
||||||
|
Ambient = lake and Color3.fromRGB(108, 100, 85) or base.ambient,
|
||||||
|
OutdoorAmbient = lake and Color3.fromRGB(157, 160, 144) or base.outdoor,
|
||||||
|
Brightness = lake and 2.5 or base.brightness,
|
||||||
|
ExposureCompensation = lake and 0.08 or base.exposure,
|
||||||
|
GeographicLatitude = lake and 35 or base.latitude,
|
||||||
|
}):Play()
|
||||||
|
terrain.WaterColor = (world and world.water) or defaultWater
|
||||||
|
terrain.WaterTransparency = (world and world.waterTransparency) or 0.15
|
||||||
|
terrain.WaterReflectance = lake and 0.12 or base.reflectance
|
||||||
if atm then
|
if atm then
|
||||||
local frost = world and world.id == "World3"
|
local frost = world and world.id == "World3"
|
||||||
TweenService:Create(atm, TweenInfo.new(2), {
|
TweenService:Create(atm, TweenInfo.new(2), {
|
||||||
Density = frost and 0.38 or 0.25,
|
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
||||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
Color = lake and Color3.fromRGB(205, 222, 232) or (frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232)),
|
||||||
|
Decay = lake and Color3.fromRGB(155, 173, 177) or base.decay,
|
||||||
|
Haze = lake and 1 or base.haze,
|
||||||
}):Play()
|
}):Play()
|
||||||
end
|
end
|
||||||
|
if bloom then TweenService:Create(bloom, TweenInfo.new(2), { Intensity = lake and 0.25 or base.bloom, Threshold = lake and 1.5 or base.threshold }):Play() end
|
||||||
|
if grade then
|
||||||
|
TweenService:Create(grade, TweenInfo.new(2), {
|
||||||
|
TintColor = lake and Color3.fromRGB(255, 242, 220) or base.tint,
|
||||||
|
Contrast = lake and 0.08 or base.contrast,
|
||||||
|
}):Play()
|
||||||
|
end
|
||||||
|
if rays then rays.Intensity = lake and 0.06 or base.rays end
|
||||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Восемь силуэтов обновляются локально 20 раз в секунду и только рядом с озером.
|
||||||
|
local fishScenery, ambientFish, waterfallRipples = nil, {}, {}
|
||||||
|
local fishElapsed = 0
|
||||||
|
RunService.Heartbeat:Connect(function(dt)
|
||||||
|
fishElapsed += dt
|
||||||
|
if fishElapsed < 0.05 then return end
|
||||||
|
fishElapsed = 0
|
||||||
|
local world = currentWorld()
|
||||||
|
if not world or world.id ~= "World1" then return end
|
||||||
|
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if not root or (root.Position - world.center).Magnitude > 180 then return end
|
||||||
|
if not fishScenery or not fishScenery.Parent or #ambientFish == 0 then
|
||||||
|
local map = workspace:FindFirstChild("FishingMap")
|
||||||
|
fishScenery = map and map:FindFirstChild("World1Scenery")
|
||||||
|
ambientFish, waterfallRipples = {}, {}
|
||||||
|
if fishScenery then
|
||||||
|
for _, child in ipairs(fishScenery:GetChildren()) do
|
||||||
|
if child:IsA("Model") and child.Name == "AmbientFish" then table.insert(ambientFish, child) end
|
||||||
|
if child:IsA("Model") and child.Name == "WaterfallRipple" then table.insert(waterfallRipples, child) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
for _, ripple in ipairs(waterfallRipples) do
|
||||||
|
if ripple.Parent then
|
||||||
|
local center = ripple:GetAttribute("RippleCenter")
|
||||||
|
local phase = (now * 0.3 + ripple:GetAttribute("RipplePhase")) % 1
|
||||||
|
local radius = 2 + phase * 8
|
||||||
|
for _, segment in ipairs(ripple:GetChildren()) do
|
||||||
|
local index = segment:GetAttribute("RippleSegment")
|
||||||
|
local a, b = index * math.pi / 6, (index + 1) * math.pi / 6
|
||||||
|
local p = center + Vector3.new(math.cos(a) * radius, 0, math.sin(a) * radius)
|
||||||
|
local q = center + Vector3.new(math.cos(b) * radius, 0, math.sin(b) * radius)
|
||||||
|
segment.Size = Vector3.new((q - p).Magnitude, 0.07, 0.07)
|
||||||
|
segment.CFrame = CFrame.lookAt((p + q) / 2, q) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
segment.Transparency = 0.6 + phase * 0.4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, fish in ipairs(ambientFish) do
|
||||||
|
if fish.Parent then
|
||||||
|
local center, radius = fish:GetAttribute("SwimCenter"), fish:GetAttribute("SwimRadius")
|
||||||
|
local angle = now * fish:GetAttribute("SwimSpeed") + fish:GetAttribute("SwimPhase")
|
||||||
|
local pos = center + Vector3.new(math.cos(angle) * radius, 0, math.sin(angle) * radius * 0.65)
|
||||||
|
local direction = Vector3.new(-math.sin(angle), 0, math.cos(angle) * 0.65)
|
||||||
|
fish:PivotTo(CFrame.lookAt(pos, pos + direction))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
while true do
|
while true do
|
||||||
local w = currentWorld()
|
local w = currentWorld()
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ Config.Worlds = {
|
|||||||
{
|
{
|
||||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
desc = "Уютное лесное озеро: прозрачная бирюзовая вода, солнечный причал и водопад среди сосен.",
|
||||||
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
|
clock = 16.2, water = Color3.fromRGB(40, 170, 165),
|
||||||
|
waterTransparency = 0.6,
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,26 +52,35 @@ terrain.WaterWaveSpeed = 12
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
||||||
|
|
||||||
local W = V(0, 0, 1500) -- центр Мира 1
|
local W = Config.Worlds[1].center
|
||||||
local GROUND_Y = 4 -- верх земли
|
local GROUND_Y, WATER_Y = 4, 0
|
||||||
local WATER_Y = 0 -- поверхность воды
|
|
||||||
|
|
||||||
-- озеро из нескольких кругов: { x, z, радиус }
|
|
||||||
local LAKES = Config.Worlds[1].lakes
|
local LAKES = Config.Worlds[1].lakes
|
||||||
|
local WORLD1_TRAIL = {
|
||||||
|
V(-104, 4.3, -34), V(-117, 7, -62), V(-108, 12, -90),
|
||||||
|
V(-83, 19, -110), V(-62, 25, -96), V(-43, 32, -119),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Лесистый берег, холм с вышкой и скала справа от озера.
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
||||||
-- холмы по краям
|
|
||||||
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
||||||
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
||||||
end
|
end
|
||||||
-- порядок важен: песок → выемка → ил → вода
|
terrain:FillBall(W + V(-48, -7, -121), 42, Enum.Material.Grass)
|
||||||
|
terrain:FillBall(W + V(-89, -7, -101), 30, Enum.Material.Grass)
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(-43, 29, -119)), 6, 17, Enum.Material.Grass)
|
||||||
|
for _, p in ipairs(WORLD1_TRAIL) do
|
||||||
|
terrain:FillBall(W + p - V(0, 9, 0), 10, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 15, -78)), V(40, 30, 52), Enum.Material.Rock)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(67, 9, -83)), V(18, 18, 39), Enum.Material.Slate)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 29, -86)), V(40, 2, 35), Enum.Material.Grass)
|
||||||
|
|
||||||
|
-- Чаша озера: песок, выемка, дно, вода; круги совпадают с FishConfig.
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
||||||
end
|
|
||||||
for _, l in ipairs(LAKES) do
|
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
@@ -80,34 +89,39 @@ end
|
|||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||||
end
|
end
|
||||||
-- то же самое напрямую по вокселям: вода ниже WATER_Y, воздух выше.
|
|
||||||
-- Fill* с Air иногда оставляет песок над водой, и озеро выглядит сухим.
|
-- Мелководье вычисляется по объединению кругов: на пересечениях нет песчаных стенок.
|
||||||
local function carveLake(l)
|
local function carveLake(l)
|
||||||
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 12, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 16, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
||||||
local mats, occ = terrain:ReadVoxels(region, 4)
|
local mats, occ = terrain:ReadVoxels(region, 4)
|
||||||
local size = mats.Size
|
local size, corner = mats.Size, region.CFrame.Position - region.Size / 2
|
||||||
local corner = region.CFrame.Position - region.Size / 2
|
|
||||||
local center = W + V(l[1], 0, l[2])
|
|
||||||
for x = 1, size.X do
|
for x = 1, size.X do
|
||||||
for y = 1, size.Y do
|
|
||||||
for z = 1, size.Z do
|
for z = 1, size.Z do
|
||||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
local px, pz = corner.X + (x - 0.5) * 4 - W.X, corner.Z + (z - 0.5) * 4 - W.Z
|
||||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
if (px - l[1]) ^ 2 + (pz - l[2]) ^ 2 <= l[3] ^ 2 then
|
||||||
local water = c.Y < WATER_Y
|
local inland = 0
|
||||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
for _, lake in ipairs(LAKES) do
|
||||||
occ[x][y][z] = water and 1 or 0
|
inland = math.max(inland, lake[3] - math.sqrt((px - lake[1]) ^ 2 + (pz - lake[2]) ^ 2))
|
||||||
|
end
|
||||||
|
local floor = -3 - math.min(inland / 18, 1) * 8
|
||||||
|
for y = 1, size.Y do
|
||||||
|
local py = corner.Y + (y - 0.5) * 4
|
||||||
|
local mat = Enum.Material.Air
|
||||||
|
if py < floor then mat = inland < 20 and Enum.Material.Sand or Enum.Material.Mud
|
||||||
|
elseif py < WATER_Y then mat = Enum.Material.Water end
|
||||||
|
mats[x][y][z], occ[x][y][z] = mat, mat == Enum.Material.Air and 0 or 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
terrain:WriteVoxels(region, 4, mats, occ)
|
terrain:WriteVoxels(region, 4, mats, occ)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do carveLake(l) end
|
||||||
carveLake(l)
|
|
||||||
end
|
-- Прибытие и короткий подход к главному причалу.
|
||||||
-- дорожка от точки прибытия к причалу и площадка
|
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(12, 4, 14), Enum.Material.Ground)
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(8, 4, 14), Enum.Material.Ground)
|
terrain:FillCylinder(CFrame.new(W + V(0, 2, 94)), 4, 13, Enum.Material.Cobblestone)
|
||||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 96)), 4, 12, Enum.Material.Cobblestone)
|
|
||||||
|
|
||||||
---------------------------------------------------------------- точка появления в лобби
|
---------------------------------------------------------------- точка появления в лобби
|
||||||
|
|
||||||
@@ -779,236 +793,472 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
||||||
|
|
||||||
local function inLake(x, z, extra)
|
do
|
||||||
for _, l in ipairs(LAKES) do
|
local previous = {}
|
||||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
for _, child in ipairs(map:GetChildren()) do previous[child] = true end
|
||||||
return true
|
local sharedRng = rng
|
||||||
|
local rng = sharedRng:Clone()
|
||||||
|
local scenery = Instance.new("Model")
|
||||||
|
scenery.Name = "World1Scenery"
|
||||||
|
scenery:SetAttribute("WorldId", "World1")
|
||||||
|
scenery.Parent = map
|
||||||
|
local C = {
|
||||||
|
wood = Color3.fromRGB(190, 135, 85), dark = Color3.fromRGB(120, 80, 50),
|
||||||
|
rope = Color3.fromRGB(215, 180, 125), roof = Color3.fromRGB(60, 100, 75),
|
||||||
|
pine = Color3.fromRGB(45, 105, 60), pineDark = Color3.fromRGB(35, 85, 50),
|
||||||
|
grass = Color3.fromRGB(125, 180, 75), rock = Color3.fromRGB(140, 138, 150),
|
||||||
|
moss = Color3.fromRGB(95, 130, 70), warm = Color3.fromRGB(255, 200, 120),
|
||||||
|
}
|
||||||
|
local function part(props)
|
||||||
|
props.Parent = props.Parent or scenery
|
||||||
|
if props.CanCollide == nil then props.CanCollide = false end
|
||||||
|
if props.CanQuery == nil then props.CanQuery = props.CanCollide end
|
||||||
|
props.CanTouch = false
|
||||||
|
if props.CastShadow == nil then props.CastShadow = props.CanCollide end
|
||||||
|
return P(props)
|
||||||
end
|
end
|
||||||
|
local function block(name, size, cf, color, material, solid)
|
||||||
|
return part({ Name = name, Size = size, CFrame = cf, Color = color, Material = material or Enum.Material.SmoothPlastic, CanCollide = solid or false })
|
||||||
|
end
|
||||||
|
local function cylA(a, b, diameter, props)
|
||||||
|
props = props or {}
|
||||||
|
props.Shape, props.Size = Enum.PartType.Cylinder, V((b - a).Magnitude, diameter, diameter)
|
||||||
|
props.CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
return part(props)
|
||||||
|
end
|
||||||
|
local function sphere(pos, size, color, material)
|
||||||
|
return part({ Name = "ShoreDetail", Shape = Enum.PartType.Ball, Size = size, Position = pos, Color = color, Material = material or Enum.Material.SmoothPlastic })
|
||||||
|
end
|
||||||
|
local function inLake(x, z, margin)
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
if (x - l[1]) ^ 2 + (z - l[2]) ^ 2 < (l[3] + (margin or 0)) ^ 2 then return true end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
local function light(parent, range, brightness)
|
||||||
-- прибытие
|
local obj = Instance.new("PointLight")
|
||||||
-- всё рядом с главным причалом: прибытие → арка → причал, по бокам портал, скупка и дед
|
obj.Color, obj.Range, obj.Brightness, obj.Shadows = C.warm, range, brightness, false
|
||||||
local arrive = W + V(0, GROUND_Y, 94)
|
obj.Parent = parent
|
||||||
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
|
||||||
arch(CFrame.new(W + V(0, GROUND_Y, 82)), 14, 11, "🌊 ТИХОЕ ОЗЕРО", Color3.fromRGB(80, 200, 255))
|
|
||||||
portal(CFrame.lookAt(W + V(-22, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
|
||||||
-- точки для линии-подсказки: конец главного причала и место перед скупкой
|
|
||||||
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.5, 42)))
|
|
||||||
marker("GuideSell", CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive) * CFrame.new(0, 0, -10))
|
|
||||||
local w1Counter = stall(CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive), {
|
|
||||||
title = "💰 СКУПКА",
|
|
||||||
titleColor = Color3.fromRGB(150, 255, 160),
|
|
||||||
wall = Color3.fromRGB(150, 115, 80),
|
|
||||||
stripeA = Color3.fromRGB(50, 150, 80),
|
|
||||||
stripeB = Color3.fromRGB(245, 240, 230),
|
|
||||||
glow = Color3.fromRGB(80, 230, 120),
|
|
||||||
action = "Sell",
|
|
||||||
promptText = "Продать всю рыбу",
|
|
||||||
promptObject = "Скупка",
|
|
||||||
npcName = "Скупщик Гриша",
|
|
||||||
npcColors = { skin = Color3.fromRGB(200, 150, 110), shirt = Color3.fromRGB(70, 130, 80), pants = Color3.fromRGB(60, 50, 40), hat = Color3.fromRGB(200, 170, 110) },
|
|
||||||
})
|
|
||||||
w1Counter:SetAttribute("GuideTarget", "Sell") -- прилавок подсвечивается на шаге обучения
|
|
||||||
|
|
||||||
-- доска «Кто водится в озере»
|
|
||||||
do
|
|
||||||
local pos = W + V(-15, GROUND_Y, 80)
|
|
||||||
local cf = CFrame.lookAt(pos, arrive)
|
|
||||||
for _, x in ipairs({ -6, 6 }) do
|
|
||||||
P({ Size = V(0.8, 11, 0.8), CFrame = cf * CFrame.new(x, 5.5, 0.3), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 40) })
|
|
||||||
end
|
end
|
||||||
local board = P({ Size = V(13, 10, 0.5), CFrame = cf * CFrame.new(0, 7, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(70, 48, 32) })
|
local function lantern(cf)
|
||||||
local lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
local bulb = block("Lantern", V(0.8, 1.15, 0.8), cf, C.warm, Enum.Material.Neon)
|
||||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
light(bulb, 14, 0.8)
|
||||||
local r = Config.Rarities[f.rarity]
|
for _, y in ipairs({ -0.7, 0.7 }) do block("LanternCap", V(1.25, 0.2, 1.25), cf * CFrame.new(0, y, 0), C.dark, Enum.Material.Metal) end
|
||||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
for _, x in ipairs({ -0.48, 0.48 }) do
|
||||||
|
for _, z in ipairs({ -0.48, 0.48 }) do block("LanternFrame", V(0.1, 1.4, 0.1), cf * CFrame.new(x, 0, z), C.dark, Enum.Material.Metal) end
|
||||||
end
|
end
|
||||||
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
|
||||||
end
|
end
|
||||||
|
local function lanternPost(pos)
|
||||||
-- костёр с брёвнами
|
cylA(pos, pos + V(0, 5, 0), 0.4, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
do
|
lantern(CFrame.new(pos + V(0, 5.4, 0)))
|
||||||
local c = W + V(-8, GROUND_Y, 110)
|
end
|
||||||
|
local function ropeRing(pos, radius)
|
||||||
for i = 0, 7 do
|
for i = 0, 7 do
|
||||||
local a = i / 8 * math.pi * 2
|
local a, b = i * math.pi / 4, (i + 1) * math.pi / 4
|
||||||
ball(c + V(math.cos(a) * 2.2, 0.3, math.sin(a) * 2.2), 1, { Color = Color3.fromRGB(120, 120, 125), Material = Enum.Material.Rock })
|
cylA(pos + V(math.cos(a) * radius, 0, math.sin(a) * radius), pos + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.16, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
end
|
|
||||||
for i = 0, 2 do
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(3, 0.6, 0.6), CFrame = CFrame.new(c + V(0, 0.4, 0)) * CFrame.Angles(0, i * math.pi / 3, 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 35) })
|
|
||||||
end
|
|
||||||
local fireBase = P({ Size = V(1, 1, 1), Position = c + V(0, 0.8, 0), Transparency = 1, CanCollide = false })
|
|
||||||
local fire = Instance.new("Fire")
|
|
||||||
fire.Size = 5
|
|
||||||
fire.Heat = 9
|
|
||||||
fire.Parent = fireBase
|
|
||||||
local light = Instance.new("PointLight")
|
|
||||||
light.Color = Color3.fromRGB(255, 160, 80)
|
|
||||||
light.Range = 20
|
|
||||||
light.Brightness = 2
|
|
||||||
light.Parent = fireBase
|
|
||||||
for _, a in ipairs({ 0, 2.1, 4.2 }) do
|
|
||||||
local p = c + V(math.cos(a) * 6, 0.6, math.sin(a) * 6)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 1.4, 1.4), CFrame = CFrame.lookAt(p, c) * CFrame.Angles(0, math.rad(90), 0) * CFrame.Angles(0, math.rad(90), 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(115, 80, 50) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function pier(center, size, primary)
|
||||||
-- дед-рыбак с подсказками
|
local cf = CFrame.new(center)
|
||||||
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 86), arrive + V(0, 3, 0)), {
|
local deck = block("PierDeck", size, cf, C.wood, Enum.Material.WoodPlanks, true)
|
||||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
if primary then deck:SetAttribute("GuideTarget", "Pier") end
|
||||||
}, "Talk", "Поговорить")
|
|
||||||
|
|
||||||
-- домик рыбака
|
|
||||||
do
|
|
||||||
local cf = CFrame.lookAt(W + V(-44, GROUND_Y, 98), W + V(0, GROUND_Y, 98))
|
|
||||||
local logC = Color3.fromRGB(130, 90, 55)
|
|
||||||
P({ Size = V(14, 1, 12), CFrame = cf * CFrame.new(0, 0.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(110, 80, 50) })
|
|
||||||
P({ Size = V(14, 8, 1), CFrame = cf * CFrame.new(0, 5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(1, 8, 12), CFrame = cf * CFrame.new(s * 6.5, 5, 0), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(5, 8, 1), CFrame = cf * CFrame.new(s * 4.5, 5, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(16, 1, 8.8), CFrame = cf * CFrame.new(0, 11.2, s * 3.4) * CFrame.Angles(math.rad(-s * 38), 0, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 60, 45) })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 2, 1), CFrame = cf * CFrame.new(0, 8, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(2.2, 2, 0.3), CFrame = cf * CFrame.new(-4.5, 5.5, -6.05), Material = Enum.Material.Glass, Color = Color3.fromRGB(255, 225, 150), Transparency = 0.2 })
|
|
||||||
P({ Size = V(14, 3, 1), CFrame = cf * CFrame.new(0, 10.5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- причалы
|
|
||||||
local function pier(center, size)
|
|
||||||
local deck = P({ Size = size, Position = center, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 110, 70) })
|
|
||||||
local alongZ = size.Z > size.X
|
local alongZ = size.Z > size.X
|
||||||
local len = alongZ and size.Z or size.X
|
local length, width = alongZ and size.Z or size.X, alongZ and size.X or size.Z
|
||||||
local wid = alongZ and size.X or size.Z
|
for d = -length / 2 + 1, length / 2 - 0.5, 2 do
|
||||||
for d = -len / 2 + 1, len / 2 - 1, 6 do
|
local offset = alongZ and V(0, 0.34, d) or V(d, 0.34, 0)
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
local boardSize = alongZ and V(width, 0.16, 1.88) or V(1.88, 0.16, width)
|
||||||
local off = alongZ and V(s * (wid / 2 - 0.4), 0, d) or V(d, 0, s * (wid / 2 - 0.4))
|
block("IndividualPlank", boardSize, cf + offset, C.wood:Lerp(C.dark, rng:NextNumber(0, 0.12)), Enum.Material.WoodPlanks)
|
||||||
vcyl(center + off + V(0, -6, 0), 13, 0.9, { Color = Color3.fromRGB(100, 70, 45), Material = Enum.Material.Wood })
|
end
|
||||||
|
for d = -length / 2 + 1, length / 2 - 1, 8 do
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
local p = center + (alongZ and V(side * (width / 2 - 0.4), 0, d) or V(d, 0, side * (width / 2 - 0.4)))
|
||||||
|
cylA(p - V(0, 7, 0), p + V(0, 1.8, 0), 1.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
ropeRing(p + V(0, 0.8, 0), 0.7)
|
||||||
|
ropeRing(p + V(0, 1.05, 0), 0.7)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return deck
|
return deck
|
||||||
end
|
end
|
||||||
-- { центр от W, размер }
|
local function fishSign(cf, width, height, color)
|
||||||
local PIERS = {
|
local panel = block("FishSign", V(width, height, 0.22), cf, color, Enum.Material.WoodPlanks)
|
||||||
{ V(0, GROUND_Y + 0.2, 58), V(8, 0.6, 42) },
|
for _, face in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||||
{ V(-86, GROUND_Y + 0.2, 15), V(34, 0.6, 7) },
|
local sg = Instance.new("SurfaceGui")
|
||||||
{ V(86, GROUND_Y + 0.2, -10), V(34, 0.6, 7) },
|
sg.Face, sg.LightInfluence, sg.PixelsPerStud = face, 0, 30
|
||||||
}
|
sg.SizingMode, sg.Parent = Enum.SurfaceGuiSizingMode.PixelsPerStud, panel
|
||||||
for i, p in ipairs(PIERS) do
|
local body = Instance.new("Frame")
|
||||||
local deck = pier(W + p[1], p[2])
|
body.Size, body.Position = UDim2.fromScale(0.5, 0.4), UDim2.fromScale(0.2, 0.3)
|
||||||
if i == 1 then
|
body.BackgroundColor3, body.BorderSizePixel, body.Parent = Color3.fromRGB(245, 239, 214), 0, sg
|
||||||
deck:SetAttribute("GuideTarget", "Pier") -- главный причал подсвечивается на шаге обучения
|
local curve = Instance.new("UICorner")
|
||||||
|
curve.CornerRadius, curve.Parent = UDim.new(1, 0), body
|
||||||
|
local tail = Instance.new("TextLabel")
|
||||||
|
tail.Size, tail.Position, tail.BackgroundTransparency = UDim2.fromScale(0.3, 0.65), UDim2.fromScale(0.59, 0.175), 1
|
||||||
|
tail.Text, tail.TextScaled, tail.TextColor3, tail.Parent = "◀", true, body.BackgroundColor3, sg
|
||||||
|
local eye = Instance.new("Frame")
|
||||||
|
eye.Size, eye.Position, eye.BorderSizePixel = UDim2.fromScale(0.045, 0.08), UDim2.fromScale(0.26, 0.43), 0
|
||||||
|
eye.BackgroundColor3, eye.Parent = color, sg
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function smoke(chimney)
|
||||||
|
local effect = Instance.new("ParticleEmitter")
|
||||||
|
effect.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
effect.Rate, effect.Lifetime, effect.Speed = 3, NumberRange.new(3, 5), NumberRange.new(1.5, 2.5)
|
||||||
|
effect.Acceleration, effect.SpreadAngle = V(0.7, 0.5, 0), Vector2.new(10, 10)
|
||||||
|
effect.Color = ColorSequence.new(Color3.fromRGB(220, 223, 219))
|
||||||
|
effect.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.8), NumberSequenceKeypoint.new(1, 4) })
|
||||||
|
effect.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.3), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
effect.Parent = chimney
|
||||||
|
end
|
||||||
|
local function pine(pos, height)
|
||||||
|
cylA(pos, pos + V(0, height * 0.8, 0), height * 0.075, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
local tint = C.pine:Lerp(C.pineDark, rng:NextNumber())
|
||||||
|
for i = 0, 3 do
|
||||||
|
local width = height * (0.6 - i * 0.115)
|
||||||
|
local p = pos + V(0, height * (0.38 + i * 0.18), 0)
|
||||||
|
local lower = block("PineCanopy", V(width, height * 0.26, width), CFrame.new(p) * CFrame.Angles(0, math.pi / 4, 0), tint)
|
||||||
|
lower.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function cabin(pos, lookAt, scale)
|
||||||
|
local cf = CFrame.lookAt(pos, lookAt)
|
||||||
|
local function at(x, y, z) return cf * CFrame.new(x * scale, y * scale, z * scale) end
|
||||||
|
block("CabinFloor", V(21, 0.6, 19) * scale, at(0, 0.3, 0), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for row = 0, 7 do
|
||||||
|
local y = 1 + row * 0.95
|
||||||
|
cylA(at(-9, y, 7).Position, at(9, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(at(side * 8.5, y, -6).Position, at(side * 8.5, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
cylA(at(side * 2, y, -6).Position, at(side * 9, y, -6).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("GreenGableRoof", V(11.6, 0.65, 18) * scale, at(side * 4.7, 10.2, 0.5) * CFrame.Angles(0, 0, -side * 0.53), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
block("RoofTrim", V(12, 0.5, 0.5) * scale, at(side * 4.7, 10.2, -8.5) * CFrame.Angles(0, 0, -side * 0.53), C.dark, Enum.Material.Wood)
|
||||||
|
local window = block("GoldenWindow", V(3.1, 3, 0.2) * scale, at(side * 5.1, 4.7, -6.55), C.warm, Enum.Material.Neon)
|
||||||
|
if side == -1 then light(window, 12, 0.55) end
|
||||||
|
block("WindowMullion", V(0.18, 3.2, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
block("WindowMullion", V(3.3, 0.18, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
cylA(at(side * 9, -5, -7).Position, at(side * 9, 0, -7).Position, 0.8 * scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do block("PorchStep", V(5, 0.3 + i * 0.25, 1) * scale, at(0, -0.3 + i * 0.1, -11 + i), C.wood, Enum.Material.WoodPlanks, true) end
|
||||||
|
lantern(at(-7.3, 3, -8.3))
|
||||||
|
block("StoneChimney", V(2.3, 7, 2.3) * scale, at(4, 12.5, 4), C.rock, Enum.Material.Cobblestone, true)
|
||||||
|
local outlet = block("SmokeOutlet", V(1, 0.1, 1), at(4, 16, 4), C.rock)
|
||||||
|
outlet.Transparency = 1
|
||||||
|
smoke(outlet)
|
||||||
|
end
|
||||||
|
local function crate(cf)
|
||||||
|
block("WoodenCrate", V(2.5, 2.5, 2.5), cf, C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, y in ipairs({ -0.9, 0.9 }) do block("CrateBand", V(2.6, 0.22, 2.6), cf * CFrame.new(0, y, 0), C.wood, Enum.Material.Wood) end
|
||||||
|
end
|
||||||
|
|
||||||
lamp(W + V(-3.5, GROUND_Y + 0.5, 40), Color3.fromRGB(255, 220, 160))
|
-- Прибытие: всё необходимое находится в пределах 25 studs.
|
||||||
lamp(W + V(-70, GROUND_Y + 0.5, 18), Color3.fromRGB(255, 220, 160))
|
local arrive = W + V(0, GROUND_Y, 94)
|
||||||
lamp(W + V(70, GROUND_Y + 0.5, -13), Color3.fromRGB(255, 220, 160))
|
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
||||||
|
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.65, 40)))
|
||||||
|
portal(CFrame.lookAt(W + V(20, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
||||||
|
local shopCF = CFrame.lookAt(W + V(-18, GROUND_Y, 84), arrive)
|
||||||
|
marker("GuideSell", shopCF * CFrame.new(0, 0, -10))
|
||||||
|
local counter = stall(shopCF, {
|
||||||
|
title = "🐟 СКУПКА", titleColor = Color3.fromRGB(240, 230, 200),
|
||||||
|
wall = C.dark, stripeA = Color3.fromRGB(45, 105, 70), stripeB = Color3.fromRGB(240, 230, 200),
|
||||||
|
glow = C.warm, action = "Sell", promptText = "Продать всю рыбу", promptObject = "Скупка",
|
||||||
|
npcName = "Скупщик Гриша",
|
||||||
|
npcColors = { skin = Color3.fromRGB(220, 175, 133), shirt = C.roof, pants = Color3.fromRGB(80, 74, 52), hat = Color3.fromRGB(215, 180, 110) },
|
||||||
|
decor = function(at)
|
||||||
|
for i, color in ipairs({ Color3.fromRGB(110, 190, 60), Color3.fromRGB(245, 211, 64), Color3.fromRGB(241, 140, 55), Color3.fromRGB(70, 160, 219) }) do
|
||||||
|
local p = at(-5 + i * 2, 8.3, 6.7).Position
|
||||||
|
sphere(p, V(0.65, 1.6, 0.45), color)
|
||||||
|
cylA(p + V(0, 0.7, 0), p + V(0, 2.2, 0), 0.05, { Color = C.rope })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local p = at(-5 + i * 1.4, 5.9, -4).Position
|
||||||
|
sphere(p, V(0.75, 0.75, 0.75), Color3.fromRGB(240, 234, 219))
|
||||||
|
sphere(p + V(0, 0.3, 0), V(0.62, 0.5, 0.62), Color3.fromRGB(214, 66, 53))
|
||||||
|
end
|
||||||
|
block("CounterBox", V(3, 1, 2), at(5, 5.9, -4), C.wood, Enum.Material.WoodPlanks)
|
||||||
|
fishSign(at(0, 21.2, -9.2), 7, 2.6, C.roof)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
counter:SetAttribute("GuideTarget", "Sell")
|
||||||
|
lantern(shopCF * CFrame.new(-10, 7.3, -10))
|
||||||
|
crate(shopCF * CFrame.new(-13, 1.25, -11))
|
||||||
|
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 83), arrive + V(0, 3, 0)), {
|
||||||
|
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = C.roof,
|
||||||
|
}, "Talk", "Поговорить")
|
||||||
|
local boardCF = CFrame.lookAt(W + V(15, GROUND_Y, 74), arrive)
|
||||||
|
for _, x in ipairs({ -4.6, 4.6 }) do cylA((boardCF * CFrame.new(x, 0, 0)).Position, (boardCF * CFrame.new(x, 10, 0)).Position, 0.6, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
local board = block("World1Bestiary", V(10, 8, 0.4), boardCF * CFrame.new(0, 6, 0), C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
local lines = { "<font color=\"#FFE3A9\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||||
|
for _, fish in ipairs(Config.Zones.World1.fish) do
|
||||||
|
local rarity = Config.Rarities[fish.rarity]
|
||||||
|
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(rarity.color:ToHex(), fish.name, rarity.name))
|
||||||
|
end
|
||||||
|
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
||||||
|
|
||||||
-- лодка у западного причала
|
-- Дощатые причалы, кнехты с канатом и снасти на переднем плане.
|
||||||
|
pier(W + V(0, 4.2, 58), V(12, 0.6, 42), true)
|
||||||
|
pier(W + V(86, 4.2, -10), V(34, 0.6, 8))
|
||||||
|
pier(W + V(-86, 4.2, 15), V(34, 0.6, 8))
|
||||||
|
for _, p in ipairs({ V(-5, 4.7, 40), V(5, 4.7, 72), V(72, 4.7, -13) }) do lanternPost(W + p) end
|
||||||
|
crate(CFrame.new(W + V(-3.8, 5.9, 67)))
|
||||||
|
local tackle = CFrame.new(W + V(3.7, 5.4, 61))
|
||||||
|
block("TackleBox", V(2.6, 1.5, 1.6), tackle, Color3.fromRGB(91, 111, 101), Enum.Material.Metal)
|
||||||
|
block("TackleLid", V(2.8, 0.25, 1.8), tackle * CFrame.new(0, 0.85, 0), Color3.fromRGB(116, 130, 114), Enum.Material.Metal)
|
||||||
|
block("TackleLatch", V(0.3, 0.65, 0.12), tackle * CFrame.new(0, 0.3, -0.85), C.rope, Enum.Material.Metal)
|
||||||
|
for _, x in ipairs({ -0.45, 0.45 }) do block("HandleLeg", V(0.15, 0.4, 0.15), tackle * CFrame.new(x, 1.12, 0), C.dark, Enum.Material.Metal) end
|
||||||
|
block("TackleHandle", V(1, 0.15, 0.15), tackle * CFrame.new(0, 1.35, 0), C.dark, Enum.Material.Metal)
|
||||||
|
local boat = CFrame.new(W + V(19, 0.5, 44)) * CFrame.Angles(0, -0.3, 0)
|
||||||
|
block("BoatHull", V(4.5, 0.5, 10), boat, C.dark, Enum.Material.WoodPlanks)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("BoatGunwale", V(0.35, 1.5, 10), boat * CFrame.new(side * 2.2, 0.7, 0), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatEnd", V(4.5, 1.5, 0.4), boat * CFrame.new(0, 0.7, side * 4.8), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatSeat", V(4.3, 0.3, 1), boat * CFrame.new(0, 1, side * 2.1), C.dark, Enum.Material.WoodPlanks)
|
||||||
|
cylA((boat * CFrame.new(side * 0.8, 1.4, -2)).Position, (boat * CFrame.new(side * 3.6, 2.3, 2.4)).Position, 0.18, { Color = C.wood, Material = Enum.Material.Wood })
|
||||||
|
block("OarBlade", V(0.7, 0.15, 1.8), boat * CFrame.new(side * 3.8, 2.4, 2.7) * CFrame.Angles(0, side * 0.5, 0), C.wood, Enum.Material.Wood)
|
||||||
|
end
|
||||||
|
cylA(W + V(14, -5, 44), W + V(14, 3.3, 44), 0.9, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
cylA(W + V(14, 2, 44), (boat * CFrame.new(-2.2, 1, 0)).Position, 0.12, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
|
|
||||||
|
-- Домики и вывеска с рыбой вдоль левого берега.
|
||||||
|
cabin(W + V(-49, 5, 66), W + V(0, 5, 45), 1)
|
||||||
|
cabin(W + V(-91, 5, -30), W + V(-25, 5, 0), 0.75)
|
||||||
|
cylA(W + V(-78, 4, -42), W + V(-78, 16, -42), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
block("BannerArm", V(5, 0.4, 0.4), CFrame.new(W + V(-76, 15, -42)), C.dark, Enum.Material.Wood)
|
||||||
|
fishSign(CFrame.new(W + V(-75.5, 12, -42)), 3.5, 5, C.roof)
|
||||||
|
|
||||||
|
-- Подъём на холм: пологие отрезки дорожки и ограждение с одной стороны.
|
||||||
|
for i = 1, #WORLD1_TRAIL - 1 do
|
||||||
|
local a, b = W + WORLD1_TRAIL[i], W + WORLD1_TRAIL[i + 1]
|
||||||
|
local cf = CFrame.lookAt((a + b) / 2, b)
|
||||||
|
block("HillTrail", V(7, 0.5, (b - a).Magnitude + 1), cf, Color3.fromRGB(184, 148, 102), Enum.Material.Ground, true)
|
||||||
|
local side = cf.RightVector * 4.2
|
||||||
|
for _, p in ipairs({ a + side, b + side }) do cylA(p, p + V(0, 3, 0), 0.35, { Color = C.dark, Material = Enum.Material.Wood }) end
|
||||||
|
for _, h in ipairs({ 1.2, 2.5 }) do cylA(a + side + V(0, h, 0), b + side + V(0, h, 0), 0.22, { Color = C.wood, Material = Enum.Material.Wood }) end
|
||||||
|
if i < 5 then lanternPost(a - side) end
|
||||||
|
end
|
||||||
|
local top = W + V(-43, 32, -119)
|
||||||
|
for _, x in ipairs({ -5, 5 }) do
|
||||||
|
for _, z in ipairs({ -5, 5 }) do cylA(top + V(x, 0, z), top + V(x, 19, z), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
block("LookoutDeck", V(13, 0.65, 13), CFrame.new(top + V(0, 11, 0)), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("LookoutRoof", V(8, 0.6, 15), CFrame.new(top + V(side * 3.2, 21, 0)) * CFrame.Angles(0, 0, -side * 0.45), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
if side == 1 then
|
||||||
|
for _, x in ipairs({ -1, 1 }) do cylA(top + V(x * 1.8, 14, 5), top + V(x * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
else
|
||||||
|
cylA(top + V(-5, 14, -5), top + V(5, 14, -5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
cylA(top + V(side * 5, 14, -5), top + V(side * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 12 do block("LookoutSteps", V(3, 0.6 + i * 0.85, 1.3), CFrame.new(top + V(0, (0.6 + i * 0.85) / 2, 22 - i * 1.25)), C.dark, Enum.Material.WoodPlanks, true) end
|
||||||
|
cylA(top + V(5, 18, 0), top + V(5, 28, 0), 0.25, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
fishSign(CFrame.new(top + V(8, 26, 0)), 6, 3, C.roof)
|
||||||
|
lantern(CFrame.new(top + V(-4, 16, 4)))
|
||||||
|
|
||||||
|
-- Водопад: движущиеся ленты, пена и тихий встроенный звук воды.
|
||||||
|
for i = 0, 3 do
|
||||||
|
local x = 35 + i * 7
|
||||||
|
block("WaterfallRockFace", V(9, 28 + (i % 2) * 4, 7), CFrame.new(W + V(x, 14, -56)) * CFrame.Angles(0, i * 0.15, 0.04), C.rock, Enum.Material.Slate, true)
|
||||||
|
block("MossyLedge", V(9, 0.8, 8), CFrame.new(W + V(x, 29 + (i % 2) * 2, -57)), C.moss, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local x = 39 + i * 5
|
||||||
|
local sheet = block("WaterfallSheet", V(4.8, 30, 0.35), CFrame.new(W + V(x, 15.2, -50.7)), Color3.fromRGB(162, 224, 223), Enum.Material.Glass)
|
||||||
|
sheet.Transparency = 0.4
|
||||||
|
local upper, lower = Instance.new("Attachment"), Instance.new("Attachment")
|
||||||
|
upper.Position, lower.Position = V(0, 14.8, 0), V(0, -14.8, 0)
|
||||||
|
upper.Parent, lower.Parent = sheet, sheet
|
||||||
|
local beam = Instance.new("Beam")
|
||||||
|
beam.Attachment0, beam.Attachment1, beam.Width0, beam.Width1 = upper, lower, 4.8, 5.4
|
||||||
|
beam.Texture, beam.TextureSpeed, beam.TextureLength = "rbxasset://textures/particles/smoke_main.dds", 1.4, 6
|
||||||
|
beam.FaceCamera, beam.Color, beam.LightEmission = true, ColorSequence.new(Color3.fromRGB(224, 248, 242)), 0.15
|
||||||
|
beam.Transparency, beam.Parent = NumberSequence.new(0.35), sheet
|
||||||
|
local foam = sphere(W + V(x, 0.3, -48), V(7, 0.3, 5), Color3.fromRGB(231, 247, 235))
|
||||||
|
foam.Transparency = 0.35
|
||||||
|
local mist = Instance.new("ParticleEmitter")
|
||||||
|
mist.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
mist.Rate, mist.Lifetime, mist.Speed = 4, NumberRange.new(1, 2), NumberRange.new(1, 2.5)
|
||||||
|
mist.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.7), NumberSequenceKeypoint.new(1, 3) })
|
||||||
|
mist.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.6), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
mist.Color, mist.SpreadAngle, mist.Parent = ColorSequence.new(Color3.fromRGB(235, 249, 244)), Vector2.new(40, 40), foam
|
||||||
|
end
|
||||||
|
local soundAnchor = block("WaterfallSound", V(1, 1, 1), CFrame.new(W + V(45, 5, -48)), C.rock)
|
||||||
|
soundAnchor.Transparency = 1
|
||||||
|
local waterSound = Instance.new("Sound")
|
||||||
|
waterSound.Name, waterSound.SoundId = "WaterfallAmbience", "rbxasset://sounds/action_swim.mp3"
|
||||||
|
waterSound.Looped, waterSound.Volume, waterSound.PlaybackSpeed = true, 0.12, 0.65
|
||||||
|
waterSound.RollOffMinDistance, waterSound.RollOffMaxDistance = 10, 120
|
||||||
|
waterSound.Parent = soundAnchor
|
||||||
|
waterSound:Play()
|
||||||
|
for ring = 0, 2 do
|
||||||
|
local ripple = Instance.new("Model")
|
||||||
|
ripple.Name = "WaterfallRipple"
|
||||||
|
ripple:SetAttribute("RippleCenter", W + V(45, 0.16, -42))
|
||||||
|
ripple:SetAttribute("RipplePhase", ring / 3)
|
||||||
|
ripple.Parent = scenery
|
||||||
|
for segment = 0, 11 do
|
||||||
|
local a, b = segment * math.pi / 6, (segment + 1) * math.pi / 6
|
||||||
|
local p = W + V(45, 0.16, -42)
|
||||||
|
local radius = 2 + ring * 2
|
||||||
|
local line = cylA(p + V(math.cos(a) * radius, 0, math.sin(a) * radius), p + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.07, { Color = Color3.fromRGB(218, 242, 228), Transparency = 0.75, Parent = ripple })
|
||||||
|
line:SetAttribute("RippleSegment", segment)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local creek = block("NarrowFeederStream", V(5, 0.15, 48), CFrame.new(W + V(45, 30.2, -77)), Color3.fromRGB(62, 168, 165), Enum.Material.Glass)
|
||||||
|
creek.Transparency = 0.3
|
||||||
|
for _, x in ipairs({ 41.7, 48.3 }) do block("CreekBank", V(1.5, 0.7, 48), CFrame.new(W + V(x, 30.2, -77)), C.moss, Enum.Material.Grass, true) end
|
||||||
|
local previousBridge
|
||||||
|
for i = 0, 16 do
|
||||||
|
local t = i / 16
|
||||||
|
local pos = W + V(29 + t * 32, 30.7 + math.sin(t * math.pi) * 3.2, -77)
|
||||||
|
local slope = math.atan(math.cos(t * math.pi) * 3.2 * math.pi / 32)
|
||||||
|
block("ArchedBridgePlank", V(2.05, 0.45, 7), CFrame.new(pos) * CFrame.Angles(0, 0, slope), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(pos + V(0, 0, side * 3.3), pos + V(0, 3.2, side * 3.3), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
if previousBridge then cylA(previousBridge + V(0, 2.8, side * 3.3), pos + V(0, 2.8, side * 3.3), 0.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
previousBridge = pos
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(29, 30, -82), V(61, 30, -82) }) do lanternPost(W + p) end
|
||||||
|
|
||||||
|
-- Кувшинки и камыш стоят у внешнего берега, вдали от проходов.
|
||||||
|
for _, lake in ipairs(LAKES) do
|
||||||
|
for i = 1, 8 do
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local d = lake[3] - rng:NextNumber(3, 9)
|
||||||
|
local p = W + V(lake[1] + math.cos(a) * d, 0.13, lake[2] + math.sin(a) * d)
|
||||||
|
if not (math.abs(p.X - W.X) < 8 and p.Z - W.Z > 30) then
|
||||||
|
part({ Name = "LilyPad", Shape = Enum.PartType.Cylinder, Size = V(0.12, 2.6, 2.6), CFrame = CFrame.new(p) * CFrame.Angles(0, 0, math.pi / 2), Color = Color3.fromRGB(79, 147, 68) })
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for petal = 0, 4 do sphere(p + V(math.cos(petal * 1.26) * 0.3, 0.18, math.sin(petal * 1.26) * 0.3), V(0.55, 0.22, 0.4), Color3.fromRGB(239, 151, 177)) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 0, 9 do
|
||||||
|
local a = i * math.pi / 5
|
||||||
|
local x, z = lake[1] + math.cos(a) * (lake[3] + 2), lake[2] + math.sin(a) * (lake[3] + 2)
|
||||||
|
if not inLake(x, z, 0) and not (math.abs(x) < 15 and z > 30) and z < 73 then
|
||||||
|
for j = 1, 4 do
|
||||||
|
local h = rng:NextNumber(2.5, 4.8)
|
||||||
|
local p = W + V(x + rng:NextNumber(-1, 1), 0, z + rng:NextNumber(-1, 1))
|
||||||
|
cylA(p, p + V(0, h, 0), 0.12, { Color = Color3.fromRGB(105, 139, 60) })
|
||||||
|
cylA(p + V(0, h - 0.8, 0), p + V(0, h, 0), 0.3, { Color = Color3.fromRGB(120, 78, 43) })
|
||||||
|
end
|
||||||
|
local p = W + V(x, 0, z)
|
||||||
|
sphere(p, V(4, 2.5, 3.3), C.rock, Enum.Material.Rock)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 1, 8 do
|
||||||
|
local lake = LAKES[(i - 1) % #LAKES + 1]
|
||||||
|
local fish = Instance.new("Model")
|
||||||
|
fish.Name = "AmbientFish"
|
||||||
|
fish:SetAttribute("SwimCenter", W + V(lake[1], -1.8, lake[2]))
|
||||||
|
fish:SetAttribute("SwimRadius", 8 + (i % 3) * 4)
|
||||||
|
fish:SetAttribute("SwimPhase", i * 1.7)
|
||||||
|
fish:SetAttribute("SwimSpeed", 0.08 + i * 0.008)
|
||||||
|
fish.Parent = scenery
|
||||||
|
local cf = CFrame.new(W + V(lake[1], -1.8, lake[2]))
|
||||||
|
local body = part({ Name = "FishShadow", Shape = Enum.PartType.Ball, Size = V(0.7, 0.22, 2), CFrame = cf, Color = Color3.fromRGB(29, 85, 83), Transparency = 0.35, Parent = fish })
|
||||||
|
fish.PrimaryPart = body
|
||||||
|
part({ Name = "TailShadow", Size = V(1, 0.12, 0.7), CFrame = cf * CFrame.new(0, 0, 1.2) * CFrame.Angles(0, math.pi / 4, 0), Color = body.Color, Transparency = 0.4, Parent = fish })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Пояс сосен, отдельные деревья у воды и горы за границей мира.
|
||||||
|
for i = 0, 83 do
|
||||||
|
local a = i / 84 * math.pi * 2
|
||||||
|
local distance = rng:NextNumber(130, 230)
|
||||||
|
local x, z = math.cos(a) * distance, math.sin(a) * distance
|
||||||
|
if not (z < -65 and z > -145 and x > -125 and x < 85) then
|
||||||
|
pine(W + V(x, groundY(W.X + x, W.Z + z), z), rng:NextNumber(14, 24))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(-72, 4, 68), V(-101, 4, 41), V(96, 4, 30), V(108, 4, -48), V(-85, 25, -133), V(-20, 27, -139), V(35, 30, -94), V(61, 30, -98) }) do pine(W + p, rng:NextNumber(14, 20)) end
|
||||||
|
for _, p in ipairs({ V(-29, 4, 103), V(42, 4, 73), V(-72, 4, 49) }) do
|
||||||
|
cylA(W + p, W + p + V(0, 11, 0), 1, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for i = 0, 2 do sphere(W + p + V((i - 1) * 3, 11 + (i % 2) * 2, 0), V(9, 7, 8), C.grass) end
|
||||||
|
end
|
||||||
|
for i = 0, 6 do
|
||||||
|
local mountain = block("DistantMountain", V(85, 90 + (i % 3) * 22, 85), CFrame.new(W + V(-240 + i * 80, 30, -300)) * CFrame.Angles(0.2, i * 0.5, 0.15), Color3.fromRGB(131, 157, 168), Enum.Material.Slate)
|
||||||
|
mountain.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
for i = 0, 3 do
|
||||||
|
local cloud = sphere(W + V(-120 + i * 83, 115 + (i % 2) * 12, -210), V(40, 12, 22), Color3.fromRGB(245, 245, 231))
|
||||||
|
cloud.Name = "CumulusCloud"
|
||||||
|
sphere(cloud.Position + V(10, 4, 0), V(22, 15, 18), cloud.Color)
|
||||||
|
end
|
||||||
|
for _, wall in ipairs({ { V(0, 40, 245), V(500, 120, 2) }, { V(0, 40, -245), V(500, 120, 2) }, { V(245, 40, 0), V(2, 120, 500) }, { V(-245, 40, 0), V(2, 120, 500) } }) do
|
||||||
|
part({ Name = "WorldBoundary", Position = W + wall[1], Size = wall[2], Transparency = 1, CanCollide = true, CanQuery = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Сохраняем прежнюю последовательность rng для неизменённых Миров 2 и 3.
|
||||||
do
|
do
|
||||||
local cf = CFrame.new(W + V(-74, WATER_Y + 0.3, 24)) * CFrame.Angles(0, math.rad(15), 0)
|
local rng = sharedRng
|
||||||
local hull = Color3.fromRGB(170, 70, 50)
|
|
||||||
P({ Size = V(4, 0.5, 9), CFrame = cf, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(0.4, 1.4, 9), CFrame = cf * CFrame.new(s * 2, 0.7, 0), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
P({ Size = V(4.4, 1.4, 0.4), CFrame = cf * CFrame.new(0, 0.7, s * 4.5), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 0.3, 1.2), CFrame = cf * CFrame.new(0, 1, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- кувшинки и камыши
|
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 7 do
|
for _ = 1, 7 do rng:NextNumber(0, math.pi * 2); rng:NextNumber(6, l[3] - 5); rng:NextNumber(2, 3.5); rng:NextNumber() end
|
||||||
local a, d = rng:NextNumber(0, math.pi * 2), rng:NextNumber(6, l[3] - 5)
|
|
||||||
local x, z = l[1] + math.cos(a) * d, l[2] + math.sin(a) * d
|
|
||||||
local size = rng:NextNumber(2, 3.5)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(0.15, size, size), CFrame = CFrame.new(W + V(x, WATER_Y + 0.28, z)) * CFrame.Angles(0, 0, math.rad(90)), Color = Color3.fromRGB(70, 150, 60), CanCollide = false })
|
|
||||||
if rng:NextNumber() < 0.4 then
|
|
||||||
ball(W + V(x + 0.3, WATER_Y + 0.55, z), 0.7, { Color = Color3.fromRGB(255, 150, 190), CanCollide = false })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for _ = 1, 9 do
|
for _ = 1, 9 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
||||||
local inOther = false
|
local other = false
|
||||||
for _, o in ipairs(LAKES) do
|
for _, o in ipairs(LAKES) do if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then other = true end end
|
||||||
if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then
|
if not other and not (math.abs(x) < 6 and z > 30) then for _ = 1, 5 do rng:NextNumber(3, 5); rng:NextNumber(-1.2, 1.2); rng:NextNumber(-1.2, 1.2) end end
|
||||||
inOther = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not inOther and not (math.abs(x) < 6 and z > 30) then
|
local function free(x, z)
|
||||||
for _ = 1, 5 do
|
return not inLake(x, z, 14) and (V(x, 0, z) - V(0, 0, 94)).Magnitude >= 36
|
||||||
local h = rng:NextNumber(3, 5)
|
and not (math.abs(x) < 9 and z > 60 and z < 125) and (V(x, 0, z) - V(-44, 0, 98)).Magnitude >= 14
|
||||||
local p = W + V(x + rng:NextNumber(-1.2, 1.2), WATER_Y + h / 2 - 0.5, z + rng:NextNumber(-1.2, 1.2))
|
|
||||||
P({ Size = V(0.18, h, 0.18), Position = p, Color = Color3.fromRGB(85, 130, 50), CanCollide = false })
|
|
||||||
P({ Size = V(0.35, 0.9, 0.35), Position = p + V(0, h / 2 - 0.3, 0), Color = Color3.fromRGB(110, 70, 40), CanCollide = false })
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- деревья, кусты, камни
|
|
||||||
local function freeSpot(x, z)
|
|
||||||
if inLake(x, z, 14) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(0, 0, 94)).Magnitude < 36 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if math.abs(x) < 9 and z > 60 and z < 125 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(-44, 0, 98)).Magnitude < 14 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
local placed = 0
|
local placed = 0
|
||||||
for _ = 1, 400 do
|
for _ = 1, 400 do
|
||||||
if placed >= 110 then
|
if placed >= 110 then break end
|
||||||
break
|
|
||||||
end
|
|
||||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
local y = groundY(W.X + x, W.Z + z)
|
|
||||||
local roll = rng:NextNumber()
|
local roll = rng:NextNumber()
|
||||||
tree(W + V(x, y - 0.5, z), roll < 0.35 and "pine" or (roll < 0.5 and "birch" or "round"))
|
if roll < 0.35 then rng:NextNumber(8, 12)
|
||||||
|
else rng:NextNumber(7, 10); if roll >= 0.5 then rng:NextInteger(135, 165) end; rng:NextNumber(9, 12) end
|
||||||
placed += 1
|
placed += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _ = 1, 60 do
|
for _ = 1, 60 do
|
||||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
bush(W + V(x, groundY(W.X + x, W.Z + z) - 0.6, z))
|
rng:NextInteger(120, 150)
|
||||||
|
for _ = 1, 3 do rng:NextNumber(-1.5, 1.5); rng:NextNumber(-1.5, 1.5); rng:NextNumber(2.5, 4) end
|
||||||
|
if rng:NextNumber() < 0.5 then
|
||||||
|
for _ = 1, 4 do rng:NextNumber(-1.8, 1.8); rng:NextNumber(1.5, 2.6); rng:NextNumber(-1.8, 1.8); rng:NextInteger(1, 3) end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 4 do
|
for _ = 1, 4 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
||||||
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then
|
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then rng:NextNumber(2.5, 5); rng:NextNumber(0, 1); rng:NextNumber(0, 6); rng:NextNumber(0, 1) end
|
||||||
local s = rng:NextNumber(2.5, 5)
|
|
||||||
P({ Size = V(s, s * 0.7, s * 0.9), CFrame = CFrame.new(W + V(x, groundY(W.X + x, W.Z + z), z)) * CFrame.Angles(rng:NextNumber(0, 1), rng:NextNumber(0, 6), rng:NextNumber(0, 1)), Material = Enum.Material.Rock, Color = Color3.fromRGB(125, 125, 130) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- фонари вдоль дорожки
|
-- Счётчики позволяют быстро проверить бюджет локации в Studio.
|
||||||
lamp(W + V(6, GROUND_Y, 90))
|
local parts, lights, emitters = 0, 0, 0
|
||||||
lamp(W + V(-6, GROUND_Y, 90))
|
for _, child in ipairs(map:GetChildren()) do
|
||||||
|
if not previous[child] then
|
||||||
-- невидимые стены по краю мира
|
local instances = child:GetDescendants()
|
||||||
for _, w in ipairs({
|
table.insert(instances, child)
|
||||||
{ V(0, 0, 245), V(500, 120, 2) },
|
for _, obj in ipairs(instances) do
|
||||||
{ V(0, 0, -245), V(500, 120, 2) },
|
if obj:IsA("BasePart") then parts += 1
|
||||||
{ V(245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("PointLight") or obj:IsA("SpotLight") then lights += 1
|
||||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("ParticleEmitter") then emitters += 1 end
|
||||||
}) do
|
|
||||||
P({ Size = w[2], Position = W + w[1] + V(0, 40, 0), Transparency = 1 })
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
scenery:SetAttribute("PartCount", parts)
|
||||||
|
scenery:SetAttribute("LightCount", lights)
|
||||||
|
scenery:SetAttribute("EmitterCount", emitters)
|
||||||
|
if parts > 3000 or lights > 25 or emitters > 10 then warn("[World1] Превышен бюджет деталей или эффектов", parts, lights, emitters) end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------- помощники для новых миров
|
---------------------------------------------------------------- помощники для новых миров
|
||||||
|
|
||||||
@@ -1475,7 +1725,7 @@ do
|
|||||||
below, above = lakeState(l)
|
below, above = lakeState(l)
|
||||||
if not lakeOk(below, above) then
|
if not lakeOk(below, above) then
|
||||||
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
||||||
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, Color3.fromRGB(30, 120, 150))
|
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, w1.water)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1539,21 +1539,109 @@ local lastWorldId = "none"
|
|||||||
local terrain = workspace.Terrain
|
local terrain = workspace.Terrain
|
||||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||||
|
|
||||||
|
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
||||||
|
local lakeDefaults
|
||||||
|
|
||||||
local function applyAmbience(world)
|
local function applyAmbience(world)
|
||||||
local clock = (world and world.clock) or 14.5
|
local lake = world and world.id == "World1"
|
||||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
|
||||||
terrain.WaterColor = (world and world.water) or defaultWater
|
|
||||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||||
|
local bloom = Lighting:FindFirstChildOfClass("BloomEffect")
|
||||||
|
local grade = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||||
|
local rays = Lighting:FindFirstChildOfClass("SunRaysEffect")
|
||||||
|
if not lakeDefaults then
|
||||||
|
lakeDefaults = {
|
||||||
|
ambient = Lighting.Ambient, outdoor = Lighting.OutdoorAmbient,
|
||||||
|
brightness = Lighting.Brightness, exposure = Lighting.ExposureCompensation,
|
||||||
|
latitude = Lighting.GeographicLatitude, reflectance = terrain.WaterReflectance,
|
||||||
|
haze = atm and atm.Haze or 0.6, decay = atm and atm.Decay or Color3.fromRGB(110, 140, 175),
|
||||||
|
bloom = bloom and bloom.Intensity or 0.5, threshold = bloom and bloom.Threshold or 1.4,
|
||||||
|
tint = grade and grade.TintColor or Color3.new(1, 1, 1),
|
||||||
|
contrast = grade and grade.Contrast or 0.06, rays = rays and rays.Intensity or 0.05,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
local base = lakeDefaults
|
||||||
|
TweenService:Create(Lighting, TweenInfo.new(2), {
|
||||||
|
ClockTime = (world and world.clock) or 14.5,
|
||||||
|
Ambient = lake and Color3.fromRGB(108, 100, 85) or base.ambient,
|
||||||
|
OutdoorAmbient = lake and Color3.fromRGB(157, 160, 144) or base.outdoor,
|
||||||
|
Brightness = lake and 2.5 or base.brightness,
|
||||||
|
ExposureCompensation = lake and 0.08 or base.exposure,
|
||||||
|
GeographicLatitude = lake and 35 or base.latitude,
|
||||||
|
}):Play()
|
||||||
|
terrain.WaterColor = (world and world.water) or defaultWater
|
||||||
|
terrain.WaterTransparency = (world and world.waterTransparency) or 0.15
|
||||||
|
terrain.WaterReflectance = lake and 0.12 or base.reflectance
|
||||||
if atm then
|
if atm then
|
||||||
local frost = world and world.id == "World3"
|
local frost = world and world.id == "World3"
|
||||||
TweenService:Create(atm, TweenInfo.new(2), {
|
TweenService:Create(atm, TweenInfo.new(2), {
|
||||||
Density = frost and 0.38 or 0.25,
|
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
||||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
Color = lake and Color3.fromRGB(205, 222, 232) or (frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232)),
|
||||||
|
Decay = lake and Color3.fromRGB(155, 173, 177) or base.decay,
|
||||||
|
Haze = lake and 1 or base.haze,
|
||||||
}):Play()
|
}):Play()
|
||||||
end
|
end
|
||||||
|
if bloom then TweenService:Create(bloom, TweenInfo.new(2), { Intensity = lake and 0.25 or base.bloom, Threshold = lake and 1.5 or base.threshold }):Play() end
|
||||||
|
if grade then
|
||||||
|
TweenService:Create(grade, TweenInfo.new(2), {
|
||||||
|
TintColor = lake and Color3.fromRGB(255, 242, 220) or base.tint,
|
||||||
|
Contrast = lake and 0.08 or base.contrast,
|
||||||
|
}):Play()
|
||||||
|
end
|
||||||
|
if rays then rays.Intensity = lake and 0.06 or base.rays end
|
||||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Восемь силуэтов обновляются локально 20 раз в секунду и только рядом с озером.
|
||||||
|
local fishScenery, ambientFish, waterfallRipples = nil, {}, {}
|
||||||
|
local fishElapsed = 0
|
||||||
|
RunService.Heartbeat:Connect(function(dt)
|
||||||
|
fishElapsed += dt
|
||||||
|
if fishElapsed < 0.05 then return end
|
||||||
|
fishElapsed = 0
|
||||||
|
local world = currentWorld()
|
||||||
|
if not world or world.id ~= "World1" then return end
|
||||||
|
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if not root or (root.Position - world.center).Magnitude > 180 then return end
|
||||||
|
if not fishScenery or not fishScenery.Parent or #ambientFish == 0 then
|
||||||
|
local map = workspace:FindFirstChild("FishingMap")
|
||||||
|
fishScenery = map and map:FindFirstChild("World1Scenery")
|
||||||
|
ambientFish, waterfallRipples = {}, {}
|
||||||
|
if fishScenery then
|
||||||
|
for _, child in ipairs(fishScenery:GetChildren()) do
|
||||||
|
if child:IsA("Model") and child.Name == "AmbientFish" then table.insert(ambientFish, child) end
|
||||||
|
if child:IsA("Model") and child.Name == "WaterfallRipple" then table.insert(waterfallRipples, child) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
for _, ripple in ipairs(waterfallRipples) do
|
||||||
|
if ripple.Parent then
|
||||||
|
local center = ripple:GetAttribute("RippleCenter")
|
||||||
|
local phase = (now * 0.3 + ripple:GetAttribute("RipplePhase")) % 1
|
||||||
|
local radius = 2 + phase * 8
|
||||||
|
for _, segment in ipairs(ripple:GetChildren()) do
|
||||||
|
local index = segment:GetAttribute("RippleSegment")
|
||||||
|
local a, b = index * math.pi / 6, (index + 1) * math.pi / 6
|
||||||
|
local p = center + Vector3.new(math.cos(a) * radius, 0, math.sin(a) * radius)
|
||||||
|
local q = center + Vector3.new(math.cos(b) * radius, 0, math.sin(b) * radius)
|
||||||
|
segment.Size = Vector3.new((q - p).Magnitude, 0.07, 0.07)
|
||||||
|
segment.CFrame = CFrame.lookAt((p + q) / 2, q) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
segment.Transparency = 0.6 + phase * 0.4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, fish in ipairs(ambientFish) do
|
||||||
|
if fish.Parent then
|
||||||
|
local center, radius = fish:GetAttribute("SwimCenter"), fish:GetAttribute("SwimRadius")
|
||||||
|
local angle = now * fish:GetAttribute("SwimSpeed") + fish:GetAttribute("SwimPhase")
|
||||||
|
local pos = center + Vector3.new(math.cos(angle) * radius, 0, math.sin(angle) * radius * 0.65)
|
||||||
|
local direction = Vector3.new(-math.sin(angle), 0, math.cos(angle) * 0.65)
|
||||||
|
fish:PivotTo(CFrame.lookAt(pos, pos + direction))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
while true do
|
while true do
|
||||||
local w = currentWorld()
|
local w = currentWorld()
|
||||||
|
|||||||
+557
-218
@@ -21,8 +21,9 @@ Config.Worlds = {
|
|||||||
{
|
{
|
||||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
desc = "Уютное лесное озеро: прозрачная бирюзовая вода, солнечный причал и водопад среди сосен.",
|
||||||
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
|
clock = 16.2, water = Color3.fromRGB(40, 170, 165),
|
||||||
|
waterTransparency = 0.6,
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
||||||
},
|
},
|
||||||
@@ -1011,26 +1012,35 @@ terrain.WaterWaveSpeed = 12
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
||||||
|
|
||||||
local W = V(0, 0, 1500) -- центр Мира 1
|
local W = Config.Worlds[1].center
|
||||||
local GROUND_Y = 4 -- верх земли
|
local GROUND_Y, WATER_Y = 4, 0
|
||||||
local WATER_Y = 0 -- поверхность воды
|
|
||||||
|
|
||||||
-- озеро из нескольких кругов: { x, z, радиус }
|
|
||||||
local LAKES = Config.Worlds[1].lakes
|
local LAKES = Config.Worlds[1].lakes
|
||||||
|
local WORLD1_TRAIL = {
|
||||||
|
V(-104, 4.3, -34), V(-117, 7, -62), V(-108, 12, -90),
|
||||||
|
V(-83, 19, -110), V(-62, 25, -96), V(-43, 32, -119),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Лесистый берег, холм с вышкой и скала справа от озера.
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
||||||
-- холмы по краям
|
|
||||||
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
||||||
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
||||||
end
|
end
|
||||||
-- порядок важен: песок → выемка → ил → вода
|
terrain:FillBall(W + V(-48, -7, -121), 42, Enum.Material.Grass)
|
||||||
|
terrain:FillBall(W + V(-89, -7, -101), 30, Enum.Material.Grass)
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(-43, 29, -119)), 6, 17, Enum.Material.Grass)
|
||||||
|
for _, p in ipairs(WORLD1_TRAIL) do
|
||||||
|
terrain:FillBall(W + p - V(0, 9, 0), 10, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 15, -78)), V(40, 30, 52), Enum.Material.Rock)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(67, 9, -83)), V(18, 18, 39), Enum.Material.Slate)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 29, -86)), V(40, 2, 35), Enum.Material.Grass)
|
||||||
|
|
||||||
|
-- Чаша озера: песок, выемка, дно, вода; круги совпадают с FishConfig.
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
||||||
end
|
|
||||||
for _, l in ipairs(LAKES) do
|
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
@@ -1039,34 +1049,39 @@ end
|
|||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||||
end
|
end
|
||||||
-- то же самое напрямую по вокселям: вода ниже WATER_Y, воздух выше.
|
|
||||||
-- Fill* с Air иногда оставляет песок над водой, и озеро выглядит сухим.
|
-- Мелководье вычисляется по объединению кругов: на пересечениях нет песчаных стенок.
|
||||||
local function carveLake(l)
|
local function carveLake(l)
|
||||||
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 12, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 16, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
||||||
local mats, occ = terrain:ReadVoxels(region, 4)
|
local mats, occ = terrain:ReadVoxels(region, 4)
|
||||||
local size = mats.Size
|
local size, corner = mats.Size, region.CFrame.Position - region.Size / 2
|
||||||
local corner = region.CFrame.Position - region.Size / 2
|
|
||||||
local center = W + V(l[1], 0, l[2])
|
|
||||||
for x = 1, size.X do
|
for x = 1, size.X do
|
||||||
for y = 1, size.Y do
|
|
||||||
for z = 1, size.Z do
|
for z = 1, size.Z do
|
||||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
local px, pz = corner.X + (x - 0.5) * 4 - W.X, corner.Z + (z - 0.5) * 4 - W.Z
|
||||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
if (px - l[1]) ^ 2 + (pz - l[2]) ^ 2 <= l[3] ^ 2 then
|
||||||
local water = c.Y < WATER_Y
|
local inland = 0
|
||||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
for _, lake in ipairs(LAKES) do
|
||||||
occ[x][y][z] = water and 1 or 0
|
inland = math.max(inland, lake[3] - math.sqrt((px - lake[1]) ^ 2 + (pz - lake[2]) ^ 2))
|
||||||
|
end
|
||||||
|
local floor = -3 - math.min(inland / 18, 1) * 8
|
||||||
|
for y = 1, size.Y do
|
||||||
|
local py = corner.Y + (y - 0.5) * 4
|
||||||
|
local mat = Enum.Material.Air
|
||||||
|
if py < floor then mat = inland < 20 and Enum.Material.Sand or Enum.Material.Mud
|
||||||
|
elseif py < WATER_Y then mat = Enum.Material.Water end
|
||||||
|
mats[x][y][z], occ[x][y][z] = mat, mat == Enum.Material.Air and 0 or 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
terrain:WriteVoxels(region, 4, mats, occ)
|
terrain:WriteVoxels(region, 4, mats, occ)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do carveLake(l) end
|
||||||
carveLake(l)
|
|
||||||
end
|
-- Прибытие и короткий подход к главному причалу.
|
||||||
-- дорожка от точки прибытия к причалу и площадка
|
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(12, 4, 14), Enum.Material.Ground)
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(8, 4, 14), Enum.Material.Ground)
|
terrain:FillCylinder(CFrame.new(W + V(0, 2, 94)), 4, 13, Enum.Material.Cobblestone)
|
||||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 96)), 4, 12, Enum.Material.Cobblestone)
|
|
||||||
|
|
||||||
---------------------------------------------------------------- точка появления в лобби
|
---------------------------------------------------------------- точка появления в лобби
|
||||||
|
|
||||||
@@ -1738,236 +1753,472 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
||||||
|
|
||||||
local function inLake(x, z, extra)
|
do
|
||||||
for _, l in ipairs(LAKES) do
|
local previous = {}
|
||||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
for _, child in ipairs(map:GetChildren()) do previous[child] = true end
|
||||||
return true
|
local sharedRng = rng
|
||||||
|
local rng = sharedRng:Clone()
|
||||||
|
local scenery = Instance.new("Model")
|
||||||
|
scenery.Name = "World1Scenery"
|
||||||
|
scenery:SetAttribute("WorldId", "World1")
|
||||||
|
scenery.Parent = map
|
||||||
|
local C = {
|
||||||
|
wood = Color3.fromRGB(190, 135, 85), dark = Color3.fromRGB(120, 80, 50),
|
||||||
|
rope = Color3.fromRGB(215, 180, 125), roof = Color3.fromRGB(60, 100, 75),
|
||||||
|
pine = Color3.fromRGB(45, 105, 60), pineDark = Color3.fromRGB(35, 85, 50),
|
||||||
|
grass = Color3.fromRGB(125, 180, 75), rock = Color3.fromRGB(140, 138, 150),
|
||||||
|
moss = Color3.fromRGB(95, 130, 70), warm = Color3.fromRGB(255, 200, 120),
|
||||||
|
}
|
||||||
|
local function part(props)
|
||||||
|
props.Parent = props.Parent or scenery
|
||||||
|
if props.CanCollide == nil then props.CanCollide = false end
|
||||||
|
if props.CanQuery == nil then props.CanQuery = props.CanCollide end
|
||||||
|
props.CanTouch = false
|
||||||
|
if props.CastShadow == nil then props.CastShadow = props.CanCollide end
|
||||||
|
return P(props)
|
||||||
end
|
end
|
||||||
|
local function block(name, size, cf, color, material, solid)
|
||||||
|
return part({ Name = name, Size = size, CFrame = cf, Color = color, Material = material or Enum.Material.SmoothPlastic, CanCollide = solid or false })
|
||||||
|
end
|
||||||
|
local function cylA(a, b, diameter, props)
|
||||||
|
props = props or {}
|
||||||
|
props.Shape, props.Size = Enum.PartType.Cylinder, V((b - a).Magnitude, diameter, diameter)
|
||||||
|
props.CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
return part(props)
|
||||||
|
end
|
||||||
|
local function sphere(pos, size, color, material)
|
||||||
|
return part({ Name = "ShoreDetail", Shape = Enum.PartType.Ball, Size = size, Position = pos, Color = color, Material = material or Enum.Material.SmoothPlastic })
|
||||||
|
end
|
||||||
|
local function inLake(x, z, margin)
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
if (x - l[1]) ^ 2 + (z - l[2]) ^ 2 < (l[3] + (margin or 0)) ^ 2 then return true end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
local function light(parent, range, brightness)
|
||||||
-- прибытие
|
local obj = Instance.new("PointLight")
|
||||||
-- всё рядом с главным причалом: прибытие → арка → причал, по бокам портал, скупка и дед
|
obj.Color, obj.Range, obj.Brightness, obj.Shadows = C.warm, range, brightness, false
|
||||||
local arrive = W + V(0, GROUND_Y, 94)
|
obj.Parent = parent
|
||||||
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
|
||||||
arch(CFrame.new(W + V(0, GROUND_Y, 82)), 14, 11, "🌊 ТИХОЕ ОЗЕРО", Color3.fromRGB(80, 200, 255))
|
|
||||||
portal(CFrame.lookAt(W + V(-22, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
|
||||||
-- точки для линии-подсказки: конец главного причала и место перед скупкой
|
|
||||||
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.5, 42)))
|
|
||||||
marker("GuideSell", CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive) * CFrame.new(0, 0, -10))
|
|
||||||
local w1Counter = stall(CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive), {
|
|
||||||
title = "💰 СКУПКА",
|
|
||||||
titleColor = Color3.fromRGB(150, 255, 160),
|
|
||||||
wall = Color3.fromRGB(150, 115, 80),
|
|
||||||
stripeA = Color3.fromRGB(50, 150, 80),
|
|
||||||
stripeB = Color3.fromRGB(245, 240, 230),
|
|
||||||
glow = Color3.fromRGB(80, 230, 120),
|
|
||||||
action = "Sell",
|
|
||||||
promptText = "Продать всю рыбу",
|
|
||||||
promptObject = "Скупка",
|
|
||||||
npcName = "Скупщик Гриша",
|
|
||||||
npcColors = { skin = Color3.fromRGB(200, 150, 110), shirt = Color3.fromRGB(70, 130, 80), pants = Color3.fromRGB(60, 50, 40), hat = Color3.fromRGB(200, 170, 110) },
|
|
||||||
})
|
|
||||||
w1Counter:SetAttribute("GuideTarget", "Sell") -- прилавок подсвечивается на шаге обучения
|
|
||||||
|
|
||||||
-- доска «Кто водится в озере»
|
|
||||||
do
|
|
||||||
local pos = W + V(-15, GROUND_Y, 80)
|
|
||||||
local cf = CFrame.lookAt(pos, arrive)
|
|
||||||
for _, x in ipairs({ -6, 6 }) do
|
|
||||||
P({ Size = V(0.8, 11, 0.8), CFrame = cf * CFrame.new(x, 5.5, 0.3), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 40) })
|
|
||||||
end
|
end
|
||||||
local board = P({ Size = V(13, 10, 0.5), CFrame = cf * CFrame.new(0, 7, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(70, 48, 32) })
|
local function lantern(cf)
|
||||||
local lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
local bulb = block("Lantern", V(0.8, 1.15, 0.8), cf, C.warm, Enum.Material.Neon)
|
||||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
light(bulb, 14, 0.8)
|
||||||
local r = Config.Rarities[f.rarity]
|
for _, y in ipairs({ -0.7, 0.7 }) do block("LanternCap", V(1.25, 0.2, 1.25), cf * CFrame.new(0, y, 0), C.dark, Enum.Material.Metal) end
|
||||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
for _, x in ipairs({ -0.48, 0.48 }) do
|
||||||
|
for _, z in ipairs({ -0.48, 0.48 }) do block("LanternFrame", V(0.1, 1.4, 0.1), cf * CFrame.new(x, 0, z), C.dark, Enum.Material.Metal) end
|
||||||
end
|
end
|
||||||
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
|
||||||
end
|
end
|
||||||
|
local function lanternPost(pos)
|
||||||
-- костёр с брёвнами
|
cylA(pos, pos + V(0, 5, 0), 0.4, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
do
|
lantern(CFrame.new(pos + V(0, 5.4, 0)))
|
||||||
local c = W + V(-8, GROUND_Y, 110)
|
end
|
||||||
|
local function ropeRing(pos, radius)
|
||||||
for i = 0, 7 do
|
for i = 0, 7 do
|
||||||
local a = i / 8 * math.pi * 2
|
local a, b = i * math.pi / 4, (i + 1) * math.pi / 4
|
||||||
ball(c + V(math.cos(a) * 2.2, 0.3, math.sin(a) * 2.2), 1, { Color = Color3.fromRGB(120, 120, 125), Material = Enum.Material.Rock })
|
cylA(pos + V(math.cos(a) * radius, 0, math.sin(a) * radius), pos + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.16, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
end
|
|
||||||
for i = 0, 2 do
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(3, 0.6, 0.6), CFrame = CFrame.new(c + V(0, 0.4, 0)) * CFrame.Angles(0, i * math.pi / 3, 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 35) })
|
|
||||||
end
|
|
||||||
local fireBase = P({ Size = V(1, 1, 1), Position = c + V(0, 0.8, 0), Transparency = 1, CanCollide = false })
|
|
||||||
local fire = Instance.new("Fire")
|
|
||||||
fire.Size = 5
|
|
||||||
fire.Heat = 9
|
|
||||||
fire.Parent = fireBase
|
|
||||||
local light = Instance.new("PointLight")
|
|
||||||
light.Color = Color3.fromRGB(255, 160, 80)
|
|
||||||
light.Range = 20
|
|
||||||
light.Brightness = 2
|
|
||||||
light.Parent = fireBase
|
|
||||||
for _, a in ipairs({ 0, 2.1, 4.2 }) do
|
|
||||||
local p = c + V(math.cos(a) * 6, 0.6, math.sin(a) * 6)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 1.4, 1.4), CFrame = CFrame.lookAt(p, c) * CFrame.Angles(0, math.rad(90), 0) * CFrame.Angles(0, math.rad(90), 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(115, 80, 50) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function pier(center, size, primary)
|
||||||
-- дед-рыбак с подсказками
|
local cf = CFrame.new(center)
|
||||||
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 86), arrive + V(0, 3, 0)), {
|
local deck = block("PierDeck", size, cf, C.wood, Enum.Material.WoodPlanks, true)
|
||||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
if primary then deck:SetAttribute("GuideTarget", "Pier") end
|
||||||
}, "Talk", "Поговорить")
|
|
||||||
|
|
||||||
-- домик рыбака
|
|
||||||
do
|
|
||||||
local cf = CFrame.lookAt(W + V(-44, GROUND_Y, 98), W + V(0, GROUND_Y, 98))
|
|
||||||
local logC = Color3.fromRGB(130, 90, 55)
|
|
||||||
P({ Size = V(14, 1, 12), CFrame = cf * CFrame.new(0, 0.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(110, 80, 50) })
|
|
||||||
P({ Size = V(14, 8, 1), CFrame = cf * CFrame.new(0, 5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(1, 8, 12), CFrame = cf * CFrame.new(s * 6.5, 5, 0), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(5, 8, 1), CFrame = cf * CFrame.new(s * 4.5, 5, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(16, 1, 8.8), CFrame = cf * CFrame.new(0, 11.2, s * 3.4) * CFrame.Angles(math.rad(-s * 38), 0, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 60, 45) })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 2, 1), CFrame = cf * CFrame.new(0, 8, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(2.2, 2, 0.3), CFrame = cf * CFrame.new(-4.5, 5.5, -6.05), Material = Enum.Material.Glass, Color = Color3.fromRGB(255, 225, 150), Transparency = 0.2 })
|
|
||||||
P({ Size = V(14, 3, 1), CFrame = cf * CFrame.new(0, 10.5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- причалы
|
|
||||||
local function pier(center, size)
|
|
||||||
local deck = P({ Size = size, Position = center, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 110, 70) })
|
|
||||||
local alongZ = size.Z > size.X
|
local alongZ = size.Z > size.X
|
||||||
local len = alongZ and size.Z or size.X
|
local length, width = alongZ and size.Z or size.X, alongZ and size.X or size.Z
|
||||||
local wid = alongZ and size.X or size.Z
|
for d = -length / 2 + 1, length / 2 - 0.5, 2 do
|
||||||
for d = -len / 2 + 1, len / 2 - 1, 6 do
|
local offset = alongZ and V(0, 0.34, d) or V(d, 0.34, 0)
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
local boardSize = alongZ and V(width, 0.16, 1.88) or V(1.88, 0.16, width)
|
||||||
local off = alongZ and V(s * (wid / 2 - 0.4), 0, d) or V(d, 0, s * (wid / 2 - 0.4))
|
block("IndividualPlank", boardSize, cf + offset, C.wood:Lerp(C.dark, rng:NextNumber(0, 0.12)), Enum.Material.WoodPlanks)
|
||||||
vcyl(center + off + V(0, -6, 0), 13, 0.9, { Color = Color3.fromRGB(100, 70, 45), Material = Enum.Material.Wood })
|
end
|
||||||
|
for d = -length / 2 + 1, length / 2 - 1, 8 do
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
local p = center + (alongZ and V(side * (width / 2 - 0.4), 0, d) or V(d, 0, side * (width / 2 - 0.4)))
|
||||||
|
cylA(p - V(0, 7, 0), p + V(0, 1.8, 0), 1.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
ropeRing(p + V(0, 0.8, 0), 0.7)
|
||||||
|
ropeRing(p + V(0, 1.05, 0), 0.7)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return deck
|
return deck
|
||||||
end
|
end
|
||||||
-- { центр от W, размер }
|
local function fishSign(cf, width, height, color)
|
||||||
local PIERS = {
|
local panel = block("FishSign", V(width, height, 0.22), cf, color, Enum.Material.WoodPlanks)
|
||||||
{ V(0, GROUND_Y + 0.2, 58), V(8, 0.6, 42) },
|
for _, face in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||||
{ V(-86, GROUND_Y + 0.2, 15), V(34, 0.6, 7) },
|
local sg = Instance.new("SurfaceGui")
|
||||||
{ V(86, GROUND_Y + 0.2, -10), V(34, 0.6, 7) },
|
sg.Face, sg.LightInfluence, sg.PixelsPerStud = face, 0, 30
|
||||||
}
|
sg.SizingMode, sg.Parent = Enum.SurfaceGuiSizingMode.PixelsPerStud, panel
|
||||||
for i, p in ipairs(PIERS) do
|
local body = Instance.new("Frame")
|
||||||
local deck = pier(W + p[1], p[2])
|
body.Size, body.Position = UDim2.fromScale(0.5, 0.4), UDim2.fromScale(0.2, 0.3)
|
||||||
if i == 1 then
|
body.BackgroundColor3, body.BorderSizePixel, body.Parent = Color3.fromRGB(245, 239, 214), 0, sg
|
||||||
deck:SetAttribute("GuideTarget", "Pier") -- главный причал подсвечивается на шаге обучения
|
local curve = Instance.new("UICorner")
|
||||||
|
curve.CornerRadius, curve.Parent = UDim.new(1, 0), body
|
||||||
|
local tail = Instance.new("TextLabel")
|
||||||
|
tail.Size, tail.Position, tail.BackgroundTransparency = UDim2.fromScale(0.3, 0.65), UDim2.fromScale(0.59, 0.175), 1
|
||||||
|
tail.Text, tail.TextScaled, tail.TextColor3, tail.Parent = "◀", true, body.BackgroundColor3, sg
|
||||||
|
local eye = Instance.new("Frame")
|
||||||
|
eye.Size, eye.Position, eye.BorderSizePixel = UDim2.fromScale(0.045, 0.08), UDim2.fromScale(0.26, 0.43), 0
|
||||||
|
eye.BackgroundColor3, eye.Parent = color, sg
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function smoke(chimney)
|
||||||
|
local effect = Instance.new("ParticleEmitter")
|
||||||
|
effect.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
effect.Rate, effect.Lifetime, effect.Speed = 3, NumberRange.new(3, 5), NumberRange.new(1.5, 2.5)
|
||||||
|
effect.Acceleration, effect.SpreadAngle = V(0.7, 0.5, 0), Vector2.new(10, 10)
|
||||||
|
effect.Color = ColorSequence.new(Color3.fromRGB(220, 223, 219))
|
||||||
|
effect.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.8), NumberSequenceKeypoint.new(1, 4) })
|
||||||
|
effect.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.3), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
effect.Parent = chimney
|
||||||
|
end
|
||||||
|
local function pine(pos, height)
|
||||||
|
cylA(pos, pos + V(0, height * 0.8, 0), height * 0.075, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
local tint = C.pine:Lerp(C.pineDark, rng:NextNumber())
|
||||||
|
for i = 0, 3 do
|
||||||
|
local width = height * (0.6 - i * 0.115)
|
||||||
|
local p = pos + V(0, height * (0.38 + i * 0.18), 0)
|
||||||
|
local lower = block("PineCanopy", V(width, height * 0.26, width), CFrame.new(p) * CFrame.Angles(0, math.pi / 4, 0), tint)
|
||||||
|
lower.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function cabin(pos, lookAt, scale)
|
||||||
|
local cf = CFrame.lookAt(pos, lookAt)
|
||||||
|
local function at(x, y, z) return cf * CFrame.new(x * scale, y * scale, z * scale) end
|
||||||
|
block("CabinFloor", V(21, 0.6, 19) * scale, at(0, 0.3, 0), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for row = 0, 7 do
|
||||||
|
local y = 1 + row * 0.95
|
||||||
|
cylA(at(-9, y, 7).Position, at(9, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(at(side * 8.5, y, -6).Position, at(side * 8.5, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
cylA(at(side * 2, y, -6).Position, at(side * 9, y, -6).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("GreenGableRoof", V(11.6, 0.65, 18) * scale, at(side * 4.7, 10.2, 0.5) * CFrame.Angles(0, 0, -side * 0.53), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
block("RoofTrim", V(12, 0.5, 0.5) * scale, at(side * 4.7, 10.2, -8.5) * CFrame.Angles(0, 0, -side * 0.53), C.dark, Enum.Material.Wood)
|
||||||
|
local window = block("GoldenWindow", V(3.1, 3, 0.2) * scale, at(side * 5.1, 4.7, -6.55), C.warm, Enum.Material.Neon)
|
||||||
|
if side == -1 then light(window, 12, 0.55) end
|
||||||
|
block("WindowMullion", V(0.18, 3.2, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
block("WindowMullion", V(3.3, 0.18, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
cylA(at(side * 9, -5, -7).Position, at(side * 9, 0, -7).Position, 0.8 * scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do block("PorchStep", V(5, 0.3 + i * 0.25, 1) * scale, at(0, -0.3 + i * 0.1, -11 + i), C.wood, Enum.Material.WoodPlanks, true) end
|
||||||
|
lantern(at(-7.3, 3, -8.3))
|
||||||
|
block("StoneChimney", V(2.3, 7, 2.3) * scale, at(4, 12.5, 4), C.rock, Enum.Material.Cobblestone, true)
|
||||||
|
local outlet = block("SmokeOutlet", V(1, 0.1, 1), at(4, 16, 4), C.rock)
|
||||||
|
outlet.Transparency = 1
|
||||||
|
smoke(outlet)
|
||||||
|
end
|
||||||
|
local function crate(cf)
|
||||||
|
block("WoodenCrate", V(2.5, 2.5, 2.5), cf, C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, y in ipairs({ -0.9, 0.9 }) do block("CrateBand", V(2.6, 0.22, 2.6), cf * CFrame.new(0, y, 0), C.wood, Enum.Material.Wood) end
|
||||||
|
end
|
||||||
|
|
||||||
lamp(W + V(-3.5, GROUND_Y + 0.5, 40), Color3.fromRGB(255, 220, 160))
|
-- Прибытие: всё необходимое находится в пределах 25 studs.
|
||||||
lamp(W + V(-70, GROUND_Y + 0.5, 18), Color3.fromRGB(255, 220, 160))
|
local arrive = W + V(0, GROUND_Y, 94)
|
||||||
lamp(W + V(70, GROUND_Y + 0.5, -13), Color3.fromRGB(255, 220, 160))
|
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
||||||
|
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.65, 40)))
|
||||||
|
portal(CFrame.lookAt(W + V(20, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
||||||
|
local shopCF = CFrame.lookAt(W + V(-18, GROUND_Y, 84), arrive)
|
||||||
|
marker("GuideSell", shopCF * CFrame.new(0, 0, -10))
|
||||||
|
local counter = stall(shopCF, {
|
||||||
|
title = "🐟 СКУПКА", titleColor = Color3.fromRGB(240, 230, 200),
|
||||||
|
wall = C.dark, stripeA = Color3.fromRGB(45, 105, 70), stripeB = Color3.fromRGB(240, 230, 200),
|
||||||
|
glow = C.warm, action = "Sell", promptText = "Продать всю рыбу", promptObject = "Скупка",
|
||||||
|
npcName = "Скупщик Гриша",
|
||||||
|
npcColors = { skin = Color3.fromRGB(220, 175, 133), shirt = C.roof, pants = Color3.fromRGB(80, 74, 52), hat = Color3.fromRGB(215, 180, 110) },
|
||||||
|
decor = function(at)
|
||||||
|
for i, color in ipairs({ Color3.fromRGB(110, 190, 60), Color3.fromRGB(245, 211, 64), Color3.fromRGB(241, 140, 55), Color3.fromRGB(70, 160, 219) }) do
|
||||||
|
local p = at(-5 + i * 2, 8.3, 6.7).Position
|
||||||
|
sphere(p, V(0.65, 1.6, 0.45), color)
|
||||||
|
cylA(p + V(0, 0.7, 0), p + V(0, 2.2, 0), 0.05, { Color = C.rope })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local p = at(-5 + i * 1.4, 5.9, -4).Position
|
||||||
|
sphere(p, V(0.75, 0.75, 0.75), Color3.fromRGB(240, 234, 219))
|
||||||
|
sphere(p + V(0, 0.3, 0), V(0.62, 0.5, 0.62), Color3.fromRGB(214, 66, 53))
|
||||||
|
end
|
||||||
|
block("CounterBox", V(3, 1, 2), at(5, 5.9, -4), C.wood, Enum.Material.WoodPlanks)
|
||||||
|
fishSign(at(0, 21.2, -9.2), 7, 2.6, C.roof)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
counter:SetAttribute("GuideTarget", "Sell")
|
||||||
|
lantern(shopCF * CFrame.new(-10, 7.3, -10))
|
||||||
|
crate(shopCF * CFrame.new(-13, 1.25, -11))
|
||||||
|
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 83), arrive + V(0, 3, 0)), {
|
||||||
|
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = C.roof,
|
||||||
|
}, "Talk", "Поговорить")
|
||||||
|
local boardCF = CFrame.lookAt(W + V(15, GROUND_Y, 74), arrive)
|
||||||
|
for _, x in ipairs({ -4.6, 4.6 }) do cylA((boardCF * CFrame.new(x, 0, 0)).Position, (boardCF * CFrame.new(x, 10, 0)).Position, 0.6, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
local board = block("World1Bestiary", V(10, 8, 0.4), boardCF * CFrame.new(0, 6, 0), C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
local lines = { "<font color=\"#FFE3A9\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||||
|
for _, fish in ipairs(Config.Zones.World1.fish) do
|
||||||
|
local rarity = Config.Rarities[fish.rarity]
|
||||||
|
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(rarity.color:ToHex(), fish.name, rarity.name))
|
||||||
|
end
|
||||||
|
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
||||||
|
|
||||||
-- лодка у западного причала
|
-- Дощатые причалы, кнехты с канатом и снасти на переднем плане.
|
||||||
|
pier(W + V(0, 4.2, 58), V(12, 0.6, 42), true)
|
||||||
|
pier(W + V(86, 4.2, -10), V(34, 0.6, 8))
|
||||||
|
pier(W + V(-86, 4.2, 15), V(34, 0.6, 8))
|
||||||
|
for _, p in ipairs({ V(-5, 4.7, 40), V(5, 4.7, 72), V(72, 4.7, -13) }) do lanternPost(W + p) end
|
||||||
|
crate(CFrame.new(W + V(-3.8, 5.9, 67)))
|
||||||
|
local tackle = CFrame.new(W + V(3.7, 5.4, 61))
|
||||||
|
block("TackleBox", V(2.6, 1.5, 1.6), tackle, Color3.fromRGB(91, 111, 101), Enum.Material.Metal)
|
||||||
|
block("TackleLid", V(2.8, 0.25, 1.8), tackle * CFrame.new(0, 0.85, 0), Color3.fromRGB(116, 130, 114), Enum.Material.Metal)
|
||||||
|
block("TackleLatch", V(0.3, 0.65, 0.12), tackle * CFrame.new(0, 0.3, -0.85), C.rope, Enum.Material.Metal)
|
||||||
|
for _, x in ipairs({ -0.45, 0.45 }) do block("HandleLeg", V(0.15, 0.4, 0.15), tackle * CFrame.new(x, 1.12, 0), C.dark, Enum.Material.Metal) end
|
||||||
|
block("TackleHandle", V(1, 0.15, 0.15), tackle * CFrame.new(0, 1.35, 0), C.dark, Enum.Material.Metal)
|
||||||
|
local boat = CFrame.new(W + V(19, 0.5, 44)) * CFrame.Angles(0, -0.3, 0)
|
||||||
|
block("BoatHull", V(4.5, 0.5, 10), boat, C.dark, Enum.Material.WoodPlanks)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("BoatGunwale", V(0.35, 1.5, 10), boat * CFrame.new(side * 2.2, 0.7, 0), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatEnd", V(4.5, 1.5, 0.4), boat * CFrame.new(0, 0.7, side * 4.8), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatSeat", V(4.3, 0.3, 1), boat * CFrame.new(0, 1, side * 2.1), C.dark, Enum.Material.WoodPlanks)
|
||||||
|
cylA((boat * CFrame.new(side * 0.8, 1.4, -2)).Position, (boat * CFrame.new(side * 3.6, 2.3, 2.4)).Position, 0.18, { Color = C.wood, Material = Enum.Material.Wood })
|
||||||
|
block("OarBlade", V(0.7, 0.15, 1.8), boat * CFrame.new(side * 3.8, 2.4, 2.7) * CFrame.Angles(0, side * 0.5, 0), C.wood, Enum.Material.Wood)
|
||||||
|
end
|
||||||
|
cylA(W + V(14, -5, 44), W + V(14, 3.3, 44), 0.9, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
cylA(W + V(14, 2, 44), (boat * CFrame.new(-2.2, 1, 0)).Position, 0.12, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
|
|
||||||
|
-- Домики и вывеска с рыбой вдоль левого берега.
|
||||||
|
cabin(W + V(-49, 5, 66), W + V(0, 5, 45), 1)
|
||||||
|
cabin(W + V(-91, 5, -30), W + V(-25, 5, 0), 0.75)
|
||||||
|
cylA(W + V(-78, 4, -42), W + V(-78, 16, -42), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
block("BannerArm", V(5, 0.4, 0.4), CFrame.new(W + V(-76, 15, -42)), C.dark, Enum.Material.Wood)
|
||||||
|
fishSign(CFrame.new(W + V(-75.5, 12, -42)), 3.5, 5, C.roof)
|
||||||
|
|
||||||
|
-- Подъём на холм: пологие отрезки дорожки и ограждение с одной стороны.
|
||||||
|
for i = 1, #WORLD1_TRAIL - 1 do
|
||||||
|
local a, b = W + WORLD1_TRAIL[i], W + WORLD1_TRAIL[i + 1]
|
||||||
|
local cf = CFrame.lookAt((a + b) / 2, b)
|
||||||
|
block("HillTrail", V(7, 0.5, (b - a).Magnitude + 1), cf, Color3.fromRGB(184, 148, 102), Enum.Material.Ground, true)
|
||||||
|
local side = cf.RightVector * 4.2
|
||||||
|
for _, p in ipairs({ a + side, b + side }) do cylA(p, p + V(0, 3, 0), 0.35, { Color = C.dark, Material = Enum.Material.Wood }) end
|
||||||
|
for _, h in ipairs({ 1.2, 2.5 }) do cylA(a + side + V(0, h, 0), b + side + V(0, h, 0), 0.22, { Color = C.wood, Material = Enum.Material.Wood }) end
|
||||||
|
if i < 5 then lanternPost(a - side) end
|
||||||
|
end
|
||||||
|
local top = W + V(-43, 32, -119)
|
||||||
|
for _, x in ipairs({ -5, 5 }) do
|
||||||
|
for _, z in ipairs({ -5, 5 }) do cylA(top + V(x, 0, z), top + V(x, 19, z), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
block("LookoutDeck", V(13, 0.65, 13), CFrame.new(top + V(0, 11, 0)), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("LookoutRoof", V(8, 0.6, 15), CFrame.new(top + V(side * 3.2, 21, 0)) * CFrame.Angles(0, 0, -side * 0.45), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
if side == 1 then
|
||||||
|
for _, x in ipairs({ -1, 1 }) do cylA(top + V(x * 1.8, 14, 5), top + V(x * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
else
|
||||||
|
cylA(top + V(-5, 14, -5), top + V(5, 14, -5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
cylA(top + V(side * 5, 14, -5), top + V(side * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 12 do block("LookoutSteps", V(3, 0.6 + i * 0.85, 1.3), CFrame.new(top + V(0, (0.6 + i * 0.85) / 2, 22 - i * 1.25)), C.dark, Enum.Material.WoodPlanks, true) end
|
||||||
|
cylA(top + V(5, 18, 0), top + V(5, 28, 0), 0.25, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
fishSign(CFrame.new(top + V(8, 26, 0)), 6, 3, C.roof)
|
||||||
|
lantern(CFrame.new(top + V(-4, 16, 4)))
|
||||||
|
|
||||||
|
-- Водопад: движущиеся ленты, пена и тихий встроенный звук воды.
|
||||||
|
for i = 0, 3 do
|
||||||
|
local x = 35 + i * 7
|
||||||
|
block("WaterfallRockFace", V(9, 28 + (i % 2) * 4, 7), CFrame.new(W + V(x, 14, -56)) * CFrame.Angles(0, i * 0.15, 0.04), C.rock, Enum.Material.Slate, true)
|
||||||
|
block("MossyLedge", V(9, 0.8, 8), CFrame.new(W + V(x, 29 + (i % 2) * 2, -57)), C.moss, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local x = 39 + i * 5
|
||||||
|
local sheet = block("WaterfallSheet", V(4.8, 30, 0.35), CFrame.new(W + V(x, 15.2, -50.7)), Color3.fromRGB(162, 224, 223), Enum.Material.Glass)
|
||||||
|
sheet.Transparency = 0.4
|
||||||
|
local upper, lower = Instance.new("Attachment"), Instance.new("Attachment")
|
||||||
|
upper.Position, lower.Position = V(0, 14.8, 0), V(0, -14.8, 0)
|
||||||
|
upper.Parent, lower.Parent = sheet, sheet
|
||||||
|
local beam = Instance.new("Beam")
|
||||||
|
beam.Attachment0, beam.Attachment1, beam.Width0, beam.Width1 = upper, lower, 4.8, 5.4
|
||||||
|
beam.Texture, beam.TextureSpeed, beam.TextureLength = "rbxasset://textures/particles/smoke_main.dds", 1.4, 6
|
||||||
|
beam.FaceCamera, beam.Color, beam.LightEmission = true, ColorSequence.new(Color3.fromRGB(224, 248, 242)), 0.15
|
||||||
|
beam.Transparency, beam.Parent = NumberSequence.new(0.35), sheet
|
||||||
|
local foam = sphere(W + V(x, 0.3, -48), V(7, 0.3, 5), Color3.fromRGB(231, 247, 235))
|
||||||
|
foam.Transparency = 0.35
|
||||||
|
local mist = Instance.new("ParticleEmitter")
|
||||||
|
mist.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
mist.Rate, mist.Lifetime, mist.Speed = 4, NumberRange.new(1, 2), NumberRange.new(1, 2.5)
|
||||||
|
mist.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.7), NumberSequenceKeypoint.new(1, 3) })
|
||||||
|
mist.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.6), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
mist.Color, mist.SpreadAngle, mist.Parent = ColorSequence.new(Color3.fromRGB(235, 249, 244)), Vector2.new(40, 40), foam
|
||||||
|
end
|
||||||
|
local soundAnchor = block("WaterfallSound", V(1, 1, 1), CFrame.new(W + V(45, 5, -48)), C.rock)
|
||||||
|
soundAnchor.Transparency = 1
|
||||||
|
local waterSound = Instance.new("Sound")
|
||||||
|
waterSound.Name, waterSound.SoundId = "WaterfallAmbience", "rbxasset://sounds/action_swim.mp3"
|
||||||
|
waterSound.Looped, waterSound.Volume, waterSound.PlaybackSpeed = true, 0.12, 0.65
|
||||||
|
waterSound.RollOffMinDistance, waterSound.RollOffMaxDistance = 10, 120
|
||||||
|
waterSound.Parent = soundAnchor
|
||||||
|
waterSound:Play()
|
||||||
|
for ring = 0, 2 do
|
||||||
|
local ripple = Instance.new("Model")
|
||||||
|
ripple.Name = "WaterfallRipple"
|
||||||
|
ripple:SetAttribute("RippleCenter", W + V(45, 0.16, -42))
|
||||||
|
ripple:SetAttribute("RipplePhase", ring / 3)
|
||||||
|
ripple.Parent = scenery
|
||||||
|
for segment = 0, 11 do
|
||||||
|
local a, b = segment * math.pi / 6, (segment + 1) * math.pi / 6
|
||||||
|
local p = W + V(45, 0.16, -42)
|
||||||
|
local radius = 2 + ring * 2
|
||||||
|
local line = cylA(p + V(math.cos(a) * radius, 0, math.sin(a) * radius), p + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.07, { Color = Color3.fromRGB(218, 242, 228), Transparency = 0.75, Parent = ripple })
|
||||||
|
line:SetAttribute("RippleSegment", segment)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local creek = block("NarrowFeederStream", V(5, 0.15, 48), CFrame.new(W + V(45, 30.2, -77)), Color3.fromRGB(62, 168, 165), Enum.Material.Glass)
|
||||||
|
creek.Transparency = 0.3
|
||||||
|
for _, x in ipairs({ 41.7, 48.3 }) do block("CreekBank", V(1.5, 0.7, 48), CFrame.new(W + V(x, 30.2, -77)), C.moss, Enum.Material.Grass, true) end
|
||||||
|
local previousBridge
|
||||||
|
for i = 0, 16 do
|
||||||
|
local t = i / 16
|
||||||
|
local pos = W + V(29 + t * 32, 30.7 + math.sin(t * math.pi) * 3.2, -77)
|
||||||
|
local slope = math.atan(math.cos(t * math.pi) * 3.2 * math.pi / 32)
|
||||||
|
block("ArchedBridgePlank", V(2.05, 0.45, 7), CFrame.new(pos) * CFrame.Angles(0, 0, slope), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(pos + V(0, 0, side * 3.3), pos + V(0, 3.2, side * 3.3), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
if previousBridge then cylA(previousBridge + V(0, 2.8, side * 3.3), pos + V(0, 2.8, side * 3.3), 0.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
previousBridge = pos
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(29, 30, -82), V(61, 30, -82) }) do lanternPost(W + p) end
|
||||||
|
|
||||||
|
-- Кувшинки и камыш стоят у внешнего берега, вдали от проходов.
|
||||||
|
for _, lake in ipairs(LAKES) do
|
||||||
|
for i = 1, 8 do
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local d = lake[3] - rng:NextNumber(3, 9)
|
||||||
|
local p = W + V(lake[1] + math.cos(a) * d, 0.13, lake[2] + math.sin(a) * d)
|
||||||
|
if not (math.abs(p.X - W.X) < 8 and p.Z - W.Z > 30) then
|
||||||
|
part({ Name = "LilyPad", Shape = Enum.PartType.Cylinder, Size = V(0.12, 2.6, 2.6), CFrame = CFrame.new(p) * CFrame.Angles(0, 0, math.pi / 2), Color = Color3.fromRGB(79, 147, 68) })
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for petal = 0, 4 do sphere(p + V(math.cos(petal * 1.26) * 0.3, 0.18, math.sin(petal * 1.26) * 0.3), V(0.55, 0.22, 0.4), Color3.fromRGB(239, 151, 177)) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 0, 9 do
|
||||||
|
local a = i * math.pi / 5
|
||||||
|
local x, z = lake[1] + math.cos(a) * (lake[3] + 2), lake[2] + math.sin(a) * (lake[3] + 2)
|
||||||
|
if not inLake(x, z, 0) and not (math.abs(x) < 15 and z > 30) and z < 73 then
|
||||||
|
for j = 1, 4 do
|
||||||
|
local h = rng:NextNumber(2.5, 4.8)
|
||||||
|
local p = W + V(x + rng:NextNumber(-1, 1), 0, z + rng:NextNumber(-1, 1))
|
||||||
|
cylA(p, p + V(0, h, 0), 0.12, { Color = Color3.fromRGB(105, 139, 60) })
|
||||||
|
cylA(p + V(0, h - 0.8, 0), p + V(0, h, 0), 0.3, { Color = Color3.fromRGB(120, 78, 43) })
|
||||||
|
end
|
||||||
|
local p = W + V(x, 0, z)
|
||||||
|
sphere(p, V(4, 2.5, 3.3), C.rock, Enum.Material.Rock)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 1, 8 do
|
||||||
|
local lake = LAKES[(i - 1) % #LAKES + 1]
|
||||||
|
local fish = Instance.new("Model")
|
||||||
|
fish.Name = "AmbientFish"
|
||||||
|
fish:SetAttribute("SwimCenter", W + V(lake[1], -1.8, lake[2]))
|
||||||
|
fish:SetAttribute("SwimRadius", 8 + (i % 3) * 4)
|
||||||
|
fish:SetAttribute("SwimPhase", i * 1.7)
|
||||||
|
fish:SetAttribute("SwimSpeed", 0.08 + i * 0.008)
|
||||||
|
fish.Parent = scenery
|
||||||
|
local cf = CFrame.new(W + V(lake[1], -1.8, lake[2]))
|
||||||
|
local body = part({ Name = "FishShadow", Shape = Enum.PartType.Ball, Size = V(0.7, 0.22, 2), CFrame = cf, Color = Color3.fromRGB(29, 85, 83), Transparency = 0.35, Parent = fish })
|
||||||
|
fish.PrimaryPart = body
|
||||||
|
part({ Name = "TailShadow", Size = V(1, 0.12, 0.7), CFrame = cf * CFrame.new(0, 0, 1.2) * CFrame.Angles(0, math.pi / 4, 0), Color = body.Color, Transparency = 0.4, Parent = fish })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Пояс сосен, отдельные деревья у воды и горы за границей мира.
|
||||||
|
for i = 0, 83 do
|
||||||
|
local a = i / 84 * math.pi * 2
|
||||||
|
local distance = rng:NextNumber(130, 230)
|
||||||
|
local x, z = math.cos(a) * distance, math.sin(a) * distance
|
||||||
|
if not (z < -65 and z > -145 and x > -125 and x < 85) then
|
||||||
|
pine(W + V(x, groundY(W.X + x, W.Z + z), z), rng:NextNumber(14, 24))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(-72, 4, 68), V(-101, 4, 41), V(96, 4, 30), V(108, 4, -48), V(-85, 25, -133), V(-20, 27, -139), V(35, 30, -94), V(61, 30, -98) }) do pine(W + p, rng:NextNumber(14, 20)) end
|
||||||
|
for _, p in ipairs({ V(-29, 4, 103), V(42, 4, 73), V(-72, 4, 49) }) do
|
||||||
|
cylA(W + p, W + p + V(0, 11, 0), 1, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for i = 0, 2 do sphere(W + p + V((i - 1) * 3, 11 + (i % 2) * 2, 0), V(9, 7, 8), C.grass) end
|
||||||
|
end
|
||||||
|
for i = 0, 6 do
|
||||||
|
local mountain = block("DistantMountain", V(85, 90 + (i % 3) * 22, 85), CFrame.new(W + V(-240 + i * 80, 30, -300)) * CFrame.Angles(0.2, i * 0.5, 0.15), Color3.fromRGB(131, 157, 168), Enum.Material.Slate)
|
||||||
|
mountain.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
for i = 0, 3 do
|
||||||
|
local cloud = sphere(W + V(-120 + i * 83, 115 + (i % 2) * 12, -210), V(40, 12, 22), Color3.fromRGB(245, 245, 231))
|
||||||
|
cloud.Name = "CumulusCloud"
|
||||||
|
sphere(cloud.Position + V(10, 4, 0), V(22, 15, 18), cloud.Color)
|
||||||
|
end
|
||||||
|
for _, wall in ipairs({ { V(0, 40, 245), V(500, 120, 2) }, { V(0, 40, -245), V(500, 120, 2) }, { V(245, 40, 0), V(2, 120, 500) }, { V(-245, 40, 0), V(2, 120, 500) } }) do
|
||||||
|
part({ Name = "WorldBoundary", Position = W + wall[1], Size = wall[2], Transparency = 1, CanCollide = true, CanQuery = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Сохраняем прежнюю последовательность rng для неизменённых Миров 2 и 3.
|
||||||
do
|
do
|
||||||
local cf = CFrame.new(W + V(-74, WATER_Y + 0.3, 24)) * CFrame.Angles(0, math.rad(15), 0)
|
local rng = sharedRng
|
||||||
local hull = Color3.fromRGB(170, 70, 50)
|
|
||||||
P({ Size = V(4, 0.5, 9), CFrame = cf, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(0.4, 1.4, 9), CFrame = cf * CFrame.new(s * 2, 0.7, 0), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
P({ Size = V(4.4, 1.4, 0.4), CFrame = cf * CFrame.new(0, 0.7, s * 4.5), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 0.3, 1.2), CFrame = cf * CFrame.new(0, 1, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- кувшинки и камыши
|
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 7 do
|
for _ = 1, 7 do rng:NextNumber(0, math.pi * 2); rng:NextNumber(6, l[3] - 5); rng:NextNumber(2, 3.5); rng:NextNumber() end
|
||||||
local a, d = rng:NextNumber(0, math.pi * 2), rng:NextNumber(6, l[3] - 5)
|
|
||||||
local x, z = l[1] + math.cos(a) * d, l[2] + math.sin(a) * d
|
|
||||||
local size = rng:NextNumber(2, 3.5)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(0.15, size, size), CFrame = CFrame.new(W + V(x, WATER_Y + 0.28, z)) * CFrame.Angles(0, 0, math.rad(90)), Color = Color3.fromRGB(70, 150, 60), CanCollide = false })
|
|
||||||
if rng:NextNumber() < 0.4 then
|
|
||||||
ball(W + V(x + 0.3, WATER_Y + 0.55, z), 0.7, { Color = Color3.fromRGB(255, 150, 190), CanCollide = false })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for _ = 1, 9 do
|
for _ = 1, 9 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
||||||
local inOther = false
|
local other = false
|
||||||
for _, o in ipairs(LAKES) do
|
for _, o in ipairs(LAKES) do if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then other = true end end
|
||||||
if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then
|
if not other and not (math.abs(x) < 6 and z > 30) then for _ = 1, 5 do rng:NextNumber(3, 5); rng:NextNumber(-1.2, 1.2); rng:NextNumber(-1.2, 1.2) end end
|
||||||
inOther = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not inOther and not (math.abs(x) < 6 and z > 30) then
|
local function free(x, z)
|
||||||
for _ = 1, 5 do
|
return not inLake(x, z, 14) and (V(x, 0, z) - V(0, 0, 94)).Magnitude >= 36
|
||||||
local h = rng:NextNumber(3, 5)
|
and not (math.abs(x) < 9 and z > 60 and z < 125) and (V(x, 0, z) - V(-44, 0, 98)).Magnitude >= 14
|
||||||
local p = W + V(x + rng:NextNumber(-1.2, 1.2), WATER_Y + h / 2 - 0.5, z + rng:NextNumber(-1.2, 1.2))
|
|
||||||
P({ Size = V(0.18, h, 0.18), Position = p, Color = Color3.fromRGB(85, 130, 50), CanCollide = false })
|
|
||||||
P({ Size = V(0.35, 0.9, 0.35), Position = p + V(0, h / 2 - 0.3, 0), Color = Color3.fromRGB(110, 70, 40), CanCollide = false })
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- деревья, кусты, камни
|
|
||||||
local function freeSpot(x, z)
|
|
||||||
if inLake(x, z, 14) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(0, 0, 94)).Magnitude < 36 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if math.abs(x) < 9 and z > 60 and z < 125 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(-44, 0, 98)).Magnitude < 14 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
local placed = 0
|
local placed = 0
|
||||||
for _ = 1, 400 do
|
for _ = 1, 400 do
|
||||||
if placed >= 110 then
|
if placed >= 110 then break end
|
||||||
break
|
|
||||||
end
|
|
||||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
local y = groundY(W.X + x, W.Z + z)
|
|
||||||
local roll = rng:NextNumber()
|
local roll = rng:NextNumber()
|
||||||
tree(W + V(x, y - 0.5, z), roll < 0.35 and "pine" or (roll < 0.5 and "birch" or "round"))
|
if roll < 0.35 then rng:NextNumber(8, 12)
|
||||||
|
else rng:NextNumber(7, 10); if roll >= 0.5 then rng:NextInteger(135, 165) end; rng:NextNumber(9, 12) end
|
||||||
placed += 1
|
placed += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _ = 1, 60 do
|
for _ = 1, 60 do
|
||||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
bush(W + V(x, groundY(W.X + x, W.Z + z) - 0.6, z))
|
rng:NextInteger(120, 150)
|
||||||
|
for _ = 1, 3 do rng:NextNumber(-1.5, 1.5); rng:NextNumber(-1.5, 1.5); rng:NextNumber(2.5, 4) end
|
||||||
|
if rng:NextNumber() < 0.5 then
|
||||||
|
for _ = 1, 4 do rng:NextNumber(-1.8, 1.8); rng:NextNumber(1.5, 2.6); rng:NextNumber(-1.8, 1.8); rng:NextInteger(1, 3) end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 4 do
|
for _ = 1, 4 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
||||||
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then
|
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then rng:NextNumber(2.5, 5); rng:NextNumber(0, 1); rng:NextNumber(0, 6); rng:NextNumber(0, 1) end
|
||||||
local s = rng:NextNumber(2.5, 5)
|
|
||||||
P({ Size = V(s, s * 0.7, s * 0.9), CFrame = CFrame.new(W + V(x, groundY(W.X + x, W.Z + z), z)) * CFrame.Angles(rng:NextNumber(0, 1), rng:NextNumber(0, 6), rng:NextNumber(0, 1)), Material = Enum.Material.Rock, Color = Color3.fromRGB(125, 125, 130) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- фонари вдоль дорожки
|
-- Счётчики позволяют быстро проверить бюджет локации в Studio.
|
||||||
lamp(W + V(6, GROUND_Y, 90))
|
local parts, lights, emitters = 0, 0, 0
|
||||||
lamp(W + V(-6, GROUND_Y, 90))
|
for _, child in ipairs(map:GetChildren()) do
|
||||||
|
if not previous[child] then
|
||||||
-- невидимые стены по краю мира
|
local instances = child:GetDescendants()
|
||||||
for _, w in ipairs({
|
table.insert(instances, child)
|
||||||
{ V(0, 0, 245), V(500, 120, 2) },
|
for _, obj in ipairs(instances) do
|
||||||
{ V(0, 0, -245), V(500, 120, 2) },
|
if obj:IsA("BasePart") then parts += 1
|
||||||
{ V(245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("PointLight") or obj:IsA("SpotLight") then lights += 1
|
||||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("ParticleEmitter") then emitters += 1 end
|
||||||
}) do
|
|
||||||
P({ Size = w[2], Position = W + w[1] + V(0, 40, 0), Transparency = 1 })
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
scenery:SetAttribute("PartCount", parts)
|
||||||
|
scenery:SetAttribute("LightCount", lights)
|
||||||
|
scenery:SetAttribute("EmitterCount", emitters)
|
||||||
|
if parts > 3000 or lights > 25 or emitters > 10 then warn("[World1] Превышен бюджет деталей или эффектов", parts, lights, emitters) end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------- помощники для новых миров
|
---------------------------------------------------------------- помощники для новых миров
|
||||||
|
|
||||||
@@ -2434,7 +2685,7 @@ do
|
|||||||
below, above = lakeState(l)
|
below, above = lakeState(l)
|
||||||
if not lakeOk(below, above) then
|
if not lakeOk(below, above) then
|
||||||
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
||||||
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, Color3.fromRGB(30, 120, 150))
|
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, w1.water)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -5375,21 +5626,109 @@ local lastWorldId = "none"
|
|||||||
local terrain = workspace.Terrain
|
local terrain = workspace.Terrain
|
||||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||||
|
|
||||||
|
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
||||||
|
local lakeDefaults
|
||||||
|
|
||||||
local function applyAmbience(world)
|
local function applyAmbience(world)
|
||||||
local clock = (world and world.clock) or 14.5
|
local lake = world and world.id == "World1"
|
||||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
|
||||||
terrain.WaterColor = (world and world.water) or defaultWater
|
|
||||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||||
|
local bloom = Lighting:FindFirstChildOfClass("BloomEffect")
|
||||||
|
local grade = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||||
|
local rays = Lighting:FindFirstChildOfClass("SunRaysEffect")
|
||||||
|
if not lakeDefaults then
|
||||||
|
lakeDefaults = {
|
||||||
|
ambient = Lighting.Ambient, outdoor = Lighting.OutdoorAmbient,
|
||||||
|
brightness = Lighting.Brightness, exposure = Lighting.ExposureCompensation,
|
||||||
|
latitude = Lighting.GeographicLatitude, reflectance = terrain.WaterReflectance,
|
||||||
|
haze = atm and atm.Haze or 0.6, decay = atm and atm.Decay or Color3.fromRGB(110, 140, 175),
|
||||||
|
bloom = bloom and bloom.Intensity or 0.5, threshold = bloom and bloom.Threshold or 1.4,
|
||||||
|
tint = grade and grade.TintColor or Color3.new(1, 1, 1),
|
||||||
|
contrast = grade and grade.Contrast or 0.06, rays = rays and rays.Intensity or 0.05,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
local base = lakeDefaults
|
||||||
|
TweenService:Create(Lighting, TweenInfo.new(2), {
|
||||||
|
ClockTime = (world and world.clock) or 14.5,
|
||||||
|
Ambient = lake and Color3.fromRGB(108, 100, 85) or base.ambient,
|
||||||
|
OutdoorAmbient = lake and Color3.fromRGB(157, 160, 144) or base.outdoor,
|
||||||
|
Brightness = lake and 2.5 or base.brightness,
|
||||||
|
ExposureCompensation = lake and 0.08 or base.exposure,
|
||||||
|
GeographicLatitude = lake and 35 or base.latitude,
|
||||||
|
}):Play()
|
||||||
|
terrain.WaterColor = (world and world.water) or defaultWater
|
||||||
|
terrain.WaterTransparency = (world and world.waterTransparency) or 0.15
|
||||||
|
terrain.WaterReflectance = lake and 0.12 or base.reflectance
|
||||||
if atm then
|
if atm then
|
||||||
local frost = world and world.id == "World3"
|
local frost = world and world.id == "World3"
|
||||||
TweenService:Create(atm, TweenInfo.new(2), {
|
TweenService:Create(atm, TweenInfo.new(2), {
|
||||||
Density = frost and 0.38 or 0.25,
|
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
||||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
Color = lake and Color3.fromRGB(205, 222, 232) or (frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232)),
|
||||||
|
Decay = lake and Color3.fromRGB(155, 173, 177) or base.decay,
|
||||||
|
Haze = lake and 1 or base.haze,
|
||||||
}):Play()
|
}):Play()
|
||||||
end
|
end
|
||||||
|
if bloom then TweenService:Create(bloom, TweenInfo.new(2), { Intensity = lake and 0.25 or base.bloom, Threshold = lake and 1.5 or base.threshold }):Play() end
|
||||||
|
if grade then
|
||||||
|
TweenService:Create(grade, TweenInfo.new(2), {
|
||||||
|
TintColor = lake and Color3.fromRGB(255, 242, 220) or base.tint,
|
||||||
|
Contrast = lake and 0.08 or base.contrast,
|
||||||
|
}):Play()
|
||||||
|
end
|
||||||
|
if rays then rays.Intensity = lake and 0.06 or base.rays end
|
||||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Восемь силуэтов обновляются локально 20 раз в секунду и только рядом с озером.
|
||||||
|
local fishScenery, ambientFish, waterfallRipples = nil, {}, {}
|
||||||
|
local fishElapsed = 0
|
||||||
|
RunService.Heartbeat:Connect(function(dt)
|
||||||
|
fishElapsed += dt
|
||||||
|
if fishElapsed < 0.05 then return end
|
||||||
|
fishElapsed = 0
|
||||||
|
local world = currentWorld()
|
||||||
|
if not world or world.id ~= "World1" then return end
|
||||||
|
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if not root or (root.Position - world.center).Magnitude > 180 then return end
|
||||||
|
if not fishScenery or not fishScenery.Parent or #ambientFish == 0 then
|
||||||
|
local map = workspace:FindFirstChild("FishingMap")
|
||||||
|
fishScenery = map and map:FindFirstChild("World1Scenery")
|
||||||
|
ambientFish, waterfallRipples = {}, {}
|
||||||
|
if fishScenery then
|
||||||
|
for _, child in ipairs(fishScenery:GetChildren()) do
|
||||||
|
if child:IsA("Model") and child.Name == "AmbientFish" then table.insert(ambientFish, child) end
|
||||||
|
if child:IsA("Model") and child.Name == "WaterfallRipple" then table.insert(waterfallRipples, child) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
for _, ripple in ipairs(waterfallRipples) do
|
||||||
|
if ripple.Parent then
|
||||||
|
local center = ripple:GetAttribute("RippleCenter")
|
||||||
|
local phase = (now * 0.3 + ripple:GetAttribute("RipplePhase")) % 1
|
||||||
|
local radius = 2 + phase * 8
|
||||||
|
for _, segment in ipairs(ripple:GetChildren()) do
|
||||||
|
local index = segment:GetAttribute("RippleSegment")
|
||||||
|
local a, b = index * math.pi / 6, (index + 1) * math.pi / 6
|
||||||
|
local p = center + Vector3.new(math.cos(a) * radius, 0, math.sin(a) * radius)
|
||||||
|
local q = center + Vector3.new(math.cos(b) * radius, 0, math.sin(b) * radius)
|
||||||
|
segment.Size = Vector3.new((q - p).Magnitude, 0.07, 0.07)
|
||||||
|
segment.CFrame = CFrame.lookAt((p + q) / 2, q) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
segment.Transparency = 0.6 + phase * 0.4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, fish in ipairs(ambientFish) do
|
||||||
|
if fish.Parent then
|
||||||
|
local center, radius = fish:GetAttribute("SwimCenter"), fish:GetAttribute("SwimRadius")
|
||||||
|
local angle = now * fish:GetAttribute("SwimSpeed") + fish:GetAttribute("SwimPhase")
|
||||||
|
local pos = center + Vector3.new(math.cos(angle) * radius, 0, math.sin(angle) * radius * 0.65)
|
||||||
|
local direction = Vector3.new(-math.sin(angle), 0, math.cos(angle) * 0.65)
|
||||||
|
fish:PivotTo(CFrame.lookAt(pos, pos + direction))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
while true do
|
while true do
|
||||||
local w = currentWorld()
|
local w = currentWorld()
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ Config.Worlds = {
|
|||||||
{
|
{
|
||||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
desc = "Уютное лесное озеро: прозрачная бирюзовая вода, солнечный причал и водопад среди сосен.",
|
||||||
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
|
clock = 16.2, water = Color3.fromRGB(40, 170, 165),
|
||||||
|
waterTransparency = 0.6,
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -51,26 +51,35 @@ terrain.WaterWaveSpeed = 12
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
||||||
|
|
||||||
local W = V(0, 0, 1500) -- центр Мира 1
|
local W = Config.Worlds[1].center
|
||||||
local GROUND_Y = 4 -- верх земли
|
local GROUND_Y, WATER_Y = 4, 0
|
||||||
local WATER_Y = 0 -- поверхность воды
|
|
||||||
|
|
||||||
-- озеро из нескольких кругов: { x, z, радиус }
|
|
||||||
local LAKES = Config.Worlds[1].lakes
|
local LAKES = Config.Worlds[1].lakes
|
||||||
|
local WORLD1_TRAIL = {
|
||||||
|
V(-104, 4.3, -34), V(-117, 7, -62), V(-108, 12, -90),
|
||||||
|
V(-83, 19, -110), V(-62, 25, -96), V(-43, 32, -119),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Лесистый берег, холм с вышкой и скала справа от озера.
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
||||||
-- холмы по краям
|
|
||||||
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
||||||
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
||||||
end
|
end
|
||||||
-- порядок важен: песок → выемка → ил → вода
|
terrain:FillBall(W + V(-48, -7, -121), 42, Enum.Material.Grass)
|
||||||
|
terrain:FillBall(W + V(-89, -7, -101), 30, Enum.Material.Grass)
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(-43, 29, -119)), 6, 17, Enum.Material.Grass)
|
||||||
|
for _, p in ipairs(WORLD1_TRAIL) do
|
||||||
|
terrain:FillBall(W + p - V(0, 9, 0), 10, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 15, -78)), V(40, 30, 52), Enum.Material.Rock)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(67, 9, -83)), V(18, 18, 39), Enum.Material.Slate)
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(45, 29, -86)), V(40, 2, 35), Enum.Material.Grass)
|
||||||
|
|
||||||
|
-- Чаша озера: песок, выемка, дно, вода; круги совпадают с FishConfig.
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
||||||
end
|
|
||||||
for _, l in ipairs(LAKES) do
|
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
@@ -79,34 +88,39 @@ end
|
|||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||||
end
|
end
|
||||||
-- то же самое напрямую по вокселям: вода ниже WATER_Y, воздух выше.
|
|
||||||
-- Fill* с Air иногда оставляет песок над водой, и озеро выглядит сухим.
|
-- Мелководье вычисляется по объединению кругов: на пересечениях нет песчаных стенок.
|
||||||
local function carveLake(l)
|
local function carveLake(l)
|
||||||
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 12, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 16, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
||||||
local mats, occ = terrain:ReadVoxels(region, 4)
|
local mats, occ = terrain:ReadVoxels(region, 4)
|
||||||
local size = mats.Size
|
local size, corner = mats.Size, region.CFrame.Position - region.Size / 2
|
||||||
local corner = region.CFrame.Position - region.Size / 2
|
|
||||||
local center = W + V(l[1], 0, l[2])
|
|
||||||
for x = 1, size.X do
|
for x = 1, size.X do
|
||||||
for y = 1, size.Y do
|
|
||||||
for z = 1, size.Z do
|
for z = 1, size.Z do
|
||||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
local px, pz = corner.X + (x - 0.5) * 4 - W.X, corner.Z + (z - 0.5) * 4 - W.Z
|
||||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
if (px - l[1]) ^ 2 + (pz - l[2]) ^ 2 <= l[3] ^ 2 then
|
||||||
local water = c.Y < WATER_Y
|
local inland = 0
|
||||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
for _, lake in ipairs(LAKES) do
|
||||||
occ[x][y][z] = water and 1 or 0
|
inland = math.max(inland, lake[3] - math.sqrt((px - lake[1]) ^ 2 + (pz - lake[2]) ^ 2))
|
||||||
|
end
|
||||||
|
local floor = -3 - math.min(inland / 18, 1) * 8
|
||||||
|
for y = 1, size.Y do
|
||||||
|
local py = corner.Y + (y - 0.5) * 4
|
||||||
|
local mat = Enum.Material.Air
|
||||||
|
if py < floor then mat = inland < 20 and Enum.Material.Sand or Enum.Material.Mud
|
||||||
|
elseif py < WATER_Y then mat = Enum.Material.Water end
|
||||||
|
mats[x][y][z], occ[x][y][z] = mat, mat == Enum.Material.Air and 0 or 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
terrain:WriteVoxels(region, 4, mats, occ)
|
terrain:WriteVoxels(region, 4, mats, occ)
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do carveLake(l) end
|
||||||
carveLake(l)
|
|
||||||
end
|
-- Прибытие и короткий подход к главному причалу.
|
||||||
-- дорожка от точки прибытия к причалу и площадка
|
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(12, 4, 14), Enum.Material.Ground)
|
||||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(8, 4, 14), Enum.Material.Ground)
|
terrain:FillCylinder(CFrame.new(W + V(0, 2, 94)), 4, 13, Enum.Material.Cobblestone)
|
||||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 96)), 4, 12, Enum.Material.Cobblestone)
|
|
||||||
|
|
||||||
---------------------------------------------------------------- точка появления в лобби
|
---------------------------------------------------------------- точка появления в лобби
|
||||||
|
|
||||||
@@ -778,236 +792,472 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
||||||
|
|
||||||
local function inLake(x, z, extra)
|
do
|
||||||
for _, l in ipairs(LAKES) do
|
local previous = {}
|
||||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
for _, child in ipairs(map:GetChildren()) do previous[child] = true end
|
||||||
return true
|
local sharedRng = rng
|
||||||
|
local rng = sharedRng:Clone()
|
||||||
|
local scenery = Instance.new("Model")
|
||||||
|
scenery.Name = "World1Scenery"
|
||||||
|
scenery:SetAttribute("WorldId", "World1")
|
||||||
|
scenery.Parent = map
|
||||||
|
local C = {
|
||||||
|
wood = Color3.fromRGB(190, 135, 85), dark = Color3.fromRGB(120, 80, 50),
|
||||||
|
rope = Color3.fromRGB(215, 180, 125), roof = Color3.fromRGB(60, 100, 75),
|
||||||
|
pine = Color3.fromRGB(45, 105, 60), pineDark = Color3.fromRGB(35, 85, 50),
|
||||||
|
grass = Color3.fromRGB(125, 180, 75), rock = Color3.fromRGB(140, 138, 150),
|
||||||
|
moss = Color3.fromRGB(95, 130, 70), warm = Color3.fromRGB(255, 200, 120),
|
||||||
|
}
|
||||||
|
local function part(props)
|
||||||
|
props.Parent = props.Parent or scenery
|
||||||
|
if props.CanCollide == nil then props.CanCollide = false end
|
||||||
|
if props.CanQuery == nil then props.CanQuery = props.CanCollide end
|
||||||
|
props.CanTouch = false
|
||||||
|
if props.CastShadow == nil then props.CastShadow = props.CanCollide end
|
||||||
|
return P(props)
|
||||||
end
|
end
|
||||||
|
local function block(name, size, cf, color, material, solid)
|
||||||
|
return part({ Name = name, Size = size, CFrame = cf, Color = color, Material = material or Enum.Material.SmoothPlastic, CanCollide = solid or false })
|
||||||
|
end
|
||||||
|
local function cylA(a, b, diameter, props)
|
||||||
|
props = props or {}
|
||||||
|
props.Shape, props.Size = Enum.PartType.Cylinder, V((b - a).Magnitude, diameter, diameter)
|
||||||
|
props.CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
return part(props)
|
||||||
|
end
|
||||||
|
local function sphere(pos, size, color, material)
|
||||||
|
return part({ Name = "ShoreDetail", Shape = Enum.PartType.Ball, Size = size, Position = pos, Color = color, Material = material or Enum.Material.SmoothPlastic })
|
||||||
|
end
|
||||||
|
local function inLake(x, z, margin)
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
if (x - l[1]) ^ 2 + (z - l[2]) ^ 2 < (l[3] + (margin or 0)) ^ 2 then return true end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
local function light(parent, range, brightness)
|
||||||
-- прибытие
|
local obj = Instance.new("PointLight")
|
||||||
-- всё рядом с главным причалом: прибытие → арка → причал, по бокам портал, скупка и дед
|
obj.Color, obj.Range, obj.Brightness, obj.Shadows = C.warm, range, brightness, false
|
||||||
local arrive = W + V(0, GROUND_Y, 94)
|
obj.Parent = parent
|
||||||
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
|
||||||
arch(CFrame.new(W + V(0, GROUND_Y, 82)), 14, 11, "🌊 ТИХОЕ ОЗЕРО", Color3.fromRGB(80, 200, 255))
|
|
||||||
portal(CFrame.lookAt(W + V(-22, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
|
||||||
-- точки для линии-подсказки: конец главного причала и место перед скупкой
|
|
||||||
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.5, 42)))
|
|
||||||
marker("GuideSell", CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive) * CFrame.new(0, 0, -10))
|
|
||||||
local w1Counter = stall(CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive), {
|
|
||||||
title = "💰 СКУПКА",
|
|
||||||
titleColor = Color3.fromRGB(150, 255, 160),
|
|
||||||
wall = Color3.fromRGB(150, 115, 80),
|
|
||||||
stripeA = Color3.fromRGB(50, 150, 80),
|
|
||||||
stripeB = Color3.fromRGB(245, 240, 230),
|
|
||||||
glow = Color3.fromRGB(80, 230, 120),
|
|
||||||
action = "Sell",
|
|
||||||
promptText = "Продать всю рыбу",
|
|
||||||
promptObject = "Скупка",
|
|
||||||
npcName = "Скупщик Гриша",
|
|
||||||
npcColors = { skin = Color3.fromRGB(200, 150, 110), shirt = Color3.fromRGB(70, 130, 80), pants = Color3.fromRGB(60, 50, 40), hat = Color3.fromRGB(200, 170, 110) },
|
|
||||||
})
|
|
||||||
w1Counter:SetAttribute("GuideTarget", "Sell") -- прилавок подсвечивается на шаге обучения
|
|
||||||
|
|
||||||
-- доска «Кто водится в озере»
|
|
||||||
do
|
|
||||||
local pos = W + V(-15, GROUND_Y, 80)
|
|
||||||
local cf = CFrame.lookAt(pos, arrive)
|
|
||||||
for _, x in ipairs({ -6, 6 }) do
|
|
||||||
P({ Size = V(0.8, 11, 0.8), CFrame = cf * CFrame.new(x, 5.5, 0.3), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 40) })
|
|
||||||
end
|
end
|
||||||
local board = P({ Size = V(13, 10, 0.5), CFrame = cf * CFrame.new(0, 7, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(70, 48, 32) })
|
local function lantern(cf)
|
||||||
local lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
local bulb = block("Lantern", V(0.8, 1.15, 0.8), cf, C.warm, Enum.Material.Neon)
|
||||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
light(bulb, 14, 0.8)
|
||||||
local r = Config.Rarities[f.rarity]
|
for _, y in ipairs({ -0.7, 0.7 }) do block("LanternCap", V(1.25, 0.2, 1.25), cf * CFrame.new(0, y, 0), C.dark, Enum.Material.Metal) end
|
||||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
for _, x in ipairs({ -0.48, 0.48 }) do
|
||||||
|
for _, z in ipairs({ -0.48, 0.48 }) do block("LanternFrame", V(0.1, 1.4, 0.1), cf * CFrame.new(x, 0, z), C.dark, Enum.Material.Metal) end
|
||||||
end
|
end
|
||||||
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
|
||||||
end
|
end
|
||||||
|
local function lanternPost(pos)
|
||||||
-- костёр с брёвнами
|
cylA(pos, pos + V(0, 5, 0), 0.4, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
do
|
lantern(CFrame.new(pos + V(0, 5.4, 0)))
|
||||||
local c = W + V(-8, GROUND_Y, 110)
|
end
|
||||||
|
local function ropeRing(pos, radius)
|
||||||
for i = 0, 7 do
|
for i = 0, 7 do
|
||||||
local a = i / 8 * math.pi * 2
|
local a, b = i * math.pi / 4, (i + 1) * math.pi / 4
|
||||||
ball(c + V(math.cos(a) * 2.2, 0.3, math.sin(a) * 2.2), 1, { Color = Color3.fromRGB(120, 120, 125), Material = Enum.Material.Rock })
|
cylA(pos + V(math.cos(a) * radius, 0, math.sin(a) * radius), pos + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.16, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
end
|
|
||||||
for i = 0, 2 do
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(3, 0.6, 0.6), CFrame = CFrame.new(c + V(0, 0.4, 0)) * CFrame.Angles(0, i * math.pi / 3, 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 35) })
|
|
||||||
end
|
|
||||||
local fireBase = P({ Size = V(1, 1, 1), Position = c + V(0, 0.8, 0), Transparency = 1, CanCollide = false })
|
|
||||||
local fire = Instance.new("Fire")
|
|
||||||
fire.Size = 5
|
|
||||||
fire.Heat = 9
|
|
||||||
fire.Parent = fireBase
|
|
||||||
local light = Instance.new("PointLight")
|
|
||||||
light.Color = Color3.fromRGB(255, 160, 80)
|
|
||||||
light.Range = 20
|
|
||||||
light.Brightness = 2
|
|
||||||
light.Parent = fireBase
|
|
||||||
for _, a in ipairs({ 0, 2.1, 4.2 }) do
|
|
||||||
local p = c + V(math.cos(a) * 6, 0.6, math.sin(a) * 6)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 1.4, 1.4), CFrame = CFrame.lookAt(p, c) * CFrame.Angles(0, math.rad(90), 0) * CFrame.Angles(0, math.rad(90), 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(115, 80, 50) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function pier(center, size, primary)
|
||||||
-- дед-рыбак с подсказками
|
local cf = CFrame.new(center)
|
||||||
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 86), arrive + V(0, 3, 0)), {
|
local deck = block("PierDeck", size, cf, C.wood, Enum.Material.WoodPlanks, true)
|
||||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
if primary then deck:SetAttribute("GuideTarget", "Pier") end
|
||||||
}, "Talk", "Поговорить")
|
|
||||||
|
|
||||||
-- домик рыбака
|
|
||||||
do
|
|
||||||
local cf = CFrame.lookAt(W + V(-44, GROUND_Y, 98), W + V(0, GROUND_Y, 98))
|
|
||||||
local logC = Color3.fromRGB(130, 90, 55)
|
|
||||||
P({ Size = V(14, 1, 12), CFrame = cf * CFrame.new(0, 0.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(110, 80, 50) })
|
|
||||||
P({ Size = V(14, 8, 1), CFrame = cf * CFrame.new(0, 5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(1, 8, 12), CFrame = cf * CFrame.new(s * 6.5, 5, 0), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(5, 8, 1), CFrame = cf * CFrame.new(s * 4.5, 5, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(16, 1, 8.8), CFrame = cf * CFrame.new(0, 11.2, s * 3.4) * CFrame.Angles(math.rad(-s * 38), 0, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 60, 45) })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 2, 1), CFrame = cf * CFrame.new(0, 8, -5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
P({ Size = V(2.2, 2, 0.3), CFrame = cf * CFrame.new(-4.5, 5.5, -6.05), Material = Enum.Material.Glass, Color = Color3.fromRGB(255, 225, 150), Transparency = 0.2 })
|
|
||||||
P({ Size = V(14, 3, 1), CFrame = cf * CFrame.new(0, 10.5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- причалы
|
|
||||||
local function pier(center, size)
|
|
||||||
local deck = P({ Size = size, Position = center, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 110, 70) })
|
|
||||||
local alongZ = size.Z > size.X
|
local alongZ = size.Z > size.X
|
||||||
local len = alongZ and size.Z or size.X
|
local length, width = alongZ and size.Z or size.X, alongZ and size.X or size.Z
|
||||||
local wid = alongZ and size.X or size.Z
|
for d = -length / 2 + 1, length / 2 - 0.5, 2 do
|
||||||
for d = -len / 2 + 1, len / 2 - 1, 6 do
|
local offset = alongZ and V(0, 0.34, d) or V(d, 0.34, 0)
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
local boardSize = alongZ and V(width, 0.16, 1.88) or V(1.88, 0.16, width)
|
||||||
local off = alongZ and V(s * (wid / 2 - 0.4), 0, d) or V(d, 0, s * (wid / 2 - 0.4))
|
block("IndividualPlank", boardSize, cf + offset, C.wood:Lerp(C.dark, rng:NextNumber(0, 0.12)), Enum.Material.WoodPlanks)
|
||||||
vcyl(center + off + V(0, -6, 0), 13, 0.9, { Color = Color3.fromRGB(100, 70, 45), Material = Enum.Material.Wood })
|
end
|
||||||
|
for d = -length / 2 + 1, length / 2 - 1, 8 do
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
local p = center + (alongZ and V(side * (width / 2 - 0.4), 0, d) or V(d, 0, side * (width / 2 - 0.4)))
|
||||||
|
cylA(p - V(0, 7, 0), p + V(0, 1.8, 0), 1.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
ropeRing(p + V(0, 0.8, 0), 0.7)
|
||||||
|
ropeRing(p + V(0, 1.05, 0), 0.7)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return deck
|
return deck
|
||||||
end
|
end
|
||||||
-- { центр от W, размер }
|
local function fishSign(cf, width, height, color)
|
||||||
local PIERS = {
|
local panel = block("FishSign", V(width, height, 0.22), cf, color, Enum.Material.WoodPlanks)
|
||||||
{ V(0, GROUND_Y + 0.2, 58), V(8, 0.6, 42) },
|
for _, face in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||||
{ V(-86, GROUND_Y + 0.2, 15), V(34, 0.6, 7) },
|
local sg = Instance.new("SurfaceGui")
|
||||||
{ V(86, GROUND_Y + 0.2, -10), V(34, 0.6, 7) },
|
sg.Face, sg.LightInfluence, sg.PixelsPerStud = face, 0, 30
|
||||||
}
|
sg.SizingMode, sg.Parent = Enum.SurfaceGuiSizingMode.PixelsPerStud, panel
|
||||||
for i, p in ipairs(PIERS) do
|
local body = Instance.new("Frame")
|
||||||
local deck = pier(W + p[1], p[2])
|
body.Size, body.Position = UDim2.fromScale(0.5, 0.4), UDim2.fromScale(0.2, 0.3)
|
||||||
if i == 1 then
|
body.BackgroundColor3, body.BorderSizePixel, body.Parent = Color3.fromRGB(245, 239, 214), 0, sg
|
||||||
deck:SetAttribute("GuideTarget", "Pier") -- главный причал подсвечивается на шаге обучения
|
local curve = Instance.new("UICorner")
|
||||||
|
curve.CornerRadius, curve.Parent = UDim.new(1, 0), body
|
||||||
|
local tail = Instance.new("TextLabel")
|
||||||
|
tail.Size, tail.Position, tail.BackgroundTransparency = UDim2.fromScale(0.3, 0.65), UDim2.fromScale(0.59, 0.175), 1
|
||||||
|
tail.Text, tail.TextScaled, tail.TextColor3, tail.Parent = "◀", true, body.BackgroundColor3, sg
|
||||||
|
local eye = Instance.new("Frame")
|
||||||
|
eye.Size, eye.Position, eye.BorderSizePixel = UDim2.fromScale(0.045, 0.08), UDim2.fromScale(0.26, 0.43), 0
|
||||||
|
eye.BackgroundColor3, eye.Parent = color, sg
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function smoke(chimney)
|
||||||
|
local effect = Instance.new("ParticleEmitter")
|
||||||
|
effect.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
effect.Rate, effect.Lifetime, effect.Speed = 3, NumberRange.new(3, 5), NumberRange.new(1.5, 2.5)
|
||||||
|
effect.Acceleration, effect.SpreadAngle = V(0.7, 0.5, 0), Vector2.new(10, 10)
|
||||||
|
effect.Color = ColorSequence.new(Color3.fromRGB(220, 223, 219))
|
||||||
|
effect.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.8), NumberSequenceKeypoint.new(1, 4) })
|
||||||
|
effect.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.3), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
effect.Parent = chimney
|
||||||
|
end
|
||||||
|
local function pine(pos, height)
|
||||||
|
cylA(pos, pos + V(0, height * 0.8, 0), height * 0.075, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
local tint = C.pine:Lerp(C.pineDark, rng:NextNumber())
|
||||||
|
for i = 0, 3 do
|
||||||
|
local width = height * (0.6 - i * 0.115)
|
||||||
|
local p = pos + V(0, height * (0.38 + i * 0.18), 0)
|
||||||
|
local lower = block("PineCanopy", V(width, height * 0.26, width), CFrame.new(p) * CFrame.Angles(0, math.pi / 4, 0), tint)
|
||||||
|
lower.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function cabin(pos, lookAt, scale)
|
||||||
|
local cf = CFrame.lookAt(pos, lookAt)
|
||||||
|
local function at(x, y, z) return cf * CFrame.new(x * scale, y * scale, z * scale) end
|
||||||
|
block("CabinFloor", V(21, 0.6, 19) * scale, at(0, 0.3, 0), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for row = 0, 7 do
|
||||||
|
local y = 1 + row * 0.95
|
||||||
|
cylA(at(-9, y, 7).Position, at(9, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(at(side * 8.5, y, -6).Position, at(side * 8.5, y, 7).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
cylA(at(side * 2, y, -6).Position, at(side * 9, y, -6).Position, scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("GreenGableRoof", V(11.6, 0.65, 18) * scale, at(side * 4.7, 10.2, 0.5) * CFrame.Angles(0, 0, -side * 0.53), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
block("RoofTrim", V(12, 0.5, 0.5) * scale, at(side * 4.7, 10.2, -8.5) * CFrame.Angles(0, 0, -side * 0.53), C.dark, Enum.Material.Wood)
|
||||||
|
local window = block("GoldenWindow", V(3.1, 3, 0.2) * scale, at(side * 5.1, 4.7, -6.55), C.warm, Enum.Material.Neon)
|
||||||
|
if side == -1 then light(window, 12, 0.55) end
|
||||||
|
block("WindowMullion", V(0.18, 3.2, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
block("WindowMullion", V(3.3, 0.18, 0.3) * scale, at(side * 5.1, 4.7, -6.7), C.dark)
|
||||||
|
cylA(at(side * 9, -5, -7).Position, at(side * 9, 0, -7).Position, 0.8 * scale, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do block("PorchStep", V(5, 0.3 + i * 0.25, 1) * scale, at(0, -0.3 + i * 0.1, -11 + i), C.wood, Enum.Material.WoodPlanks, true) end
|
||||||
|
lantern(at(-7.3, 3, -8.3))
|
||||||
|
block("StoneChimney", V(2.3, 7, 2.3) * scale, at(4, 12.5, 4), C.rock, Enum.Material.Cobblestone, true)
|
||||||
|
local outlet = block("SmokeOutlet", V(1, 0.1, 1), at(4, 16, 4), C.rock)
|
||||||
|
outlet.Transparency = 1
|
||||||
|
smoke(outlet)
|
||||||
|
end
|
||||||
|
local function crate(cf)
|
||||||
|
block("WoodenCrate", V(2.5, 2.5, 2.5), cf, C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, y in ipairs({ -0.9, 0.9 }) do block("CrateBand", V(2.6, 0.22, 2.6), cf * CFrame.new(0, y, 0), C.wood, Enum.Material.Wood) end
|
||||||
|
end
|
||||||
|
|
||||||
lamp(W + V(-3.5, GROUND_Y + 0.5, 40), Color3.fromRGB(255, 220, 160))
|
-- Прибытие: всё необходимое находится в пределах 25 studs.
|
||||||
lamp(W + V(-70, GROUND_Y + 0.5, 18), Color3.fromRGB(255, 220, 160))
|
local arrive = W + V(0, GROUND_Y, 94)
|
||||||
lamp(W + V(70, GROUND_Y + 0.5, -13), Color3.fromRGB(255, 220, 160))
|
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
||||||
|
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.65, 40)))
|
||||||
|
portal(CFrame.lookAt(W + V(20, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
||||||
|
local shopCF = CFrame.lookAt(W + V(-18, GROUND_Y, 84), arrive)
|
||||||
|
marker("GuideSell", shopCF * CFrame.new(0, 0, -10))
|
||||||
|
local counter = stall(shopCF, {
|
||||||
|
title = "🐟 СКУПКА", titleColor = Color3.fromRGB(240, 230, 200),
|
||||||
|
wall = C.dark, stripeA = Color3.fromRGB(45, 105, 70), stripeB = Color3.fromRGB(240, 230, 200),
|
||||||
|
glow = C.warm, action = "Sell", promptText = "Продать всю рыбу", promptObject = "Скупка",
|
||||||
|
npcName = "Скупщик Гриша",
|
||||||
|
npcColors = { skin = Color3.fromRGB(220, 175, 133), shirt = C.roof, pants = Color3.fromRGB(80, 74, 52), hat = Color3.fromRGB(215, 180, 110) },
|
||||||
|
decor = function(at)
|
||||||
|
for i, color in ipairs({ Color3.fromRGB(110, 190, 60), Color3.fromRGB(245, 211, 64), Color3.fromRGB(241, 140, 55), Color3.fromRGB(70, 160, 219) }) do
|
||||||
|
local p = at(-5 + i * 2, 8.3, 6.7).Position
|
||||||
|
sphere(p, V(0.65, 1.6, 0.45), color)
|
||||||
|
cylA(p + V(0, 0.7, 0), p + V(0, 2.2, 0), 0.05, { Color = C.rope })
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local p = at(-5 + i * 1.4, 5.9, -4).Position
|
||||||
|
sphere(p, V(0.75, 0.75, 0.75), Color3.fromRGB(240, 234, 219))
|
||||||
|
sphere(p + V(0, 0.3, 0), V(0.62, 0.5, 0.62), Color3.fromRGB(214, 66, 53))
|
||||||
|
end
|
||||||
|
block("CounterBox", V(3, 1, 2), at(5, 5.9, -4), C.wood, Enum.Material.WoodPlanks)
|
||||||
|
fishSign(at(0, 21.2, -9.2), 7, 2.6, C.roof)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
counter:SetAttribute("GuideTarget", "Sell")
|
||||||
|
lantern(shopCF * CFrame.new(-10, 7.3, -10))
|
||||||
|
crate(shopCF * CFrame.new(-13, 1.25, -11))
|
||||||
|
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 83), arrive + V(0, 3, 0)), {
|
||||||
|
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = C.roof,
|
||||||
|
}, "Talk", "Поговорить")
|
||||||
|
local boardCF = CFrame.lookAt(W + V(15, GROUND_Y, 74), arrive)
|
||||||
|
for _, x in ipairs({ -4.6, 4.6 }) do cylA((boardCF * CFrame.new(x, 0, 0)).Position, (boardCF * CFrame.new(x, 10, 0)).Position, 0.6, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
local board = block("World1Bestiary", V(10, 8, 0.4), boardCF * CFrame.new(0, 6, 0), C.dark, Enum.Material.WoodPlanks, true)
|
||||||
|
local lines = { "<font color=\"#FFE3A9\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||||
|
for _, fish in ipairs(Config.Zones.World1.fish) do
|
||||||
|
local rarity = Config.Rarities[fish.rarity]
|
||||||
|
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(rarity.color:ToHex(), fish.name, rarity.name))
|
||||||
|
end
|
||||||
|
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
||||||
|
|
||||||
-- лодка у западного причала
|
-- Дощатые причалы, кнехты с канатом и снасти на переднем плане.
|
||||||
|
pier(W + V(0, 4.2, 58), V(12, 0.6, 42), true)
|
||||||
|
pier(W + V(86, 4.2, -10), V(34, 0.6, 8))
|
||||||
|
pier(W + V(-86, 4.2, 15), V(34, 0.6, 8))
|
||||||
|
for _, p in ipairs({ V(-5, 4.7, 40), V(5, 4.7, 72), V(72, 4.7, -13) }) do lanternPost(W + p) end
|
||||||
|
crate(CFrame.new(W + V(-3.8, 5.9, 67)))
|
||||||
|
local tackle = CFrame.new(W + V(3.7, 5.4, 61))
|
||||||
|
block("TackleBox", V(2.6, 1.5, 1.6), tackle, Color3.fromRGB(91, 111, 101), Enum.Material.Metal)
|
||||||
|
block("TackleLid", V(2.8, 0.25, 1.8), tackle * CFrame.new(0, 0.85, 0), Color3.fromRGB(116, 130, 114), Enum.Material.Metal)
|
||||||
|
block("TackleLatch", V(0.3, 0.65, 0.12), tackle * CFrame.new(0, 0.3, -0.85), C.rope, Enum.Material.Metal)
|
||||||
|
for _, x in ipairs({ -0.45, 0.45 }) do block("HandleLeg", V(0.15, 0.4, 0.15), tackle * CFrame.new(x, 1.12, 0), C.dark, Enum.Material.Metal) end
|
||||||
|
block("TackleHandle", V(1, 0.15, 0.15), tackle * CFrame.new(0, 1.35, 0), C.dark, Enum.Material.Metal)
|
||||||
|
local boat = CFrame.new(W + V(19, 0.5, 44)) * CFrame.Angles(0, -0.3, 0)
|
||||||
|
block("BoatHull", V(4.5, 0.5, 10), boat, C.dark, Enum.Material.WoodPlanks)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("BoatGunwale", V(0.35, 1.5, 10), boat * CFrame.new(side * 2.2, 0.7, 0), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatEnd", V(4.5, 1.5, 0.4), boat * CFrame.new(0, 0.7, side * 4.8), C.wood, Enum.Material.Wood)
|
||||||
|
block("BoatSeat", V(4.3, 0.3, 1), boat * CFrame.new(0, 1, side * 2.1), C.dark, Enum.Material.WoodPlanks)
|
||||||
|
cylA((boat * CFrame.new(side * 0.8, 1.4, -2)).Position, (boat * CFrame.new(side * 3.6, 2.3, 2.4)).Position, 0.18, { Color = C.wood, Material = Enum.Material.Wood })
|
||||||
|
block("OarBlade", V(0.7, 0.15, 1.8), boat * CFrame.new(side * 3.8, 2.4, 2.7) * CFrame.Angles(0, side * 0.5, 0), C.wood, Enum.Material.Wood)
|
||||||
|
end
|
||||||
|
cylA(W + V(14, -5, 44), W + V(14, 3.3, 44), 0.9, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
cylA(W + V(14, 2, 44), (boat * CFrame.new(-2.2, 1, 0)).Position, 0.12, { Color = C.rope, Material = Enum.Material.Fabric })
|
||||||
|
|
||||||
|
-- Домики и вывеска с рыбой вдоль левого берега.
|
||||||
|
cabin(W + V(-49, 5, 66), W + V(0, 5, 45), 1)
|
||||||
|
cabin(W + V(-91, 5, -30), W + V(-25, 5, 0), 0.75)
|
||||||
|
cylA(W + V(-78, 4, -42), W + V(-78, 16, -42), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
block("BannerArm", V(5, 0.4, 0.4), CFrame.new(W + V(-76, 15, -42)), C.dark, Enum.Material.Wood)
|
||||||
|
fishSign(CFrame.new(W + V(-75.5, 12, -42)), 3.5, 5, C.roof)
|
||||||
|
|
||||||
|
-- Подъём на холм: пологие отрезки дорожки и ограждение с одной стороны.
|
||||||
|
for i = 1, #WORLD1_TRAIL - 1 do
|
||||||
|
local a, b = W + WORLD1_TRAIL[i], W + WORLD1_TRAIL[i + 1]
|
||||||
|
local cf = CFrame.lookAt((a + b) / 2, b)
|
||||||
|
block("HillTrail", V(7, 0.5, (b - a).Magnitude + 1), cf, Color3.fromRGB(184, 148, 102), Enum.Material.Ground, true)
|
||||||
|
local side = cf.RightVector * 4.2
|
||||||
|
for _, p in ipairs({ a + side, b + side }) do cylA(p, p + V(0, 3, 0), 0.35, { Color = C.dark, Material = Enum.Material.Wood }) end
|
||||||
|
for _, h in ipairs({ 1.2, 2.5 }) do cylA(a + side + V(0, h, 0), b + side + V(0, h, 0), 0.22, { Color = C.wood, Material = Enum.Material.Wood }) end
|
||||||
|
if i < 5 then lanternPost(a - side) end
|
||||||
|
end
|
||||||
|
local top = W + V(-43, 32, -119)
|
||||||
|
for _, x in ipairs({ -5, 5 }) do
|
||||||
|
for _, z in ipairs({ -5, 5 }) do cylA(top + V(x, 0, z), top + V(x, 19, z), 0.7, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
block("LookoutDeck", V(13, 0.65, 13), CFrame.new(top + V(0, 11, 0)), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
block("LookoutRoof", V(8, 0.6, 15), CFrame.new(top + V(side * 3.2, 21, 0)) * CFrame.Angles(0, 0, -side * 0.45), C.roof, Enum.Material.WoodPlanks, true)
|
||||||
|
if side == 1 then
|
||||||
|
for _, x in ipairs({ -1, 1 }) do cylA(top + V(x * 1.8, 14, 5), top + V(x * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
else
|
||||||
|
cylA(top + V(-5, 14, -5), top + V(5, 14, -5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
cylA(top + V(side * 5, 14, -5), top + V(side * 5, 14, 5), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
end
|
||||||
|
for i = 0, 12 do block("LookoutSteps", V(3, 0.6 + i * 0.85, 1.3), CFrame.new(top + V(0, (0.6 + i * 0.85) / 2, 22 - i * 1.25)), C.dark, Enum.Material.WoodPlanks, true) end
|
||||||
|
cylA(top + V(5, 18, 0), top + V(5, 28, 0), 0.25, { Color = C.dark, Material = Enum.Material.Wood })
|
||||||
|
fishSign(CFrame.new(top + V(8, 26, 0)), 6, 3, C.roof)
|
||||||
|
lantern(CFrame.new(top + V(-4, 16, 4)))
|
||||||
|
|
||||||
|
-- Водопад: движущиеся ленты, пена и тихий встроенный звук воды.
|
||||||
|
for i = 0, 3 do
|
||||||
|
local x = 35 + i * 7
|
||||||
|
block("WaterfallRockFace", V(9, 28 + (i % 2) * 4, 7), CFrame.new(W + V(x, 14, -56)) * CFrame.Angles(0, i * 0.15, 0.04), C.rock, Enum.Material.Slate, true)
|
||||||
|
block("MossyLedge", V(9, 0.8, 8), CFrame.new(W + V(x, 29 + (i % 2) * 2, -57)), C.moss, Enum.Material.Grass)
|
||||||
|
end
|
||||||
|
for i = 0, 2 do
|
||||||
|
local x = 39 + i * 5
|
||||||
|
local sheet = block("WaterfallSheet", V(4.8, 30, 0.35), CFrame.new(W + V(x, 15.2, -50.7)), Color3.fromRGB(162, 224, 223), Enum.Material.Glass)
|
||||||
|
sheet.Transparency = 0.4
|
||||||
|
local upper, lower = Instance.new("Attachment"), Instance.new("Attachment")
|
||||||
|
upper.Position, lower.Position = V(0, 14.8, 0), V(0, -14.8, 0)
|
||||||
|
upper.Parent, lower.Parent = sheet, sheet
|
||||||
|
local beam = Instance.new("Beam")
|
||||||
|
beam.Attachment0, beam.Attachment1, beam.Width0, beam.Width1 = upper, lower, 4.8, 5.4
|
||||||
|
beam.Texture, beam.TextureSpeed, beam.TextureLength = "rbxasset://textures/particles/smoke_main.dds", 1.4, 6
|
||||||
|
beam.FaceCamera, beam.Color, beam.LightEmission = true, ColorSequence.new(Color3.fromRGB(224, 248, 242)), 0.15
|
||||||
|
beam.Transparency, beam.Parent = NumberSequence.new(0.35), sheet
|
||||||
|
local foam = sphere(W + V(x, 0.3, -48), V(7, 0.3, 5), Color3.fromRGB(231, 247, 235))
|
||||||
|
foam.Transparency = 0.35
|
||||||
|
local mist = Instance.new("ParticleEmitter")
|
||||||
|
mist.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
mist.Rate, mist.Lifetime, mist.Speed = 4, NumberRange.new(1, 2), NumberRange.new(1, 2.5)
|
||||||
|
mist.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.7), NumberSequenceKeypoint.new(1, 3) })
|
||||||
|
mist.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.6), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
mist.Color, mist.SpreadAngle, mist.Parent = ColorSequence.new(Color3.fromRGB(235, 249, 244)), Vector2.new(40, 40), foam
|
||||||
|
end
|
||||||
|
local soundAnchor = block("WaterfallSound", V(1, 1, 1), CFrame.new(W + V(45, 5, -48)), C.rock)
|
||||||
|
soundAnchor.Transparency = 1
|
||||||
|
local waterSound = Instance.new("Sound")
|
||||||
|
waterSound.Name, waterSound.SoundId = "WaterfallAmbience", "rbxasset://sounds/action_swim.mp3"
|
||||||
|
waterSound.Looped, waterSound.Volume, waterSound.PlaybackSpeed = true, 0.12, 0.65
|
||||||
|
waterSound.RollOffMinDistance, waterSound.RollOffMaxDistance = 10, 120
|
||||||
|
waterSound.Parent = soundAnchor
|
||||||
|
waterSound:Play()
|
||||||
|
for ring = 0, 2 do
|
||||||
|
local ripple = Instance.new("Model")
|
||||||
|
ripple.Name = "WaterfallRipple"
|
||||||
|
ripple:SetAttribute("RippleCenter", W + V(45, 0.16, -42))
|
||||||
|
ripple:SetAttribute("RipplePhase", ring / 3)
|
||||||
|
ripple.Parent = scenery
|
||||||
|
for segment = 0, 11 do
|
||||||
|
local a, b = segment * math.pi / 6, (segment + 1) * math.pi / 6
|
||||||
|
local p = W + V(45, 0.16, -42)
|
||||||
|
local radius = 2 + ring * 2
|
||||||
|
local line = cylA(p + V(math.cos(a) * radius, 0, math.sin(a) * radius), p + V(math.cos(b) * radius, 0, math.sin(b) * radius), 0.07, { Color = Color3.fromRGB(218, 242, 228), Transparency = 0.75, Parent = ripple })
|
||||||
|
line:SetAttribute("RippleSegment", segment)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local creek = block("NarrowFeederStream", V(5, 0.15, 48), CFrame.new(W + V(45, 30.2, -77)), Color3.fromRGB(62, 168, 165), Enum.Material.Glass)
|
||||||
|
creek.Transparency = 0.3
|
||||||
|
for _, x in ipairs({ 41.7, 48.3 }) do block("CreekBank", V(1.5, 0.7, 48), CFrame.new(W + V(x, 30.2, -77)), C.moss, Enum.Material.Grass, true) end
|
||||||
|
local previousBridge
|
||||||
|
for i = 0, 16 do
|
||||||
|
local t = i / 16
|
||||||
|
local pos = W + V(29 + t * 32, 30.7 + math.sin(t * math.pi) * 3.2, -77)
|
||||||
|
local slope = math.atan(math.cos(t * math.pi) * 3.2 * math.pi / 32)
|
||||||
|
block("ArchedBridgePlank", V(2.05, 0.45, 7), CFrame.new(pos) * CFrame.Angles(0, 0, slope), C.wood, Enum.Material.WoodPlanks, true)
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for _, side in ipairs({ -1, 1 }) do
|
||||||
|
cylA(pos + V(0, 0, side * 3.3), pos + V(0, 3.2, side * 3.3), 0.3, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
if previousBridge then cylA(previousBridge + V(0, 2.8, side * 3.3), pos + V(0, 2.8, side * 3.3), 0.25, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true }) end
|
||||||
|
end
|
||||||
|
previousBridge = pos
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(29, 30, -82), V(61, 30, -82) }) do lanternPost(W + p) end
|
||||||
|
|
||||||
|
-- Кувшинки и камыш стоят у внешнего берега, вдали от проходов.
|
||||||
|
for _, lake in ipairs(LAKES) do
|
||||||
|
for i = 1, 8 do
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local d = lake[3] - rng:NextNumber(3, 9)
|
||||||
|
local p = W + V(lake[1] + math.cos(a) * d, 0.13, lake[2] + math.sin(a) * d)
|
||||||
|
if not (math.abs(p.X - W.X) < 8 and p.Z - W.Z > 30) then
|
||||||
|
part({ Name = "LilyPad", Shape = Enum.PartType.Cylinder, Size = V(0.12, 2.6, 2.6), CFrame = CFrame.new(p) * CFrame.Angles(0, 0, math.pi / 2), Color = Color3.fromRGB(79, 147, 68) })
|
||||||
|
if i % 2 == 0 then
|
||||||
|
for petal = 0, 4 do sphere(p + V(math.cos(petal * 1.26) * 0.3, 0.18, math.sin(petal * 1.26) * 0.3), V(0.55, 0.22, 0.4), Color3.fromRGB(239, 151, 177)) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 0, 9 do
|
||||||
|
local a = i * math.pi / 5
|
||||||
|
local x, z = lake[1] + math.cos(a) * (lake[3] + 2), lake[2] + math.sin(a) * (lake[3] + 2)
|
||||||
|
if not inLake(x, z, 0) and not (math.abs(x) < 15 and z > 30) and z < 73 then
|
||||||
|
for j = 1, 4 do
|
||||||
|
local h = rng:NextNumber(2.5, 4.8)
|
||||||
|
local p = W + V(x + rng:NextNumber(-1, 1), 0, z + rng:NextNumber(-1, 1))
|
||||||
|
cylA(p, p + V(0, h, 0), 0.12, { Color = Color3.fromRGB(105, 139, 60) })
|
||||||
|
cylA(p + V(0, h - 0.8, 0), p + V(0, h, 0), 0.3, { Color = Color3.fromRGB(120, 78, 43) })
|
||||||
|
end
|
||||||
|
local p = W + V(x, 0, z)
|
||||||
|
sphere(p, V(4, 2.5, 3.3), C.rock, Enum.Material.Rock)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 1, 8 do
|
||||||
|
local lake = LAKES[(i - 1) % #LAKES + 1]
|
||||||
|
local fish = Instance.new("Model")
|
||||||
|
fish.Name = "AmbientFish"
|
||||||
|
fish:SetAttribute("SwimCenter", W + V(lake[1], -1.8, lake[2]))
|
||||||
|
fish:SetAttribute("SwimRadius", 8 + (i % 3) * 4)
|
||||||
|
fish:SetAttribute("SwimPhase", i * 1.7)
|
||||||
|
fish:SetAttribute("SwimSpeed", 0.08 + i * 0.008)
|
||||||
|
fish.Parent = scenery
|
||||||
|
local cf = CFrame.new(W + V(lake[1], -1.8, lake[2]))
|
||||||
|
local body = part({ Name = "FishShadow", Shape = Enum.PartType.Ball, Size = V(0.7, 0.22, 2), CFrame = cf, Color = Color3.fromRGB(29, 85, 83), Transparency = 0.35, Parent = fish })
|
||||||
|
fish.PrimaryPart = body
|
||||||
|
part({ Name = "TailShadow", Size = V(1, 0.12, 0.7), CFrame = cf * CFrame.new(0, 0, 1.2) * CFrame.Angles(0, math.pi / 4, 0), Color = body.Color, Transparency = 0.4, Parent = fish })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Пояс сосен, отдельные деревья у воды и горы за границей мира.
|
||||||
|
for i = 0, 83 do
|
||||||
|
local a = i / 84 * math.pi * 2
|
||||||
|
local distance = rng:NextNumber(130, 230)
|
||||||
|
local x, z = math.cos(a) * distance, math.sin(a) * distance
|
||||||
|
if not (z < -65 and z > -145 and x > -125 and x < 85) then
|
||||||
|
pine(W + V(x, groundY(W.X + x, W.Z + z), z), rng:NextNumber(14, 24))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ V(-72, 4, 68), V(-101, 4, 41), V(96, 4, 30), V(108, 4, -48), V(-85, 25, -133), V(-20, 27, -139), V(35, 30, -94), V(61, 30, -98) }) do pine(W + p, rng:NextNumber(14, 20)) end
|
||||||
|
for _, p in ipairs({ V(-29, 4, 103), V(42, 4, 73), V(-72, 4, 49) }) do
|
||||||
|
cylA(W + p, W + p + V(0, 11, 0), 1, { Color = C.dark, Material = Enum.Material.Wood, CanCollide = true })
|
||||||
|
for i = 0, 2 do sphere(W + p + V((i - 1) * 3, 11 + (i % 2) * 2, 0), V(9, 7, 8), C.grass) end
|
||||||
|
end
|
||||||
|
for i = 0, 6 do
|
||||||
|
local mountain = block("DistantMountain", V(85, 90 + (i % 3) * 22, 85), CFrame.new(W + V(-240 + i * 80, 30, -300)) * CFrame.Angles(0.2, i * 0.5, 0.15), Color3.fromRGB(131, 157, 168), Enum.Material.Slate)
|
||||||
|
mountain.Shape = Enum.PartType.Ball
|
||||||
|
end
|
||||||
|
for i = 0, 3 do
|
||||||
|
local cloud = sphere(W + V(-120 + i * 83, 115 + (i % 2) * 12, -210), V(40, 12, 22), Color3.fromRGB(245, 245, 231))
|
||||||
|
cloud.Name = "CumulusCloud"
|
||||||
|
sphere(cloud.Position + V(10, 4, 0), V(22, 15, 18), cloud.Color)
|
||||||
|
end
|
||||||
|
for _, wall in ipairs({ { V(0, 40, 245), V(500, 120, 2) }, { V(0, 40, -245), V(500, 120, 2) }, { V(245, 40, 0), V(2, 120, 500) }, { V(-245, 40, 0), V(2, 120, 500) } }) do
|
||||||
|
part({ Name = "WorldBoundary", Position = W + wall[1], Size = wall[2], Transparency = 1, CanCollide = true, CanQuery = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Сохраняем прежнюю последовательность rng для неизменённых Миров 2 и 3.
|
||||||
do
|
do
|
||||||
local cf = CFrame.new(W + V(-74, WATER_Y + 0.3, 24)) * CFrame.Angles(0, math.rad(15), 0)
|
local rng = sharedRng
|
||||||
local hull = Color3.fromRGB(170, 70, 50)
|
|
||||||
P({ Size = V(4, 0.5, 9), CFrame = cf, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
for _, s in ipairs({ -1, 1 }) do
|
|
||||||
P({ Size = V(0.4, 1.4, 9), CFrame = cf * CFrame.new(s * 2, 0.7, 0), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
P({ Size = V(4.4, 1.4, 0.4), CFrame = cf * CFrame.new(0, 0.7, s * 4.5), Material = Enum.Material.Wood, Color = hull })
|
|
||||||
end
|
|
||||||
P({ Size = V(4, 0.3, 1.2), CFrame = cf * CFrame.new(0, 1, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- кувшинки и камыши
|
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 7 do
|
for _ = 1, 7 do rng:NextNumber(0, math.pi * 2); rng:NextNumber(6, l[3] - 5); rng:NextNumber(2, 3.5); rng:NextNumber() end
|
||||||
local a, d = rng:NextNumber(0, math.pi * 2), rng:NextNumber(6, l[3] - 5)
|
|
||||||
local x, z = l[1] + math.cos(a) * d, l[2] + math.sin(a) * d
|
|
||||||
local size = rng:NextNumber(2, 3.5)
|
|
||||||
P({ Shape = Enum.PartType.Cylinder, Size = V(0.15, size, size), CFrame = CFrame.new(W + V(x, WATER_Y + 0.28, z)) * CFrame.Angles(0, 0, math.rad(90)), Color = Color3.fromRGB(70, 150, 60), CanCollide = false })
|
|
||||||
if rng:NextNumber() < 0.4 then
|
|
||||||
ball(W + V(x + 0.3, WATER_Y + 0.55, z), 0.7, { Color = Color3.fromRGB(255, 150, 190), CanCollide = false })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for _ = 1, 9 do
|
for _ = 1, 9 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
||||||
local inOther = false
|
local other = false
|
||||||
for _, o in ipairs(LAKES) do
|
for _, o in ipairs(LAKES) do if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then other = true end end
|
||||||
if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then
|
if not other and not (math.abs(x) < 6 and z > 30) then for _ = 1, 5 do rng:NextNumber(3, 5); rng:NextNumber(-1.2, 1.2); rng:NextNumber(-1.2, 1.2) end end
|
||||||
inOther = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not inOther and not (math.abs(x) < 6 and z > 30) then
|
local function free(x, z)
|
||||||
for _ = 1, 5 do
|
return not inLake(x, z, 14) and (V(x, 0, z) - V(0, 0, 94)).Magnitude >= 36
|
||||||
local h = rng:NextNumber(3, 5)
|
and not (math.abs(x) < 9 and z > 60 and z < 125) and (V(x, 0, z) - V(-44, 0, 98)).Magnitude >= 14
|
||||||
local p = W + V(x + rng:NextNumber(-1.2, 1.2), WATER_Y + h / 2 - 0.5, z + rng:NextNumber(-1.2, 1.2))
|
|
||||||
P({ Size = V(0.18, h, 0.18), Position = p, Color = Color3.fromRGB(85, 130, 50), CanCollide = false })
|
|
||||||
P({ Size = V(0.35, 0.9, 0.35), Position = p + V(0, h / 2 - 0.3, 0), Color = Color3.fromRGB(110, 70, 40), CanCollide = false })
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- деревья, кусты, камни
|
|
||||||
local function freeSpot(x, z)
|
|
||||||
if inLake(x, z, 14) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(0, 0, 94)).Magnitude < 36 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if math.abs(x) < 9 and z > 60 and z < 125 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if (V(x, 0, z) - V(-44, 0, 98)).Magnitude < 14 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
local placed = 0
|
local placed = 0
|
||||||
for _ = 1, 400 do
|
for _ = 1, 400 do
|
||||||
if placed >= 110 then
|
if placed >= 110 then break end
|
||||||
break
|
|
||||||
end
|
|
||||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
local y = groundY(W.X + x, W.Z + z)
|
|
||||||
local roll = rng:NextNumber()
|
local roll = rng:NextNumber()
|
||||||
tree(W + V(x, y - 0.5, z), roll < 0.35 and "pine" or (roll < 0.5 and "birch" or "round"))
|
if roll < 0.35 then rng:NextNumber(8, 12)
|
||||||
|
else rng:NextNumber(7, 10); if roll >= 0.5 then rng:NextInteger(135, 165) end; rng:NextNumber(9, 12) end
|
||||||
placed += 1
|
placed += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _ = 1, 60 do
|
for _ = 1, 60 do
|
||||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||||
if freeSpot(x, z) then
|
if free(x, z) then
|
||||||
bush(W + V(x, groundY(W.X + x, W.Z + z) - 0.6, z))
|
rng:NextInteger(120, 150)
|
||||||
|
for _ = 1, 3 do rng:NextNumber(-1.5, 1.5); rng:NextNumber(-1.5, 1.5); rng:NextNumber(2.5, 4) end
|
||||||
|
if rng:NextNumber() < 0.5 then
|
||||||
|
for _ = 1, 4 do rng:NextNumber(-1.8, 1.8); rng:NextNumber(1.5, 2.6); rng:NextNumber(-1.8, 1.8); rng:NextInteger(1, 3) end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, l in ipairs(LAKES) do
|
for _, l in ipairs(LAKES) do
|
||||||
for _ = 1, 4 do
|
for _ = 1, 4 do
|
||||||
local a = rng:NextNumber(0, math.pi * 2)
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
||||||
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then
|
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then rng:NextNumber(2.5, 5); rng:NextNumber(0, 1); rng:NextNumber(0, 6); rng:NextNumber(0, 1) end
|
||||||
local s = rng:NextNumber(2.5, 5)
|
|
||||||
P({ Size = V(s, s * 0.7, s * 0.9), CFrame = CFrame.new(W + V(x, groundY(W.X + x, W.Z + z), z)) * CFrame.Angles(rng:NextNumber(0, 1), rng:NextNumber(0, 6), rng:NextNumber(0, 1)), Material = Enum.Material.Rock, Color = Color3.fromRGB(125, 125, 130) })
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- фонари вдоль дорожки
|
-- Счётчики позволяют быстро проверить бюджет локации в Studio.
|
||||||
lamp(W + V(6, GROUND_Y, 90))
|
local parts, lights, emitters = 0, 0, 0
|
||||||
lamp(W + V(-6, GROUND_Y, 90))
|
for _, child in ipairs(map:GetChildren()) do
|
||||||
|
if not previous[child] then
|
||||||
-- невидимые стены по краю мира
|
local instances = child:GetDescendants()
|
||||||
for _, w in ipairs({
|
table.insert(instances, child)
|
||||||
{ V(0, 0, 245), V(500, 120, 2) },
|
for _, obj in ipairs(instances) do
|
||||||
{ V(0, 0, -245), V(500, 120, 2) },
|
if obj:IsA("BasePart") then parts += 1
|
||||||
{ V(245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("PointLight") or obj:IsA("SpotLight") then lights += 1
|
||||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
elseif obj:IsA("ParticleEmitter") then emitters += 1 end
|
||||||
}) do
|
|
||||||
P({ Size = w[2], Position = W + w[1] + V(0, 40, 0), Transparency = 1 })
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
scenery:SetAttribute("PartCount", parts)
|
||||||
|
scenery:SetAttribute("LightCount", lights)
|
||||||
|
scenery:SetAttribute("EmitterCount", emitters)
|
||||||
|
if parts > 3000 or lights > 25 or emitters > 10 then warn("[World1] Превышен бюджет деталей или эффектов", parts, lights, emitters) end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------- помощники для новых миров
|
---------------------------------------------------------------- помощники для новых миров
|
||||||
|
|
||||||
@@ -1474,7 +1724,7 @@ do
|
|||||||
below, above = lakeState(l)
|
below, above = lakeState(l)
|
||||||
if not lakeOk(below, above) then
|
if not lakeOk(below, above) then
|
||||||
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
||||||
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, Color3.fromRGB(30, 120, 150))
|
planes[i] = waterPlane(w1.center + V(l[1], w1.waterY + 0.05, l[2]), l[3] * 2, w1.water)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1538,21 +1538,109 @@ local lastWorldId = "none"
|
|||||||
local terrain = workspace.Terrain
|
local terrain = workspace.Terrain
|
||||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||||
|
|
||||||
|
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
||||||
|
local lakeDefaults
|
||||||
|
|
||||||
local function applyAmbience(world)
|
local function applyAmbience(world)
|
||||||
local clock = (world and world.clock) or 14.5
|
local lake = world and world.id == "World1"
|
||||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
|
||||||
terrain.WaterColor = (world and world.water) or defaultWater
|
|
||||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||||
|
local bloom = Lighting:FindFirstChildOfClass("BloomEffect")
|
||||||
|
local grade = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||||
|
local rays = Lighting:FindFirstChildOfClass("SunRaysEffect")
|
||||||
|
if not lakeDefaults then
|
||||||
|
lakeDefaults = {
|
||||||
|
ambient = Lighting.Ambient, outdoor = Lighting.OutdoorAmbient,
|
||||||
|
brightness = Lighting.Brightness, exposure = Lighting.ExposureCompensation,
|
||||||
|
latitude = Lighting.GeographicLatitude, reflectance = terrain.WaterReflectance,
|
||||||
|
haze = atm and atm.Haze or 0.6, decay = atm and atm.Decay or Color3.fromRGB(110, 140, 175),
|
||||||
|
bloom = bloom and bloom.Intensity or 0.5, threshold = bloom and bloom.Threshold or 1.4,
|
||||||
|
tint = grade and grade.TintColor or Color3.new(1, 1, 1),
|
||||||
|
contrast = grade and grade.Contrast or 0.06, rays = rays and rays.Intensity or 0.05,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
local base = lakeDefaults
|
||||||
|
TweenService:Create(Lighting, TweenInfo.new(2), {
|
||||||
|
ClockTime = (world and world.clock) or 14.5,
|
||||||
|
Ambient = lake and Color3.fromRGB(108, 100, 85) or base.ambient,
|
||||||
|
OutdoorAmbient = lake and Color3.fromRGB(157, 160, 144) or base.outdoor,
|
||||||
|
Brightness = lake and 2.5 or base.brightness,
|
||||||
|
ExposureCompensation = lake and 0.08 or base.exposure,
|
||||||
|
GeographicLatitude = lake and 35 or base.latitude,
|
||||||
|
}):Play()
|
||||||
|
terrain.WaterColor = (world and world.water) or defaultWater
|
||||||
|
terrain.WaterTransparency = (world and world.waterTransparency) or 0.15
|
||||||
|
terrain.WaterReflectance = lake and 0.12 or base.reflectance
|
||||||
if atm then
|
if atm then
|
||||||
local frost = world and world.id == "World3"
|
local frost = world and world.id == "World3"
|
||||||
TweenService:Create(atm, TweenInfo.new(2), {
|
TweenService:Create(atm, TweenInfo.new(2), {
|
||||||
Density = frost and 0.38 or 0.25,
|
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
||||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
Color = lake and Color3.fromRGB(205, 222, 232) or (frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232)),
|
||||||
|
Decay = lake and Color3.fromRGB(155, 173, 177) or base.decay,
|
||||||
|
Haze = lake and 1 or base.haze,
|
||||||
}):Play()
|
}):Play()
|
||||||
end
|
end
|
||||||
|
if bloom then TweenService:Create(bloom, TweenInfo.new(2), { Intensity = lake and 0.25 or base.bloom, Threshold = lake and 1.5 or base.threshold }):Play() end
|
||||||
|
if grade then
|
||||||
|
TweenService:Create(grade, TweenInfo.new(2), {
|
||||||
|
TintColor = lake and Color3.fromRGB(255, 242, 220) or base.tint,
|
||||||
|
Contrast = lake and 0.08 or base.contrast,
|
||||||
|
}):Play()
|
||||||
|
end
|
||||||
|
if rays then rays.Intensity = lake and 0.06 or base.rays end
|
||||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Восемь силуэтов обновляются локально 20 раз в секунду и только рядом с озером.
|
||||||
|
local fishScenery, ambientFish, waterfallRipples = nil, {}, {}
|
||||||
|
local fishElapsed = 0
|
||||||
|
RunService.Heartbeat:Connect(function(dt)
|
||||||
|
fishElapsed += dt
|
||||||
|
if fishElapsed < 0.05 then return end
|
||||||
|
fishElapsed = 0
|
||||||
|
local world = currentWorld()
|
||||||
|
if not world or world.id ~= "World1" then return end
|
||||||
|
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if not root or (root.Position - world.center).Magnitude > 180 then return end
|
||||||
|
if not fishScenery or not fishScenery.Parent or #ambientFish == 0 then
|
||||||
|
local map = workspace:FindFirstChild("FishingMap")
|
||||||
|
fishScenery = map and map:FindFirstChild("World1Scenery")
|
||||||
|
ambientFish, waterfallRipples = {}, {}
|
||||||
|
if fishScenery then
|
||||||
|
for _, child in ipairs(fishScenery:GetChildren()) do
|
||||||
|
if child:IsA("Model") and child.Name == "AmbientFish" then table.insert(ambientFish, child) end
|
||||||
|
if child:IsA("Model") and child.Name == "WaterfallRipple" then table.insert(waterfallRipples, child) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
for _, ripple in ipairs(waterfallRipples) do
|
||||||
|
if ripple.Parent then
|
||||||
|
local center = ripple:GetAttribute("RippleCenter")
|
||||||
|
local phase = (now * 0.3 + ripple:GetAttribute("RipplePhase")) % 1
|
||||||
|
local radius = 2 + phase * 8
|
||||||
|
for _, segment in ipairs(ripple:GetChildren()) do
|
||||||
|
local index = segment:GetAttribute("RippleSegment")
|
||||||
|
local a, b = index * math.pi / 6, (index + 1) * math.pi / 6
|
||||||
|
local p = center + Vector3.new(math.cos(a) * radius, 0, math.sin(a) * radius)
|
||||||
|
local q = center + Vector3.new(math.cos(b) * radius, 0, math.sin(b) * radius)
|
||||||
|
segment.Size = Vector3.new((q - p).Magnitude, 0.07, 0.07)
|
||||||
|
segment.CFrame = CFrame.lookAt((p + q) / 2, q) * CFrame.Angles(0, math.pi / 2, 0)
|
||||||
|
segment.Transparency = 0.6 + phase * 0.4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, fish in ipairs(ambientFish) do
|
||||||
|
if fish.Parent then
|
||||||
|
local center, radius = fish:GetAttribute("SwimCenter"), fish:GetAttribute("SwimRadius")
|
||||||
|
local angle = now * fish:GetAttribute("SwimSpeed") + fish:GetAttribute("SwimPhase")
|
||||||
|
local pos = center + Vector3.new(math.cos(angle) * radius, 0, math.sin(angle) * radius * 0.65)
|
||||||
|
local direction = Vector3.new(-math.sin(angle), 0, math.cos(angle) * 0.65)
|
||||||
|
fish:PivotTo(CFrame.lookAt(pos, pos + direction))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
while true do
|
while true do
|
||||||
local w = currentWorld()
|
local w = currentWorld()
|
||||||
|
|||||||
Reference in new issue
Block a user