12
This commit is contained in:
1 parent
1d5300eb96
commit
306cbfcbef
15 files changed
+4645
-1157
No files matched your search
@@ -1539,10 +1539,31 @@ local lastWorldId = "none"
|
||||
local terrain = workspace.Terrain
|
||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||
|
||||
-- то, что мир может поменять под себя (вода, оттенок, цвета травы и песка); остальные миры — как в MapBuilder
|
||||
local DEFAULT_LOOK = { waterTransparency = 0.15, waveSize = 0.3, tint = Color3.new(1, 1, 1) }
|
||||
local defaultTerrainColors = nil
|
||||
|
||||
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
|
||||
terrain.WaterTransparency = (world and world.waterTransparency) or DEFAULT_LOOK.waterTransparency
|
||||
terrain.WaterWaveSize = (world and world.waveSize) or DEFAULT_LOOK.waveSize
|
||||
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||
if cc then
|
||||
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
||||
end
|
||||
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
||||
if not defaultTerrainColors then
|
||||
defaultTerrainColors = {}
|
||||
for _, name in ipairs({ "Snow", "Salt", "Mud", "Sand" }) do
|
||||
defaultTerrainColors[name] = terrain:GetMaterialColor(Enum.Material[name])
|
||||
end
|
||||
end
|
||||
local colors = (world and world.terrainColors) or {}
|
||||
for name, def in pairs(defaultTerrainColors) do
|
||||
terrain:SetMaterialColor(Enum.Material[name], colors[name] or def)
|
||||
end
|
||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||
if atm then
|
||||
local frost = world and world.id == "World3"
|
||||
@@ -1554,6 +1575,58 @@ local function applyAmbience(world)
|
||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||
end
|
||||
|
||||
-- тёмные силуэты рыб под прозрачной водой «Тихого озера», медленно плавают по кругу (только у этого игрока)
|
||||
do
|
||||
local w1 = Config.Worlds[1]
|
||||
local fishList = Config.Zones.World1.fish
|
||||
local frng = Random.new(11)
|
||||
local folder = new("Folder", { Name = "FishShadows", Parent = workspace })
|
||||
local swimmers = {}
|
||||
for i = 1, 10 do
|
||||
local l = w1.lakes[(i - 1) % #w1.lakes + 1]
|
||||
local ok, model = pcall(Models.buildFish, fishList[(i - 1) % #fishList + 1].id, nil, frng:NextNumber(1.3, 2), true)
|
||||
if ok and model then
|
||||
for _, d in ipairs(model:GetDescendants()) do
|
||||
if d:IsA("BasePart") then
|
||||
d.Color = Color3.fromRGB(22, 70, 74)
|
||||
d.Material = Enum.Material.SmoothPlastic
|
||||
d.Transparency = 0.5
|
||||
d.CanCollide, d.CanQuery, d.CanTouch, d.CastShadow = false, false, false, false
|
||||
elseif d:IsA("Decal") or d:IsA("ParticleEmitter") or d:IsA("Light") then
|
||||
d:Destroy()
|
||||
end
|
||||
end
|
||||
model.Parent = folder
|
||||
table.insert(swimmers, {
|
||||
model = model,
|
||||
c = w1.center + Vector3.new(l[1] + frng:NextNumber(-l[3], l[3]) * 0.25, w1.waterY - frng:NextNumber(1.4, 2.4), l[2] + frng:NextNumber(-l[3], l[3]) * 0.25),
|
||||
r = l[3] * frng:NextNumber(0.25, 0.55), a = frng:NextNumber(0, math.pi * 2),
|
||||
w = frng:NextNumber(0.08, 0.18) * (frng:NextNumber() < 0.5 and -1 or 1),
|
||||
})
|
||||
end
|
||||
end
|
||||
local acc = 0
|
||||
RunService.Heartbeat:Connect(function(dt)
|
||||
acc += dt
|
||||
if acc < 1 / 30 then
|
||||
return
|
||||
end
|
||||
local step = acc
|
||||
acc = 0
|
||||
local w = currentWorld()
|
||||
if not (w and w.id == "World1") then
|
||||
return
|
||||
end
|
||||
for _, s in ipairs(swimmers) do
|
||||
s.a += s.w * step
|
||||
local pos = s.c + Vector3.new(math.cos(s.a) * s.r, math.sin(s.a * 3) * 0.2, math.sin(s.a) * s.r)
|
||||
local dir = Vector3.new(-math.sin(s.a), 0, math.cos(s.a)) * math.sign(s.w)
|
||||
-- голова рыбы смотрит в +X модели, поэтому разворачиваем на 90°
|
||||
s.model:PivotTo(CFrame.lookAt(pos, pos + dir) * CFrame.Angles(0, math.rad(90), 0))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
task.spawn(function()
|
||||
while true do
|
||||
local w = currentWorld()
|
||||
@@ -1587,7 +1660,6 @@ end)
|
||||
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
||||
|
||||
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
||||
local W1 = Config.Worlds[1].center
|
||||
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
||||
|
||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||
@@ -1645,7 +1717,7 @@ end
|
||||
|
||||
local function guideMarker(name)
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
local m = map and map:FindFirstChild(name)
|
||||
local m = map and map:FindFirstChild(name, true) -- маркеры могут лежать в папках уровня (World1Map)
|
||||
return m and m.Position
|
||||
end
|
||||
|
||||
@@ -1776,13 +1848,7 @@ local function guideRoute(step, pos, world)
|
||||
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"
|
||||
return { guideMarker("GuideSell") }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user