1212
This commit is contained in:
1 parent
ec69c6c8d7
commit
ccd24dc5ec
10 files changed
+500
-340
No files matched your search
@@ -1338,7 +1338,13 @@ local function startCharge(tool)
|
||||
return
|
||||
end
|
||||
local world = Config.WorldAt(hrp.Position)
|
||||
local dir = world and Config.CastDirection(world, 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)
|
||||
@@ -1557,17 +1563,18 @@ for i = 1, GUIDE_N do
|
||||
for k = 1, 2 do
|
||||
arms[k] = new("Part", {
|
||||
Anchored = true, CanCollide = false, CanQuery = false, CanTouch = false, CastShadow = false,
|
||||
Material = Enum.Material.Neon, Color = WHITE, Size = Vector3.new(0.32, 0.06, 1.35), Transparency = 1,
|
||||
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)
|
||||
-- два объёмных бруска стрелки «>» острием вперёд (по -Z)
|
||||
local GUIDE_HEIGHT = 2.2 -- стрелки висят в воздухе над землёй
|
||||
local ARM_CF = {}
|
||||
for k, s in ipairs({ -1, 1 }) do
|
||||
local center = Vector3.new(s * 0.45, 0, -0.1)
|
||||
ARM_CF[k] = CFrame.lookAt(center, center + Vector3.new(s * 0.9, 0, 1))
|
||||
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
|
||||
@@ -1600,15 +1607,44 @@ local function guideMarker(name)
|
||||
return m and m.Position
|
||||
end
|
||||
|
||||
-- маршрут для текущего шага: точки ломаной (без игрока) и подсказка; nil — линию не показываем
|
||||
-- объект цели подсвечивается голубым (атрибут 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
|
||||
|
||||
-- маршрут для текущего шага: точки ломаной (без игрока), подсказка и что подсветить; nil — линию не показываем
|
||||
local function guideRoute(step, pos, world)
|
||||
local inW1 = world and world.id == "World1"
|
||||
if step == 0 and not world then
|
||||
return { guideMarker("GuideBoard") }, "📋 Прочитай табличку «Как играть»"
|
||||
return { guideMarker("GuideBoard") }, "📋 Прочитай табличку «Как играть»", "Board"
|
||||
elseif not world then -- шаги 1–3 из лобби: сначала в портал
|
||||
return { guideMarker("GuidePortal") }, "🌊 Иди в портал «Тихое озеро»"
|
||||
return { guideMarker("GuidePortal") }, "🌊 Иди в портал «Тихое озеро»", "Portal"
|
||||
elseif step == 2 and inW1 then
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Иди на причал, зажми ЛКМ и отпусти — заброс!"
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Иди на причал, зажми ЛКМ и отпусти — заброс!", "Pier"
|
||||
elseif step == 3 and inW1 then
|
||||
local route = {}
|
||||
local rel = pos - W1
|
||||
@@ -1616,7 +1652,7 @@ local function guideRoute(step, pos, world)
|
||||
table.insert(route, W1 + Vector3.new(0, 4.5, 84)) -- сначала сойти с причала
|
||||
end
|
||||
table.insert(route, guideMarker("GuideSell"))
|
||||
return route, "💰 Продай рыбу в скупке"
|
||||
return route, "💰 Продай рыбу в скупке", "Sell"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -1627,6 +1663,7 @@ RunService.RenderStepped:Connect(function()
|
||||
-- пока сервер не прислал шаг (данные ещё грузятся), ничего не показываем
|
||||
if not hrp or player:GetAttribute("Tutorial") == nil or step >= Config.TutorialDone then
|
||||
guideHint.Visible = false
|
||||
guideHighlight.Enabled = false
|
||||
hideChevrons(1)
|
||||
return
|
||||
end
|
||||
@@ -1646,9 +1683,17 @@ RunService.RenderStepped:Connect(function()
|
||||
end
|
||||
step = tutorialStep()
|
||||
|
||||
local route, hint = guideRoute(step, pos, world)
|
||||
local route, hint, key = guideRoute(step, pos, world)
|
||||
guideHint.Text = hint or ""
|
||||
guideHint.Visible = hint ~= nil and state == "idle"
|
||||
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
|
||||
@@ -1687,11 +1732,12 @@ RunService.RenderStepped:Connect(function()
|
||||
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
|
||||
local base = CFrame.lookAt(Vector3.new(p.X, y + 0.08, p.Z), Vector3.new(p.X, y + 0.08, p.Z) + dir)
|
||||
-- висят в воздухе и слегка покачиваются волной
|
||||
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.1 + 0.9 * fade
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user