3D-рыбы, диковинки, экономика v3
This commit is contained in:
1 parent
087e9b0d9b
commit
3ad192d26e
161 files changed
+567804
-1184
No files matched your search
@@ -316,9 +316,60 @@ local function addEyes(model, x, y, zHalf, size)
|
||||
end
|
||||
end
|
||||
|
||||
-- длина прежней рыбы из шаров (с хвостом) по форме — под неё масштабируем модели из Blockbench
|
||||
local SHAPE_LEN = { long = 2.6, sturgeon = 2.6, tall = 1.7, shark = 3, sword = 2.4, puffer = 1.4, angler = 1.6, flat = 2.2, ray = 2.4, eel = 3.4, jelly = 1.6 }
|
||||
|
||||
-- модель из Blockbench (ReplicatedStorage.FishModels): клон шаблона, масштаб, мутация, Anchored
|
||||
local function fishFromTemplate(tpl, fish, mutationId, s, anchored)
|
||||
local m = tpl:Clone()
|
||||
m.Name = fish.name
|
||||
local len = (SHAPE_LEN[fish.shape or "classic"] or 2) * 1.15 * s
|
||||
m:ScaleTo(len / math.max(tpl:GetAttribute("Length") or 2, 0.1))
|
||||
local glow = fish.glow
|
||||
local rainbow = { C(255, 90, 90), C(255, 190, 70), C(250, 240, 90), C(110, 230, 120), C(90, 200, 255), C(170, 120, 255) }
|
||||
local i = 0
|
||||
for _, p in ipairs(m:GetDescendants()) do
|
||||
if p:IsA("BasePart") and p ~= m.PrimaryPart then
|
||||
local group = p.Parent and p.Parent.Name or ""
|
||||
local isEye = group == "Eye"
|
||||
if group == "Glow" or p.Name:find("_Glow") then
|
||||
p.Material = NEON
|
||||
end
|
||||
if not isEye then
|
||||
if mutationId == "Golden" and (group == "Body" or group == "Fins" or group == "Tail") then
|
||||
local k = (p.Color.R + p.Color.G + p.Color.B) / 3
|
||||
p.Color = C(255, 205, 60):Lerp(C(200, 130, 25), 1 - math.clamp(k * 1.4, 0, 1))
|
||||
p.Material = METAL
|
||||
elseif mutationId == "Shiny" then
|
||||
p.Color = lighten(p.Color, 0.35)
|
||||
p.Reflectance = 0.25
|
||||
elseif mutationId == "Rainbow" then
|
||||
i += 1
|
||||
p.Color = rainbow[(i % #rainbow) + 1]
|
||||
p.Material = NEON
|
||||
elseif glow and group == "Fins" then
|
||||
p.Material = NEON
|
||||
end
|
||||
end
|
||||
p.Anchored = anchored and true or false
|
||||
end
|
||||
end
|
||||
m.PrimaryPart.Anchored = anchored and true or false
|
||||
m:PivotTo(CFrame.new())
|
||||
if mutationId == "Shiny" or mutationId == "Rainbow" or mutationId == "Golden" then
|
||||
sparkles(m.PrimaryPart, mutationId == "Golden" and C(255, 220, 120) or C(255, 255, 255), 6)
|
||||
end
|
||||
return m
|
||||
end
|
||||
|
||||
function M.buildFish(fishId, mutationId, scale, anchored)
|
||||
local fish = Config.FindFish(fishId) or Config.Zones.World1.fish[1]
|
||||
local s = (scale or 1) * fish.size
|
||||
local tplFolder = game:GetService("ReplicatedStorage"):FindFirstChild("FishModels")
|
||||
local tpl = tplFolder and tplFolder:FindFirstChild(fish.id)
|
||||
if tpl then
|
||||
return fishFromTemplate(tpl, fish, mutationId, s, anchored)
|
||||
end
|
||||
local c1, c2 = fish.color, fish.color2 or darken(fish.color, 0.3)
|
||||
local mat = SP
|
||||
local glow = fish.glow
|
||||
|
||||
@@ -2349,7 +2349,8 @@ if RunService:IsStudio() then
|
||||
local data = profiles[player]
|
||||
local fish = data and rollFish(player, data, a, 1, { manual = true, perfect = b, bait = c })
|
||||
if fish then
|
||||
grantFish(player, data, fish, { perfect = b, misses = 0 })
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
grantFish(player, data, fish, { perfect = b, misses = 0, fromPos = hrp and (hrp.Position + hrp.CFrame.LookVector * 14 - Vector3.new(0, 2, 0)) })
|
||||
return fish.id, fish.curio
|
||||
end
|
||||
elseif op == "xp" then
|
||||
|
||||
Reference in new issue
Block a user