Compare commits
10
Commits
58ce572e2d
...
ver_GPT
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc6c45409d | ||
|
|
1d5300eb96 | ||
|
|
57ba58f0ca | ||
|
|
1bb038816b | ||
|
|
059a42295d | ||
|
|
ccd24dc5ec | ||
|
|
ec69c6c8d7 | ||
|
|
8434f61030 | ||
|
|
28ec53735b | ||
|
|
c3cf9a9bec |
No files matched your search
+1541
-389
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -12,8 +12,9 @@ Config.Worlds = {
|
||||
{
|
||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
||||
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
|
||||
desc = "Уютное лесное озеро: прозрачная бирюзовая вода, солнечный причал и водопад среди сосен.",
|
||||
clock = 16.2, water = Color3.fromRGB(40, 170, 165),
|
||||
waterTransparency = 0.6,
|
||||
waterY = 0,
|
||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
||||
},
|
||||
@@ -58,6 +59,80 @@ function Config.WorldAt(pos)
|
||||
return nil
|
||||
end
|
||||
|
||||
-- куда бросать из этой точки (единичный вектор по горизонтали): к центру ближайшего озера или лунки,
|
||||
-- а если ближе море — от центра острова к морю
|
||||
function Config.CastDirection(world, pos)
|
||||
if not world then
|
||||
return nil
|
||||
end
|
||||
local x, z = pos.X - world.center.X, pos.Z - world.center.Z
|
||||
local best, bestGap
|
||||
local function consider(dir, gap)
|
||||
if dir.Magnitude > 0.1 and (not bestGap or gap < bestGap) then
|
||||
best, bestGap = dir.Unit, gap
|
||||
end
|
||||
end
|
||||
if world.holes then
|
||||
for _, h in ipairs(world.holes) do
|
||||
consider(Vector3.new(h[1] - x, 0, h[2] - z), math.sqrt((h[1] - x) ^ 2 + (h[2] - z) ^ 2) - (world.holeRadius or 6))
|
||||
end
|
||||
end
|
||||
for _, l in ipairs(world.lakes or {}) do
|
||||
if not world.holes then -- в Мире 3 озёра подо льдом, бросаем только в лунки
|
||||
consider(Vector3.new(l[1] - x, 0, l[2] - z), math.sqrt((l[1] - x) ^ 2 + (l[2] - z) ^ 2) - l[3])
|
||||
end
|
||||
end
|
||||
if world.sea then
|
||||
consider(Vector3.new(x, 0, z), world.sea - math.sqrt(x * x + z * z))
|
||||
end
|
||||
return best
|
||||
end
|
||||
|
||||
-- расстояние по горизонтали от точки до ближайшей воды (0 — над водой: на причале или в воде)
|
||||
function Config.WaterGap(world, pos)
|
||||
if not world then
|
||||
return math.huge
|
||||
end
|
||||
local x, z = pos.X - world.center.X, pos.Z - world.center.Z
|
||||
local gap = math.huge
|
||||
if world.holes then
|
||||
for _, h in ipairs(world.holes) do
|
||||
gap = math.min(gap, math.sqrt((h[1] - x) ^ 2 + (h[2] - z) ^ 2) - (world.holeRadius or 6))
|
||||
end
|
||||
else
|
||||
for _, l in ipairs(world.lakes or {}) do
|
||||
gap = math.min(gap, math.sqrt((l[1] - x) ^ 2 + (l[2] - z) ^ 2) - l[3])
|
||||
end
|
||||
end
|
||||
if world.sea then
|
||||
gap = math.min(gap, world.sea - math.sqrt(x * x + z * z))
|
||||
end
|
||||
return math.max(0, gap)
|
||||
end
|
||||
|
||||
-- можно ли закидывать отсюда (pos — центр персонажа): стоим на берегу или платформе
|
||||
-- и до воды не дальше Config.CastReach. Возвращает true или текст подсказки.
|
||||
-- humanoid можно не передавать (на сервере его состояние ненадёжно) — тогда проверяем только по высоте.
|
||||
function Config.CanCastFrom(world, pos, humanoid)
|
||||
if not world then
|
||||
return "🌍 Тут нет рыбы"
|
||||
end
|
||||
local inWater = pos.Y < (world.waterY or 0) + 2 -- у плывущего персонажа центр почти на уровне воды
|
||||
if humanoid then
|
||||
inWater = inWater or humanoid:GetState() == Enum.HumanoidStateType.Swimming or humanoid.FloorMaterial == Enum.Material.Water
|
||||
end
|
||||
if inWater then
|
||||
return "🏊 Выйди из воды"
|
||||
end
|
||||
if humanoid and humanoid.FloorMaterial == Enum.Material.Air then
|
||||
return "Встань на землю"
|
||||
end
|
||||
if Config.WaterGap(world, pos) > Config.CastReach then
|
||||
return "🌊 Подойди к воде"
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- есть ли вода в этой точке мира (озеро, море или лунка)
|
||||
function Config.IsWater(world, pos)
|
||||
if not world then
|
||||
@@ -264,6 +339,16 @@ Config.BiteTimeMin = 3
|
||||
Config.BiteTimeMax = 7
|
||||
Config.BiteTimeout = 12
|
||||
Config.MaxMisses = 2
|
||||
-- заброс: держишь ЛКМ — сила ездит 0 → 1 → 0 → …; от силы в момент отпускания зависит дальность
|
||||
Config.CastChargeTime = 1.3 -- секунд на проход шкалы в одну сторону
|
||||
Config.CastMinDist, Config.CastMaxDist = 6, 28
|
||||
Config.CastReach = 7 -- закидывать можно не дальше ~2 м (7 studs) от воды
|
||||
Config.CastPerfect = { 0.72, 0.86 } -- зелёная зона шкалы
|
||||
Config.CastPerfectLuck = 1.2 -- множитель удачи за попадание в зелёную зону
|
||||
|
||||
-- обучение: линия-подсказка ведёт по шагам 0 → 1 → 2 → 3, на 4 обучение пройдено
|
||||
-- 0 — табличка «Как играть», 1 — портал в Мир 1, 2 — причал (поймать рыбу), 3 — скупка (продать)
|
||||
Config.TutorialDone = 4
|
||||
function Config.HitsNeeded(rank)
|
||||
return math.ceil(rank / 2)
|
||||
end
|
||||
|
||||
@@ -52,26 +52,35 @@ terrain.WaterWaveSpeed = 12
|
||||
|
||||
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
||||
|
||||
local W = V(0, 0, 1500) -- центр Мира 1
|
||||
local GROUND_Y = 4 -- верх земли
|
||||
local WATER_Y = 0 -- поверхность воды
|
||||
|
||||
-- озеро из нескольких кругов: { x, z, радиус }
|
||||
local W = Config.Worlds[1].center
|
||||
local GROUND_Y, WATER_Y = 4, 0
|
||||
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)
|
||||
-- холмы по краям
|
||||
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)
|
||||
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
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
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)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
@@ -80,34 +89,39 @@ end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||
end
|
||||
-- то же самое напрямую по вокселям: вода ниже WATER_Y, воздух выше.
|
||||
-- Fill* с Air иногда оставляет песок над водой, и озеро выглядит сухим.
|
||||
|
||||
-- Мелководье вычисляется по объединению кругов: на пересечениях нет песчаных стенок.
|
||||
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 size = mats.Size
|
||||
local corner = region.CFrame.Position - region.Size / 2
|
||||
local center = W + V(l[1], 0, l[2])
|
||||
local size, corner = mats.Size, region.CFrame.Position - region.Size / 2
|
||||
for x = 1, size.X do
|
||||
for y = 1, size.Y do
|
||||
for z = 1, size.Z do
|
||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
||||
local water = c.Y < WATER_Y
|
||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
||||
occ[x][y][z] = water and 1 or 0
|
||||
for z = 1, size.Z do
|
||||
local px, pz = corner.X + (x - 0.5) * 4 - W.X, corner.Z + (z - 0.5) * 4 - W.Z
|
||||
if (px - l[1]) ^ 2 + (pz - l[2]) ^ 2 <= l[3] ^ 2 then
|
||||
local inland = 0
|
||||
for _, lake in ipairs(LAKES) do
|
||||
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
|
||||
terrain:WriteVoxels(region, 4, mats, occ)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
carveLake(l)
|
||||
end
|
||||
-- дорожка от точки прибытия к причалу и площадка
|
||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 100)), V(8, 4, 44), Enum.Material.Ground)
|
||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 130)), 4, 17, Enum.Material.Cobblestone)
|
||||
for _, l in ipairs(LAKES) do carveLake(l) end
|
||||
|
||||
-- Прибытие и короткий подход к главному причалу.
|
||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(12, 4, 14), Enum.Material.Ground)
|
||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 94)), 4, 13, Enum.Material.Cobblestone)
|
||||
|
||||
|
||||
---------------------------------------------------------------- точка появления в лобби
|
||||
|
||||
@@ -118,7 +132,7 @@ if not spawn then
|
||||
end
|
||||
spawn.Anchored = true
|
||||
spawn.Size = V(8, 0.2, 8)
|
||||
spawn.CFrame = CFrame.new(0, 1.15, 50)
|
||||
spawn.CFrame = CFrame.new(0, 1.15, 57)
|
||||
spawn.Transparency = 1
|
||||
spawn.Duration = 0
|
||||
for _, d in ipairs(spawn:GetChildren()) do
|
||||
@@ -514,7 +528,7 @@ for _, a in ipairs({ 0, 90, 180, 270 }) do
|
||||
P({ Size = V(10, 1.0, 48), CFrame = CFrame.new(math.cos(r) * 60, 0.52, math.sin(r) * 60) * CFrame.Angles(0, -r + math.pi / 2, 0), Material = Enum.Material.Marble, Color = Color3.fromRGB(225, 218, 205) })
|
||||
end
|
||||
|
||||
marker("LobbySpawn", CFrame.new(0, FLOOR + 2, 50))
|
||||
marker("LobbySpawn", CFrame.new(0, FLOOR + 2, 57)) -- на дорожке за табличкой «Как играть»: сначала она, дальше портал в Мир 1
|
||||
|
||||
-- фонтан со статуей золотой рыбы
|
||||
vcyl(V(0, FLOOR + 1, 0), 2, 24, { Material = Enum.Material.Slate, Color = Color3.fromRGB(205, 200, 190) })
|
||||
@@ -552,16 +566,24 @@ do
|
||||
water.Acceleration = V(0, -25, 0)
|
||||
water.Parent = att
|
||||
end
|
||||
for i = 0, 5 do
|
||||
local a = math.rad(i * 60 + 30)
|
||||
bench(CFrame.lookAt(V(math.cos(a) * 17, FLOOR, math.sin(a) * 17), V(math.cos(a) * 30, FLOOR, math.sin(a) * 30)))
|
||||
-- скамейки по внешнему краю площади, между порталами, лицом к фонтану
|
||||
for _, deg in ipairs({ 45, 135, 225, 315 }) do
|
||||
local a = math.rad(deg)
|
||||
for _, side in ipairs({ -1, 1 }) do
|
||||
local b = a + side * math.rad(9)
|
||||
bench(CFrame.lookAt(V(math.cos(b) * 34, FLOOR, math.sin(b) * 34), V(0, FLOOR, 0)))
|
||||
end
|
||||
end
|
||||
|
||||
-- фонари по кругу
|
||||
-- фонари по кругу (у спавна — за спиной игрока, чтобы не закрывали табличку и сундук)
|
||||
for i = 0, 7 do
|
||||
local a = math.rad(i * 45 + 22.5)
|
||||
lamp(V(math.cos(a) * 40, FLOOR, math.sin(a) * 40))
|
||||
local deg = i * 45 + 22.5
|
||||
if deg ~= 67.5 and deg ~= 112.5 then
|
||||
local a = math.rad(deg)
|
||||
lamp(V(math.cos(a) * 40, FLOOR, math.sin(a) * 40))
|
||||
end
|
||||
end
|
||||
lamp(V(7, FLOOR, 48)) -- левый фонарь стоит за табличкой «Как играть»
|
||||
|
||||
-- клумбы с деревьями
|
||||
for _, deg in ipairs({ 225, 315 }) do
|
||||
@@ -660,12 +682,20 @@ stall(CFrame.lookAt(V(62, FLOOR, 0), V(0, FLOOR, 0)), {
|
||||
end,
|
||||
})
|
||||
|
||||
-- порталы во все миры и арка с названием
|
||||
local portalCF = CFrame.lookAt(V(0, FLOOR, -66), V(0, FLOOR, 0))
|
||||
arch(portalCF, 84, 24, "🎣 " .. string.upper(Config.GameName) .. " 🎣", Color3.fromRGB(255, 190, 60))
|
||||
-- арка с названием
|
||||
arch(CFrame.lookAt(V(0, FLOOR, -66), V(0, FLOOR, 0)), 84, 24, "🎣 " .. string.upper(Config.GameName) .. " 🎣", Color3.fromRGB(255, 190, 60))
|
||||
|
||||
-- порталы по кругу у фонтана, лицом наружу; первый (бесплатный) мир — прямо перед точкой появления
|
||||
local PORTAL_R = 19
|
||||
for i, w in ipairs(Config.Worlds) do
|
||||
local title = w.icon .. " " .. w.name .. (w.level > 1 and (" (ур. " .. w.level .. ")") or "")
|
||||
portal(portalCF * CFrame.new(-27 + (i - 1) * 18, 0, 0), title, w.color, w.id, w.soon)
|
||||
local a = math.rad(90 - (i - 1) * 90) -- 90° = сторона спавна (+Z)
|
||||
local pos = V(math.cos(a) * PORTAL_R, FLOOR, math.sin(a) * PORTAL_R)
|
||||
local disc = portal(CFrame.lookAt(pos, V(pos.X * 2, FLOOR, pos.Z * 2)), title, w.color, w.id, w.soon)
|
||||
if i == 1 then
|
||||
disc:SetAttribute("GuideTarget", "Portal")
|
||||
marker("GuidePortal", CFrame.new(pos.X * 1.3, FLOOR, pos.Z * 1.3)) -- точка перед порталом для линии-подсказки
|
||||
end
|
||||
end
|
||||
|
||||
-- невидимая стена по кругу: из лобби не уйти
|
||||
@@ -746,304 +776,489 @@ end
|
||||
|
||||
-- табличка «Как играть»
|
||||
do
|
||||
local pos = V(-14, FLOOR, 34)
|
||||
local cf = CFrame.lookAt(pos, V(0, FLOOR, 50))
|
||||
-- слева от дорожки за точкой появления, лицом к камере игрока; фонарь — за табличкой
|
||||
local pos = V(-12, FLOOR, 48)
|
||||
local cf = CFrame.lookAt(pos, V(0, FLOOR, 64))
|
||||
lamp((cf * CFrame.new(0, 0, 2.5)).Position)
|
||||
marker("GuideBoard", cf * CFrame.new(0, 0, -6)) -- перед табличкой, для линии-подсказки
|
||||
for _, x in ipairs({ -6.5, 6.5 }) do
|
||||
P({ Size = V(0.8, 9, 0.8), CFrame = cf * CFrame.new(x, 4.5, 0.3), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 40) })
|
||||
end
|
||||
local board = P({ Size = V(14, 8, 0.5), CFrame = cf * CFrame.new(0, 6, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(70, 48, 32) })
|
||||
board:SetAttribute("GuideTarget", "Board") -- подсвечивается на шаге обучения
|
||||
surfaceText(board, Enum.NormalId.Front,
|
||||
"<font color=\"#FFD866\">КАК ИГРАТЬ</font>\n1. Портал «Мир 1» или кнопка 🌍 Миры\n2. Удочка — клавиша 1, клик у воды\n3. Клюёт → кликай в зелёную зону\n4. 🎒 Сумка — B, 📜 Задания — Q\n5. Собирай коллекцию — получай награды!",
|
||||
"<font color=\"#FFD866\">КАК ИГРАТЬ</font>\n1. Портал «Мир 1» или кнопка 🌍 Миры\n2. Удочка — клавиша 1, у воды зажми ЛКМ и отпусти\n3. Клюёт → кликай в зелёную зону\n4. 🎒 Сумка — B, 📜 Задания — Q\n5. Собирай коллекцию — получай награды!",
|
||||
Color3.fromRGB(255, 245, 225), { TextXAlignment = Enum.TextXAlignment.Left })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
||||
|
||||
local function inLake(x, z, extra)
|
||||
for _, l in ipairs(LAKES) do
|
||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
||||
return true
|
||||
do
|
||||
local previous = {}
|
||||
for _, child in ipairs(map:GetChildren()) do previous[child] = true end
|
||||
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
|
||||
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
|
||||
return false
|
||||
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
|
||||
obj.Parent = parent
|
||||
end
|
||||
local function lantern(cf)
|
||||
local bulb = block("Lantern", V(0.8, 1.15, 0.8), cf, C.warm, Enum.Material.Neon)
|
||||
light(bulb, 14, 0.8)
|
||||
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
|
||||
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
|
||||
return false
|
||||
end
|
||||
|
||||
-- прибытие
|
||||
local arrive = W + V(0, GROUND_Y, 128)
|
||||
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
||||
arch(CFrame.new(W + V(0, GROUND_Y, 112)), 14, 11, "🌊 ТИХОЕ ОЗЕРО", Color3.fromRGB(80, 200, 255))
|
||||
portal(CFrame.lookAt(W + V(-26, GROUND_Y, 140), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
||||
stall(CFrame.lookAt(W + V(30, GROUND_Y, 140), 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) },
|
||||
})
|
||||
|
||||
-- доска «Кто водится в озере»
|
||||
do
|
||||
local pos = W + V(-16, GROUND_Y, 104)
|
||||
local cf = CFrame.lookAt(pos, W + V(0, GROUND_Y, 120))
|
||||
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) })
|
||||
local function lanternPost(pos)
|
||||
cylA(pos, pos + V(0, 5, 0), 0.4, { Color = C.dark, Material = Enum.Material.Wood })
|
||||
lantern(CFrame.new(pos + V(0, 5.4, 0)))
|
||||
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 lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
||||
local r = Config.Rarities[f.rarity]
|
||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
||||
local function ropeRing(pos, radius)
|
||||
for i = 0, 7 do
|
||||
local a, b = i * math.pi / 4, (i + 1) * math.pi / 4
|
||||
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
|
||||
end
|
||||
local function pier(center, size, primary)
|
||||
local cf = CFrame.new(center)
|
||||
local deck = block("PierDeck", size, cf, C.wood, Enum.Material.WoodPlanks, true)
|
||||
if primary then deck:SetAttribute("GuideTarget", "Pier") end
|
||||
local alongZ = size.Z > size.X
|
||||
local length, width = alongZ and size.Z or size.X, alongZ and size.X or size.Z
|
||||
for d = -length / 2 + 1, length / 2 - 0.5, 2 do
|
||||
local offset = alongZ and V(0, 0.34, d) or V(d, 0.34, 0)
|
||||
local boardSize = alongZ and V(width, 0.16, 1.88) or V(1.88, 0.16, width)
|
||||
block("IndividualPlank", boardSize, cf + offset, C.wood:Lerp(C.dark, rng:NextNumber(0, 0.12)), Enum.Material.WoodPlanks)
|
||||
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
|
||||
return deck
|
||||
end
|
||||
local function fishSign(cf, width, height, color)
|
||||
local panel = block("FishSign", V(width, height, 0.22), cf, color, Enum.Material.WoodPlanks)
|
||||
for _, face in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||
local sg = Instance.new("SurfaceGui")
|
||||
sg.Face, sg.LightInfluence, sg.PixelsPerStud = face, 0, 30
|
||||
sg.SizingMode, sg.Parent = Enum.SurfaceGuiSizingMode.PixelsPerStud, panel
|
||||
local body = Instance.new("Frame")
|
||||
body.Size, body.Position = UDim2.fromScale(0.5, 0.4), UDim2.fromScale(0.2, 0.3)
|
||||
body.BackgroundColor3, body.BorderSizePixel, body.Parent = Color3.fromRGB(245, 239, 214), 0, sg
|
||||
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
|
||||
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
|
||||
|
||||
-- Прибытие: всё необходимое находится в пределах 25 studs.
|
||||
local arrive = W + V(0, GROUND_Y, 94)
|
||||
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))
|
||||
end
|
||||
|
||||
-- костёр с брёвнами
|
||||
do
|
||||
local c = W + V(14, GROUND_Y, 118)
|
||||
for i = 0, 7 do
|
||||
local a = i / 8 * math.pi * 2
|
||||
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 })
|
||||
-- Дощатые причалы, кнехты с канатом и снасти на переднем плане.
|
||||
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
|
||||
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) })
|
||||
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 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
|
||||
|
||||
-- дед-рыбак с подсказками
|
||||
npc("Дед Петрович", CFrame.lookAt(W + V(-7, GROUND_Y + 3, 80), W + V(0, GROUND_Y + 3, 95)), {
|
||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
||||
}, "Talk", "Поговорить")
|
||||
|
||||
-- домик рыбака
|
||||
do
|
||||
local cf = CFrame.lookAt(W + V(-34, GROUND_Y, 100), W + V(0, GROUND_Y, 100))
|
||||
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)
|
||||
P({ Size = size, Position = center, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 110, 70) })
|
||||
local alongZ = size.Z > size.X
|
||||
local len = alongZ and size.Z or size.X
|
||||
local wid = alongZ and size.X or size.Z
|
||||
for d = -len / 2 + 1, len / 2 - 1, 6 do
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
local off = alongZ and V(s * (wid / 2 - 0.4), 0, d) or V(d, 0, s * (wid / 2 - 0.4))
|
||||
vcyl(center + off + V(0, -6, 0), 13, 0.9, { Color = Color3.fromRGB(100, 70, 45), Material = Enum.Material.Wood })
|
||||
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
|
||||
end
|
||||
-- { центр от W, размер }
|
||||
local PIERS = {
|
||||
{ V(0, GROUND_Y + 0.2, 58), V(8, 0.6, 42) },
|
||||
{ V(-86, GROUND_Y + 0.2, 15), V(34, 0.6, 7) },
|
||||
{ V(86, GROUND_Y + 0.2, -10), V(34, 0.6, 7) },
|
||||
}
|
||||
for _, p in ipairs(PIERS) do
|
||||
pier(W + p[1], p[2])
|
||||
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
|
||||
|
||||
-- невидимое ограждение: в воду не зайти, рыбачить можно с берега и причалов
|
||||
do
|
||||
local function barrier(cf, size)
|
||||
P({ Name = "LakeBarrier", Size = size, CFrame = cf, Transparency = 1, CanQuery = false, CanTouch = false, CastShadow = false })
|
||||
end
|
||||
local SEG = 3 -- длина секции по берегу
|
||||
local H = 500 -- высота: не перепрыгнуть
|
||||
local MID = WATER_Y + H / 2
|
||||
local function onPier(x, z, pad)
|
||||
for _, p in ipairs(PIERS) do
|
||||
if math.abs(x - p[1].X) < p[2].X / 2 + pad and math.abs(z - p[1].Z) < p[2].Z / 2 + pad then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
-- по внешнему краю озёр (участки внутри соседнего озера пропускаем)
|
||||
for _, l in ipairs(LAKES) do
|
||||
local r = l[3] + 2
|
||||
local n = math.ceil(2 * math.pi * r / SEG)
|
||||
local len = 2 * math.pi * r / n + 0.6
|
||||
for i = 0, n - 1 do
|
||||
local a = i / n * math.pi * 2
|
||||
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||
local inner = false
|
||||
for _, o in ipairs(LAKES) do
|
||||
if o ~= l and (x - o[1]) ^ 2 + (z - o[2]) ^ 2 < (o[3] + 2) ^ 2 then
|
||||
inner = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not inner and not onPier(x, z, len / 2 + 0.2) then
|
||||
local pos = W + V(x, MID, z)
|
||||
barrier(CFrame.lookAt(pos, W + V(l[1], MID, l[2])), V(len, H, 1))
|
||||
end
|
||||
end
|
||||
end
|
||||
-- бортики причалов: по бокам и на конце, который над водой
|
||||
for _, p in ipairs(PIERS) do
|
||||
local c, s = p[1], p[2]
|
||||
local h, y = H, MID
|
||||
local alongZ = s.Z > s.X
|
||||
for _, side in ipairs({ -1, 1 }) do
|
||||
if alongZ then
|
||||
barrier(CFrame.new(W + V(c.X + side * (s.X / 2 + 0.5), y, c.Z)), V(1, h, s.Z))
|
||||
else
|
||||
barrier(CFrame.new(W + V(c.X, y, c.Z + side * (s.Z / 2 + 0.5))), V(s.X, h, 1))
|
||||
end
|
||||
end
|
||||
for _, side in ipairs({ -1, 1 }) do
|
||||
local ex = alongZ and c.X or c.X + side * s.X / 2
|
||||
local ez = alongZ and c.Z + side * s.Z / 2 or c.Z
|
||||
if inLake(ex, ez) then
|
||||
if alongZ then
|
||||
barrier(CFrame.new(W + V(ex, y, ez + side * 0.5)), V(s.X + 2, h, 1))
|
||||
else
|
||||
barrier(CFrame.new(W + V(ex + side * 0.5, y, ez)), V(1, h, s.Z + 2))
|
||||
-- Кувшинки и камыш стоят у внешнего берега, вдали от проходов.
|
||||
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
|
||||
end
|
||||
end
|
||||
lamp(W + V(-3.5, GROUND_Y + 0.5, 40), Color3.fromRGB(255, 220, 160))
|
||||
lamp(W + V(-70, GROUND_Y + 0.5, 18), Color3.fromRGB(255, 220, 160))
|
||||
lamp(W + V(70, GROUND_Y + 0.5, -13), Color3.fromRGB(255, 220, 160))
|
||||
|
||||
-- лодка у западного причала
|
||||
do
|
||||
local cf = CFrame.new(W + V(-74, WATER_Y + 0.3, 24)) * CFrame.Angles(0, math.rad(15), 0)
|
||||
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 _ = 1, 7 do
|
||||
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
|
||||
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 inOther = false
|
||||
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
|
||||
inOther = true
|
||||
end
|
||||
end
|
||||
if not inOther and not (math.abs(x) < 6 and z > 30) then
|
||||
for _ = 1, 5 do
|
||||
local h = rng:NextNumber(3, 5)
|
||||
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 })
|
||||
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
|
||||
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
|
||||
|
||||
-- деревья, кусты, камни
|
||||
local function freeSpot(x, z)
|
||||
if inLake(x, z, 14) then
|
||||
return false
|
||||
end
|
||||
if (V(x, 0, z) - V(0, 0, 128)).Magnitude < 34 then
|
||||
return false
|
||||
end
|
||||
if math.abs(x) < 9 and z > 70 and z < 125 then
|
||||
return false
|
||||
end
|
||||
if (V(x, 0, z) - V(-34, 0, 100)).Magnitude < 14 then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local placed = 0
|
||||
for _ = 1, 400 do
|
||||
if placed >= 110 then
|
||||
break
|
||||
end
|
||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||
if freeSpot(x, z) then
|
||||
local y = groundY(W.X + x, W.Z + z)
|
||||
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"))
|
||||
placed += 1
|
||||
end
|
||||
end
|
||||
for _ = 1, 60 do
|
||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||
if freeSpot(x, z) then
|
||||
bush(W + V(x, groundY(W.X + x, W.Z + z) - 0.6, z))
|
||||
end
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
for _ = 1, 4 do
|
||||
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)
|
||||
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then
|
||||
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) })
|
||||
-- Пояс сосен, отдельные деревья у воды и горы за границей мира.
|
||||
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
|
||||
local rng = sharedRng
|
||||
for _, l in ipairs(LAKES) 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
|
||||
for _ = 1, 9 do
|
||||
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 other = false
|
||||
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 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
|
||||
end
|
||||
end
|
||||
local function free(x, z)
|
||||
return not inLake(x, z, 14) and (V(x, 0, z) - V(0, 0, 94)).Magnitude >= 36
|
||||
and not (math.abs(x) < 9 and z > 60 and z < 125) and (V(x, 0, z) - V(-44, 0, 98)).Magnitude >= 14
|
||||
end
|
||||
local placed = 0
|
||||
for _ = 1, 400 do
|
||||
if placed >= 110 then break end
|
||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||
if free(x, z) then
|
||||
local roll = rng:NextNumber()
|
||||
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
|
||||
end
|
||||
end
|
||||
for _ = 1, 60 do
|
||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||
if free(x, z) then
|
||||
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
|
||||
for _, l in ipairs(LAKES) do
|
||||
for _ = 1, 4 do
|
||||
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)
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Счётчики позволяют быстро проверить бюджет локации в Studio.
|
||||
local parts, lights, emitters = 0, 0, 0
|
||||
for _, child in ipairs(map:GetChildren()) do
|
||||
if not previous[child] then
|
||||
local instances = child:GetDescendants()
|
||||
table.insert(instances, child)
|
||||
for _, obj in ipairs(instances) do
|
||||
if obj:IsA("BasePart") then parts += 1
|
||||
elseif obj:IsA("PointLight") or obj:IsA("SpotLight") then lights += 1
|
||||
elseif obj:IsA("ParticleEmitter") then emitters += 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
|
||||
|
||||
-- фонари вдоль дорожки
|
||||
for _, z in ipairs({ 84, 100 }) do
|
||||
lamp(W + V(6, GROUND_Y, z))
|
||||
lamp(W + V(-6, GROUND_Y, z))
|
||||
end
|
||||
|
||||
-- невидимые стены по краю мира
|
||||
for _, w in ipairs({
|
||||
{ V(0, 0, 245), V(500, 120, 2) },
|
||||
{ V(0, 0, -245), V(500, 120, 2) },
|
||||
{ V(245, 0, 0), V(2, 120, 500) },
|
||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
||||
}) do
|
||||
P({ Size = w[2], Position = W + w[1] + V(0, 40, 0), Transparency = 1 })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- помощники для новых миров
|
||||
|
||||
@@ -1510,7 +1725,7 @@ do
|
||||
below, above = lakeState(l)
|
||||
if not lakeOk(below, above) then
|
||||
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
|
||||
|
||||
@@ -220,6 +220,8 @@ local function updateStats(player)
|
||||
player:SetAttribute("BoostBonus", boostActive(data))
|
||||
player:SetAttribute("BoostLeft", math.max(0, data.boostUntil - os.time()))
|
||||
player:SetAttribute("TotalCaught", data.totalCaught)
|
||||
-- шаг обучения (линия-подсказка); у старых игроков без поля, уже ловивших рыбу, обучение пройдено
|
||||
player:SetAttribute("Tutorial", data.tutorial or (data.totalCaught > 0 and Config.TutorialDone or 0))
|
||||
player:SetAttribute("Mastery", masteryCount(data))
|
||||
player:SetAttribute("Passes", table.concat(ps, ","))
|
||||
|
||||
@@ -240,10 +242,10 @@ local function addXp(player, data, amount)
|
||||
leveled = true
|
||||
end
|
||||
if leveled then
|
||||
notify(player, "⭐ Новый уровень: " .. data.level .. "! Удача +" .. math.floor(Config.LuckPerPlayerLevel * 100) .. "%", GOLD)
|
||||
notify(player, "⭐ Уровень " .. data.level .. "!", GOLD)
|
||||
for _, w in ipairs(Config.Worlds) do
|
||||
if w.level == data.level and not w.soon then
|
||||
notify(player, "🌍 Открыт новый мир: " .. w.icon .. " " .. w.name .. "!", w.color)
|
||||
notify(player, "🌍 Открыт: " .. w.icon .. " " .. w.name, w.color)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -299,7 +301,7 @@ local function questProgress(player, kind, amount)
|
||||
q.progress = math.min(q.goal, q.progress + amount)
|
||||
changed = true
|
||||
if q.progress >= q.goal then
|
||||
notify(player, "📜 Задание выполнено! Забери награду (клавиша Q)", GOLD)
|
||||
notify(player, "📜 Задание готово! (Q)", GOLD)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -336,7 +338,7 @@ local function claimDaily(player)
|
||||
end
|
||||
local t = today()
|
||||
if data.daily.last >= t then
|
||||
notify(player, "🎁 Сегодня награда уже получена. Приходи завтра!", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "🎁 Приходи завтра", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
local streak = (data.daily.last == t - 1) and (data.daily.streak % 7 + 1) or 1
|
||||
@@ -372,7 +374,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
end
|
||||
for _, f in ipairs(zone.fish) do
|
||||
if (rarity == "Master" or f.rarity == rarity) and not data.discovered[f.id] then
|
||||
notify(player, "Сначала поймай всех рыб этой группы!", RED)
|
||||
notify(player, "Сначала поймай всех", RED)
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -380,7 +382,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
if rarity == "Master" then
|
||||
local coins = Config.MasteryCoins * world.mult
|
||||
data.coins += coins
|
||||
notify(player, ("🏆 Мир «%s» собран! +%d 💰 и +%d%% удачи навсегда"):format(world.name, coins, math.floor(Config.MasteryLuck * 100 + 0.5)), GOLD)
|
||||
notify(player, ("🏆 «%s» собран! +%d 💰"):format(world.name, coins), GOLD)
|
||||
else
|
||||
local r = Config.CollectionRewards[rarity]
|
||||
if not r then
|
||||
@@ -388,7 +390,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
end
|
||||
data.coins += r.coins * world.mult
|
||||
addXp(player, data, r.xp * world.mult)
|
||||
notify(player, ("📖 Коллекция «%s»: +%d 💰 +%d XP"):format(Config.Rarities[rarity].name, r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
notify(player, ("📖 +%d 💰 +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
end
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
@@ -542,6 +544,28 @@ local function splash(part, count)
|
||||
end
|
||||
|
||||
-- рыба вылетает из воды, летит к игроку и показывается над головой
|
||||
-- шлейф за летящим предметом — эффект быстрого движения (ширина — расстояние между точками крепления)
|
||||
local TRAIL_COLOR = Color3.fromRGB(215, 245, 255)
|
||||
local function addTrail(part, width)
|
||||
local a0 = Instance.new("Attachment")
|
||||
a0.Position = Vector3.new(0, width / 2, 0)
|
||||
a0.Parent = part
|
||||
local a1 = Instance.new("Attachment")
|
||||
a1.Position = Vector3.new(0, -width / 2, 0)
|
||||
a1.Parent = part
|
||||
local trail = Instance.new("Trail")
|
||||
trail.Attachment0, trail.Attachment1 = a0, a1
|
||||
trail.FaceCamera = true
|
||||
trail.Lifetime = 0.35
|
||||
trail.MinLength = 0.05
|
||||
trail.LightEmission = 0.7
|
||||
trail.Color = ColorSequence.new(TRAIL_COLOR)
|
||||
trail.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.1), NumberSequenceKeypoint.new(1, 1) })
|
||||
trail.WidthScale = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 0) })
|
||||
trail.Parent = part
|
||||
return trail
|
||||
end
|
||||
|
||||
local function showFishFlight(player, fish, fromPos)
|
||||
local head = player.Character and player.Character:FindFirstChild("Head")
|
||||
if not head then
|
||||
@@ -550,6 +574,14 @@ local function showFishFlight(player, fish, fromPos)
|
||||
local model = Models.buildFish(fish.id, fish.mutation, 0.9, true)
|
||||
model:PivotTo(CFrame.new(fromPos))
|
||||
model.Parent = workspace
|
||||
-- шлейф на отдельной невидимой детали: рыба крутится, а шлейф должен оставаться ровным
|
||||
local carrier = Instance.new("Part")
|
||||
carrier.Anchored, carrier.CanCollide, carrier.CanQuery, carrier.CanTouch = true, false, false, false
|
||||
carrier.Transparency = 1
|
||||
carrier.Size = Vector3.new(0.2, 0.2, 0.2)
|
||||
carrier.CFrame = CFrame.new(fromPos)
|
||||
carrier.Parent = model
|
||||
local trail = addTrail(carrier, 1.8)
|
||||
task.spawn(function()
|
||||
local t0, dur = os.clock(), 0.55
|
||||
while head.Parent do
|
||||
@@ -557,11 +589,13 @@ local function showFishFlight(player, fish, fromPos)
|
||||
local target = head.Position + Vector3.new(0, 2.8, 0)
|
||||
local p = fromPos:Lerp(target, a) + Vector3.new(0, math.sin(a * math.pi) * 8, 0)
|
||||
model:PivotTo(CFrame.new(p) * CFrame.Angles(0, 0, a * math.pi * 2))
|
||||
carrier.CFrame = CFrame.new(p)
|
||||
if a >= 1 then
|
||||
break
|
||||
end
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
trail.Enabled = false
|
||||
local t1 = os.clock()
|
||||
while head.Parent and os.clock() - t1 < 1.8 do
|
||||
model:PivotTo(CFrame.new(head.Position + Vector3.new(0, 2.8, 0)) * CFrame.Angles(0, os.clock() * 3, math.rad(-15)))
|
||||
@@ -575,22 +609,59 @@ end
|
||||
|
||||
local fishing = {}
|
||||
|
||||
-- ищем воду перед игроком по карте мира из FishConfig (не зависит от террейна)
|
||||
local function findWater(hrp, world)
|
||||
local look = hrp.CFrame.LookVector * Vector3.new(1, 0, 1)
|
||||
if look.Magnitude < 0.01 then
|
||||
look = Vector3.new(0, 0, -1)
|
||||
-- ищем воду по карте мира из FishConfig (не зависит от террейна) в сторону центра ближайшего озера:
|
||||
-- сначала на дальности, которую задала сила заброса, потом всё дальше от неё
|
||||
local function findWater(hrp, world, power)
|
||||
local look = Config.CastDirection(world, hrp.Position)
|
||||
if not look then
|
||||
look = hrp.CFrame.LookVector * Vector3.new(1, 0, 1)
|
||||
look = look.Magnitude > 0.01 and look.Unit or Vector3.new(0, 0, -1)
|
||||
end
|
||||
look = look.Unit
|
||||
for _, d in ipairs({ 14, 11, 17, 8, 20, 6, 24, 4 }) do
|
||||
local p = hrp.Position + look * d
|
||||
if Config.IsWater(world, p) then
|
||||
return Vector3.new(p.X, world.waterY or 0, p.Z)
|
||||
local want = Config.CastMinDist + (Config.CastMaxDist - Config.CastMinDist) * power
|
||||
for off = 0, 26, 2 do
|
||||
for _, d in ipairs({ want - off, want + off }) do
|
||||
if d >= 4 and d <= Config.CastMaxDist + 2 then
|
||||
local p = hrp.Position + look * d
|
||||
if Config.IsWater(world, p) then
|
||||
return Vector3.new(p.X, world.waterY or 0, p.Z), d
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- вытягивание пустого поплавка: быстро летит к кончику удочки со шлейфом и исчезает
|
||||
local function reelBobber(bobber, tool)
|
||||
local root = bobber and bobber.PrimaryPart
|
||||
local tip = tool and tool:FindFirstChild("Handle") and tool.Handle:FindFirstChild("Tip")
|
||||
if not root or not tip then
|
||||
if bobber then
|
||||
bobber:Destroy()
|
||||
end
|
||||
return
|
||||
end
|
||||
local trail = bobber:FindFirstChildWhichIsA("Trail", true)
|
||||
if trail then
|
||||
trail.Enabled = true
|
||||
else
|
||||
addTrail(root, 1.2)
|
||||
end
|
||||
local from = root.Position
|
||||
task.spawn(function()
|
||||
local t0, dur = os.clock(), 0.3
|
||||
while bobber.Parent and tip.Parent do
|
||||
local a = math.min(1, (os.clock() - t0) / dur)
|
||||
bobber:PivotTo(CFrame.new(from:Lerp(tip.WorldPosition, a) + Vector3.new(0, math.sin(a * math.pi) * 2.5, 0)))
|
||||
if a >= 1 then
|
||||
break
|
||||
end
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
bobber:Destroy()
|
||||
end)
|
||||
end
|
||||
|
||||
local function stopFishing(player, tellClient)
|
||||
local s = fishing[player]
|
||||
if not s then
|
||||
@@ -601,7 +672,11 @@ local function stopFishing(player, tellClient)
|
||||
s.tween:Cancel()
|
||||
end
|
||||
if s.bobber then
|
||||
s.bobber:Destroy()
|
||||
if s.stage == "casting" then
|
||||
s.bobber:Destroy() -- ещё летит: его двигает flyBobber
|
||||
else
|
||||
reelBobber(s.bobber, s.tool)
|
||||
end
|
||||
end
|
||||
if s.tool then
|
||||
tweenGrip(s.tool, REST_ANGLE, 0.3)
|
||||
@@ -611,12 +686,12 @@ local function stopFishing(player, tellClient)
|
||||
end
|
||||
end
|
||||
|
||||
local function rollFish(player, data, worldId)
|
||||
local function rollFish(player, data, worldId, luckMult)
|
||||
local zone = Config.Zones[worldId]
|
||||
if not zone then
|
||||
return nil
|
||||
end
|
||||
local luck = totalLuck(player, data)
|
||||
local luck = totalLuck(player, data) * (luckMult or 1)
|
||||
local bonus = luck - 1
|
||||
local weights, total = {}, 0
|
||||
for i, f in ipairs(zone.fish) do
|
||||
@@ -658,13 +733,14 @@ local function rollFish(player, data, worldId)
|
||||
}
|
||||
end
|
||||
|
||||
local function flyBobber(s, tool, target)
|
||||
local function flyBobber(s, tool, target, dur, arc)
|
||||
local tip = tool:FindFirstChild("Handle") and tool.Handle:FindFirstChild("Tip")
|
||||
local start = tip and tip.WorldPosition or (target + Vector3.new(0, 6, 0))
|
||||
local bobber = Models.buildBobber()
|
||||
bobber:PivotTo(CFrame.new(start))
|
||||
bobber.Parent = workspace
|
||||
s.bobber = bobber
|
||||
local trail = addTrail(bobber.PrimaryPart, 1.2)
|
||||
if tip then
|
||||
local a1 = Instance.new("Attachment")
|
||||
a1.Position = Vector3.new(0, 0.9, 0)
|
||||
@@ -678,22 +754,24 @@ local function flyBobber(s, tool, target)
|
||||
line.Color = ColorSequence.new(Color3.fromRGB(245, 245, 245))
|
||||
line.Parent = bobber
|
||||
end
|
||||
local t0, dur = os.clock(), 0.55
|
||||
local t0 = os.clock()
|
||||
while bobber.Parent do
|
||||
local a = math.min(1, (os.clock() - t0) / dur)
|
||||
bobber:PivotTo(CFrame.new(start:Lerp(target, a) + Vector3.new(0, math.sin(a * math.pi) * 6, 0)))
|
||||
bobber:PivotTo(CFrame.new(start:Lerp(target, a) + Vector3.new(0, math.sin(a * math.pi) * arc, 0)))
|
||||
if a >= 1 then
|
||||
break
|
||||
end
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
trail.Enabled = false -- на воде поплавок качается, шлейф уже не нужен
|
||||
if bobber.Parent then
|
||||
splash(bobber.PrimaryPart, 18)
|
||||
playSound(bobber.PrimaryPart, SPLASH_SOUND, 0.5)
|
||||
end
|
||||
end
|
||||
|
||||
local function onCast(player)
|
||||
local function onCast(player, power)
|
||||
power = math.clamp(tonumber(power) or 0.6, 0, 1)
|
||||
local data = profiles[player]
|
||||
if not data then
|
||||
return
|
||||
@@ -710,42 +788,47 @@ local function onCast(player)
|
||||
return
|
||||
end
|
||||
local world = Config.WorldAt(hrp.Position)
|
||||
local target = world and findWater(hrp, world)
|
||||
local can = Config.CanCastFrom(world, hrp.Position)
|
||||
if can ~= true then
|
||||
remote:FireClient(player, "CastFail")
|
||||
notify(player, can, Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
local target, dist = findWater(hrp, world, power)
|
||||
if not target then
|
||||
remote:FireClient(player, "CastFail")
|
||||
notify(player, world and "Повернись лицом к воде (или к лунке)!" or "Здесь нет рыбы — иди в один из миров 🌍", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "🌊 Подойди к воде", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
if #data.items >= bagCapacity(player, data) then
|
||||
remote:FireClient(player, "CastFail")
|
||||
notify(player, "🎒 Сумка полна! Продай рыбу в скупке.", RED)
|
||||
notify(player, "🎒 Сумка полна!", RED)
|
||||
return
|
||||
end
|
||||
|
||||
local stats = Config.RodStats(data.rod, rodLevel(data))
|
||||
local fish = rollFish(player, data, world.id)
|
||||
local perfect = power >= Config.CastPerfect[1] and power <= Config.CastPerfect[2]
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1)
|
||||
if not fish then
|
||||
remote:FireClient(player, "CastFail")
|
||||
return
|
||||
end
|
||||
local s = { stage = "casting", fish = fish, tool = tool }
|
||||
fishing[player] = s
|
||||
remote:FireClient(player, "Cast")
|
||||
-- замах игрок уже сделал, пока держал кнопку (у себя на клиенте); здесь только бросок вперёд
|
||||
local throw = { windup = 0.15, flight = 0.35 + dist * 0.018, arc = 2 + dist * 0.3, perfect = perfect }
|
||||
local splashAt = target + Vector3.new(0, 0.15, 0)
|
||||
remote:FireClient(player, "Cast", splashAt, throw) -- клиенту для камеры
|
||||
|
||||
task.spawn(function()
|
||||
-- замах назад и бросок вперёд
|
||||
local tw = tweenGrip(tool, 100, 0.25)
|
||||
if tw then
|
||||
tw.Completed:Wait()
|
||||
end
|
||||
tw = tweenGrip(tool, 8, 0.15)
|
||||
local tw = tweenGrip(tool, 8, throw.windup)
|
||||
if tw then
|
||||
tw.Completed:Wait()
|
||||
end
|
||||
if fishing[player] ~= s then
|
||||
return
|
||||
end
|
||||
flyBobber(s, tool, target + Vector3.new(0, 0.15, 0))
|
||||
flyBobber(s, tool, splashAt, throw.flight, throw.arc)
|
||||
tweenGrip(tool, REST_ANGLE - 5, 0.4)
|
||||
if fishing[player] ~= s then
|
||||
if s.bobber then
|
||||
@@ -792,7 +875,7 @@ local function onCast(player)
|
||||
if fishing[player] == s and s.stage == "bite" then
|
||||
stopFishing(player, false)
|
||||
remote:FireClient(player, "Escaped")
|
||||
notify(player, "Рыба ушла… не успел вытащить.", RED)
|
||||
notify(player, "🐟 Рыба ушла", RED)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -810,14 +893,17 @@ local function onCatch(player, success, misses)
|
||||
if s.tween then
|
||||
s.tween:Cancel()
|
||||
end
|
||||
if s.bobber then
|
||||
s.bobber:Destroy()
|
||||
local failed = success ~= true or os.clock() - s.biteAt > Config.BiteTimeout + 1
|
||||
if failed then
|
||||
reelBobber(s.bobber, tool)
|
||||
elseif s.bobber then
|
||||
s.bobber:Destroy() -- вместо поплавка к игроку летит рыба
|
||||
end
|
||||
|
||||
if success ~= true or os.clock() - s.biteAt > Config.BiteTimeout + 1 then
|
||||
if failed then
|
||||
gripSequence(tool, { { REST_ANGLE, 0.3 } })
|
||||
remote:FireClient(player, "Escaped")
|
||||
notify(player, "Рыба сорвалась!", RED)
|
||||
notify(player, "🐟 Сорвалась!", RED)
|
||||
return
|
||||
end
|
||||
gripSequence(tool, { { 85, 0.15 }, { REST_ANGLE, 0.45 } })
|
||||
@@ -910,7 +996,7 @@ local function sellItems(player, filterUid)
|
||||
end
|
||||
if count == 0 then
|
||||
if filterUid == nil then
|
||||
notify(player, "Нечего продавать — сначала поймай рыбу!", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "🎒 Сумка пуста", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
return
|
||||
end
|
||||
@@ -936,12 +1022,12 @@ local function buy(player, kind, id)
|
||||
end
|
||||
local lvl = rodLevel(data, id)
|
||||
if lvl >= Config.RodUpgrade.maxLevel then
|
||||
notify(player, "Удочка уже улучшена до максимума ★★★★★", GOLD)
|
||||
notify(player, "★★★★★ Максимум", GOLD)
|
||||
return
|
||||
end
|
||||
local cost = Config.UpgradeCost(rod, lvl)
|
||||
if data.coins < cost then
|
||||
notify(player, "Не хватает монет: нужно " .. cost .. " 💰", RED)
|
||||
notify(player, "Нужно " .. cost .. " 💰", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= cost
|
||||
@@ -960,17 +1046,17 @@ local function buy(player, kind, id)
|
||||
return
|
||||
end
|
||||
if potion.level and data.level < potion.level then
|
||||
notify(player, "Нужен уровень " .. potion.level .. "!", RED)
|
||||
notify(player, "🔒 Нужен ур. " .. potion.level, RED)
|
||||
return
|
||||
end
|
||||
if data.coins < potion.price then
|
||||
notify(player, "Не хватает монет: нужно " .. potion.price .. " 💰", RED)
|
||||
notify(player, "Нужно " .. potion.price .. " 💰", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= potion.price
|
||||
applyPotion(data, potion.bonus, potion.duration)
|
||||
updateStats(player)
|
||||
notify(player, ("🍀 %s: удача +%d%% на %d мин"):format(potion.name, potion.bonus * 100, potion.duration / 60), GREEN)
|
||||
notify(player, ("🍀 +%d%% удачи, %d мин"):format(potion.bonus * 100, potion.duration / 60), GREEN)
|
||||
return
|
||||
end
|
||||
local list, owned
|
||||
@@ -987,16 +1073,16 @@ local function buy(player, kind, id)
|
||||
end
|
||||
if not owned[id] then
|
||||
if data.level < item.level then
|
||||
notify(player, "Нужен уровень " .. item.level .. "!", RED)
|
||||
notify(player, "🔒 Нужен ур. " .. item.level, RED)
|
||||
return
|
||||
end
|
||||
if data.coins < item.price then
|
||||
notify(player, "Не хватает монет: нужно " .. item.price .. " 💰", RED)
|
||||
notify(player, "Нужно " .. item.price .. " 💰", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= item.price
|
||||
owned[id] = true
|
||||
notify(player, "Куплено: " .. item.name .. "!", GREEN)
|
||||
notify(player, "✅ " .. item.name, GREEN)
|
||||
end
|
||||
if kind == "Rod" then
|
||||
data.rod = id
|
||||
@@ -1026,11 +1112,11 @@ local function teleportTo(player, worldId)
|
||||
return
|
||||
end
|
||||
if world.soon then
|
||||
notify(player, world.icon .. " " .. world.name .. " скоро откроется! Следи за обновлениями.", world.color)
|
||||
notify(player, world.icon .. " " .. world.name .. " — скоро!", world.color)
|
||||
return
|
||||
end
|
||||
if data.level < world.level then
|
||||
notify(player, ("🔒 %s откроется на %d уровне"):format(world.name, world.level), RED)
|
||||
notify(player, ("🔒 %s: ур. %d"):format(world.name, world.level), RED)
|
||||
return
|
||||
end
|
||||
markerName = world.id .. "Spawn"
|
||||
@@ -1095,7 +1181,15 @@ end)
|
||||
|
||||
remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
if action == "Cast" then
|
||||
onCast(player)
|
||||
onCast(player, a)
|
||||
elseif action == "Tutorial" then
|
||||
-- шаги обучения идут только вперёд
|
||||
local data = profiles[player]
|
||||
local step = math.floor(tonumber(a) or 0)
|
||||
if data and step > (player:GetAttribute("Tutorial") or 0) and step <= Config.TutorialDone then
|
||||
data.tutorial = step
|
||||
player:SetAttribute("Tutorial", step)
|
||||
end
|
||||
elseif action == "Catch" then
|
||||
onCatch(player, a, b)
|
||||
elseif action == "Cancel" then
|
||||
@@ -1109,13 +1203,13 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
if nearSeller(player) then
|
||||
sellItems(player, a)
|
||||
else
|
||||
notify(player, "Продавать можно только у скупщика 💰", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
elseif action == "SellAll" then
|
||||
if nearSeller(player) then
|
||||
sellItems(player, nil)
|
||||
else
|
||||
notify(player, "Продавать можно только у скупщика 💰", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
elseif action == "Teleport" then
|
||||
teleportTo(player, a)
|
||||
@@ -1141,7 +1235,7 @@ MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, passI
|
||||
if gp.id == passId then
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][gp.key] = true
|
||||
notify(player, "Спасибо за покупку! " .. gp.icon .. " " .. gp.name .. " активирован", GOLD)
|
||||
notify(player, "✅ " .. gp.icon .. " " .. gp.name, GOLD)
|
||||
if gp.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
@@ -1177,7 +1271,7 @@ MarketplaceService.ProcessReceipt = function(info)
|
||||
end
|
||||
if product.boost then
|
||||
applyPotion(data, product.boost, product.duration)
|
||||
notify(player, ("Спасибо! Удача +%d%% на %d мин"):format(product.boost * 100, product.duration / 60), GOLD)
|
||||
notify(player, ("🍀 +%d%% удачи, %d мин"):format(product.boost * 100, product.duration / 60), GOLD)
|
||||
end
|
||||
table.insert(data.receipts, info.PurchaseId)
|
||||
if #data.receipts > 50 then
|
||||
@@ -1197,7 +1291,7 @@ task.spawn(function()
|
||||
workspace:SetAttribute("Event", currentEvent.id)
|
||||
workspace:SetAttribute("EventEnds", workspace:GetServerTimeNow() + currentEvent.duration)
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
notify(p, "🎉 Событие: " .. currentEvent.name .. " — " .. currentEvent.desc, GOLD)
|
||||
notify(p, "🎉 " .. currentEvent.name, GOLD)
|
||||
updateStats(p)
|
||||
end
|
||||
task.wait(currentEvent.duration)
|
||||
|
||||
@@ -219,9 +219,44 @@ local function sideButton(order, icon, label, key, color, onClick)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- уведомления
|
||||
-- мультяшный стиль подсказок: крупный круглый шрифт без обводки на мягкой «дымке» —
|
||||
-- тёмная подложка, которая плавно растворяется к краям; появляются «пружинкой»
|
||||
|
||||
local SOFT_EDGES = NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.18, 0.62),
|
||||
NumberSequenceKeypoint.new(0.82, 0.62), NumberSequenceKeypoint.new(1, 1),
|
||||
})
|
||||
-- жирный округлый шрифт с кириллицей (у FredokaOne кириллицы нет — Roblox подставляет тонкий шрифт)
|
||||
local HINT_FONT = Font.new("rbxasset://fonts/families/Nunito.json", Enum.FontWeight.Heavy)
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует
|
||||
local function softPlate(props, textProps)
|
||||
local plate = new("Frame", props)
|
||||
plate.BackgroundColor3 = BLACK
|
||||
plate.BackgroundTransparency = 0
|
||||
corner(30).Parent = plate
|
||||
new("UIGradient", { Transparency = SOFT_EDGES, Parent = plate })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 48), PaddingRight = UDim.new(0, 48), Parent = plate })
|
||||
local d = { Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, TextXAlignment = Enum.TextXAlignment.Center, Parent = plate }
|
||||
for k, v in pairs(textProps) do
|
||||
d[k] = v
|
||||
end
|
||||
local label = text(d)
|
||||
label.FontFace = HINT_FONT
|
||||
return plate, label
|
||||
end
|
||||
local function popIn(obj, from)
|
||||
local sc = obj:FindFirstChildOfClass("UIScale") or new("UIScale", { Parent = obj })
|
||||
sc.Scale = from or 0.4
|
||||
TweenService:Create(sc, TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Scale = 1 }):Play()
|
||||
end
|
||||
local function wobble(obj, deg, period)
|
||||
obj.Rotation = -deg
|
||||
TweenService:Create(obj, TweenInfo.new(period, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true), { Rotation = deg }):Play()
|
||||
end
|
||||
|
||||
-- уведомления — под подсказкой обучения, которая стоит в самом верху
|
||||
local toasts = new("Frame", {
|
||||
Size = UDim2.new(0, 560, 0, 200), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 8),
|
||||
Size = UDim2.new(0, 900, 0, 200), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 84),
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 6), HorizontalAlignment = Enum.HorizontalAlignment.Center, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
local toastOrder = 0
|
||||
@@ -251,11 +286,11 @@ local function notify(msg, color)
|
||||
if #items >= 3 then
|
||||
items[1]:Destroy()
|
||||
end
|
||||
local t = new("Frame", {
|
||||
Size = UDim2.new(0, 0, 0, 38), AutomaticSize = Enum.AutomaticSize.X, BackgroundColor3 = C.bg,
|
||||
BackgroundTransparency = 0.15, LayoutOrder = toastOrder, Parent = toasts,
|
||||
}, { corner(12), stroke(color or WHITE, 2, 0.2), new("UIPadding", { PaddingLeft = UDim.new(0, 16), PaddingRight = UDim.new(0, 16) }) })
|
||||
local l = text({ Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, Font = TITLE, TextSize = 19, TextColor3 = color or WHITE, Text = msg, Parent = t })
|
||||
local t, l = softPlate(
|
||||
{ Size = UDim2.new(0, 0, 0, 54), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
{ TextSize = 30, TextColor3 = color or WHITE, Text = msg }
|
||||
)
|
||||
popIn(t)
|
||||
t:SetAttribute("Msg", msg)
|
||||
toastTimers[t] = 0
|
||||
task.delay(3.2, function()
|
||||
@@ -328,11 +363,12 @@ end
|
||||
|
||||
---------------------------------------------------------------- статус и мини-игра
|
||||
|
||||
local statusLabel = text({
|
||||
Size = UDim2.fromOffset(460, 34), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -110),
|
||||
Font = TITLE, TextSize = 22, TextXAlignment = Enum.TextXAlignment.Center, TextStrokeTransparency = 0.3,
|
||||
Text = "🎣 Ждём поклёвку… (клик — смотать)", Visible = false, Parent = gui,
|
||||
})
|
||||
-- вверху, на месте подсказки обучения (она во время рыбалки скрыта)
|
||||
local statusLabel = softPlate(
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = gui },
|
||||
{ TextSize = 36, Text = "🎣 Ждём клёв…" }
|
||||
)
|
||||
wobble(statusLabel, 1.2, 1.4)
|
||||
local mgFrame = new("Frame", {
|
||||
Size = UDim2.fromOffset(480, 124), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -100),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
@@ -940,7 +976,7 @@ robuxWin.render = function(tab)
|
||||
buttonText = has and "Куплено ✓" or ("R$ " .. it.robux), buttonColor = has and C.grey or C.green, active = not has,
|
||||
onClick = function()
|
||||
if not it.id or it.id == 0 then
|
||||
notify("Товар ещё не настроен: впиши его ID в FishConfig", Color3.fromRGB(255, 200, 120))
|
||||
notify("⚙ Товар не настроен", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
if tab == "passes" then
|
||||
@@ -1046,10 +1082,282 @@ refreshHud()
|
||||
local state = "idle"
|
||||
local mg = { pos = 0, dir = 1, speed = 1, zoneStart = 0.4, zoneWidth = 0.25, hits = 0, need = 1, misses = 0, maxMisses = 2, deadline = 0, timeout = 10 }
|
||||
|
||||
-- с начала зарядки и до конца рыбалки персонажем не управляем: не ходит, не прыгает, не поворачивается
|
||||
local ContextActionService = game:GetService("ContextActionService")
|
||||
local MOVE_KEYS = {
|
||||
Enum.KeyCode.W, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.D, Enum.KeyCode.Space,
|
||||
Enum.KeyCode.Up, Enum.KeyCode.Down, Enum.KeyCode.Left, Enum.KeyCode.Right,
|
||||
Enum.KeyCode.Thumbstick1, Enum.KeyCode.ButtonA,
|
||||
}
|
||||
local controls
|
||||
local movementLocked = false
|
||||
local function setMovementLocked(locked)
|
||||
if not controls then
|
||||
local pm = player:FindFirstChild("PlayerScripts") and player.PlayerScripts:FindFirstChild("PlayerModule")
|
||||
local ok, mod = pcall(require, pm)
|
||||
controls = ok and mod and mod:GetControls() or nil
|
||||
end
|
||||
if controls then
|
||||
if locked then
|
||||
controls:Disable()
|
||||
else
|
||||
controls:Enable()
|
||||
end
|
||||
end
|
||||
if locked ~= movementLocked then
|
||||
movementLocked = locked
|
||||
if locked then
|
||||
ContextActionService:BindActionAtPriority("FishingLock", function()
|
||||
return Enum.ContextActionResult.Sink
|
||||
end, false, Enum.ContextActionPriority.High.Value + 100, table.unpack(MOVE_KEYS))
|
||||
else
|
||||
ContextActionService:UnbindAction("FishingLock")
|
||||
end
|
||||
end
|
||||
local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
|
||||
if hum then
|
||||
hum.AutoRotate = not locked
|
||||
hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, not locked)
|
||||
if locked then
|
||||
hum:Move(Vector3.zero)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function easeInOut(a)
|
||||
return a < 0.5 and 4 * a * a * a or 1 - (-2 * a + 2) ^ 3 / 2
|
||||
end
|
||||
local function easeOut(a)
|
||||
return 1 - (1 - a) ^ 3
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
||||
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
||||
|
||||
local REST_ANGLE, BACK_ANGLE = 30, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local function gripCF(angle)
|
||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||
end
|
||||
|
||||
local charge = nil -- { t0, tool }
|
||||
local castTool = nil -- удочка последнего броска: вернуть её в покой, если бросок не удался
|
||||
-- сила ездит туда-сюда: 0 → 1 за CastChargeTime, потом обратно к 0 и снова вверх, пока держишь ЛКМ
|
||||
local function chargePower()
|
||||
if not charge then
|
||||
return 0
|
||||
end
|
||||
local t = ((os.clock() - charge.t0) / Config.CastChargeTime) % 2
|
||||
return t <= 1 and t or 2 - t
|
||||
end
|
||||
local function inPerfect(v)
|
||||
return v >= Config.CastPerfect[1] and v <= Config.CastPerfect[2]
|
||||
end
|
||||
|
||||
-- шкала-дуга справа от персонажа: внизу слабый бросок, вверху сильный, зелёная зона — бонус удачи
|
||||
local GAUGE_R, GAUGE_DEG, GAUGE_N = 190, 110, 32
|
||||
local gauge = new("Frame", {
|
||||
Size = UDim2.fromOffset(150, 280), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0.57, 0, 0.48, 0),
|
||||
BackgroundTransparency = 1, Visible = false, Parent = gui,
|
||||
})
|
||||
local GAUGE_C = Vector2.new(110 - GAUGE_R, 140) -- центр окружности левее рамки: дуга выгнута вправо
|
||||
local function arcPoint(v, r)
|
||||
local th = math.rad(-GAUGE_DEG / 2 + GAUGE_DEG * v)
|
||||
return GAUGE_C + Vector2.new(math.cos(th) * r, -math.sin(th) * r), -math.deg(th)
|
||||
end
|
||||
do
|
||||
local segLen = 2 * math.pi * GAUGE_R * (GAUGE_DEG / 360) / GAUGE_N
|
||||
for _, layer in ipairs({ { 46, 4, BLACK }, { 34, 1 } }) do -- чёрная обводка, потом цветные секции
|
||||
for i = 0, GAUGE_N - 1 do
|
||||
local v = (i + 0.5) / GAUGE_N
|
||||
local pos, rot = arcPoint(v, GAUGE_R)
|
||||
local color = layer[3]
|
||||
or ((v < 0.12 or v > 0.94) and C.red)
|
||||
or (inPerfect(v) and Color3.fromRGB(110, 235, 60))
|
||||
or Color3.fromRGB(40, 70, 95)
|
||||
new("Frame", {
|
||||
Size = UDim2.fromOffset(layer[1], segLen + layer[2]), AnchorPoint = Vector2.new(0.5, 0.5),
|
||||
Position = UDim2.fromOffset(pos.X, pos.Y), Rotation = rot, BorderSizePixel = 0,
|
||||
BackgroundColor3 = color, Parent = gauge,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
local needle = new("Frame", {
|
||||
Size = UDim2.fromOffset(64, 8), AnchorPoint = Vector2.new(0.5, 0.5), BackgroundColor3 = WHITE,
|
||||
BorderSizePixel = 0, ZIndex = 3, Parent = gauge,
|
||||
}, { corner(4), stroke(BLACK, 2) })
|
||||
local multLabel = text({
|
||||
Size = UDim2.fromOffset(110, 40), AnchorPoint = Vector2.new(0.5, 1), Font = TITLE, TextSize = 34,
|
||||
Text = "×" .. Config.CastPerfectLuck, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 4,
|
||||
Visible = false, Parent = gauge,
|
||||
})
|
||||
new("UIStroke", { Color = BLACK, Thickness = 3, Parent = multLabel })
|
||||
do
|
||||
local top = arcPoint(1, GAUGE_R)
|
||||
multLabel.Position = UDim2.fromOffset(top.X + 10, top.Y - 18)
|
||||
end
|
||||
|
||||
local function updateCharge()
|
||||
local p = chargePower()
|
||||
local pos, rot = arcPoint(p, GAUGE_R)
|
||||
needle.Position = UDim2.fromOffset(pos.X, pos.Y)
|
||||
needle.Rotation = rot
|
||||
local good = inPerfect(p)
|
||||
multLabel.Visible = good
|
||||
needle.BackgroundColor3 = good and Color3.fromRGB(190, 255, 150) or WHITE
|
||||
if charge.tool and charge.tool.Parent then
|
||||
charge.tool.Grip = gripCF(REST_ANGLE + (BACK_ANGLE - REST_ANGLE) * easeOut(p))
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- камера при забросе
|
||||
-- зарядка: камера уходит в сторону от персонажа и отъезжает тем дальше, чем сильнее замах;
|
||||
-- бросок: камера сбоку разгоняется за поплавком; потом сверху-сбоку держит в кадре игрока и поплавок
|
||||
|
||||
local CAM_IN, CAM_SETTLE, CAM_RETURN = 0.35, 0.8, 0.6
|
||||
local UP = Vector3.new(0, 1, 0)
|
||||
local fishCam = nil
|
||||
|
||||
local function sideCF(fc, p)
|
||||
return CFrame.lookAt(fc.hrp + fc.r * (9 + 3 * p) - fc.f * (3 + 2 * p) + UP * (3 + 1.5 * p), fc.hrp + fc.f * 6 + UP)
|
||||
end
|
||||
local function chaseCF(fc, p)
|
||||
return CFrame.lookAt(p + fc.r * 9 - fc.f * 5 + UP * 3, p + fc.f * 3)
|
||||
end
|
||||
local function restCF(fc)
|
||||
local d = ((fc.target - fc.hrp) * Vector3.new(1, 0, 1)).Magnitude
|
||||
local mid = fc.hrp:Lerp(fc.target, 0.5)
|
||||
return CFrame.lookAt(mid + fc.r * (8 + d * 0.55) - fc.f * 4 + UP * (6 + d * 0.25), fc.hrp:Lerp(fc.target, 0.6))
|
||||
end
|
||||
|
||||
local function fishCamStep()
|
||||
local fc = fishCam
|
||||
local cam = workspace.CurrentCamera
|
||||
if not fc or not cam then
|
||||
return
|
||||
end
|
||||
if fc.returning then
|
||||
local a = math.min(1, (os.clock() - fc.returning) / CAM_RETURN)
|
||||
local e = easeInOut(a)
|
||||
cam.CFrame = fc.leaveCF:Lerp(fc.origCF, e)
|
||||
cam.FieldOfView = fc.leaveFov + (fc.origFov - fc.leaveFov) * e
|
||||
if a >= 1 then
|
||||
RunService:UnbindFromRenderStep("FishCam")
|
||||
cam.CameraType = Enum.CameraType.Custom
|
||||
fishCam = nil
|
||||
end
|
||||
return
|
||||
end
|
||||
local now = os.clock()
|
||||
local cf, fov
|
||||
if not fc.castT0 then
|
||||
-- зарядка: плавно уходим в вид сбоку; чем сильнее замах, тем дальше камера и шире обзор
|
||||
-- после отпускания ЛКМ, пока ждём ответ сервера, держим набранную силу
|
||||
local p = charge and chargePower() or (fc.power or 0)
|
||||
fc.power = p
|
||||
local e = easeOut(math.min(1, (now - fc.t0) / CAM_IN))
|
||||
cf = fc.origCF:Lerp(sideCF(fc, p), e)
|
||||
fov = fc.origFov + 12 * p * e
|
||||
else
|
||||
local th = fc.throw
|
||||
local t = now - fc.castT0
|
||||
local lunge = fc.fromCF + fc.f * 1.5
|
||||
if t < th.windup then
|
||||
-- рывок удочки вперёд: камера подаётся следом
|
||||
local e = easeOut(t / th.windup)
|
||||
cf = fc.fromCF:Lerp(lunge, e)
|
||||
fov = fc.fromFov + 4 * e
|
||||
elseif t < th.windup + th.flight then
|
||||
if not fc.start then
|
||||
fc.start = (fc.tip and fc.tip.Parent and fc.tip.WorldPosition) or (fc.hrp + fc.f * 2 + UP * 4)
|
||||
end
|
||||
local a = (t - th.windup) / th.flight
|
||||
local p = fc.start:Lerp(fc.target, a) + UP * (math.sin(a * math.pi) * th.arc) -- та же дуга, что у поплавка
|
||||
local e = easeInOut(a)
|
||||
cf = lunge:Lerp(chaseCF(fc, p), e)
|
||||
fov = (fc.fromFov + 4) + ((fc.origFov - 6) - (fc.fromFov + 4)) * e
|
||||
else
|
||||
local e = easeOut(math.min(1, (t - th.windup - th.flight) / CAM_SETTLE))
|
||||
local sway = Vector3.new(math.sin(now * 0.7) * 0.5, math.sin(now * 1.1) * 0.25, 0)
|
||||
if state == "bite" then
|
||||
sway += Vector3.new(math.random() - 0.5, math.random() - 0.5, 0) * 0.15
|
||||
end
|
||||
cf = chaseCF(fc, fc.target):Lerp(restCF(fc) + sway, e)
|
||||
fov = fc.origFov - 6 + 6 * e
|
||||
end
|
||||
end
|
||||
cam.CFrame = cf
|
||||
cam.FieldOfView = fov
|
||||
end
|
||||
|
||||
-- начало зарядки: dir — куда полетит поплавок (к центру озера)
|
||||
local function startChargeCam(tool, dir)
|
||||
local cam = workspace.CurrentCamera
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if not cam or not hrp then
|
||||
return
|
||||
end
|
||||
fishCam = {
|
||||
t0 = os.clock(), hrp = hrp.Position, f = dir, r = dir:Cross(UP),
|
||||
tip = tool:FindFirstChild("Handle") and tool.Handle:FindFirstChild("Tip"),
|
||||
-- если камера ещё возвращалась с прошлого заброса, возвращаться будем туда же
|
||||
origCF = fishCam and fishCam.origCF or cam.CFrame,
|
||||
origFov = fishCam and fishCam.origFov or cam.FieldOfView,
|
||||
}
|
||||
cam.CameraType = Enum.CameraType.Scriptable
|
||||
RunService:UnbindFromRenderStep("FishCam")
|
||||
RunService:BindToRenderStep("FishCam", Enum.RenderPriority.Camera.Value + 1, fishCamStep)
|
||||
end
|
||||
|
||||
-- сервер принял бросок: target — куда упадёт поплавок, throw — тайминги и высота дуги
|
||||
local function startCastCam(target, throw)
|
||||
local cam = workspace.CurrentCamera
|
||||
if not fishCam or fishCam.returning or not cam or typeof(target) ~= "Vector3" or type(throw) ~= "table" then
|
||||
return
|
||||
end
|
||||
fishCam.castT0 = os.clock()
|
||||
fishCam.target = target
|
||||
fishCam.throw = throw
|
||||
fishCam.fromCF = cam.CFrame
|
||||
fishCam.fromFov = cam.FieldOfView
|
||||
end
|
||||
|
||||
local function stopFishCam()
|
||||
local cam = workspace.CurrentCamera
|
||||
if not fishCam or fishCam.returning or not cam then
|
||||
return
|
||||
end
|
||||
fishCam.returning = os.clock()
|
||||
fishCam.leaveCF = cam.CFrame
|
||||
fishCam.leaveFov = cam.FieldOfView
|
||||
end
|
||||
|
||||
local reelToken
|
||||
local function setState(s)
|
||||
if s ~= "charging" and charge then
|
||||
-- зарядку прервали (убрал удочку и т.п.): удочку обратно в покой
|
||||
if charge.tool.Parent then
|
||||
charge.tool.Grip = gripCF(REST_ANGLE)
|
||||
end
|
||||
charge = nil
|
||||
end
|
||||
state = s
|
||||
statusLabel.Visible = (s == "waiting")
|
||||
mgFrame.Visible = (s == "bite")
|
||||
gauge.Visible = (s == "charging")
|
||||
setMovementLocked(s ~= "idle")
|
||||
if s == "idle" then
|
||||
stopFishCam()
|
||||
elseif s == "reeling" then
|
||||
-- на случай, если сервер не ответит на вытаскивание: не оставляем игрока замороженным
|
||||
local token = {}
|
||||
reelToken = token
|
||||
task.delay(4, function()
|
||||
if state == "reeling" and reelToken == token then
|
||||
setState("idle")
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
local function updatePips()
|
||||
pipsText.Text = "🎯 " .. string.rep("<font color=\"#7CFF9A\">●</font>", mg.hits) .. string.rep("<font color=\"#5A6480\">●</font>", mg.need - mg.hits)
|
||||
@@ -1065,11 +1373,45 @@ local function placeZone()
|
||||
zoneF.Position = UDim2.fromScale(mg.zoneStart, 0)
|
||||
end
|
||||
|
||||
-- ЛКМ зажата: персонаж разворачивается к центру озера, начинается зарядка
|
||||
local function startCharge(tool)
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if not hrp then
|
||||
return
|
||||
end
|
||||
local world = Config.WorldAt(hrp.Position)
|
||||
-- из воды и издалека не заряжаем вовсе: сразу подсказка
|
||||
local can = Config.CanCastFrom(world, hrp.Position, player.Character:FindFirstChildOfClass("Humanoid"))
|
||||
if can ~= true then
|
||||
notify(can, Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
local dir = Config.CastDirection(world, hrp.Position)
|
||||
if not dir then
|
||||
dir = hrp.CFrame.LookVector * Vector3.new(1, 0, 1)
|
||||
dir = dir.Magnitude > 0.01 and dir.Unit or Vector3.new(0, 0, -1)
|
||||
end
|
||||
hrp.CFrame = CFrame.lookAt(hrp.Position, hrp.Position + dir)
|
||||
charge = { t0 = os.clock(), tool = tool }
|
||||
setState("charging")
|
||||
startChargeCam(tool, dir)
|
||||
updateCharge()
|
||||
end
|
||||
|
||||
-- ЛКМ отпущена: бросок с набранной силой
|
||||
local function releaseCast()
|
||||
if state ~= "charging" or not charge then
|
||||
return
|
||||
end
|
||||
local power = chargePower()
|
||||
castTool = charge.tool
|
||||
charge = nil -- удочку не возвращаем: сервер сам сделает рывок вперёд
|
||||
setState("casting")
|
||||
remote:FireServer("Cast", power)
|
||||
end
|
||||
|
||||
local function onActivate()
|
||||
if state == "idle" then
|
||||
setState("casting")
|
||||
remote:FireServer("Cast")
|
||||
elseif state == "waiting" then
|
||||
if state == "waiting" then
|
||||
remote:FireServer("Cancel")
|
||||
setState("idle")
|
||||
elseif state == "bite" then
|
||||
@@ -1103,7 +1445,14 @@ local function hookTool(tool)
|
||||
return
|
||||
end
|
||||
hooked[tool] = true
|
||||
tool.Activated:Connect(onActivate)
|
||||
tool.Activated:Connect(function()
|
||||
if state == "idle" then
|
||||
startCharge(tool)
|
||||
else
|
||||
onActivate()
|
||||
end
|
||||
end)
|
||||
tool.Deactivated:Connect(releaseCast)
|
||||
tool.Unequipped:Connect(function()
|
||||
if state == "waiting" or state == "bite" or state == "casting" then
|
||||
remote:FireServer("Cancel")
|
||||
@@ -1133,6 +1482,12 @@ if player.Character then
|
||||
watch(player.Character)
|
||||
end
|
||||
|
||||
RunService.RenderStepped:Connect(function()
|
||||
if state == "charging" and charge then
|
||||
updateCharge()
|
||||
end
|
||||
end)
|
||||
|
||||
RunService.RenderStepped:Connect(function(dt)
|
||||
if state ~= "bite" then
|
||||
return
|
||||
@@ -1184,21 +1539,109 @@ local lastWorldId = "none"
|
||||
local terrain = workspace.Terrain
|
||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||
|
||||
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
||||
local lakeDefaults
|
||||
|
||||
local function applyAmbience(world)
|
||||
local clock = (world and world.clock) or 14.5
|
||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
||||
terrain.WaterColor = (world and world.water) or defaultWater
|
||||
local lake = world and world.id == "World1"
|
||||
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
|
||||
local frost = world and world.id == "World3"
|
||||
TweenService:Create(atm, TweenInfo.new(2), {
|
||||
Density = frost and 0.38 or 0.25,
|
||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
||||
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
||||
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()
|
||||
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
|
||||
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()
|
||||
while true do
|
||||
local w = currentWorld()
|
||||
@@ -1228,6 +1671,314 @@ task.spawn(function()
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- обучение: линия-подсказка
|
||||
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
||||
|
||||
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
||||
local W1 = Config.Worlds[1].center
|
||||
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
||||
|
||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||
local guideHint, guideHintText = softPlate(
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = gui },
|
||||
{ TextSize = 42, Text = "" }
|
||||
)
|
||||
wobble(guideHint, 1.2, 1.6)
|
||||
local lastHint = nil
|
||||
|
||||
local guideFolder = new("Folder", { Name = "TutorialGuide", Parent = workspace })
|
||||
local chevrons = {}
|
||||
for i = 1, GUIDE_N do
|
||||
local arms = {}
|
||||
for k = 1, 2 do
|
||||
arms[k] = new("Part", {
|
||||
Anchored = true, CanCollide = false, CanQuery = false, CanTouch = false, CastShadow = false,
|
||||
Material = Enum.Material.Neon, Color = Color3.fromRGB(70, 195, 255), Size = Vector3.new(0.5, 0.5, 2), Transparency = 1,
|
||||
Parent = guideFolder,
|
||||
})
|
||||
end
|
||||
chevrons[i] = arms
|
||||
end
|
||||
-- два объёмных бруска стрелки «>» острием вперёд (по -Z)
|
||||
local GUIDE_HEIGHT = 2.2 -- стрелки висят в воздухе над землёй
|
||||
local ARM_CF = {}
|
||||
for k, s in ipairs({ -1, 1 }) do
|
||||
local center = Vector3.new(s * 0.65, 0, -0.15)
|
||||
ARM_CF[k] = CFrame.lookAt(center, center + Vector3.new(s * 1.3, 0, 1.5))
|
||||
end
|
||||
local function hideChevrons(from)
|
||||
for i = from, GUIDE_N do
|
||||
chevrons[i][1].Transparency = 1
|
||||
chevrons[i][2].Transparency = 1
|
||||
end
|
||||
end
|
||||
|
||||
local guideRay = RaycastParams.new()
|
||||
guideRay.FilterType = Enum.RaycastFilterType.Exclude
|
||||
guideRay.RespectCanCollide = true
|
||||
guideRay.IgnoreWater = false
|
||||
|
||||
local function tutorialStep()
|
||||
return math.max(player:GetAttribute("Tutorial") or 0, guideStep)
|
||||
end
|
||||
local function advanceTutorial(step)
|
||||
if step > tutorialStep() then
|
||||
guideStep = step
|
||||
remote:FireServer("Tutorial", step)
|
||||
if step >= Config.TutorialDone then
|
||||
notify("🎓 Обучение пройдено!", C.gold)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function guideMarker(name)
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
local m = map and map:FindFirstChild(name)
|
||||
return m and m.Position
|
||||
end
|
||||
|
||||
-- объект цели подсвечивается голубым (атрибут GuideTarget ставит MapBuilder)
|
||||
local guideHighlight = new("Highlight", {
|
||||
FillColor = Color3.fromRGB(70, 195, 255), OutlineColor = Color3.fromRGB(170, 235, 255),
|
||||
DepthMode = Enum.HighlightDepthMode.AlwaysOnTop, Enabled = false, Parent = guideFolder,
|
||||
})
|
||||
local guideObjects, guideScanAt = {}, {}
|
||||
local function guideObject(key)
|
||||
local obj = guideObjects[key]
|
||||
if obj and obj.Parent then
|
||||
return obj
|
||||
end
|
||||
-- карта большая: если объекта нет (ещё не загрузился), ищем заново не чаще раза в 2 секунды
|
||||
if guideScanAt[key] and os.clock() - guideScanAt[key] < 2 then
|
||||
return nil
|
||||
end
|
||||
guideScanAt[key] = os.clock()
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return nil
|
||||
end
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:GetAttribute("GuideTarget") == key then
|
||||
guideObjects[key] = d
|
||||
return d
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- первый подход к табличке: камера крупно на табличку, управление и весь интерфейс убраны;
|
||||
-- кнопка «Далее» плавно возвращает камеру, интерфейс и управление
|
||||
local StarterGui = game:GetService("StarterGui")
|
||||
local BOARD_CAM_TIME, BOARD_FOV = 0.8, 70
|
||||
local boardView = nil
|
||||
local closeBoardView
|
||||
-- кнопка в отдельном ScreenGui: основной интерфейс на это время выключается целиком
|
||||
local boardGui = new("ScreenGui", { Name = "BoardView", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 50, Enabled = false, Parent = player:WaitForChild("PlayerGui") })
|
||||
btn({
|
||||
Size = UDim2.fromOffset(240, 60), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -40),
|
||||
BackgroundColor3 = C.green, Text = "Далее ▶", TextSize = 26, Parent = boardGui,
|
||||
}, function()
|
||||
closeBoardView()
|
||||
end)
|
||||
|
||||
local function setInterfaceHidden(hidden)
|
||||
gui.Enabled = not hidden
|
||||
boardGui.Enabled = hidden
|
||||
pcall(function()
|
||||
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden)
|
||||
end)
|
||||
-- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было
|
||||
if hidden then
|
||||
boardView.billboards = {}
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
for _, d in ipairs(map and map:GetDescendants() or {}) do
|
||||
if d:IsA("BillboardGui") and d.Enabled then
|
||||
d.Enabled = false
|
||||
table.insert(boardView.billboards, d)
|
||||
end
|
||||
end
|
||||
elseif boardView and boardView.billboards then
|
||||
for _, d in ipairs(boardView.billboards) do
|
||||
d.Enabled = true
|
||||
end
|
||||
boardView.billboards = nil
|
||||
end
|
||||
end
|
||||
|
||||
local function boardCamStep()
|
||||
local bv, cam = boardView, workspace.CurrentCamera
|
||||
if not bv or not cam then
|
||||
return
|
||||
end
|
||||
local e = easeInOut(math.min(1, (os.clock() - bv.t0) / BOARD_CAM_TIME))
|
||||
cam.CFrame = bv.fromCF:Lerp(bv.toCF, e)
|
||||
cam.FieldOfView = bv.fromFov + (bv.toFov - bv.fromFov) * e
|
||||
if bv.returning and e >= 1 then
|
||||
RunService:UnbindFromRenderStep("BoardCam")
|
||||
cam.CameraType = Enum.CameraType.Custom
|
||||
setInterfaceHidden(false)
|
||||
boardView = nil
|
||||
setMovementLocked(false)
|
||||
end
|
||||
end
|
||||
|
||||
local function openBoardView(board)
|
||||
local cam = workspace.CurrentCamera
|
||||
-- отходим ровно настолько, чтобы табличка целиком влезла в кадр (по высоте и по ширине) с небольшим запасом
|
||||
local half = math.tan(math.rad(BOARD_FOV / 2))
|
||||
local aspect = cam.ViewportSize.X / math.max(1, cam.ViewportSize.Y)
|
||||
local dist = math.max((board.Size.Y / 2) / half, (board.Size.X / 2) / (half * aspect)) * 1.15
|
||||
boardView = {
|
||||
t0 = os.clock(), origCF = cam.CFrame, origFov = cam.FieldOfView,
|
||||
fromCF = cam.CFrame, fromFov = cam.FieldOfView,
|
||||
-- надписи на лицевой стороне (Front), она смотрит по LookVector
|
||||
toCF = CFrame.lookAt(board.Position + board.CFrame.LookVector * dist, board.Position), toFov = BOARD_FOV,
|
||||
}
|
||||
setMovementLocked(true)
|
||||
setInterfaceHidden(true)
|
||||
cam.CameraType = Enum.CameraType.Scriptable
|
||||
RunService:UnbindFromRenderStep("BoardCam")
|
||||
RunService:BindToRenderStep("BoardCam", Enum.RenderPriority.Camera.Value + 1, boardCamStep)
|
||||
end
|
||||
|
||||
closeBoardView = function()
|
||||
local cam = workspace.CurrentCamera
|
||||
if not boardView or boardView.returning or not cam then
|
||||
return
|
||||
end
|
||||
boardGui.Enabled = false -- кнопка пропадает сразу, остальной интерфейс — когда камера вернётся
|
||||
boardView.returning = true
|
||||
boardView.t0 = os.clock()
|
||||
boardView.fromCF, boardView.fromFov = cam.CFrame, cam.FieldOfView
|
||||
boardView.toCF, boardView.toFov = boardView.origCF, boardView.origFov
|
||||
advanceTutorial(1)
|
||||
end
|
||||
|
||||
-- маршрут для текущего шага: точки ломаной (без игрока), подсказка и что подсветить; nil — линию не показываем
|
||||
local function guideRoute(step, pos, world)
|
||||
local inW1 = world and world.id == "World1"
|
||||
if step == 0 and not world then
|
||||
return { guideMarker("GuideBoard") }, "📋 Прочитай табличку", "Board"
|
||||
elseif not world then -- шаги 1–3 из лобби: сначала в портал
|
||||
return { guideMarker("GuidePortal") }, "🌊 Иди в портал", "Portal"
|
||||
elseif step == 2 and inW1 then
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||
elseif step == 3 and inW1 then
|
||||
local route = {}
|
||||
local rel = pos - W1
|
||||
if math.abs(rel.X) < 6 and rel.Z < 80 then
|
||||
table.insert(route, W1 + Vector3.new(0, 4.5, 84)) -- сначала сойти с причала
|
||||
end
|
||||
table.insert(route, guideMarker("GuideSell"))
|
||||
return route, "💰 Продай рыбу", "Sell"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
RunService.RenderStepped:Connect(function()
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
local step = tutorialStep()
|
||||
-- пока сервер не прислал шаг (данные ещё грузятся), ничего не показываем
|
||||
if not hrp or player:GetAttribute("Tutorial") == nil or step >= Config.TutorialDone then
|
||||
guideHint.Visible = false
|
||||
guideHighlight.Enabled = false
|
||||
hideChevrons(1)
|
||||
return
|
||||
end
|
||||
if boardView then -- смотрим на табличку: ни линии, ни подсказок
|
||||
guideHint.Visible = false
|
||||
guideHighlight.Enabled = false
|
||||
hideChevrons(1)
|
||||
return
|
||||
end
|
||||
local pos = hrp.Position
|
||||
local world = Config.WorldAt(pos)
|
||||
|
||||
-- переходы между шагами
|
||||
if step <= 1 and world and world.id == "World1" then
|
||||
advanceTutorial(2)
|
||||
elseif step == 0 then
|
||||
local board = guideMarker("GuideBoard")
|
||||
if board and (board - pos).Magnitude < 9 and state == "idle" then
|
||||
local obj = guideObject("Board")
|
||||
if obj then
|
||||
openBoardView(obj) -- шаг засчитается по кнопке «Далее»
|
||||
return
|
||||
end
|
||||
advanceTutorial(1)
|
||||
end
|
||||
elseif step == 2 and (player:GetAttribute("TotalCaught") or 0) > 0 then
|
||||
advanceTutorial(3)
|
||||
end
|
||||
step = tutorialStep()
|
||||
|
||||
local route, hint, key = guideRoute(step, pos, world)
|
||||
guideHintText.Text = hint or ""
|
||||
local showHint = hint ~= nil and state == "idle"
|
||||
if showHint and (hint ~= lastHint or not guideHint.Visible) then
|
||||
popIn(guideHint, 0.5)
|
||||
end
|
||||
lastHint = hint
|
||||
guideHint.Visible = showHint
|
||||
local target = (key and state == "idle") and guideObject(key) or nil
|
||||
guideHighlight.Adornee = target or nil
|
||||
guideHighlight.Enabled = target ~= nil
|
||||
if target then
|
||||
local pulse = (math.sin(os.clock() * 4) + 1) / 2 -- мягкое мигание
|
||||
guideHighlight.FillTransparency = 0.45 + 0.3 * pulse
|
||||
guideHighlight.OutlineTransparency = 0.3 * pulse
|
||||
end
|
||||
if not route or #route == 0 or state ~= "idle" then
|
||||
hideChevrons(1)
|
||||
return
|
||||
end
|
||||
|
||||
-- ломаная от ног игрока через точки маршрута
|
||||
local pts = { pos - Vector3.new(0, 3, 0) }
|
||||
for _, p in ipairs(route) do
|
||||
table.insert(pts, p)
|
||||
end
|
||||
local lens, total = {}, 0
|
||||
for i = 2, #pts do
|
||||
local d = ((pts[i] - pts[i - 1]) * Vector3.new(1, 0, 1)).Magnitude
|
||||
lens[i] = math.max(d, 0.001)
|
||||
total += d
|
||||
end
|
||||
if total < 4 then
|
||||
hideChevrons(1) -- уже на месте
|
||||
return
|
||||
end
|
||||
|
||||
guideRay.FilterDescendantsInstances = { player.Character, guideFolder }
|
||||
local phase = (os.clock() * GUIDE_SPEED) % GUIDE_GAP
|
||||
local seg, segStart = 2, 0
|
||||
for i = 1, GUIDE_N do
|
||||
local d = 2 + phase + (i - 1) * GUIDE_GAP
|
||||
if d > total - 1 then
|
||||
hideChevrons(i)
|
||||
break
|
||||
end
|
||||
while seg < #pts and d > segStart + lens[seg] do
|
||||
segStart += lens[seg]
|
||||
seg += 1
|
||||
end
|
||||
local a, b = pts[seg - 1], pts[seg]
|
||||
local p = a:Lerp(b, (d - segStart) / lens[seg])
|
||||
local dir = (b - a) * Vector3.new(1, 0, 1)
|
||||
local hit = workspace:Raycast(p + Vector3.new(0, 4, 0), Vector3.new(0, -12, 0), guideRay)
|
||||
-- висят в воздухе и слегка покачиваются волной
|
||||
local y = (hit and hit.Position.Y or p.Y) + GUIDE_HEIGHT + math.sin(os.clock() * 4 - d * 0.5) * 0.25
|
||||
local base = CFrame.lookAt(Vector3.new(p.X, y, p.Z), Vector3.new(p.X, y, p.Z) + dir)
|
||||
-- у игрока и у цели стрелки плавно проявляются и гаснут
|
||||
local fade = math.max(0, 1 - math.min(d - 2, total - 1 - d) / 2.5)
|
||||
local tr = 0.05 + 0.95 * fade
|
||||
for k = 1, 2 do
|
||||
chevrons[i][k].CFrame = base * ARM_CF[k]
|
||||
chevrons[i][k].Transparency = tr
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- события от сервера
|
||||
|
||||
remote.OnClientEvent:Connect(function(action, a, b, c)
|
||||
@@ -1235,7 +1986,11 @@ remote.OnClientEvent:Connect(function(action, a, b, c)
|
||||
notify(a, b)
|
||||
elseif action == "Cast" then
|
||||
setState("waiting")
|
||||
startCastCam(a, b)
|
||||
elseif action == "CastFail" or action == "Cancel" or action == "Escaped" then
|
||||
if action == "CastFail" and castTool and castTool.Parent then
|
||||
castTool.Grip = gripCF(REST_ANGLE) -- сервер удочку не трогал, а у нас она в замахе
|
||||
end
|
||||
setState("idle")
|
||||
elseif action == "Bite" then
|
||||
mg.speed = a.speed
|
||||
@@ -1255,8 +2010,11 @@ remote.OnClientEvent:Connect(function(action, a, b, c)
|
||||
showCatch(a, b)
|
||||
playUiSound(DING, 0.5)
|
||||
elseif action == "Sold" then
|
||||
if tutorialStep() == 3 then
|
||||
advanceTutorial(Config.TutorialDone)
|
||||
end
|
||||
floatText("+" .. fmt(a) .. " 💰", C.gold)
|
||||
notify(("Продано рыб: %d → +%s 💰"):format(b, fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
elseif action == "Inventory" then
|
||||
inventory = a or {}
|
||||
discovered = b or {}
|
||||
|
||||
+1541
-389
File diff suppressed because it is too large.
Load diff
@@ -11,8 +11,9 @@ Config.Worlds = {
|
||||
{
|
||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
||||
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
|
||||
desc = "Уютное лесное озеро: прозрачная бирюзовая вода, солнечный причал и водопад среди сосен.",
|
||||
clock = 16.2, water = Color3.fromRGB(40, 170, 165),
|
||||
waterTransparency = 0.6,
|
||||
waterY = 0,
|
||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
||||
},
|
||||
@@ -57,6 +58,80 @@ function Config.WorldAt(pos)
|
||||
return nil
|
||||
end
|
||||
|
||||
-- куда бросать из этой точки (единичный вектор по горизонтали): к центру ближайшего озера или лунки,
|
||||
-- а если ближе море — от центра острова к морю
|
||||
function Config.CastDirection(world, pos)
|
||||
if not world then
|
||||
return nil
|
||||
end
|
||||
local x, z = pos.X - world.center.X, pos.Z - world.center.Z
|
||||
local best, bestGap
|
||||
local function consider(dir, gap)
|
||||
if dir.Magnitude > 0.1 and (not bestGap or gap < bestGap) then
|
||||
best, bestGap = dir.Unit, gap
|
||||
end
|
||||
end
|
||||
if world.holes then
|
||||
for _, h in ipairs(world.holes) do
|
||||
consider(Vector3.new(h[1] - x, 0, h[2] - z), math.sqrt((h[1] - x) ^ 2 + (h[2] - z) ^ 2) - (world.holeRadius or 6))
|
||||
end
|
||||
end
|
||||
for _, l in ipairs(world.lakes or {}) do
|
||||
if not world.holes then -- в Мире 3 озёра подо льдом, бросаем только в лунки
|
||||
consider(Vector3.new(l[1] - x, 0, l[2] - z), math.sqrt((l[1] - x) ^ 2 + (l[2] - z) ^ 2) - l[3])
|
||||
end
|
||||
end
|
||||
if world.sea then
|
||||
consider(Vector3.new(x, 0, z), world.sea - math.sqrt(x * x + z * z))
|
||||
end
|
||||
return best
|
||||
end
|
||||
|
||||
-- расстояние по горизонтали от точки до ближайшей воды (0 — над водой: на причале или в воде)
|
||||
function Config.WaterGap(world, pos)
|
||||
if not world then
|
||||
return math.huge
|
||||
end
|
||||
local x, z = pos.X - world.center.X, pos.Z - world.center.Z
|
||||
local gap = math.huge
|
||||
if world.holes then
|
||||
for _, h in ipairs(world.holes) do
|
||||
gap = math.min(gap, math.sqrt((h[1] - x) ^ 2 + (h[2] - z) ^ 2) - (world.holeRadius or 6))
|
||||
end
|
||||
else
|
||||
for _, l in ipairs(world.lakes or {}) do
|
||||
gap = math.min(gap, math.sqrt((l[1] - x) ^ 2 + (l[2] - z) ^ 2) - l[3])
|
||||
end
|
||||
end
|
||||
if world.sea then
|
||||
gap = math.min(gap, world.sea - math.sqrt(x * x + z * z))
|
||||
end
|
||||
return math.max(0, gap)
|
||||
end
|
||||
|
||||
-- можно ли закидывать отсюда (pos — центр персонажа): стоим на берегу или платформе
|
||||
-- и до воды не дальше Config.CastReach. Возвращает true или текст подсказки.
|
||||
-- humanoid можно не передавать (на сервере его состояние ненадёжно) — тогда проверяем только по высоте.
|
||||
function Config.CanCastFrom(world, pos, humanoid)
|
||||
if not world then
|
||||
return "🌍 Тут нет рыбы"
|
||||
end
|
||||
local inWater = pos.Y < (world.waterY or 0) + 2 -- у плывущего персонажа центр почти на уровне воды
|
||||
if humanoid then
|
||||
inWater = inWater or humanoid:GetState() == Enum.HumanoidStateType.Swimming or humanoid.FloorMaterial == Enum.Material.Water
|
||||
end
|
||||
if inWater then
|
||||
return "🏊 Выйди из воды"
|
||||
end
|
||||
if humanoid and humanoid.FloorMaterial == Enum.Material.Air then
|
||||
return "Встань на землю"
|
||||
end
|
||||
if Config.WaterGap(world, pos) > Config.CastReach then
|
||||
return "🌊 Подойди к воде"
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- есть ли вода в этой точке мира (озеро, море или лунка)
|
||||
function Config.IsWater(world, pos)
|
||||
if not world then
|
||||
@@ -263,6 +338,16 @@ Config.BiteTimeMin = 3
|
||||
Config.BiteTimeMax = 7
|
||||
Config.BiteTimeout = 12
|
||||
Config.MaxMisses = 2
|
||||
-- заброс: держишь ЛКМ — сила ездит 0 → 1 → 0 → …; от силы в момент отпускания зависит дальность
|
||||
Config.CastChargeTime = 1.3 -- секунд на проход шкалы в одну сторону
|
||||
Config.CastMinDist, Config.CastMaxDist = 6, 28
|
||||
Config.CastReach = 7 -- закидывать можно не дальше ~2 м (7 studs) от воды
|
||||
Config.CastPerfect = { 0.72, 0.86 } -- зелёная зона шкалы
|
||||
Config.CastPerfectLuck = 1.2 -- множитель удачи за попадание в зелёную зону
|
||||
|
||||
-- обучение: линия-подсказка ведёт по шагам 0 → 1 → 2 → 3, на 4 обучение пройдено
|
||||
-- 0 — табличка «Как играть», 1 — портал в Мир 1, 2 — причал (поймать рыбу), 3 — скупка (продать)
|
||||
Config.TutorialDone = 4
|
||||
function Config.HitsNeeded(rank)
|
||||
return math.ceil(rank / 2)
|
||||
end
|
||||
|
||||
@@ -219,6 +219,8 @@ local function updateStats(player)
|
||||
player:SetAttribute("BoostBonus", boostActive(data))
|
||||
player:SetAttribute("BoostLeft", math.max(0, data.boostUntil - os.time()))
|
||||
player:SetAttribute("TotalCaught", data.totalCaught)
|
||||
-- шаг обучения (линия-подсказка); у старых игроков без поля, уже ловивших рыбу, обучение пройдено
|
||||
player:SetAttribute("Tutorial", data.tutorial or (data.totalCaught > 0 and Config.TutorialDone or 0))
|
||||
player:SetAttribute("Mastery", masteryCount(data))
|
||||
player:SetAttribute("Passes", table.concat(ps, ","))
|
||||
|
||||
@@ -239,10 +241,10 @@ local function addXp(player, data, amount)
|
||||
leveled = true
|
||||
end
|
||||
if leveled then
|
||||
notify(player, "⭐ Новый уровень: " .. data.level .. "! Удача +" .. math.floor(Config.LuckPerPlayerLevel * 100) .. "%", GOLD)
|
||||
notify(player, "⭐ Уровень " .. data.level .. "!", GOLD)
|
||||
for _, w in ipairs(Config.Worlds) do
|
||||
if w.level == data.level and not w.soon then
|
||||
notify(player, "🌍 Открыт новый мир: " .. w.icon .. " " .. w.name .. "!", w.color)
|
||||
notify(player, "🌍 Открыт: " .. w.icon .. " " .. w.name, w.color)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -298,7 +300,7 @@ local function questProgress(player, kind, amount)
|
||||
q.progress = math.min(q.goal, q.progress + amount)
|
||||
changed = true
|
||||
if q.progress >= q.goal then
|
||||
notify(player, "📜 Задание выполнено! Забери награду (клавиша Q)", GOLD)
|
||||
notify(player, "📜 Задание готово! (Q)", GOLD)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -335,7 +337,7 @@ local function claimDaily(player)
|
||||
end
|
||||
local t = today()
|
||||
if data.daily.last >= t then
|
||||
notify(player, "🎁 Сегодня награда уже получена. Приходи завтра!", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "🎁 Приходи завтра", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
local streak = (data.daily.last == t - 1) and (data.daily.streak % 7 + 1) or 1
|
||||
@@ -371,7 +373,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
end
|
||||
for _, f in ipairs(zone.fish) do
|
||||
if (rarity == "Master" or f.rarity == rarity) and not data.discovered[f.id] then
|
||||
notify(player, "Сначала поймай всех рыб этой группы!", RED)
|
||||
notify(player, "Сначала поймай всех", RED)
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -379,7 +381,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
if rarity == "Master" then
|
||||
local coins = Config.MasteryCoins * world.mult
|
||||
data.coins += coins
|
||||
notify(player, ("🏆 Мир «%s» собран! +%d 💰 и +%d%% удачи навсегда"):format(world.name, coins, math.floor(Config.MasteryLuck * 100 + 0.5)), GOLD)
|
||||
notify(player, ("🏆 «%s» собран! +%d 💰"):format(world.name, coins), GOLD)
|
||||
else
|
||||
local r = Config.CollectionRewards[rarity]
|
||||
if not r then
|
||||
@@ -387,7 +389,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
end
|
||||
data.coins += r.coins * world.mult
|
||||
addXp(player, data, r.xp * world.mult)
|
||||
notify(player, ("📖 Коллекция «%s»: +%d 💰 +%d XP"):format(Config.Rarities[rarity].name, r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
notify(player, ("📖 +%d 💰 +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
end
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
@@ -541,6 +543,28 @@ local function splash(part, count)
|
||||
end
|
||||
|
||||
-- рыба вылетает из воды, летит к игроку и показывается над головой
|
||||
-- шлейф за летящим предметом — эффект быстрого движения (ширина — расстояние между точками крепления)
|
||||
local TRAIL_COLOR = Color3.fromRGB(215, 245, 255)
|
||||
local function addTrail(part, width)
|
||||
local a0 = Instance.new("Attachment")
|
||||
a0.Position = Vector3.new(0, width / 2, 0)
|
||||
a0.Parent = part
|
||||
local a1 = Instance.new("Attachment")
|
||||
a1.Position = Vector3.new(0, -width / 2, 0)
|
||||
a1.Parent = part
|
||||
local trail = Instance.new("Trail")
|
||||
trail.Attachment0, trail.Attachment1 = a0, a1
|
||||
trail.FaceCamera = true
|
||||
trail.Lifetime = 0.35
|
||||
trail.MinLength = 0.05
|
||||
trail.LightEmission = 0.7
|
||||
trail.Color = ColorSequence.new(TRAIL_COLOR)
|
||||
trail.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.1), NumberSequenceKeypoint.new(1, 1) })
|
||||
trail.WidthScale = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 0) })
|
||||
trail.Parent = part
|
||||
return trail
|
||||
end
|
||||
|
||||
local function showFishFlight(player, fish, fromPos)
|
||||
local head = player.Character and player.Character:FindFirstChild("Head")
|
||||
if not head then
|
||||
@@ -549,6 +573,14 @@ local function showFishFlight(player, fish, fromPos)
|
||||
local model = Models.buildFish(fish.id, fish.mutation, 0.9, true)
|
||||
model:PivotTo(CFrame.new(fromPos))
|
||||
model.Parent = workspace
|
||||
-- шлейф на отдельной невидимой детали: рыба крутится, а шлейф должен оставаться ровным
|
||||
local carrier = Instance.new("Part")
|
||||
carrier.Anchored, carrier.CanCollide, carrier.CanQuery, carrier.CanTouch = true, false, false, false
|
||||
carrier.Transparency = 1
|
||||
carrier.Size = Vector3.new(0.2, 0.2, 0.2)
|
||||
carrier.CFrame = CFrame.new(fromPos)
|
||||
carrier.Parent = model
|
||||
local trail = addTrail(carrier, 1.8)
|
||||
task.spawn(function()
|
||||
local t0, dur = os.clock(), 0.55
|
||||
while head.Parent do
|
||||
@@ -556,11 +588,13 @@ local function showFishFlight(player, fish, fromPos)
|
||||
local target = head.Position + Vector3.new(0, 2.8, 0)
|
||||
local p = fromPos:Lerp(target, a) + Vector3.new(0, math.sin(a * math.pi) * 8, 0)
|
||||
model:PivotTo(CFrame.new(p) * CFrame.Angles(0, 0, a * math.pi * 2))
|
||||
carrier.CFrame = CFrame.new(p)
|
||||
if a >= 1 then
|
||||
break
|
||||
end
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
trail.Enabled = false
|
||||
local t1 = os.clock()
|
||||
while head.Parent and os.clock() - t1 < 1.8 do
|
||||
model:PivotTo(CFrame.new(head.Position + Vector3.new(0, 2.8, 0)) * CFrame.Angles(0, os.clock() * 3, math.rad(-15)))
|
||||
@@ -574,22 +608,59 @@ end
|
||||
|
||||
local fishing = {}
|
||||
|
||||
-- ищем воду перед игроком по карте мира из FishConfig (не зависит от террейна)
|
||||
local function findWater(hrp, world)
|
||||
local look = hrp.CFrame.LookVector * Vector3.new(1, 0, 1)
|
||||
if look.Magnitude < 0.01 then
|
||||
look = Vector3.new(0, 0, -1)
|
||||
-- ищем воду по карте мира из FishConfig (не зависит от террейна) в сторону центра ближайшего озера:
|
||||
-- сначала на дальности, которую задала сила заброса, потом всё дальше от неё
|
||||
local function findWater(hrp, world, power)
|
||||
local look = Config.CastDirection(world, hrp.Position)
|
||||
if not look then
|
||||
look = hrp.CFrame.LookVector * Vector3.new(1, 0, 1)
|
||||
look = look.Magnitude > 0.01 and look.Unit or Vector3.new(0, 0, -1)
|
||||
end
|
||||
look = look.Unit
|
||||
for _, d in ipairs({ 14, 11, 17, 8, 20, 6, 24, 4 }) do
|
||||
local p = hrp.Position + look * d
|
||||
if Config.IsWater(world, p) then
|
||||
return Vector3.new(p.X, world.waterY or 0, p.Z)
|
||||
local want = Config.CastMinDist + (Config.CastMaxDist - Config.CastMinDist) * power
|
||||
for off = 0, 26, 2 do
|
||||
for _, d in ipairs({ want - off, want + off }) do
|
||||
if d >= 4 and d <= Config.CastMaxDist + 2 then
|
||||
local p = hrp.Position + look * d
|
||||
if Config.IsWater(world, p) then
|
||||
return Vector3.new(p.X, world.waterY or 0, p.Z), d
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- вытягивание пустого поплавка: быстро летит к кончику удочки со шлейфом и исчезает
|
||||
local function reelBobber(bobber, tool)
|
||||
local root = bobber and bobber.PrimaryPart
|
||||
local tip = tool and tool:FindFirstChild("Handle") and tool.Handle:FindFirstChild("Tip")
|
||||
if not root or not tip then
|
||||
if bobber then
|
||||
bobber:Destroy()
|
||||
end
|
||||
return
|
||||
end
|
||||
local trail = bobber:FindFirstChildWhichIsA("Trail", true)
|
||||
if trail then
|
||||
trail.Enabled = true
|
||||
else
|
||||
addTrail(root, 1.2)
|
||||
end
|
||||
local from = root.Position
|
||||
task.spawn(function()
|
||||
local t0, dur = os.clock(), 0.3
|
||||
while bobber.Parent and tip.Parent do
|
||||
local a = math.min(1, (os.clock() - t0) / dur)
|
||||
bobber:PivotTo(CFrame.new(from:Lerp(tip.WorldPosition, a) + Vector3.new(0, math.sin(a * math.pi) * 2.5, 0)))
|
||||
if a >= 1 then
|
||||
break
|
||||
end
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
bobber:Destroy()
|
||||
end)
|
||||
end
|
||||
|
||||
local function stopFishing(player, tellClient)
|
||||
local s = fishing[player]
|
||||
if not s then
|
||||
@@ -600,7 +671,11 @@ local function stopFishing(player, tellClient)
|
||||
s.tween:Cancel()
|
||||
end
|
||||
if s.bobber then
|
||||
s.bobber:Destroy()
|
||||
if s.stage == "casting" then
|
||||
s.bobber:Destroy() -- ещё летит: его двигает flyBobber
|
||||
else
|
||||
reelBobber(s.bobber, s.tool)
|
||||
end
|
||||
end
|
||||
if s.tool then
|
||||
tweenGrip(s.tool, REST_ANGLE, 0.3)
|
||||
@@ -610,12 +685,12 @@ local function stopFishing(player, tellClient)
|
||||
end
|
||||
end
|
||||
|
||||
local function rollFish(player, data, worldId)
|
||||
local function rollFish(player, data, worldId, luckMult)
|
||||
local zone = Config.Zones[worldId]
|
||||
if not zone then
|
||||
return nil
|
||||
end
|
||||
local luck = totalLuck(player, data)
|
||||
local luck = totalLuck(player, data) * (luckMult or 1)
|
||||
local bonus = luck - 1
|
||||
local weights, total = {}, 0
|
||||
for i, f in ipairs(zone.fish) do
|
||||
@@ -657,13 +732,14 @@ local function rollFish(player, data, worldId)
|
||||
}
|
||||
end
|
||||
|
||||
local function flyBobber(s, tool, target)
|
||||
local function flyBobber(s, tool, target, dur, arc)
|
||||
local tip = tool:FindFirstChild("Handle") and tool.Handle:FindFirstChild("Tip")
|
||||
local start = tip and tip.WorldPosition or (target + Vector3.new(0, 6, 0))
|
||||
local bobber = Models.buildBobber()
|
||||
bobber:PivotTo(CFrame.new(start))
|
||||
bobber.Parent = workspace
|
||||
s.bobber = bobber
|
||||
local trail = addTrail(bobber.PrimaryPart, 1.2)
|
||||
if tip then
|
||||
local a1 = Instance.new("Attachment")
|
||||
a1.Position = Vector3.new(0, 0.9, 0)
|
||||
@@ -677,22 +753,24 @@ local function flyBobber(s, tool, target)
|
||||
line.Color = ColorSequence.new(Color3.fromRGB(245, 245, 245))
|
||||
line.Parent = bobber
|
||||
end
|
||||
local t0, dur = os.clock(), 0.55
|
||||
local t0 = os.clock()
|
||||
while bobber.Parent do
|
||||
local a = math.min(1, (os.clock() - t0) / dur)
|
||||
bobber:PivotTo(CFrame.new(start:Lerp(target, a) + Vector3.new(0, math.sin(a * math.pi) * 6, 0)))
|
||||
bobber:PivotTo(CFrame.new(start:Lerp(target, a) + Vector3.new(0, math.sin(a * math.pi) * arc, 0)))
|
||||
if a >= 1 then
|
||||
break
|
||||
end
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
trail.Enabled = false -- на воде поплавок качается, шлейф уже не нужен
|
||||
if bobber.Parent then
|
||||
splash(bobber.PrimaryPart, 18)
|
||||
playSound(bobber.PrimaryPart, SPLASH_SOUND, 0.5)
|
||||
end
|
||||
end
|
||||
|
||||
local function onCast(player)
|
||||
local function onCast(player, power)
|
||||
power = math.clamp(tonumber(power) or 0.6, 0, 1)
|
||||
local data = profiles[player]
|
||||
if not data then
|
||||
return
|
||||
@@ -709,42 +787,47 @@ local function onCast(player)
|
||||
return
|
||||
end
|
||||
local world = Config.WorldAt(hrp.Position)
|
||||
local target = world and findWater(hrp, world)
|
||||
local can = Config.CanCastFrom(world, hrp.Position)
|
||||
if can ~= true then
|
||||
remote:FireClient(player, "CastFail")
|
||||
notify(player, can, Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
local target, dist = findWater(hrp, world, power)
|
||||
if not target then
|
||||
remote:FireClient(player, "CastFail")
|
||||
notify(player, world and "Повернись лицом к воде (или к лунке)!" or "Здесь нет рыбы — иди в один из миров 🌍", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "🌊 Подойди к воде", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
if #data.items >= bagCapacity(player, data) then
|
||||
remote:FireClient(player, "CastFail")
|
||||
notify(player, "🎒 Сумка полна! Продай рыбу в скупке.", RED)
|
||||
notify(player, "🎒 Сумка полна!", RED)
|
||||
return
|
||||
end
|
||||
|
||||
local stats = Config.RodStats(data.rod, rodLevel(data))
|
||||
local fish = rollFish(player, data, world.id)
|
||||
local perfect = power >= Config.CastPerfect[1] and power <= Config.CastPerfect[2]
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1)
|
||||
if not fish then
|
||||
remote:FireClient(player, "CastFail")
|
||||
return
|
||||
end
|
||||
local s = { stage = "casting", fish = fish, tool = tool }
|
||||
fishing[player] = s
|
||||
remote:FireClient(player, "Cast")
|
||||
-- замах игрок уже сделал, пока держал кнопку (у себя на клиенте); здесь только бросок вперёд
|
||||
local throw = { windup = 0.15, flight = 0.35 + dist * 0.018, arc = 2 + dist * 0.3, perfect = perfect }
|
||||
local splashAt = target + Vector3.new(0, 0.15, 0)
|
||||
remote:FireClient(player, "Cast", splashAt, throw) -- клиенту для камеры
|
||||
|
||||
task.spawn(function()
|
||||
-- замах назад и бросок вперёд
|
||||
local tw = tweenGrip(tool, 100, 0.25)
|
||||
if tw then
|
||||
tw.Completed:Wait()
|
||||
end
|
||||
tw = tweenGrip(tool, 8, 0.15)
|
||||
local tw = tweenGrip(tool, 8, throw.windup)
|
||||
if tw then
|
||||
tw.Completed:Wait()
|
||||
end
|
||||
if fishing[player] ~= s then
|
||||
return
|
||||
end
|
||||
flyBobber(s, tool, target + Vector3.new(0, 0.15, 0))
|
||||
flyBobber(s, tool, splashAt, throw.flight, throw.arc)
|
||||
tweenGrip(tool, REST_ANGLE - 5, 0.4)
|
||||
if fishing[player] ~= s then
|
||||
if s.bobber then
|
||||
@@ -791,7 +874,7 @@ local function onCast(player)
|
||||
if fishing[player] == s and s.stage == "bite" then
|
||||
stopFishing(player, false)
|
||||
remote:FireClient(player, "Escaped")
|
||||
notify(player, "Рыба ушла… не успел вытащить.", RED)
|
||||
notify(player, "🐟 Рыба ушла", RED)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -809,14 +892,17 @@ local function onCatch(player, success, misses)
|
||||
if s.tween then
|
||||
s.tween:Cancel()
|
||||
end
|
||||
if s.bobber then
|
||||
s.bobber:Destroy()
|
||||
local failed = success ~= true or os.clock() - s.biteAt > Config.BiteTimeout + 1
|
||||
if failed then
|
||||
reelBobber(s.bobber, tool)
|
||||
elseif s.bobber then
|
||||
s.bobber:Destroy() -- вместо поплавка к игроку летит рыба
|
||||
end
|
||||
|
||||
if success ~= true or os.clock() - s.biteAt > Config.BiteTimeout + 1 then
|
||||
if failed then
|
||||
gripSequence(tool, { { REST_ANGLE, 0.3 } })
|
||||
remote:FireClient(player, "Escaped")
|
||||
notify(player, "Рыба сорвалась!", RED)
|
||||
notify(player, "🐟 Сорвалась!", RED)
|
||||
return
|
||||
end
|
||||
gripSequence(tool, { { 85, 0.15 }, { REST_ANGLE, 0.45 } })
|
||||
@@ -909,7 +995,7 @@ local function sellItems(player, filterUid)
|
||||
end
|
||||
if count == 0 then
|
||||
if filterUid == nil then
|
||||
notify(player, "Нечего продавать — сначала поймай рыбу!", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "🎒 Сумка пуста", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
return
|
||||
end
|
||||
@@ -935,12 +1021,12 @@ local function buy(player, kind, id)
|
||||
end
|
||||
local lvl = rodLevel(data, id)
|
||||
if lvl >= Config.RodUpgrade.maxLevel then
|
||||
notify(player, "Удочка уже улучшена до максимума ★★★★★", GOLD)
|
||||
notify(player, "★★★★★ Максимум", GOLD)
|
||||
return
|
||||
end
|
||||
local cost = Config.UpgradeCost(rod, lvl)
|
||||
if data.coins < cost then
|
||||
notify(player, "Не хватает монет: нужно " .. cost .. " 💰", RED)
|
||||
notify(player, "Нужно " .. cost .. " 💰", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= cost
|
||||
@@ -959,17 +1045,17 @@ local function buy(player, kind, id)
|
||||
return
|
||||
end
|
||||
if potion.level and data.level < potion.level then
|
||||
notify(player, "Нужен уровень " .. potion.level .. "!", RED)
|
||||
notify(player, "🔒 Нужен ур. " .. potion.level, RED)
|
||||
return
|
||||
end
|
||||
if data.coins < potion.price then
|
||||
notify(player, "Не хватает монет: нужно " .. potion.price .. " 💰", RED)
|
||||
notify(player, "Нужно " .. potion.price .. " 💰", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= potion.price
|
||||
applyPotion(data, potion.bonus, potion.duration)
|
||||
updateStats(player)
|
||||
notify(player, ("🍀 %s: удача +%d%% на %d мин"):format(potion.name, potion.bonus * 100, potion.duration / 60), GREEN)
|
||||
notify(player, ("🍀 +%d%% удачи, %d мин"):format(potion.bonus * 100, potion.duration / 60), GREEN)
|
||||
return
|
||||
end
|
||||
local list, owned
|
||||
@@ -986,16 +1072,16 @@ local function buy(player, kind, id)
|
||||
end
|
||||
if not owned[id] then
|
||||
if data.level < item.level then
|
||||
notify(player, "Нужен уровень " .. item.level .. "!", RED)
|
||||
notify(player, "🔒 Нужен ур. " .. item.level, RED)
|
||||
return
|
||||
end
|
||||
if data.coins < item.price then
|
||||
notify(player, "Не хватает монет: нужно " .. item.price .. " 💰", RED)
|
||||
notify(player, "Нужно " .. item.price .. " 💰", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= item.price
|
||||
owned[id] = true
|
||||
notify(player, "Куплено: " .. item.name .. "!", GREEN)
|
||||
notify(player, "✅ " .. item.name, GREEN)
|
||||
end
|
||||
if kind == "Rod" then
|
||||
data.rod = id
|
||||
@@ -1025,11 +1111,11 @@ local function teleportTo(player, worldId)
|
||||
return
|
||||
end
|
||||
if world.soon then
|
||||
notify(player, world.icon .. " " .. world.name .. " скоро откроется! Следи за обновлениями.", world.color)
|
||||
notify(player, world.icon .. " " .. world.name .. " — скоро!", world.color)
|
||||
return
|
||||
end
|
||||
if data.level < world.level then
|
||||
notify(player, ("🔒 %s откроется на %d уровне"):format(world.name, world.level), RED)
|
||||
notify(player, ("🔒 %s: ур. %d"):format(world.name, world.level), RED)
|
||||
return
|
||||
end
|
||||
markerName = world.id .. "Spawn"
|
||||
@@ -1094,7 +1180,15 @@ end)
|
||||
|
||||
remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
if action == "Cast" then
|
||||
onCast(player)
|
||||
onCast(player, a)
|
||||
elseif action == "Tutorial" then
|
||||
-- шаги обучения идут только вперёд
|
||||
local data = profiles[player]
|
||||
local step = math.floor(tonumber(a) or 0)
|
||||
if data and step > (player:GetAttribute("Tutorial") or 0) and step <= Config.TutorialDone then
|
||||
data.tutorial = step
|
||||
player:SetAttribute("Tutorial", step)
|
||||
end
|
||||
elseif action == "Catch" then
|
||||
onCatch(player, a, b)
|
||||
elseif action == "Cancel" then
|
||||
@@ -1108,13 +1202,13 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
if nearSeller(player) then
|
||||
sellItems(player, a)
|
||||
else
|
||||
notify(player, "Продавать можно только у скупщика 💰", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
elseif action == "SellAll" then
|
||||
if nearSeller(player) then
|
||||
sellItems(player, nil)
|
||||
else
|
||||
notify(player, "Продавать можно только у скупщика 💰", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
elseif action == "Teleport" then
|
||||
teleportTo(player, a)
|
||||
@@ -1140,7 +1234,7 @@ MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, passI
|
||||
if gp.id == passId then
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][gp.key] = true
|
||||
notify(player, "Спасибо за покупку! " .. gp.icon .. " " .. gp.name .. " активирован", GOLD)
|
||||
notify(player, "✅ " .. gp.icon .. " " .. gp.name, GOLD)
|
||||
if gp.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
@@ -1176,7 +1270,7 @@ MarketplaceService.ProcessReceipt = function(info)
|
||||
end
|
||||
if product.boost then
|
||||
applyPotion(data, product.boost, product.duration)
|
||||
notify(player, ("Спасибо! Удача +%d%% на %d мин"):format(product.boost * 100, product.duration / 60), GOLD)
|
||||
notify(player, ("🍀 +%d%% удачи, %d мин"):format(product.boost * 100, product.duration / 60), GOLD)
|
||||
end
|
||||
table.insert(data.receipts, info.PurchaseId)
|
||||
if #data.receipts > 50 then
|
||||
@@ -1196,7 +1290,7 @@ task.spawn(function()
|
||||
workspace:SetAttribute("Event", currentEvent.id)
|
||||
workspace:SetAttribute("EventEnds", workspace:GetServerTimeNow() + currentEvent.duration)
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
notify(p, "🎉 Событие: " .. currentEvent.name .. " — " .. currentEvent.desc, GOLD)
|
||||
notify(p, "🎉 " .. currentEvent.name, GOLD)
|
||||
updateStats(p)
|
||||
end
|
||||
task.wait(currentEvent.duration)
|
||||
|
||||
@@ -51,26 +51,35 @@ terrain.WaterWaveSpeed = 12
|
||||
|
||||
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
||||
|
||||
local W = V(0, 0, 1500) -- центр Мира 1
|
||||
local GROUND_Y = 4 -- верх земли
|
||||
local WATER_Y = 0 -- поверхность воды
|
||||
|
||||
-- озеро из нескольких кругов: { x, z, радиус }
|
||||
local W = Config.Worlds[1].center
|
||||
local GROUND_Y, WATER_Y = 4, 0
|
||||
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)
|
||||
-- холмы по краям
|
||||
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)
|
||||
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
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
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)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
@@ -79,34 +88,39 @@ end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||
end
|
||||
-- то же самое напрямую по вокселям: вода ниже WATER_Y, воздух выше.
|
||||
-- Fill* с Air иногда оставляет песок над водой, и озеро выглядит сухим.
|
||||
|
||||
-- Мелководье вычисляется по объединению кругов: на пересечениях нет песчаных стенок.
|
||||
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 size = mats.Size
|
||||
local corner = region.CFrame.Position - region.Size / 2
|
||||
local center = W + V(l[1], 0, l[2])
|
||||
local size, corner = mats.Size, region.CFrame.Position - region.Size / 2
|
||||
for x = 1, size.X do
|
||||
for y = 1, size.Y do
|
||||
for z = 1, size.Z do
|
||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
||||
local water = c.Y < WATER_Y
|
||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
||||
occ[x][y][z] = water and 1 or 0
|
||||
for z = 1, size.Z do
|
||||
local px, pz = corner.X + (x - 0.5) * 4 - W.X, corner.Z + (z - 0.5) * 4 - W.Z
|
||||
if (px - l[1]) ^ 2 + (pz - l[2]) ^ 2 <= l[3] ^ 2 then
|
||||
local inland = 0
|
||||
for _, lake in ipairs(LAKES) do
|
||||
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
|
||||
terrain:WriteVoxels(region, 4, mats, occ)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
carveLake(l)
|
||||
end
|
||||
-- дорожка от точки прибытия к причалу и площадка
|
||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 100)), V(8, 4, 44), Enum.Material.Ground)
|
||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 130)), 4, 17, Enum.Material.Cobblestone)
|
||||
for _, l in ipairs(LAKES) do carveLake(l) end
|
||||
|
||||
-- Прибытие и короткий подход к главному причалу.
|
||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(12, 4, 14), Enum.Material.Ground)
|
||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 94)), 4, 13, Enum.Material.Cobblestone)
|
||||
|
||||
|
||||
---------------------------------------------------------------- точка появления в лобби
|
||||
|
||||
@@ -117,7 +131,7 @@ if not spawn then
|
||||
end
|
||||
spawn.Anchored = true
|
||||
spawn.Size = V(8, 0.2, 8)
|
||||
spawn.CFrame = CFrame.new(0, 1.15, 50)
|
||||
spawn.CFrame = CFrame.new(0, 1.15, 57)
|
||||
spawn.Transparency = 1
|
||||
spawn.Duration = 0
|
||||
for _, d in ipairs(spawn:GetChildren()) do
|
||||
@@ -513,7 +527,7 @@ for _, a in ipairs({ 0, 90, 180, 270 }) do
|
||||
P({ Size = V(10, 1.0, 48), CFrame = CFrame.new(math.cos(r) * 60, 0.52, math.sin(r) * 60) * CFrame.Angles(0, -r + math.pi / 2, 0), Material = Enum.Material.Marble, Color = Color3.fromRGB(225, 218, 205) })
|
||||
end
|
||||
|
||||
marker("LobbySpawn", CFrame.new(0, FLOOR + 2, 50))
|
||||
marker("LobbySpawn", CFrame.new(0, FLOOR + 2, 57)) -- на дорожке за табличкой «Как играть»: сначала она, дальше портал в Мир 1
|
||||
|
||||
-- фонтан со статуей золотой рыбы
|
||||
vcyl(V(0, FLOOR + 1, 0), 2, 24, { Material = Enum.Material.Slate, Color = Color3.fromRGB(205, 200, 190) })
|
||||
@@ -551,16 +565,24 @@ do
|
||||
water.Acceleration = V(0, -25, 0)
|
||||
water.Parent = att
|
||||
end
|
||||
for i = 0, 5 do
|
||||
local a = math.rad(i * 60 + 30)
|
||||
bench(CFrame.lookAt(V(math.cos(a) * 17, FLOOR, math.sin(a) * 17), V(math.cos(a) * 30, FLOOR, math.sin(a) * 30)))
|
||||
-- скамейки по внешнему краю площади, между порталами, лицом к фонтану
|
||||
for _, deg in ipairs({ 45, 135, 225, 315 }) do
|
||||
local a = math.rad(deg)
|
||||
for _, side in ipairs({ -1, 1 }) do
|
||||
local b = a + side * math.rad(9)
|
||||
bench(CFrame.lookAt(V(math.cos(b) * 34, FLOOR, math.sin(b) * 34), V(0, FLOOR, 0)))
|
||||
end
|
||||
end
|
||||
|
||||
-- фонари по кругу
|
||||
-- фонари по кругу (у спавна — за спиной игрока, чтобы не закрывали табличку и сундук)
|
||||
for i = 0, 7 do
|
||||
local a = math.rad(i * 45 + 22.5)
|
||||
lamp(V(math.cos(a) * 40, FLOOR, math.sin(a) * 40))
|
||||
local deg = i * 45 + 22.5
|
||||
if deg ~= 67.5 and deg ~= 112.5 then
|
||||
local a = math.rad(deg)
|
||||
lamp(V(math.cos(a) * 40, FLOOR, math.sin(a) * 40))
|
||||
end
|
||||
end
|
||||
lamp(V(7, FLOOR, 48)) -- левый фонарь стоит за табличкой «Как играть»
|
||||
|
||||
-- клумбы с деревьями
|
||||
for _, deg in ipairs({ 225, 315 }) do
|
||||
@@ -659,12 +681,20 @@ stall(CFrame.lookAt(V(62, FLOOR, 0), V(0, FLOOR, 0)), {
|
||||
end,
|
||||
})
|
||||
|
||||
-- порталы во все миры и арка с названием
|
||||
local portalCF = CFrame.lookAt(V(0, FLOOR, -66), V(0, FLOOR, 0))
|
||||
arch(portalCF, 84, 24, "🎣 " .. string.upper(Config.GameName) .. " 🎣", Color3.fromRGB(255, 190, 60))
|
||||
-- арка с названием
|
||||
arch(CFrame.lookAt(V(0, FLOOR, -66), V(0, FLOOR, 0)), 84, 24, "🎣 " .. string.upper(Config.GameName) .. " 🎣", Color3.fromRGB(255, 190, 60))
|
||||
|
||||
-- порталы по кругу у фонтана, лицом наружу; первый (бесплатный) мир — прямо перед точкой появления
|
||||
local PORTAL_R = 19
|
||||
for i, w in ipairs(Config.Worlds) do
|
||||
local title = w.icon .. " " .. w.name .. (w.level > 1 and (" (ур. " .. w.level .. ")") or "")
|
||||
portal(portalCF * CFrame.new(-27 + (i - 1) * 18, 0, 0), title, w.color, w.id, w.soon)
|
||||
local a = math.rad(90 - (i - 1) * 90) -- 90° = сторона спавна (+Z)
|
||||
local pos = V(math.cos(a) * PORTAL_R, FLOOR, math.sin(a) * PORTAL_R)
|
||||
local disc = portal(CFrame.lookAt(pos, V(pos.X * 2, FLOOR, pos.Z * 2)), title, w.color, w.id, w.soon)
|
||||
if i == 1 then
|
||||
disc:SetAttribute("GuideTarget", "Portal")
|
||||
marker("GuidePortal", CFrame.new(pos.X * 1.3, FLOOR, pos.Z * 1.3)) -- точка перед порталом для линии-подсказки
|
||||
end
|
||||
end
|
||||
|
||||
-- невидимая стена по кругу: из лобби не уйти
|
||||
@@ -745,304 +775,489 @@ end
|
||||
|
||||
-- табличка «Как играть»
|
||||
do
|
||||
local pos = V(-14, FLOOR, 34)
|
||||
local cf = CFrame.lookAt(pos, V(0, FLOOR, 50))
|
||||
-- слева от дорожки за точкой появления, лицом к камере игрока; фонарь — за табличкой
|
||||
local pos = V(-12, FLOOR, 48)
|
||||
local cf = CFrame.lookAt(pos, V(0, FLOOR, 64))
|
||||
lamp((cf * CFrame.new(0, 0, 2.5)).Position)
|
||||
marker("GuideBoard", cf * CFrame.new(0, 0, -6)) -- перед табличкой, для линии-подсказки
|
||||
for _, x in ipairs({ -6.5, 6.5 }) do
|
||||
P({ Size = V(0.8, 9, 0.8), CFrame = cf * CFrame.new(x, 4.5, 0.3), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 40) })
|
||||
end
|
||||
local board = P({ Size = V(14, 8, 0.5), CFrame = cf * CFrame.new(0, 6, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(70, 48, 32) })
|
||||
board:SetAttribute("GuideTarget", "Board") -- подсвечивается на шаге обучения
|
||||
surfaceText(board, Enum.NormalId.Front,
|
||||
"<font color=\"#FFD866\">КАК ИГРАТЬ</font>\n1. Портал «Мир 1» или кнопка 🌍 Миры\n2. Удочка — клавиша 1, клик у воды\n3. Клюёт → кликай в зелёную зону\n4. 🎒 Сумка — B, 📜 Задания — Q\n5. Собирай коллекцию — получай награды!",
|
||||
"<font color=\"#FFD866\">КАК ИГРАТЬ</font>\n1. Портал «Мир 1» или кнопка 🌍 Миры\n2. Удочка — клавиша 1, у воды зажми ЛКМ и отпусти\n3. Клюёт → кликай в зелёную зону\n4. 🎒 Сумка — B, 📜 Задания — Q\n5. Собирай коллекцию — получай награды!",
|
||||
Color3.fromRGB(255, 245, 225), { TextXAlignment = Enum.TextXAlignment.Left })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
||||
|
||||
local function inLake(x, z, extra)
|
||||
for _, l in ipairs(LAKES) do
|
||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
||||
return true
|
||||
do
|
||||
local previous = {}
|
||||
for _, child in ipairs(map:GetChildren()) do previous[child] = true end
|
||||
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
|
||||
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
|
||||
return false
|
||||
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
|
||||
obj.Parent = parent
|
||||
end
|
||||
local function lantern(cf)
|
||||
local bulb = block("Lantern", V(0.8, 1.15, 0.8), cf, C.warm, Enum.Material.Neon)
|
||||
light(bulb, 14, 0.8)
|
||||
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
|
||||
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
|
||||
return false
|
||||
end
|
||||
|
||||
-- прибытие
|
||||
local arrive = W + V(0, GROUND_Y, 128)
|
||||
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
||||
arch(CFrame.new(W + V(0, GROUND_Y, 112)), 14, 11, "🌊 ТИХОЕ ОЗЕРО", Color3.fromRGB(80, 200, 255))
|
||||
portal(CFrame.lookAt(W + V(-26, GROUND_Y, 140), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
||||
stall(CFrame.lookAt(W + V(30, GROUND_Y, 140), 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) },
|
||||
})
|
||||
|
||||
-- доска «Кто водится в озере»
|
||||
do
|
||||
local pos = W + V(-16, GROUND_Y, 104)
|
||||
local cf = CFrame.lookAt(pos, W + V(0, GROUND_Y, 120))
|
||||
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) })
|
||||
local function lanternPost(pos)
|
||||
cylA(pos, pos + V(0, 5, 0), 0.4, { Color = C.dark, Material = Enum.Material.Wood })
|
||||
lantern(CFrame.new(pos + V(0, 5.4, 0)))
|
||||
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 lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
||||
local r = Config.Rarities[f.rarity]
|
||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
||||
local function ropeRing(pos, radius)
|
||||
for i = 0, 7 do
|
||||
local a, b = i * math.pi / 4, (i + 1) * math.pi / 4
|
||||
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
|
||||
end
|
||||
local function pier(center, size, primary)
|
||||
local cf = CFrame.new(center)
|
||||
local deck = block("PierDeck", size, cf, C.wood, Enum.Material.WoodPlanks, true)
|
||||
if primary then deck:SetAttribute("GuideTarget", "Pier") end
|
||||
local alongZ = size.Z > size.X
|
||||
local length, width = alongZ and size.Z or size.X, alongZ and size.X or size.Z
|
||||
for d = -length / 2 + 1, length / 2 - 0.5, 2 do
|
||||
local offset = alongZ and V(0, 0.34, d) or V(d, 0.34, 0)
|
||||
local boardSize = alongZ and V(width, 0.16, 1.88) or V(1.88, 0.16, width)
|
||||
block("IndividualPlank", boardSize, cf + offset, C.wood:Lerp(C.dark, rng:NextNumber(0, 0.12)), Enum.Material.WoodPlanks)
|
||||
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
|
||||
return deck
|
||||
end
|
||||
local function fishSign(cf, width, height, color)
|
||||
local panel = block("FishSign", V(width, height, 0.22), cf, color, Enum.Material.WoodPlanks)
|
||||
for _, face in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||
local sg = Instance.new("SurfaceGui")
|
||||
sg.Face, sg.LightInfluence, sg.PixelsPerStud = face, 0, 30
|
||||
sg.SizingMode, sg.Parent = Enum.SurfaceGuiSizingMode.PixelsPerStud, panel
|
||||
local body = Instance.new("Frame")
|
||||
body.Size, body.Position = UDim2.fromScale(0.5, 0.4), UDim2.fromScale(0.2, 0.3)
|
||||
body.BackgroundColor3, body.BorderSizePixel, body.Parent = Color3.fromRGB(245, 239, 214), 0, sg
|
||||
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
|
||||
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
|
||||
|
||||
-- Прибытие: всё необходимое находится в пределах 25 studs.
|
||||
local arrive = W + V(0, GROUND_Y, 94)
|
||||
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))
|
||||
end
|
||||
|
||||
-- костёр с брёвнами
|
||||
do
|
||||
local c = W + V(14, GROUND_Y, 118)
|
||||
for i = 0, 7 do
|
||||
local a = i / 8 * math.pi * 2
|
||||
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 })
|
||||
-- Дощатые причалы, кнехты с канатом и снасти на переднем плане.
|
||||
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
|
||||
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) })
|
||||
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 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
|
||||
|
||||
-- дед-рыбак с подсказками
|
||||
npc("Дед Петрович", CFrame.lookAt(W + V(-7, GROUND_Y + 3, 80), W + V(0, GROUND_Y + 3, 95)), {
|
||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
||||
}, "Talk", "Поговорить")
|
||||
|
||||
-- домик рыбака
|
||||
do
|
||||
local cf = CFrame.lookAt(W + V(-34, GROUND_Y, 100), W + V(0, GROUND_Y, 100))
|
||||
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)
|
||||
P({ Size = size, Position = center, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 110, 70) })
|
||||
local alongZ = size.Z > size.X
|
||||
local len = alongZ and size.Z or size.X
|
||||
local wid = alongZ and size.X or size.Z
|
||||
for d = -len / 2 + 1, len / 2 - 1, 6 do
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
local off = alongZ and V(s * (wid / 2 - 0.4), 0, d) or V(d, 0, s * (wid / 2 - 0.4))
|
||||
vcyl(center + off + V(0, -6, 0), 13, 0.9, { Color = Color3.fromRGB(100, 70, 45), Material = Enum.Material.Wood })
|
||||
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
|
||||
end
|
||||
-- { центр от W, размер }
|
||||
local PIERS = {
|
||||
{ V(0, GROUND_Y + 0.2, 58), V(8, 0.6, 42) },
|
||||
{ V(-86, GROUND_Y + 0.2, 15), V(34, 0.6, 7) },
|
||||
{ V(86, GROUND_Y + 0.2, -10), V(34, 0.6, 7) },
|
||||
}
|
||||
for _, p in ipairs(PIERS) do
|
||||
pier(W + p[1], p[2])
|
||||
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
|
||||
|
||||
-- невидимое ограждение: в воду не зайти, рыбачить можно с берега и причалов
|
||||
do
|
||||
local function barrier(cf, size)
|
||||
P({ Name = "LakeBarrier", Size = size, CFrame = cf, Transparency = 1, CanQuery = false, CanTouch = false, CastShadow = false })
|
||||
end
|
||||
local SEG = 3 -- длина секции по берегу
|
||||
local H = 500 -- высота: не перепрыгнуть
|
||||
local MID = WATER_Y + H / 2
|
||||
local function onPier(x, z, pad)
|
||||
for _, p in ipairs(PIERS) do
|
||||
if math.abs(x - p[1].X) < p[2].X / 2 + pad and math.abs(z - p[1].Z) < p[2].Z / 2 + pad then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
-- по внешнему краю озёр (участки внутри соседнего озера пропускаем)
|
||||
for _, l in ipairs(LAKES) do
|
||||
local r = l[3] + 2
|
||||
local n = math.ceil(2 * math.pi * r / SEG)
|
||||
local len = 2 * math.pi * r / n + 0.6
|
||||
for i = 0, n - 1 do
|
||||
local a = i / n * math.pi * 2
|
||||
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||
local inner = false
|
||||
for _, o in ipairs(LAKES) do
|
||||
if o ~= l and (x - o[1]) ^ 2 + (z - o[2]) ^ 2 < (o[3] + 2) ^ 2 then
|
||||
inner = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not inner and not onPier(x, z, len / 2 + 0.2) then
|
||||
local pos = W + V(x, MID, z)
|
||||
barrier(CFrame.lookAt(pos, W + V(l[1], MID, l[2])), V(len, H, 1))
|
||||
end
|
||||
end
|
||||
end
|
||||
-- бортики причалов: по бокам и на конце, который над водой
|
||||
for _, p in ipairs(PIERS) do
|
||||
local c, s = p[1], p[2]
|
||||
local h, y = H, MID
|
||||
local alongZ = s.Z > s.X
|
||||
for _, side in ipairs({ -1, 1 }) do
|
||||
if alongZ then
|
||||
barrier(CFrame.new(W + V(c.X + side * (s.X / 2 + 0.5), y, c.Z)), V(1, h, s.Z))
|
||||
else
|
||||
barrier(CFrame.new(W + V(c.X, y, c.Z + side * (s.Z / 2 + 0.5))), V(s.X, h, 1))
|
||||
end
|
||||
end
|
||||
for _, side in ipairs({ -1, 1 }) do
|
||||
local ex = alongZ and c.X or c.X + side * s.X / 2
|
||||
local ez = alongZ and c.Z + side * s.Z / 2 or c.Z
|
||||
if inLake(ex, ez) then
|
||||
if alongZ then
|
||||
barrier(CFrame.new(W + V(ex, y, ez + side * 0.5)), V(s.X + 2, h, 1))
|
||||
else
|
||||
barrier(CFrame.new(W + V(ex + side * 0.5, y, ez)), V(1, h, s.Z + 2))
|
||||
-- Кувшинки и камыш стоят у внешнего берега, вдали от проходов.
|
||||
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
|
||||
end
|
||||
end
|
||||
lamp(W + V(-3.5, GROUND_Y + 0.5, 40), Color3.fromRGB(255, 220, 160))
|
||||
lamp(W + V(-70, GROUND_Y + 0.5, 18), Color3.fromRGB(255, 220, 160))
|
||||
lamp(W + V(70, GROUND_Y + 0.5, -13), Color3.fromRGB(255, 220, 160))
|
||||
|
||||
-- лодка у западного причала
|
||||
do
|
||||
local cf = CFrame.new(W + V(-74, WATER_Y + 0.3, 24)) * CFrame.Angles(0, math.rad(15), 0)
|
||||
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 _ = 1, 7 do
|
||||
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
|
||||
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 inOther = false
|
||||
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
|
||||
inOther = true
|
||||
end
|
||||
end
|
||||
if not inOther and not (math.abs(x) < 6 and z > 30) then
|
||||
for _ = 1, 5 do
|
||||
local h = rng:NextNumber(3, 5)
|
||||
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 })
|
||||
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
|
||||
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
|
||||
|
||||
-- деревья, кусты, камни
|
||||
local function freeSpot(x, z)
|
||||
if inLake(x, z, 14) then
|
||||
return false
|
||||
end
|
||||
if (V(x, 0, z) - V(0, 0, 128)).Magnitude < 34 then
|
||||
return false
|
||||
end
|
||||
if math.abs(x) < 9 and z > 70 and z < 125 then
|
||||
return false
|
||||
end
|
||||
if (V(x, 0, z) - V(-34, 0, 100)).Magnitude < 14 then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local placed = 0
|
||||
for _ = 1, 400 do
|
||||
if placed >= 110 then
|
||||
break
|
||||
end
|
||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||
if freeSpot(x, z) then
|
||||
local y = groundY(W.X + x, W.Z + z)
|
||||
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"))
|
||||
placed += 1
|
||||
end
|
||||
end
|
||||
for _ = 1, 60 do
|
||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||
if freeSpot(x, z) then
|
||||
bush(W + V(x, groundY(W.X + x, W.Z + z) - 0.6, z))
|
||||
end
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
for _ = 1, 4 do
|
||||
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)
|
||||
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then
|
||||
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) })
|
||||
-- Пояс сосен, отдельные деревья у воды и горы за границей мира.
|
||||
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
|
||||
local rng = sharedRng
|
||||
for _, l in ipairs(LAKES) 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
|
||||
for _ = 1, 9 do
|
||||
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 other = false
|
||||
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 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
|
||||
end
|
||||
end
|
||||
local function free(x, z)
|
||||
return not inLake(x, z, 14) and (V(x, 0, z) - V(0, 0, 94)).Magnitude >= 36
|
||||
and not (math.abs(x) < 9 and z > 60 and z < 125) and (V(x, 0, z) - V(-44, 0, 98)).Magnitude >= 14
|
||||
end
|
||||
local placed = 0
|
||||
for _ = 1, 400 do
|
||||
if placed >= 110 then break end
|
||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||
if free(x, z) then
|
||||
local roll = rng:NextNumber()
|
||||
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
|
||||
end
|
||||
end
|
||||
for _ = 1, 60 do
|
||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||
if free(x, z) then
|
||||
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
|
||||
for _, l in ipairs(LAKES) do
|
||||
for _ = 1, 4 do
|
||||
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)
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Счётчики позволяют быстро проверить бюджет локации в Studio.
|
||||
local parts, lights, emitters = 0, 0, 0
|
||||
for _, child in ipairs(map:GetChildren()) do
|
||||
if not previous[child] then
|
||||
local instances = child:GetDescendants()
|
||||
table.insert(instances, child)
|
||||
for _, obj in ipairs(instances) do
|
||||
if obj:IsA("BasePart") then parts += 1
|
||||
elseif obj:IsA("PointLight") or obj:IsA("SpotLight") then lights += 1
|
||||
elseif obj:IsA("ParticleEmitter") then emitters += 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
|
||||
|
||||
-- фонари вдоль дорожки
|
||||
for _, z in ipairs({ 84, 100 }) do
|
||||
lamp(W + V(6, GROUND_Y, z))
|
||||
lamp(W + V(-6, GROUND_Y, z))
|
||||
end
|
||||
|
||||
-- невидимые стены по краю мира
|
||||
for _, w in ipairs({
|
||||
{ V(0, 0, 245), V(500, 120, 2) },
|
||||
{ V(0, 0, -245), V(500, 120, 2) },
|
||||
{ V(245, 0, 0), V(2, 120, 500) },
|
||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
||||
}) do
|
||||
P({ Size = w[2], Position = W + w[1] + V(0, 40, 0), Transparency = 1 })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- помощники для новых миров
|
||||
|
||||
@@ -1509,7 +1724,7 @@ do
|
||||
below, above = lakeState(l)
|
||||
if not lakeOk(below, above) then
|
||||
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
|
||||
|
||||
@@ -218,9 +218,44 @@ local function sideButton(order, icon, label, key, color, onClick)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- уведомления
|
||||
-- мультяшный стиль подсказок: крупный круглый шрифт без обводки на мягкой «дымке» —
|
||||
-- тёмная подложка, которая плавно растворяется к краям; появляются «пружинкой»
|
||||
|
||||
local SOFT_EDGES = NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.18, 0.62),
|
||||
NumberSequenceKeypoint.new(0.82, 0.62), NumberSequenceKeypoint.new(1, 1),
|
||||
})
|
||||
-- жирный округлый шрифт с кириллицей (у FredokaOne кириллицы нет — Roblox подставляет тонкий шрифт)
|
||||
local HINT_FONT = Font.new("rbxasset://fonts/families/Nunito.json", Enum.FontWeight.Heavy)
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует
|
||||
local function softPlate(props, textProps)
|
||||
local plate = new("Frame", props)
|
||||
plate.BackgroundColor3 = BLACK
|
||||
plate.BackgroundTransparency = 0
|
||||
corner(30).Parent = plate
|
||||
new("UIGradient", { Transparency = SOFT_EDGES, Parent = plate })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 48), PaddingRight = UDim.new(0, 48), Parent = plate })
|
||||
local d = { Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, TextXAlignment = Enum.TextXAlignment.Center, Parent = plate }
|
||||
for k, v in pairs(textProps) do
|
||||
d[k] = v
|
||||
end
|
||||
local label = text(d)
|
||||
label.FontFace = HINT_FONT
|
||||
return plate, label
|
||||
end
|
||||
local function popIn(obj, from)
|
||||
local sc = obj:FindFirstChildOfClass("UIScale") or new("UIScale", { Parent = obj })
|
||||
sc.Scale = from or 0.4
|
||||
TweenService:Create(sc, TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Scale = 1 }):Play()
|
||||
end
|
||||
local function wobble(obj, deg, period)
|
||||
obj.Rotation = -deg
|
||||
TweenService:Create(obj, TweenInfo.new(period, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true), { Rotation = deg }):Play()
|
||||
end
|
||||
|
||||
-- уведомления — под подсказкой обучения, которая стоит в самом верху
|
||||
local toasts = new("Frame", {
|
||||
Size = UDim2.new(0, 560, 0, 200), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 8),
|
||||
Size = UDim2.new(0, 900, 0, 200), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 84),
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 6), HorizontalAlignment = Enum.HorizontalAlignment.Center, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
local toastOrder = 0
|
||||
@@ -250,11 +285,11 @@ local function notify(msg, color)
|
||||
if #items >= 3 then
|
||||
items[1]:Destroy()
|
||||
end
|
||||
local t = new("Frame", {
|
||||
Size = UDim2.new(0, 0, 0, 38), AutomaticSize = Enum.AutomaticSize.X, BackgroundColor3 = C.bg,
|
||||
BackgroundTransparency = 0.15, LayoutOrder = toastOrder, Parent = toasts,
|
||||
}, { corner(12), stroke(color or WHITE, 2, 0.2), new("UIPadding", { PaddingLeft = UDim.new(0, 16), PaddingRight = UDim.new(0, 16) }) })
|
||||
local l = text({ Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, Font = TITLE, TextSize = 19, TextColor3 = color or WHITE, Text = msg, Parent = t })
|
||||
local t, l = softPlate(
|
||||
{ Size = UDim2.new(0, 0, 0, 54), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
{ TextSize = 30, TextColor3 = color or WHITE, Text = msg }
|
||||
)
|
||||
popIn(t)
|
||||
t:SetAttribute("Msg", msg)
|
||||
toastTimers[t] = 0
|
||||
task.delay(3.2, function()
|
||||
@@ -327,11 +362,12 @@ end
|
||||
|
||||
---------------------------------------------------------------- статус и мини-игра
|
||||
|
||||
local statusLabel = text({
|
||||
Size = UDim2.fromOffset(460, 34), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -110),
|
||||
Font = TITLE, TextSize = 22, TextXAlignment = Enum.TextXAlignment.Center, TextStrokeTransparency = 0.3,
|
||||
Text = "🎣 Ждём поклёвку… (клик — смотать)", Visible = false, Parent = gui,
|
||||
})
|
||||
-- вверху, на месте подсказки обучения (она во время рыбалки скрыта)
|
||||
local statusLabel = softPlate(
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = gui },
|
||||
{ TextSize = 36, Text = "🎣 Ждём клёв…" }
|
||||
)
|
||||
wobble(statusLabel, 1.2, 1.4)
|
||||
local mgFrame = new("Frame", {
|
||||
Size = UDim2.fromOffset(480, 124), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -100),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
@@ -939,7 +975,7 @@ robuxWin.render = function(tab)
|
||||
buttonText = has and "Куплено ✓" or ("R$ " .. it.robux), buttonColor = has and C.grey or C.green, active = not has,
|
||||
onClick = function()
|
||||
if not it.id or it.id == 0 then
|
||||
notify("Товар ещё не настроен: впиши его ID в FishConfig", Color3.fromRGB(255, 200, 120))
|
||||
notify("⚙ Товар не настроен", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
if tab == "passes" then
|
||||
@@ -1045,10 +1081,282 @@ refreshHud()
|
||||
local state = "idle"
|
||||
local mg = { pos = 0, dir = 1, speed = 1, zoneStart = 0.4, zoneWidth = 0.25, hits = 0, need = 1, misses = 0, maxMisses = 2, deadline = 0, timeout = 10 }
|
||||
|
||||
-- с начала зарядки и до конца рыбалки персонажем не управляем: не ходит, не прыгает, не поворачивается
|
||||
local ContextActionService = game:GetService("ContextActionService")
|
||||
local MOVE_KEYS = {
|
||||
Enum.KeyCode.W, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.D, Enum.KeyCode.Space,
|
||||
Enum.KeyCode.Up, Enum.KeyCode.Down, Enum.KeyCode.Left, Enum.KeyCode.Right,
|
||||
Enum.KeyCode.Thumbstick1, Enum.KeyCode.ButtonA,
|
||||
}
|
||||
local controls
|
||||
local movementLocked = false
|
||||
local function setMovementLocked(locked)
|
||||
if not controls then
|
||||
local pm = player:FindFirstChild("PlayerScripts") and player.PlayerScripts:FindFirstChild("PlayerModule")
|
||||
local ok, mod = pcall(require, pm)
|
||||
controls = ok and mod and mod:GetControls() or nil
|
||||
end
|
||||
if controls then
|
||||
if locked then
|
||||
controls:Disable()
|
||||
else
|
||||
controls:Enable()
|
||||
end
|
||||
end
|
||||
if locked ~= movementLocked then
|
||||
movementLocked = locked
|
||||
if locked then
|
||||
ContextActionService:BindActionAtPriority("FishingLock", function()
|
||||
return Enum.ContextActionResult.Sink
|
||||
end, false, Enum.ContextActionPriority.High.Value + 100, table.unpack(MOVE_KEYS))
|
||||
else
|
||||
ContextActionService:UnbindAction("FishingLock")
|
||||
end
|
||||
end
|
||||
local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
|
||||
if hum then
|
||||
hum.AutoRotate = not locked
|
||||
hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, not locked)
|
||||
if locked then
|
||||
hum:Move(Vector3.zero)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function easeInOut(a)
|
||||
return a < 0.5 and 4 * a * a * a or 1 - (-2 * a + 2) ^ 3 / 2
|
||||
end
|
||||
local function easeOut(a)
|
||||
return 1 - (1 - a) ^ 3
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
||||
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
||||
|
||||
local REST_ANGLE, BACK_ANGLE = 30, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local function gripCF(angle)
|
||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||
end
|
||||
|
||||
local charge = nil -- { t0, tool }
|
||||
local castTool = nil -- удочка последнего броска: вернуть её в покой, если бросок не удался
|
||||
-- сила ездит туда-сюда: 0 → 1 за CastChargeTime, потом обратно к 0 и снова вверх, пока держишь ЛКМ
|
||||
local function chargePower()
|
||||
if not charge then
|
||||
return 0
|
||||
end
|
||||
local t = ((os.clock() - charge.t0) / Config.CastChargeTime) % 2
|
||||
return t <= 1 and t or 2 - t
|
||||
end
|
||||
local function inPerfect(v)
|
||||
return v >= Config.CastPerfect[1] and v <= Config.CastPerfect[2]
|
||||
end
|
||||
|
||||
-- шкала-дуга справа от персонажа: внизу слабый бросок, вверху сильный, зелёная зона — бонус удачи
|
||||
local GAUGE_R, GAUGE_DEG, GAUGE_N = 190, 110, 32
|
||||
local gauge = new("Frame", {
|
||||
Size = UDim2.fromOffset(150, 280), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0.57, 0, 0.48, 0),
|
||||
BackgroundTransparency = 1, Visible = false, Parent = gui,
|
||||
})
|
||||
local GAUGE_C = Vector2.new(110 - GAUGE_R, 140) -- центр окружности левее рамки: дуга выгнута вправо
|
||||
local function arcPoint(v, r)
|
||||
local th = math.rad(-GAUGE_DEG / 2 + GAUGE_DEG * v)
|
||||
return GAUGE_C + Vector2.new(math.cos(th) * r, -math.sin(th) * r), -math.deg(th)
|
||||
end
|
||||
do
|
||||
local segLen = 2 * math.pi * GAUGE_R * (GAUGE_DEG / 360) / GAUGE_N
|
||||
for _, layer in ipairs({ { 46, 4, BLACK }, { 34, 1 } }) do -- чёрная обводка, потом цветные секции
|
||||
for i = 0, GAUGE_N - 1 do
|
||||
local v = (i + 0.5) / GAUGE_N
|
||||
local pos, rot = arcPoint(v, GAUGE_R)
|
||||
local color = layer[3]
|
||||
or ((v < 0.12 or v > 0.94) and C.red)
|
||||
or (inPerfect(v) and Color3.fromRGB(110, 235, 60))
|
||||
or Color3.fromRGB(40, 70, 95)
|
||||
new("Frame", {
|
||||
Size = UDim2.fromOffset(layer[1], segLen + layer[2]), AnchorPoint = Vector2.new(0.5, 0.5),
|
||||
Position = UDim2.fromOffset(pos.X, pos.Y), Rotation = rot, BorderSizePixel = 0,
|
||||
BackgroundColor3 = color, Parent = gauge,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
local needle = new("Frame", {
|
||||
Size = UDim2.fromOffset(64, 8), AnchorPoint = Vector2.new(0.5, 0.5), BackgroundColor3 = WHITE,
|
||||
BorderSizePixel = 0, ZIndex = 3, Parent = gauge,
|
||||
}, { corner(4), stroke(BLACK, 2) })
|
||||
local multLabel = text({
|
||||
Size = UDim2.fromOffset(110, 40), AnchorPoint = Vector2.new(0.5, 1), Font = TITLE, TextSize = 34,
|
||||
Text = "×" .. Config.CastPerfectLuck, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 4,
|
||||
Visible = false, Parent = gauge,
|
||||
})
|
||||
new("UIStroke", { Color = BLACK, Thickness = 3, Parent = multLabel })
|
||||
do
|
||||
local top = arcPoint(1, GAUGE_R)
|
||||
multLabel.Position = UDim2.fromOffset(top.X + 10, top.Y - 18)
|
||||
end
|
||||
|
||||
local function updateCharge()
|
||||
local p = chargePower()
|
||||
local pos, rot = arcPoint(p, GAUGE_R)
|
||||
needle.Position = UDim2.fromOffset(pos.X, pos.Y)
|
||||
needle.Rotation = rot
|
||||
local good = inPerfect(p)
|
||||
multLabel.Visible = good
|
||||
needle.BackgroundColor3 = good and Color3.fromRGB(190, 255, 150) or WHITE
|
||||
if charge.tool and charge.tool.Parent then
|
||||
charge.tool.Grip = gripCF(REST_ANGLE + (BACK_ANGLE - REST_ANGLE) * easeOut(p))
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- камера при забросе
|
||||
-- зарядка: камера уходит в сторону от персонажа и отъезжает тем дальше, чем сильнее замах;
|
||||
-- бросок: камера сбоку разгоняется за поплавком; потом сверху-сбоку держит в кадре игрока и поплавок
|
||||
|
||||
local CAM_IN, CAM_SETTLE, CAM_RETURN = 0.35, 0.8, 0.6
|
||||
local UP = Vector3.new(0, 1, 0)
|
||||
local fishCam = nil
|
||||
|
||||
local function sideCF(fc, p)
|
||||
return CFrame.lookAt(fc.hrp + fc.r * (9 + 3 * p) - fc.f * (3 + 2 * p) + UP * (3 + 1.5 * p), fc.hrp + fc.f * 6 + UP)
|
||||
end
|
||||
local function chaseCF(fc, p)
|
||||
return CFrame.lookAt(p + fc.r * 9 - fc.f * 5 + UP * 3, p + fc.f * 3)
|
||||
end
|
||||
local function restCF(fc)
|
||||
local d = ((fc.target - fc.hrp) * Vector3.new(1, 0, 1)).Magnitude
|
||||
local mid = fc.hrp:Lerp(fc.target, 0.5)
|
||||
return CFrame.lookAt(mid + fc.r * (8 + d * 0.55) - fc.f * 4 + UP * (6 + d * 0.25), fc.hrp:Lerp(fc.target, 0.6))
|
||||
end
|
||||
|
||||
local function fishCamStep()
|
||||
local fc = fishCam
|
||||
local cam = workspace.CurrentCamera
|
||||
if not fc or not cam then
|
||||
return
|
||||
end
|
||||
if fc.returning then
|
||||
local a = math.min(1, (os.clock() - fc.returning) / CAM_RETURN)
|
||||
local e = easeInOut(a)
|
||||
cam.CFrame = fc.leaveCF:Lerp(fc.origCF, e)
|
||||
cam.FieldOfView = fc.leaveFov + (fc.origFov - fc.leaveFov) * e
|
||||
if a >= 1 then
|
||||
RunService:UnbindFromRenderStep("FishCam")
|
||||
cam.CameraType = Enum.CameraType.Custom
|
||||
fishCam = nil
|
||||
end
|
||||
return
|
||||
end
|
||||
local now = os.clock()
|
||||
local cf, fov
|
||||
if not fc.castT0 then
|
||||
-- зарядка: плавно уходим в вид сбоку; чем сильнее замах, тем дальше камера и шире обзор
|
||||
-- после отпускания ЛКМ, пока ждём ответ сервера, держим набранную силу
|
||||
local p = charge and chargePower() or (fc.power or 0)
|
||||
fc.power = p
|
||||
local e = easeOut(math.min(1, (now - fc.t0) / CAM_IN))
|
||||
cf = fc.origCF:Lerp(sideCF(fc, p), e)
|
||||
fov = fc.origFov + 12 * p * e
|
||||
else
|
||||
local th = fc.throw
|
||||
local t = now - fc.castT0
|
||||
local lunge = fc.fromCF + fc.f * 1.5
|
||||
if t < th.windup then
|
||||
-- рывок удочки вперёд: камера подаётся следом
|
||||
local e = easeOut(t / th.windup)
|
||||
cf = fc.fromCF:Lerp(lunge, e)
|
||||
fov = fc.fromFov + 4 * e
|
||||
elseif t < th.windup + th.flight then
|
||||
if not fc.start then
|
||||
fc.start = (fc.tip and fc.tip.Parent and fc.tip.WorldPosition) or (fc.hrp + fc.f * 2 + UP * 4)
|
||||
end
|
||||
local a = (t - th.windup) / th.flight
|
||||
local p = fc.start:Lerp(fc.target, a) + UP * (math.sin(a * math.pi) * th.arc) -- та же дуга, что у поплавка
|
||||
local e = easeInOut(a)
|
||||
cf = lunge:Lerp(chaseCF(fc, p), e)
|
||||
fov = (fc.fromFov + 4) + ((fc.origFov - 6) - (fc.fromFov + 4)) * e
|
||||
else
|
||||
local e = easeOut(math.min(1, (t - th.windup - th.flight) / CAM_SETTLE))
|
||||
local sway = Vector3.new(math.sin(now * 0.7) * 0.5, math.sin(now * 1.1) * 0.25, 0)
|
||||
if state == "bite" then
|
||||
sway += Vector3.new(math.random() - 0.5, math.random() - 0.5, 0) * 0.15
|
||||
end
|
||||
cf = chaseCF(fc, fc.target):Lerp(restCF(fc) + sway, e)
|
||||
fov = fc.origFov - 6 + 6 * e
|
||||
end
|
||||
end
|
||||
cam.CFrame = cf
|
||||
cam.FieldOfView = fov
|
||||
end
|
||||
|
||||
-- начало зарядки: dir — куда полетит поплавок (к центру озера)
|
||||
local function startChargeCam(tool, dir)
|
||||
local cam = workspace.CurrentCamera
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if not cam or not hrp then
|
||||
return
|
||||
end
|
||||
fishCam = {
|
||||
t0 = os.clock(), hrp = hrp.Position, f = dir, r = dir:Cross(UP),
|
||||
tip = tool:FindFirstChild("Handle") and tool.Handle:FindFirstChild("Tip"),
|
||||
-- если камера ещё возвращалась с прошлого заброса, возвращаться будем туда же
|
||||
origCF = fishCam and fishCam.origCF or cam.CFrame,
|
||||
origFov = fishCam and fishCam.origFov or cam.FieldOfView,
|
||||
}
|
||||
cam.CameraType = Enum.CameraType.Scriptable
|
||||
RunService:UnbindFromRenderStep("FishCam")
|
||||
RunService:BindToRenderStep("FishCam", Enum.RenderPriority.Camera.Value + 1, fishCamStep)
|
||||
end
|
||||
|
||||
-- сервер принял бросок: target — куда упадёт поплавок, throw — тайминги и высота дуги
|
||||
local function startCastCam(target, throw)
|
||||
local cam = workspace.CurrentCamera
|
||||
if not fishCam or fishCam.returning or not cam or typeof(target) ~= "Vector3" or type(throw) ~= "table" then
|
||||
return
|
||||
end
|
||||
fishCam.castT0 = os.clock()
|
||||
fishCam.target = target
|
||||
fishCam.throw = throw
|
||||
fishCam.fromCF = cam.CFrame
|
||||
fishCam.fromFov = cam.FieldOfView
|
||||
end
|
||||
|
||||
local function stopFishCam()
|
||||
local cam = workspace.CurrentCamera
|
||||
if not fishCam or fishCam.returning or not cam then
|
||||
return
|
||||
end
|
||||
fishCam.returning = os.clock()
|
||||
fishCam.leaveCF = cam.CFrame
|
||||
fishCam.leaveFov = cam.FieldOfView
|
||||
end
|
||||
|
||||
local reelToken
|
||||
local function setState(s)
|
||||
if s ~= "charging" and charge then
|
||||
-- зарядку прервали (убрал удочку и т.п.): удочку обратно в покой
|
||||
if charge.tool.Parent then
|
||||
charge.tool.Grip = gripCF(REST_ANGLE)
|
||||
end
|
||||
charge = nil
|
||||
end
|
||||
state = s
|
||||
statusLabel.Visible = (s == "waiting")
|
||||
mgFrame.Visible = (s == "bite")
|
||||
gauge.Visible = (s == "charging")
|
||||
setMovementLocked(s ~= "idle")
|
||||
if s == "idle" then
|
||||
stopFishCam()
|
||||
elseif s == "reeling" then
|
||||
-- на случай, если сервер не ответит на вытаскивание: не оставляем игрока замороженным
|
||||
local token = {}
|
||||
reelToken = token
|
||||
task.delay(4, function()
|
||||
if state == "reeling" and reelToken == token then
|
||||
setState("idle")
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
local function updatePips()
|
||||
pipsText.Text = "🎯 " .. string.rep("<font color=\"#7CFF9A\">●</font>", mg.hits) .. string.rep("<font color=\"#5A6480\">●</font>", mg.need - mg.hits)
|
||||
@@ -1064,11 +1372,45 @@ local function placeZone()
|
||||
zoneF.Position = UDim2.fromScale(mg.zoneStart, 0)
|
||||
end
|
||||
|
||||
-- ЛКМ зажата: персонаж разворачивается к центру озера, начинается зарядка
|
||||
local function startCharge(tool)
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if not hrp then
|
||||
return
|
||||
end
|
||||
local world = Config.WorldAt(hrp.Position)
|
||||
-- из воды и издалека не заряжаем вовсе: сразу подсказка
|
||||
local can = Config.CanCastFrom(world, hrp.Position, player.Character:FindFirstChildOfClass("Humanoid"))
|
||||
if can ~= true then
|
||||
notify(can, Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
local dir = Config.CastDirection(world, hrp.Position)
|
||||
if not dir then
|
||||
dir = hrp.CFrame.LookVector * Vector3.new(1, 0, 1)
|
||||
dir = dir.Magnitude > 0.01 and dir.Unit or Vector3.new(0, 0, -1)
|
||||
end
|
||||
hrp.CFrame = CFrame.lookAt(hrp.Position, hrp.Position + dir)
|
||||
charge = { t0 = os.clock(), tool = tool }
|
||||
setState("charging")
|
||||
startChargeCam(tool, dir)
|
||||
updateCharge()
|
||||
end
|
||||
|
||||
-- ЛКМ отпущена: бросок с набранной силой
|
||||
local function releaseCast()
|
||||
if state ~= "charging" or not charge then
|
||||
return
|
||||
end
|
||||
local power = chargePower()
|
||||
castTool = charge.tool
|
||||
charge = nil -- удочку не возвращаем: сервер сам сделает рывок вперёд
|
||||
setState("casting")
|
||||
remote:FireServer("Cast", power)
|
||||
end
|
||||
|
||||
local function onActivate()
|
||||
if state == "idle" then
|
||||
setState("casting")
|
||||
remote:FireServer("Cast")
|
||||
elseif state == "waiting" then
|
||||
if state == "waiting" then
|
||||
remote:FireServer("Cancel")
|
||||
setState("idle")
|
||||
elseif state == "bite" then
|
||||
@@ -1102,7 +1444,14 @@ local function hookTool(tool)
|
||||
return
|
||||
end
|
||||
hooked[tool] = true
|
||||
tool.Activated:Connect(onActivate)
|
||||
tool.Activated:Connect(function()
|
||||
if state == "idle" then
|
||||
startCharge(tool)
|
||||
else
|
||||
onActivate()
|
||||
end
|
||||
end)
|
||||
tool.Deactivated:Connect(releaseCast)
|
||||
tool.Unequipped:Connect(function()
|
||||
if state == "waiting" or state == "bite" or state == "casting" then
|
||||
remote:FireServer("Cancel")
|
||||
@@ -1132,6 +1481,12 @@ if player.Character then
|
||||
watch(player.Character)
|
||||
end
|
||||
|
||||
RunService.RenderStepped:Connect(function()
|
||||
if state == "charging" and charge then
|
||||
updateCharge()
|
||||
end
|
||||
end)
|
||||
|
||||
RunService.RenderStepped:Connect(function(dt)
|
||||
if state ~= "bite" then
|
||||
return
|
||||
@@ -1183,21 +1538,109 @@ local lastWorldId = "none"
|
||||
local terrain = workspace.Terrain
|
||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||
|
||||
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
||||
local lakeDefaults
|
||||
|
||||
local function applyAmbience(world)
|
||||
local clock = (world and world.clock) or 14.5
|
||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
||||
terrain.WaterColor = (world and world.water) or defaultWater
|
||||
local lake = world and world.id == "World1"
|
||||
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
|
||||
local frost = world and world.id == "World3"
|
||||
TweenService:Create(atm, TweenInfo.new(2), {
|
||||
Density = frost and 0.38 or 0.25,
|
||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
||||
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
||||
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()
|
||||
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
|
||||
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()
|
||||
while true do
|
||||
local w = currentWorld()
|
||||
@@ -1227,6 +1670,314 @@ task.spawn(function()
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- обучение: линия-подсказка
|
||||
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
||||
|
||||
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
||||
local W1 = Config.Worlds[1].center
|
||||
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
||||
|
||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||
local guideHint, guideHintText = softPlate(
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = gui },
|
||||
{ TextSize = 42, Text = "" }
|
||||
)
|
||||
wobble(guideHint, 1.2, 1.6)
|
||||
local lastHint = nil
|
||||
|
||||
local guideFolder = new("Folder", { Name = "TutorialGuide", Parent = workspace })
|
||||
local chevrons = {}
|
||||
for i = 1, GUIDE_N do
|
||||
local arms = {}
|
||||
for k = 1, 2 do
|
||||
arms[k] = new("Part", {
|
||||
Anchored = true, CanCollide = false, CanQuery = false, CanTouch = false, CastShadow = false,
|
||||
Material = Enum.Material.Neon, Color = Color3.fromRGB(70, 195, 255), Size = Vector3.new(0.5, 0.5, 2), Transparency = 1,
|
||||
Parent = guideFolder,
|
||||
})
|
||||
end
|
||||
chevrons[i] = arms
|
||||
end
|
||||
-- два объёмных бруска стрелки «>» острием вперёд (по -Z)
|
||||
local GUIDE_HEIGHT = 2.2 -- стрелки висят в воздухе над землёй
|
||||
local ARM_CF = {}
|
||||
for k, s in ipairs({ -1, 1 }) do
|
||||
local center = Vector3.new(s * 0.65, 0, -0.15)
|
||||
ARM_CF[k] = CFrame.lookAt(center, center + Vector3.new(s * 1.3, 0, 1.5))
|
||||
end
|
||||
local function hideChevrons(from)
|
||||
for i = from, GUIDE_N do
|
||||
chevrons[i][1].Transparency = 1
|
||||
chevrons[i][2].Transparency = 1
|
||||
end
|
||||
end
|
||||
|
||||
local guideRay = RaycastParams.new()
|
||||
guideRay.FilterType = Enum.RaycastFilterType.Exclude
|
||||
guideRay.RespectCanCollide = true
|
||||
guideRay.IgnoreWater = false
|
||||
|
||||
local function tutorialStep()
|
||||
return math.max(player:GetAttribute("Tutorial") or 0, guideStep)
|
||||
end
|
||||
local function advanceTutorial(step)
|
||||
if step > tutorialStep() then
|
||||
guideStep = step
|
||||
remote:FireServer("Tutorial", step)
|
||||
if step >= Config.TutorialDone then
|
||||
notify("🎓 Обучение пройдено!", C.gold)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function guideMarker(name)
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
local m = map and map:FindFirstChild(name)
|
||||
return m and m.Position
|
||||
end
|
||||
|
||||
-- объект цели подсвечивается голубым (атрибут GuideTarget ставит MapBuilder)
|
||||
local guideHighlight = new("Highlight", {
|
||||
FillColor = Color3.fromRGB(70, 195, 255), OutlineColor = Color3.fromRGB(170, 235, 255),
|
||||
DepthMode = Enum.HighlightDepthMode.AlwaysOnTop, Enabled = false, Parent = guideFolder,
|
||||
})
|
||||
local guideObjects, guideScanAt = {}, {}
|
||||
local function guideObject(key)
|
||||
local obj = guideObjects[key]
|
||||
if obj and obj.Parent then
|
||||
return obj
|
||||
end
|
||||
-- карта большая: если объекта нет (ещё не загрузился), ищем заново не чаще раза в 2 секунды
|
||||
if guideScanAt[key] and os.clock() - guideScanAt[key] < 2 then
|
||||
return nil
|
||||
end
|
||||
guideScanAt[key] = os.clock()
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return nil
|
||||
end
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:GetAttribute("GuideTarget") == key then
|
||||
guideObjects[key] = d
|
||||
return d
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- первый подход к табличке: камера крупно на табличку, управление и весь интерфейс убраны;
|
||||
-- кнопка «Далее» плавно возвращает камеру, интерфейс и управление
|
||||
local StarterGui = game:GetService("StarterGui")
|
||||
local BOARD_CAM_TIME, BOARD_FOV = 0.8, 70
|
||||
local boardView = nil
|
||||
local closeBoardView
|
||||
-- кнопка в отдельном ScreenGui: основной интерфейс на это время выключается целиком
|
||||
local boardGui = new("ScreenGui", { Name = "BoardView", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 50, Enabled = false, Parent = player:WaitForChild("PlayerGui") })
|
||||
btn({
|
||||
Size = UDim2.fromOffset(240, 60), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -40),
|
||||
BackgroundColor3 = C.green, Text = "Далее ▶", TextSize = 26, Parent = boardGui,
|
||||
}, function()
|
||||
closeBoardView()
|
||||
end)
|
||||
|
||||
local function setInterfaceHidden(hidden)
|
||||
gui.Enabled = not hidden
|
||||
boardGui.Enabled = hidden
|
||||
pcall(function()
|
||||
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden)
|
||||
end)
|
||||
-- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было
|
||||
if hidden then
|
||||
boardView.billboards = {}
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
for _, d in ipairs(map and map:GetDescendants() or {}) do
|
||||
if d:IsA("BillboardGui") and d.Enabled then
|
||||
d.Enabled = false
|
||||
table.insert(boardView.billboards, d)
|
||||
end
|
||||
end
|
||||
elseif boardView and boardView.billboards then
|
||||
for _, d in ipairs(boardView.billboards) do
|
||||
d.Enabled = true
|
||||
end
|
||||
boardView.billboards = nil
|
||||
end
|
||||
end
|
||||
|
||||
local function boardCamStep()
|
||||
local bv, cam = boardView, workspace.CurrentCamera
|
||||
if not bv or not cam then
|
||||
return
|
||||
end
|
||||
local e = easeInOut(math.min(1, (os.clock() - bv.t0) / BOARD_CAM_TIME))
|
||||
cam.CFrame = bv.fromCF:Lerp(bv.toCF, e)
|
||||
cam.FieldOfView = bv.fromFov + (bv.toFov - bv.fromFov) * e
|
||||
if bv.returning and e >= 1 then
|
||||
RunService:UnbindFromRenderStep("BoardCam")
|
||||
cam.CameraType = Enum.CameraType.Custom
|
||||
setInterfaceHidden(false)
|
||||
boardView = nil
|
||||
setMovementLocked(false)
|
||||
end
|
||||
end
|
||||
|
||||
local function openBoardView(board)
|
||||
local cam = workspace.CurrentCamera
|
||||
-- отходим ровно настолько, чтобы табличка целиком влезла в кадр (по высоте и по ширине) с небольшим запасом
|
||||
local half = math.tan(math.rad(BOARD_FOV / 2))
|
||||
local aspect = cam.ViewportSize.X / math.max(1, cam.ViewportSize.Y)
|
||||
local dist = math.max((board.Size.Y / 2) / half, (board.Size.X / 2) / (half * aspect)) * 1.15
|
||||
boardView = {
|
||||
t0 = os.clock(), origCF = cam.CFrame, origFov = cam.FieldOfView,
|
||||
fromCF = cam.CFrame, fromFov = cam.FieldOfView,
|
||||
-- надписи на лицевой стороне (Front), она смотрит по LookVector
|
||||
toCF = CFrame.lookAt(board.Position + board.CFrame.LookVector * dist, board.Position), toFov = BOARD_FOV,
|
||||
}
|
||||
setMovementLocked(true)
|
||||
setInterfaceHidden(true)
|
||||
cam.CameraType = Enum.CameraType.Scriptable
|
||||
RunService:UnbindFromRenderStep("BoardCam")
|
||||
RunService:BindToRenderStep("BoardCam", Enum.RenderPriority.Camera.Value + 1, boardCamStep)
|
||||
end
|
||||
|
||||
closeBoardView = function()
|
||||
local cam = workspace.CurrentCamera
|
||||
if not boardView or boardView.returning or not cam then
|
||||
return
|
||||
end
|
||||
boardGui.Enabled = false -- кнопка пропадает сразу, остальной интерфейс — когда камера вернётся
|
||||
boardView.returning = true
|
||||
boardView.t0 = os.clock()
|
||||
boardView.fromCF, boardView.fromFov = cam.CFrame, cam.FieldOfView
|
||||
boardView.toCF, boardView.toFov = boardView.origCF, boardView.origFov
|
||||
advanceTutorial(1)
|
||||
end
|
||||
|
||||
-- маршрут для текущего шага: точки ломаной (без игрока), подсказка и что подсветить; nil — линию не показываем
|
||||
local function guideRoute(step, pos, world)
|
||||
local inW1 = world and world.id == "World1"
|
||||
if step == 0 and not world then
|
||||
return { guideMarker("GuideBoard") }, "📋 Прочитай табличку", "Board"
|
||||
elseif not world then -- шаги 1–3 из лобби: сначала в портал
|
||||
return { guideMarker("GuidePortal") }, "🌊 Иди в портал", "Portal"
|
||||
elseif step == 2 and inW1 then
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||
elseif step == 3 and inW1 then
|
||||
local route = {}
|
||||
local rel = pos - W1
|
||||
if math.abs(rel.X) < 6 and rel.Z < 80 then
|
||||
table.insert(route, W1 + Vector3.new(0, 4.5, 84)) -- сначала сойти с причала
|
||||
end
|
||||
table.insert(route, guideMarker("GuideSell"))
|
||||
return route, "💰 Продай рыбу", "Sell"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
RunService.RenderStepped:Connect(function()
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
local step = tutorialStep()
|
||||
-- пока сервер не прислал шаг (данные ещё грузятся), ничего не показываем
|
||||
if not hrp or player:GetAttribute("Tutorial") == nil or step >= Config.TutorialDone then
|
||||
guideHint.Visible = false
|
||||
guideHighlight.Enabled = false
|
||||
hideChevrons(1)
|
||||
return
|
||||
end
|
||||
if boardView then -- смотрим на табличку: ни линии, ни подсказок
|
||||
guideHint.Visible = false
|
||||
guideHighlight.Enabled = false
|
||||
hideChevrons(1)
|
||||
return
|
||||
end
|
||||
local pos = hrp.Position
|
||||
local world = Config.WorldAt(pos)
|
||||
|
||||
-- переходы между шагами
|
||||
if step <= 1 and world and world.id == "World1" then
|
||||
advanceTutorial(2)
|
||||
elseif step == 0 then
|
||||
local board = guideMarker("GuideBoard")
|
||||
if board and (board - pos).Magnitude < 9 and state == "idle" then
|
||||
local obj = guideObject("Board")
|
||||
if obj then
|
||||
openBoardView(obj) -- шаг засчитается по кнопке «Далее»
|
||||
return
|
||||
end
|
||||
advanceTutorial(1)
|
||||
end
|
||||
elseif step == 2 and (player:GetAttribute("TotalCaught") or 0) > 0 then
|
||||
advanceTutorial(3)
|
||||
end
|
||||
step = tutorialStep()
|
||||
|
||||
local route, hint, key = guideRoute(step, pos, world)
|
||||
guideHintText.Text = hint or ""
|
||||
local showHint = hint ~= nil and state == "idle"
|
||||
if showHint and (hint ~= lastHint or not guideHint.Visible) then
|
||||
popIn(guideHint, 0.5)
|
||||
end
|
||||
lastHint = hint
|
||||
guideHint.Visible = showHint
|
||||
local target = (key and state == "idle") and guideObject(key) or nil
|
||||
guideHighlight.Adornee = target or nil
|
||||
guideHighlight.Enabled = target ~= nil
|
||||
if target then
|
||||
local pulse = (math.sin(os.clock() * 4) + 1) / 2 -- мягкое мигание
|
||||
guideHighlight.FillTransparency = 0.45 + 0.3 * pulse
|
||||
guideHighlight.OutlineTransparency = 0.3 * pulse
|
||||
end
|
||||
if not route or #route == 0 or state ~= "idle" then
|
||||
hideChevrons(1)
|
||||
return
|
||||
end
|
||||
|
||||
-- ломаная от ног игрока через точки маршрута
|
||||
local pts = { pos - Vector3.new(0, 3, 0) }
|
||||
for _, p in ipairs(route) do
|
||||
table.insert(pts, p)
|
||||
end
|
||||
local lens, total = {}, 0
|
||||
for i = 2, #pts do
|
||||
local d = ((pts[i] - pts[i - 1]) * Vector3.new(1, 0, 1)).Magnitude
|
||||
lens[i] = math.max(d, 0.001)
|
||||
total += d
|
||||
end
|
||||
if total < 4 then
|
||||
hideChevrons(1) -- уже на месте
|
||||
return
|
||||
end
|
||||
|
||||
guideRay.FilterDescendantsInstances = { player.Character, guideFolder }
|
||||
local phase = (os.clock() * GUIDE_SPEED) % GUIDE_GAP
|
||||
local seg, segStart = 2, 0
|
||||
for i = 1, GUIDE_N do
|
||||
local d = 2 + phase + (i - 1) * GUIDE_GAP
|
||||
if d > total - 1 then
|
||||
hideChevrons(i)
|
||||
break
|
||||
end
|
||||
while seg < #pts and d > segStart + lens[seg] do
|
||||
segStart += lens[seg]
|
||||
seg += 1
|
||||
end
|
||||
local a, b = pts[seg - 1], pts[seg]
|
||||
local p = a:Lerp(b, (d - segStart) / lens[seg])
|
||||
local dir = (b - a) * Vector3.new(1, 0, 1)
|
||||
local hit = workspace:Raycast(p + Vector3.new(0, 4, 0), Vector3.new(0, -12, 0), guideRay)
|
||||
-- висят в воздухе и слегка покачиваются волной
|
||||
local y = (hit and hit.Position.Y or p.Y) + GUIDE_HEIGHT + math.sin(os.clock() * 4 - d * 0.5) * 0.25
|
||||
local base = CFrame.lookAt(Vector3.new(p.X, y, p.Z), Vector3.new(p.X, y, p.Z) + dir)
|
||||
-- у игрока и у цели стрелки плавно проявляются и гаснут
|
||||
local fade = math.max(0, 1 - math.min(d - 2, total - 1 - d) / 2.5)
|
||||
local tr = 0.05 + 0.95 * fade
|
||||
for k = 1, 2 do
|
||||
chevrons[i][k].CFrame = base * ARM_CF[k]
|
||||
chevrons[i][k].Transparency = tr
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- события от сервера
|
||||
|
||||
remote.OnClientEvent:Connect(function(action, a, b, c)
|
||||
@@ -1234,7 +1985,11 @@ remote.OnClientEvent:Connect(function(action, a, b, c)
|
||||
notify(a, b)
|
||||
elseif action == "Cast" then
|
||||
setState("waiting")
|
||||
startCastCam(a, b)
|
||||
elseif action == "CastFail" or action == "Cancel" or action == "Escaped" then
|
||||
if action == "CastFail" and castTool and castTool.Parent then
|
||||
castTool.Grip = gripCF(REST_ANGLE) -- сервер удочку не трогал, а у нас она в замахе
|
||||
end
|
||||
setState("idle")
|
||||
elseif action == "Bite" then
|
||||
mg.speed = a.speed
|
||||
@@ -1254,8 +2009,11 @@ remote.OnClientEvent:Connect(function(action, a, b, c)
|
||||
showCatch(a, b)
|
||||
playUiSound(DING, 0.5)
|
||||
elseif action == "Sold" then
|
||||
if tutorialStep() == 3 then
|
||||
advanceTutorial(Config.TutorialDone)
|
||||
end
|
||||
floatText("+" .. fmt(a) .. " 💰", C.gold)
|
||||
notify(("Продано рыб: %d → +%s 💰"):format(b, fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
elseif action == "Inventory" then
|
||||
inventory = a or {}
|
||||
discovered = b or {}
|
||||
|
||||
Reference in new issue
Block a user