12
This commit is contained in:
1 parent
3402fe5edb
commit
8cf3be75c2
13 files changed
+5944
-3984
No files matched your search
@@ -17,21 +17,25 @@ default.project.json проект Rojo
|
|||||||
Откройте `Fishing.rbxlx` в Roblox Studio (**File → Open from File…** или двойной клик) и нажмите **Play** (F5).
|
Откройте `Fishing.rbxlx` в Roblox Studio (**File → Open from File…** или двойной клик) и нажмите **Play** (F5).
|
||||||
Файл собирается из `src/` командой `powershell -ExecutionPolicy Bypass -File build.ps1` (в git он не попадает — см. `.gitignore`).
|
Файл собирается из `src/` командой `powershell -ExecutionPolicy Bypass -File build.ps1` (в git он не попадает — см. `.gitignore`).
|
||||||
|
|
||||||
## «Тихое озеро»: уровень собирается один раз и правится руками
|
## Карта собирается один раз в Studio и правится руками
|
||||||
|
|
||||||
Локацию «Тихое озеро» строит модуль `src/ServerScriptService/World1Builder.lua`. Порядок:
|
Лобби и все миры строит модуль `src/ServerScriptService/WorldBuilder.lua` («Тихое озеро» он берёт из `World1Builder.lua`). Порядок:
|
||||||
|
|
||||||
1. Откройте `Fishing.rbxlx` в Studio и подключите Rojo (**Plugins → Rojo → Connect**).
|
1. Откройте плейс в Studio и подключите Rojo (**Plugins → Rojo → Connect**).
|
||||||
2. В **Command Bar** выполните:
|
2. В **Command Bar** выполните:
|
||||||
```lua
|
```lua
|
||||||
require(game.ServerScriptService.World1Builder:Clone()).bake()
|
require(game.ServerScriptService.WorldBuilder:Clone()).bake()
|
||||||
```
|
```
|
||||||
В `Workspace` появится папка `World1Map` (детали и модели), а на месте мира — террейн.
|
В `Workspace` появится папка `FishingMap` (лобби и миры: детали и модели), а на месте миров — террейн.
|
||||||
3. Сохраните плейс (**Ctrl+S**). Дальше двигайте, удаляйте и добавляйте объекты как обычно, в том числе модели из Toolbox. Игра возьмёт уровень из плейса и не будет генерировать его заново.
|
3. Сохраните плейс (**Ctrl+S**). Дальше двигайте, удаляйте и добавляйте объекты как обычно, в том числе модели из Toolbox. Игра возьмёт карту из плейса и не будет генерировать её заново.
|
||||||
|
|
||||||
Не удаляйте маркеры `World1Spawn`, `GuideFishSpot`, `GuideSell`, `World1NpcSeller`, `World1NpcGrandpa` и доску `World1Bestiary`. Двигать их можно: NPC и точка появления встанут туда при запуске. Если меняете форму озера, поправьте круги `lakes` у Мира 1 в `FishConfig.lua`: по ним игра решает, где вода.
|
Повторный `bake()` стирает `FishingMap` и террейн миров и строит всё заново, ручные правки при этом пропадут. Исключение — «Тихое озеро» (`FishingMap/World1Map`): его `bake()` переносит в новую карту как есть, вместе с террейном. Чтобы собрать и его заново, сначала удалите `World1Map`.
|
||||||
|
|
||||||
После сборки уровня `build.ps1` больше не перезаписывает `Fishing.rbxlx`: скрипты приходят через Rojo. Команда `build.ps1 -Force` пересоздаёт плейс с нуля и **стирает** собранный уровень.
|
Цвета материалов террейна общие на весь плейс, и в нём сохранены цвета «Тихого озера» (зелёный `Snow`). Поэтому в редакторе снег Ледяного фьорда тоже зелёный, а в игре его перекрашивает `terrainColors` мира в `FishConfig.lua`.
|
||||||
|
|
||||||
|
NPC в редакторе показаны полупрозрачными фигурами (`NpcSpot`, `World1NpcSeller`, `World1NpcGrandpa`): при запуске на их место встаёт персонаж, имя и цвета берутся из атрибутов детали. Доски с атрибутом `Bestiary` получают список рыб из `FishConfig` при каждом запуске. Не удаляйте маркеры (`LobbySpawn`, `World1Spawn`, `World2Spawn`, `World3Spawn`, `Guide*`), двигать их можно. Если меняете форму озера, поправьте круги `lakes` у мира в `FishConfig.lua`: по ним игра решает, где вода.
|
||||||
|
|
||||||
|
После сборки карты `build.ps1` больше не перезаписывает `Fishing.rbxlx`: скрипты приходят через Rojo. Команда `build.ps1 -Force` пересоздаёт плейс с нуля и **стирает** собранную карту.
|
||||||
|
|
||||||
## Установка в свой плейс без Rojo
|
## Установка в свой плейс без Rojo
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Builds Fishing.rbxlx (place file for Roblox Studio) and install/* from src/.
|
# Builds Fishing.rbxlx (place file for Roblox Studio) and install/* from src/.
|
||||||
# Run: powershell -ExecutionPolicy Bypass -File build.ps1
|
# Run: powershell -ExecutionPolicy Bypass -File build.ps1
|
||||||
# Fishing.rbxlx is created only if it does not exist yet: after the level is baked in Studio
|
# Fishing.rbxlx is created only if it does not exist yet: after the map is baked in Studio
|
||||||
# (World1Builder) the place file holds the hand-edited map, and scripts reach it via Rojo.
|
# (WorldBuilder) the place file holds the hand-edited map, and scripts reach it via Rojo.
|
||||||
# Use -Force to recreate it from scratch (this DELETES the map built in Studio).
|
# Use -Force to recreate it from scratch (this DELETES the map built in Studio).
|
||||||
param([switch]$Force)
|
param([switch]$Force)
|
||||||
|
|
||||||
@@ -14,6 +14,7 @@ $scripts = @(
|
|||||||
@{ Name = 'MapBuilder'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\MapBuilder.server.lua'; Rbxmx = '3_MapBuilder_ServerScriptService.rbxmx' },
|
@{ Name = 'MapBuilder'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\MapBuilder.server.lua'; Rbxmx = '3_MapBuilder_ServerScriptService.rbxmx' },
|
||||||
@{ Name = 'GameServer'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\GameServer.server.lua'; Rbxmx = '4_GameServer_ServerScriptService.rbxmx' },
|
@{ Name = 'GameServer'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\GameServer.server.lua'; Rbxmx = '4_GameServer_ServerScriptService.rbxmx' },
|
||||||
@{ Name = 'World1Builder'; Class = 'ModuleScript'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\World1Builder.lua'; Rbxmx = '6_World1Builder_ServerScriptService.rbxmx' },
|
@{ Name = 'World1Builder'; Class = 'ModuleScript'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\World1Builder.lua'; Rbxmx = '6_World1Builder_ServerScriptService.rbxmx' },
|
||||||
|
@{ Name = 'WorldBuilder'; Class = 'ModuleScript'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\WorldBuilder.lua'; Rbxmx = '7_WorldBuilder_ServerScriptService.rbxmx' },
|
||||||
@{ Name = 'FishingClient'; Class = 'LocalScript'; Service = 'StarterPlayerScripts'; Path = 'src\StarterPlayer\StarterPlayerScripts\FishingClient.client.lua'; Rbxmx = '5_FishingClient_StarterPlayerScripts.rbxmx' }
|
@{ Name = 'FishingClient'; Class = 'LocalScript'; Service = 'StarterPlayerScripts'; Path = 'src\StarterPlayer\StarterPlayerScripts\FishingClient.client.lua'; Rbxmx = '5_FishingClient_StarterPlayerScripts.rbxmx' }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,34 @@ Config.Worlds = {
|
|||||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
||||||
clock = 16.4, water = Color3.fromRGB(38, 172, 166),
|
clock = 16.2,
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
|
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
|
||||||
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
|
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
|
||||||
waterTransparency = 0.6, waveSize = 0.12, tint = Color3.fromRGB(255, 240, 222),
|
tint = Color3.fromRGB(255, 247, 236),
|
||||||
|
-- свет и эффекты: свойства Lighting и его эффектов; чего здесь нет, остаётся как в MapBuilder
|
||||||
|
look = {
|
||||||
|
lighting = {
|
||||||
|
Brightness = 2.6, ExposureCompensation = -0.15,
|
||||||
|
Ambient = Color3.fromRGB(62, 66, 84), OutdoorAmbient = Color3.fromRGB(105, 112, 132),
|
||||||
|
ColorShift_Top = Color3.fromRGB(255, 232, 196),
|
||||||
|
EnvironmentDiffuseScale = 0.6, EnvironmentSpecularScale = 0.8,
|
||||||
|
},
|
||||||
|
-- дымка вдали: Density — сколько тумана, Haze — насколько он плотный у горизонта
|
||||||
|
atmosphere = {
|
||||||
|
Density = 0.38, Offset = 0.1, Haze = 1.2, Glare = 0.15,
|
||||||
|
Color = Color3.fromRGB(188, 204, 224), Decay = Color3.fromRGB(196, 176, 160),
|
||||||
|
},
|
||||||
|
color = { Saturation = 0.28, Contrast = 0.2, Brightness = -0.02 },
|
||||||
|
bloom = { Intensity = 0.45, Size = 28, Threshold = 1.2 },
|
||||||
|
sunRays = { Intensity = 0.06, Spread = 0.6 },
|
||||||
|
-- лёгкое размытие дальнего плана
|
||||||
|
dof = { Enabled = true, FarIntensity = 0.2, FocusDistance = 60, InFocusRadius = 120, NearIntensity = 0 },
|
||||||
|
},
|
||||||
-- земля мира залита материалом Snow (ровный, без травинок), дорожки — Salt; здесь они перекрашиваются
|
-- земля мира залита материалом Snow (ровный, без травинок), дорожки — Salt; здесь они перекрашиваются
|
||||||
terrainColors = {
|
terrainColors = {
|
||||||
Snow = Color3.fromRGB(122, 182, 74), Salt = Color3.fromRGB(176, 136, 90),
|
Snow = Color3.fromRGB(127, 163, 63), Salt = Color3.fromRGB(191, 155, 105),
|
||||||
|
Rock = Color3.fromRGB(132, 139, 155), Slate = Color3.fromRGB(132, 139, 155),
|
||||||
Mud = Color3.fromRGB(78, 110, 92), Sand = Color3.fromRGB(205, 190, 140),
|
Mud = Color3.fromRGB(78, 110, 92), Sand = Color3.fromRGB(205, 190, 140),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -28,7 +48,7 @@ Config.Worlds = {
|
|||||||
id = "World2", name = "Тропический остров", icon = "🏝", level = 8, mult = 4,
|
id = "World2", name = "Тропический остров", icon = "🏝", level = 8, mult = 4,
|
||||||
center = Vector3.new(1500, 0, 0), color = Color3.fromRGB(255, 190, 70),
|
center = Vector3.new(1500, 0, 0), color = Color3.fromRGB(255, 190, 70),
|
||||||
desc = "Бирюзовое море, пальмы и яркая рифовая рыба.",
|
desc = "Бирюзовое море, пальмы и яркая рифовая рыба.",
|
||||||
clock = 13, water = Color3.fromRGB(35, 175, 185),
|
clock = 13,
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
sea = 119, -- всё дальше этого радиуса от центра — море
|
sea = 119, -- всё дальше этого радиуса от центра — море
|
||||||
},
|
},
|
||||||
@@ -36,7 +56,7 @@ Config.Worlds = {
|
|||||||
id = "World3", name = "Ледяной фьорд", icon = "❄", level = 18, mult = 12,
|
id = "World3", name = "Ледяной фьорд", icon = "❄", level = 18, mult = 12,
|
||||||
center = Vector3.new(-1500, 0, 0), color = Color3.fromRGB(150, 220, 255),
|
center = Vector3.new(-1500, 0, 0), color = Color3.fromRGB(150, 220, 255),
|
||||||
desc = "Рыбалка в лунках среди льдов и северного сияния.",
|
desc = "Рыбалка в лунках среди льдов и северного сияния.",
|
||||||
clock = 18.3, water = Color3.fromRGB(25, 70, 100),
|
clock = 18.3,
|
||||||
waterY = 1,
|
waterY = 1,
|
||||||
lakes = { { 0, 0, 70 }, { -55, 30, 45 }, { 55, -25, 50 }, { 5, -70, 40 } }, -- подо льдом
|
lakes = { { 0, 0, 70 }, { -55, 30, 45 }, { 55, -25, 50 }, { 5, -70, 40 } }, -- подо льдом
|
||||||
holes = {
|
holes = {
|
||||||
@@ -44,6 +64,9 @@ Config.Worlds = {
|
|||||||
{ -45, 15 }, { 55, -25 }, { 75, -5 }, { 40, -50 }, { 5, -75 }, { -15, -60 }, { 25, -80 },
|
{ -45, 15 }, { 55, -25 }, { 75, -5 }, { 40, -50 }, { 5, -75 }, { -15, -60 }, { 25, -80 },
|
||||||
},
|
},
|
||||||
holeRadius = 6,
|
holeRadius = 6,
|
||||||
|
-- цвета террейна общие на весь плейс, а в нём сохранены цвета «Тихого озера» (зелёный Snow) —
|
||||||
|
-- поэтому снег фьорда задаём явно
|
||||||
|
terrainColors = { Snow = Color3.fromRGB(205, 212, 228) },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id = "World4", name = "Вулкан", icon = "🌋", level = 30, mult = 30, soon = true,
|
id = "World4", name = "Вулкан", icon = "🌋", level = 30, mult = 30, soon = true,
|
||||||
@@ -290,17 +313,53 @@ Config.CollectionRewards = {
|
|||||||
}
|
}
|
||||||
Config.MasteryCoins = 5000 -- за весь мир (тоже умножается на mult)
|
Config.MasteryCoins = 5000 -- за весь мир (тоже умножается на mult)
|
||||||
|
|
||||||
---------------------------------------------------------------- задания
|
---------------------------------------------------------------- цепочки заданий
|
||||||
-- coins/xp = награда за 1 единицу цели (умножается на цель и уровень игрока)
|
-- короткие задания идут по очереди: награда сразу, следующее появляется мгновенно.
|
||||||
Config.Quests = {
|
-- после последнего шага — бонус цепочки и следующая цепочка; каждый новый круг цели растут
|
||||||
{ kind = "catch", text = "Поймай %d рыб", goals = { 10, 20, 35 }, coins = 6, xp = 5 },
|
-- coins/xp = награда за 1 единицу цели (умножается на цель и уровень игрока);
|
||||||
{ kind = "rare", text = "Поймай %d рыб редкости «Редкая» и выше", goals = { 1, 2, 3 }, coins = 60, xp = 50 },
|
-- max — потолок цели, byLevel — цель растёт с уровнем игрока;
|
||||||
{ kind = "epic", text = "Поймай эпическую рыбу или реже", goals = { 1 }, coins = 250, xp = 200 },
|
-- forms — слово после числа для 1 / 2–4 / 5+ (подставляется вместо второго %s)
|
||||||
{ kind = "mutation", text = "Поймай рыбу с мутацией", goals = { 1 }, coins = 200, xp = 150 },
|
local FISH, TIMES = { "рыбу", "рыбы", "рыб" }, { "раз", "раза", "раз" }
|
||||||
{ kind = "earn", text = "Заработай %d монет на продаже", goals = { 200, 600, 1500 }, coins = 0.25, xp = 0.2 },
|
Config.QuestKinds = {
|
||||||
{ kind = "perfect", text = "Сделай %d идеальных подсечек (без промаха)", goals = { 5, 10, 15 }, coins = 15, xp = 12 },
|
catch = { text = "Поймай %d %s", forms = FISH, coins = 5, xp = 4 },
|
||||||
|
uncommon = { text = "Поймай %d %s «Необычная» или реже", forms = FISH, coins = 18, xp = 14 },
|
||||||
|
rare = { text = "Поймай %d %s «Редкая» или реже", forms = FISH, coins = 60, xp = 50 },
|
||||||
|
perfect = { text = "Подсеки %d %s без промаха", forms = TIMES, coins = 10, xp = 8 },
|
||||||
|
perfectCast = { text = "Забрось в зелёную зону %d %s", forms = TIMES, coins = 8, xp = 6 },
|
||||||
|
combo = { text = "Набери серию из %d рыб", coins = 12, xp = 10, max = 15 },
|
||||||
|
sell = { text = "Продай %d %s", forms = FISH, coins = 3, xp = 3 },
|
||||||
|
earn = { text = "Заработай %d 💰 на продаже", coins = 0.25, xp = 0.2, byLevel = true },
|
||||||
|
buy = { text = "Купи что-нибудь в магазине", coins = 40, xp = 30, max = 1 },
|
||||||
|
boss = { text = "Нанеси боссу %d урона", coins = 15, xp = 12 },
|
||||||
|
}
|
||||||
|
Config.QuestChains = {
|
||||||
|
{ name = "🎣 Утренний клёв", steps = { { "catch", 3 }, { "perfectCast", 2 }, { "sell", 3 }, { "catch", 5 }, { "uncommon", 1 } } },
|
||||||
|
{ name = "🔥 Без промаха", steps = { { "perfect", 3 }, { "combo", 3 }, { "catch", 6 }, { "earn", 80 }, { "combo", 5 } } },
|
||||||
|
{ name = "💎 Охота за редкостью", steps = { { "uncommon", 3 }, { "perfectCast", 3 }, { "rare", 1 }, { "sell", 8 }, { "buy", 1 } } },
|
||||||
|
{ name = "🏆 Мастер озера", steps = { { "combo", 6 }, { "catch", 10 }, { "perfect", 6 }, { "rare", 2 }, { "earn", 300 } } },
|
||||||
|
}
|
||||||
|
Config.QuestTierGrowth = 0.5 -- каждый следующий круг цепочек: цели ×(1 + 0.5 · номер круга)
|
||||||
|
Config.ChainBonus = { coins = 120, xp = 100, potion = "Luck1" } -- за всю цепочку (растёт с уровнем и кругом)
|
||||||
|
|
||||||
|
---------------------------------------------------------------- серия улова
|
||||||
|
-- каждая рыба подряд без срыва: +10% к цене и опыту следующей, до ×2;
|
||||||
|
-- срыв, ушедшая рыба или timeout секунд без улова — серия сгорает
|
||||||
|
Config.Combo = { step = 0.1, max = 2.0, timeout = 90 }
|
||||||
|
|
||||||
|
---------------------------------------------------------------- босс озера
|
||||||
|
-- раз в interval секунд в мир, где больше всего игроков, приплывает босс. Его ловят всем сервером:
|
||||||
|
-- каждая пойманная там рыба наносит урон = ранг редкости (+1 за подсечку без промаха).
|
||||||
|
-- Если за duration секунд урона хватило — награда всем, кто помог (× mult мира, минимум 40% за малый вклад)
|
||||||
|
Config.Boss = {
|
||||||
|
firstDelay = 240, interval = 600, duration = 180,
|
||||||
|
hpPerPlayer = 12,
|
||||||
|
reward = { coins = 300, xp = 250, potion = "Luck1" },
|
||||||
|
worlds = {
|
||||||
|
World1 = { name = "Сом-великан", fish = "Som", mutation = "Golden", scale = 5 },
|
||||||
|
World2 = { name = "Королевская акула", fish = "Shark", mutation = "Golden", scale = 3 },
|
||||||
|
World3 = { name = "Ледяной левиафан", fish = "Leviathan", mutation = "Rainbow", scale = 2.5 },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
Config.QuestSlots = 3
|
|
||||||
|
|
||||||
-- ежедневная награда (7 дней по кругу), монеты растут с уровнем
|
-- ежедневная награда (7 дней по кругу), монеты растут с уровнем
|
||||||
Config.DailyRewards = {
|
Config.DailyRewards = {
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -42,7 +42,7 @@ local function defaultData()
|
|||||||
rod = "Basic", rods = { Basic = true }, rodLevels = {},
|
rod = "Basic", rods = { Basic = true }, rodLevels = {},
|
||||||
bag = "Pouch", bags = { Pouch = true },
|
bag = "Pouch", bags = { Pouch = true },
|
||||||
items = {}, discovered = {}, claimed = {},
|
items = {}, discovered = {}, claimed = {},
|
||||||
quests = {}, daily = { last = 0, streak = 0 },
|
chain = { index = 1, step = 1, progress = 0, tier = 0 }, daily = { last = 0, streak = 0 },
|
||||||
boostUntil = 0, boostBonus = 0,
|
boostUntil = 0, boostBonus = 0,
|
||||||
totalCaught = 0, nextUid = 1, receipts = {},
|
totalCaught = 0, nextUid = 1, receipts = {},
|
||||||
}
|
}
|
||||||
@@ -169,13 +169,58 @@ local function sendInventory(player)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------- цепочки заданий
|
||||||
|
|
||||||
|
local function levelMult(data)
|
||||||
|
return 1 + (data.level - 1) * 0.25
|
||||||
|
end
|
||||||
|
|
||||||
|
local function currentChain(data)
|
||||||
|
local c = data.chain
|
||||||
|
local chain = Config.QuestChains[(c.index - 1) % #Config.QuestChains + 1]
|
||||||
|
return chain, chain.steps[c.step]
|
||||||
|
end
|
||||||
|
|
||||||
|
local function stepGoal(data, step)
|
||||||
|
local kind = Config.QuestKinds[step[1]]
|
||||||
|
local g = step[2] * (1 + Config.QuestTierGrowth * data.chain.tier)
|
||||||
|
if kind.byLevel then
|
||||||
|
g *= levelMult(data)
|
||||||
|
end
|
||||||
|
g = math.ceil(g)
|
||||||
|
return kind.max and math.min(g, kind.max) or g
|
||||||
|
end
|
||||||
|
|
||||||
|
local function stepReward(data, step, goal)
|
||||||
|
local kind = Config.QuestKinds[step[1]]
|
||||||
|
local m = levelMult(data)
|
||||||
|
return math.max(10, math.floor(kind.coins * goal * m)), math.max(10, math.floor(kind.xp * goal * m))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function chainBonus(data)
|
||||||
|
local b = Config.ChainBonus
|
||||||
|
local m = levelMult(data) * (1 + Config.QuestTierGrowth * data.chain.tier)
|
||||||
|
return math.floor(b.coins * m), math.floor(b.xp * m), b.potion and Config.Find(Config.Potions, b.potion)
|
||||||
|
end
|
||||||
|
|
||||||
local function sendQuests(player)
|
local function sendQuests(player)
|
||||||
local data = profiles[player]
|
local data = profiles[player]
|
||||||
if not data then
|
if not data then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local chain = currentChain(data)
|
||||||
|
local steps = {}
|
||||||
|
for i, st in ipairs(chain.steps) do
|
||||||
|
local goal = stepGoal(data, st)
|
||||||
|
local coins, xp = stepReward(data, st, goal)
|
||||||
|
steps[i] = { kind = st[1], goal = goal, coins = coins, xp = xp }
|
||||||
|
end
|
||||||
|
local bCoins, bXp, potion = chainBonus(data)
|
||||||
local t = today()
|
local t = today()
|
||||||
remote:FireClient(player, "Quests", data.quests, {
|
remote:FireClient(player, "Quests", {
|
||||||
|
name = chain.name, round = data.chain.tier + 1, step = data.chain.step, progress = data.chain.progress,
|
||||||
|
steps = steps, bonus = { coins = bCoins, xp = bXp, potion = potion and potion.name },
|
||||||
|
}, {
|
||||||
available = data.daily.last < t,
|
available = data.daily.last < t,
|
||||||
streak = data.daily.streak,
|
streak = data.daily.streak,
|
||||||
nextStreak = (data.daily.last == t - 1) and (data.daily.streak % 7 + 1) or ((data.daily.last < t) and 1 or data.daily.streak),
|
nextStreak = (data.daily.last == t - 1) and (data.daily.streak % 7 + 1) or ((data.daily.last < t) and 1 or data.daily.streak),
|
||||||
@@ -256,79 +301,54 @@ local function applyPotion(data, bonus, duration)
|
|||||||
data.boostUntil = math.max(os.time(), data.boostUntil) + duration
|
data.boostUntil = math.max(os.time(), data.boostUntil) + duration
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------- задания
|
---------------------------------------------------------------- задания: прогресс цепочки
|
||||||
|
|
||||||
local function makeQuest(data, exclude)
|
-- у старых сохранений вместо цепочки были три случайных задания
|
||||||
local pool = {}
|
local function ensureChain(data)
|
||||||
for _, q in ipairs(Config.Quests) do
|
if type(data.chain) ~= "table" then
|
||||||
if not exclude[q.kind] then
|
data.chain = { index = 1, step = 1, progress = 0, tier = 0 }
|
||||||
table.insert(pool, q)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if #pool == 0 then
|
data.quests = nil
|
||||||
pool = Config.Quests
|
|
||||||
end
|
|
||||||
local t = pool[rng:NextInteger(1, #pool)]
|
|
||||||
local goal = t.goals[rng:NextInteger(1, #t.goals)]
|
|
||||||
local mult = 1 + (data.level - 1) * 0.25
|
|
||||||
return {
|
|
||||||
kind = t.kind, goal = goal, progress = 0,
|
|
||||||
coins = math.max(10, math.floor(t.coins * goal * mult)),
|
|
||||||
xp = math.max(10, math.floor(t.xp * goal * mult)),
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function ensureQuests(data)
|
-- absolute = true: amount — текущее значение (серия), а не прибавка
|
||||||
local kinds = {}
|
local function questProgress(player, kind, amount, absolute)
|
||||||
for _, q in ipairs(data.quests) do
|
|
||||||
kinds[q.kind] = true
|
|
||||||
end
|
|
||||||
while #data.quests < Config.QuestSlots do
|
|
||||||
local q = makeQuest(data, kinds)
|
|
||||||
kinds[q.kind] = true
|
|
||||||
table.insert(data.quests, q)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function questProgress(player, kind, amount)
|
|
||||||
local data = profiles[player]
|
local data = profiles[player]
|
||||||
if not data then
|
if not data then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local changed = false
|
local chain, step = currentChain(data)
|
||||||
for _, q in ipairs(data.quests) do
|
if step[1] ~= kind then
|
||||||
if q.kind == kind and q.progress < q.goal then
|
|
||||||
q.progress = math.min(q.goal, q.progress + amount)
|
|
||||||
changed = true
|
|
||||||
if q.progress >= q.goal then
|
|
||||||
notify(player, "📜 Задание готово! (Q)", GOLD)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if changed then
|
|
||||||
sendQuests(player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function claimQuest(player, index)
|
|
||||||
local data = profiles[player]
|
|
||||||
local q = data and type(index) == "number" and data.quests[index]
|
|
||||||
if not q or q.progress < q.goal then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
data.coins += q.coins
|
local c = data.chain
|
||||||
addXp(player, data, q.xp)
|
c.progress = absolute and math.max(c.progress, amount) or c.progress + amount
|
||||||
local kinds = {}
|
local goal = stepGoal(data, step)
|
||||||
for i, other in ipairs(data.quests) do
|
if c.progress >= goal then
|
||||||
if i ~= index then
|
-- награда сразу, следующий шаг тоже сразу
|
||||||
kinds[other.kind] = true
|
local coins, xp = stepReward(data, step, goal)
|
||||||
|
data.coins += coins
|
||||||
|
addXp(player, data, xp)
|
||||||
|
remote:FireClient(player, "QuestDone", kind, goal, coins, xp)
|
||||||
|
c.step += 1
|
||||||
|
c.progress = 0
|
||||||
|
if c.step > #chain.steps then
|
||||||
|
local bCoins, bXp, potion = chainBonus(data)
|
||||||
|
data.coins += bCoins
|
||||||
|
addXp(player, data, bXp)
|
||||||
|
if potion then
|
||||||
|
applyPotion(data, potion.bonus, potion.duration)
|
||||||
|
end
|
||||||
|
remote:FireClient(player, "ChainDone", chain.name, bCoins, bXp, potion and potion.name)
|
||||||
|
c.index += 1
|
||||||
|
c.step = 1
|
||||||
|
if (c.index - 1) % #Config.QuestChains == 0 then
|
||||||
|
c.tier += 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
updateStats(player)
|
||||||
end
|
end
|
||||||
kinds[q.kind] = true
|
|
||||||
data.quests[index] = makeQuest(data, kinds)
|
|
||||||
updateStats(player)
|
|
||||||
sendQuests(player)
|
sendQuests(player)
|
||||||
notify(player, ("📜 Награда: +%d 💰 +%d XP"):format(q.coins, q.xp), GREEN)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function claimDaily(player)
|
local function claimDaily(player)
|
||||||
@@ -609,6 +629,34 @@ end
|
|||||||
|
|
||||||
local fishing = {}
|
local fishing = {}
|
||||||
|
|
||||||
|
-- серия улова (на время игры, не сохраняется)
|
||||||
|
local combo, comboUntil = {}, {}
|
||||||
|
local function setCombo(player, n)
|
||||||
|
combo[player] = n
|
||||||
|
comboUntil[player] = n > 0 and os.time() + Config.Combo.timeout or nil
|
||||||
|
player:SetAttribute("Combo", n)
|
||||||
|
player:SetAttribute("ComboEnds", n > 0 and workspace:GetServerTimeNow() + Config.Combo.timeout or nil)
|
||||||
|
end
|
||||||
|
local function breakCombo(player)
|
||||||
|
if (combo[player] or 0) >= 2 then
|
||||||
|
remote:FireClient(player, "ComboLost", combo[player])
|
||||||
|
end
|
||||||
|
setCombo(player, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- босс озера: { world, def, hp, max, dmg = { [player] = урон } }
|
||||||
|
local boss = nil
|
||||||
|
local function bossHit(player, world, dmg)
|
||||||
|
if not boss or boss.hp <= 0 or not world or world.id ~= boss.world.id then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
boss.hp = math.max(0, boss.hp - dmg)
|
||||||
|
boss.dmg[player] = (boss.dmg[player] or 0) + dmg
|
||||||
|
workspace:SetAttribute("BossHP", boss.hp)
|
||||||
|
remote:FireClient(player, "BossHit", dmg)
|
||||||
|
questProgress(player, "boss", dmg)
|
||||||
|
end
|
||||||
|
|
||||||
-- ищем воду по карте мира из FishConfig (не зависит от террейна) в сторону центра ближайшего озера:
|
-- ищем воду по карте мира из FishConfig (не зависит от террейна) в сторону центра ближайшего озера:
|
||||||
-- сначала на дальности, которую задала сила заброса, потом всё дальше от неё
|
-- сначала на дальности, которую задала сила заброса, потом всё дальше от неё
|
||||||
local function findWater(hrp, world, power)
|
local function findWater(hrp, world, power)
|
||||||
@@ -813,7 +861,7 @@ local function onCast(player, power)
|
|||||||
remote:FireClient(player, "CastFail")
|
remote:FireClient(player, "CastFail")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local s = { stage = "casting", fish = fish, tool = tool }
|
local s = { stage = "casting", fish = fish, tool = tool, perfect = perfect }
|
||||||
fishing[player] = s
|
fishing[player] = s
|
||||||
-- замах игрок уже сделал, пока держал кнопку (у себя на клиенте); здесь только бросок вперёд
|
-- замах игрок уже сделал, пока держал кнопку (у себя на клиенте); здесь только бросок вперёд
|
||||||
local throw = { windup = 0.15, flight = 0.35 + dist * 0.018, arc = 2 + dist * 0.3, perfect = perfect }
|
local throw = { windup = 0.15, flight = 0.35 + dist * 0.018, arc = 2 + dist * 0.3, perfect = perfect }
|
||||||
@@ -876,6 +924,7 @@ local function onCast(player, power)
|
|||||||
stopFishing(player, false)
|
stopFishing(player, false)
|
||||||
remote:FireClient(player, "Escaped")
|
remote:FireClient(player, "Escaped")
|
||||||
notify(player, "🐟 Рыба ушла", RED)
|
notify(player, "🐟 Рыба ушла", RED)
|
||||||
|
breakCombo(player)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -904,11 +953,18 @@ local function onCatch(player, success, misses)
|
|||||||
gripSequence(tool, { { REST_ANGLE, 0.3 } })
|
gripSequence(tool, { { REST_ANGLE, 0.3 } })
|
||||||
remote:FireClient(player, "Escaped")
|
remote:FireClient(player, "Escaped")
|
||||||
notify(player, "🐟 Сорвалась!", RED)
|
notify(player, "🐟 Сорвалась!", RED)
|
||||||
|
breakCombo(player)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
gripSequence(tool, { { 85, 0.15 }, { REST_ANGLE, 0.45 } })
|
gripSequence(tool, { { 85, 0.15 }, { REST_ANGLE, 0.45 } })
|
||||||
|
|
||||||
|
-- серия: каждая рыба подряд дороже и даёт больше опыта
|
||||||
local fish = s.fish
|
local fish = s.fish
|
||||||
|
local streak = combo[player] or 0
|
||||||
|
local comboMult = math.min(Config.Combo.max, 1 + Config.Combo.step * streak)
|
||||||
|
fish.value = math.floor(fish.value * comboMult + 0.5)
|
||||||
|
fish.xp = math.floor(fish.xp * comboMult + 0.5)
|
||||||
|
setCombo(player, streak + 1)
|
||||||
table.insert(data.items, {
|
table.insert(data.items, {
|
||||||
uid = data.nextUid, id = fish.id, name = fish.name, rarity = fish.rarity,
|
uid = data.nextUid, id = fish.id, name = fish.name, rarity = fish.rarity,
|
||||||
weight = fish.weight, value = fish.value, mutation = fish.mutation,
|
weight = fish.weight, value = fish.value, mutation = fish.mutation,
|
||||||
@@ -934,22 +990,26 @@ local function onCatch(player, success, misses)
|
|||||||
if fromPos then
|
if fromPos then
|
||||||
showFishFlight(player, fish, fromPos)
|
showFishFlight(player, fish, fromPos)
|
||||||
end
|
end
|
||||||
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord })
|
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord, combo = comboMult, streak = streak + 1 })
|
||||||
|
|
||||||
local rank = Config.Rarities[fish.rarity].rank
|
local rank = Config.Rarities[fish.rarity].rank
|
||||||
questProgress(player, "catch", 1)
|
questProgress(player, "catch", 1)
|
||||||
|
if rank >= 2 then
|
||||||
|
questProgress(player, "uncommon", 1)
|
||||||
|
end
|
||||||
if rank >= 3 then
|
if rank >= 3 then
|
||||||
questProgress(player, "rare", 1)
|
questProgress(player, "rare", 1)
|
||||||
end
|
end
|
||||||
if rank >= 4 then
|
|
||||||
questProgress(player, "epic", 1)
|
|
||||||
end
|
|
||||||
if fish.mutation then
|
|
||||||
questProgress(player, "mutation", 1)
|
|
||||||
end
|
|
||||||
if misses == 0 then
|
if misses == 0 then
|
||||||
questProgress(player, "perfect", 1)
|
questProgress(player, "perfect", 1)
|
||||||
end
|
end
|
||||||
|
if s.perfect then
|
||||||
|
questProgress(player, "perfectCast", 1)
|
||||||
|
end
|
||||||
|
questProgress(player, "combo", streak + 1, true)
|
||||||
|
|
||||||
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
bossHit(player, hrp and Config.WorldAt(hrp.Position), rank + (misses == 0 and 1 or 0))
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------- скупка
|
---------------------------------------------------------------- скупка
|
||||||
@@ -1005,6 +1065,7 @@ local function sellItems(player, filterUid)
|
|||||||
updateStats(player)
|
updateStats(player)
|
||||||
sendInventory(player)
|
sendInventory(player)
|
||||||
remote:FireClient(player, "Sold", total, count)
|
remote:FireClient(player, "Sold", total, count)
|
||||||
|
questProgress(player, "sell", count)
|
||||||
questProgress(player, "earn", total)
|
questProgress(player, "earn", total)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1038,6 +1099,7 @@ local function buy(player, kind, id)
|
|||||||
end
|
end
|
||||||
updateStats(player)
|
updateStats(player)
|
||||||
notify(player, ("✨ %s улучшена до +%d!"):format(rod.name, lvl + 1), GOLD)
|
notify(player, ("✨ %s улучшена до +%d!"):format(rod.name, lvl + 1), GOLD)
|
||||||
|
questProgress(player, "buy", 1)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if kind == "Potion" then
|
if kind == "Potion" then
|
||||||
@@ -1057,6 +1119,7 @@ local function buy(player, kind, id)
|
|||||||
applyPotion(data, potion.bonus, potion.duration)
|
applyPotion(data, potion.bonus, potion.duration)
|
||||||
updateStats(player)
|
updateStats(player)
|
||||||
notify(player, ("🍀 +%d%% удачи, %d мин"):format(potion.bonus * 100, potion.duration / 60), GREEN)
|
notify(player, ("🍀 +%d%% удачи, %d мин"):format(potion.bonus * 100, potion.duration / 60), GREEN)
|
||||||
|
questProgress(player, "buy", 1)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local list, owned
|
local list, owned
|
||||||
@@ -1071,6 +1134,7 @@ local function buy(player, kind, id)
|
|||||||
if not item then
|
if not item then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local bought = false
|
||||||
if not owned[id] then
|
if not owned[id] then
|
||||||
if data.level < item.level then
|
if data.level < item.level then
|
||||||
notify(player, "🔒 Нужен ур. " .. item.level, RED)
|
notify(player, "🔒 Нужен ур. " .. item.level, RED)
|
||||||
@@ -1082,6 +1146,7 @@ local function buy(player, kind, id)
|
|||||||
end
|
end
|
||||||
data.coins -= item.price
|
data.coins -= item.price
|
||||||
owned[id] = true
|
owned[id] = true
|
||||||
|
bought = true
|
||||||
notify(player, "✅ " .. item.name, GREEN)
|
notify(player, "✅ " .. item.name, GREEN)
|
||||||
end
|
end
|
||||||
if kind == "Rod" then
|
if kind == "Rod" then
|
||||||
@@ -1093,6 +1158,9 @@ local function buy(player, kind, id)
|
|||||||
attachBag(player)
|
attachBag(player)
|
||||||
end
|
end
|
||||||
updateStats(player)
|
updateStats(player)
|
||||||
|
if bought then
|
||||||
|
questProgress(player, "buy", 1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------- телепорт
|
---------------------------------------------------------------- телепорт
|
||||||
@@ -1215,8 +1283,6 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
|
|||||||
teleportTo(player, a)
|
teleportTo(player, a)
|
||||||
elseif action == "ClaimCollection" then
|
elseif action == "ClaimCollection" then
|
||||||
claimCollection(player, a, b)
|
claimCollection(player, a, b)
|
||||||
elseif action == "ClaimQuest" then
|
|
||||||
claimQuest(player, a)
|
|
||||||
elseif action == "ClaimDaily" then
|
elseif action == "ClaimDaily" then
|
||||||
claimDaily(player)
|
claimDaily(player)
|
||||||
elseif action == "RequestInventory" then
|
elseif action == "RequestInventory" then
|
||||||
@@ -1304,6 +1370,105 @@ task.spawn(function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
---------------------------------------------------------------- босс озера
|
||||||
|
|
||||||
|
local function playerWorld(p)
|
||||||
|
local hrp = p.Character and p.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
return hrp and Config.WorldAt(hrp.Position)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function setBossAttrs()
|
||||||
|
workspace:SetAttribute("BossWorld", boss and boss.world.id or nil)
|
||||||
|
workspace:SetAttribute("BossName", boss and boss.def.name or nil)
|
||||||
|
workspace:SetAttribute("BossHP", boss and boss.hp or nil)
|
||||||
|
workspace:SetAttribute("BossMax", boss and boss.max or nil)
|
||||||
|
workspace:SetAttribute("BossEnds", boss and boss.ends or nil)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function finishBoss(won)
|
||||||
|
local b = boss
|
||||||
|
boss = nil
|
||||||
|
setBossAttrs()
|
||||||
|
local helpers, best, bestDmg = 0, nil, 0
|
||||||
|
for p, d in pairs(b.dmg) do
|
||||||
|
if p.Parent then
|
||||||
|
helpers += 1
|
||||||
|
if d > bestDmg then
|
||||||
|
best, bestDmg = p, d
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not won then
|
||||||
|
for _, p in ipairs(Players:GetPlayers()) do
|
||||||
|
remote:FireClient(p, "BossDone", false, b.def.name)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local R = Config.Boss.reward
|
||||||
|
local fair = b.max / math.max(1, helpers) -- «честная доля» урона на одного
|
||||||
|
local potion = R.potion and Config.Find(Config.Potions, R.potion)
|
||||||
|
for p, d in pairs(b.dmg) do
|
||||||
|
local data = p.Parent and profiles[p]
|
||||||
|
if data then
|
||||||
|
local share = 0.4 + 0.6 * math.min(1, d / fair)
|
||||||
|
local coins = math.floor(R.coins * b.world.mult * share * levelMult(data))
|
||||||
|
local xp = math.floor(R.xp * b.world.mult * share)
|
||||||
|
data.coins += coins
|
||||||
|
addXp(p, data, xp)
|
||||||
|
if potion then
|
||||||
|
applyPotion(data, potion.bonus, potion.duration)
|
||||||
|
end
|
||||||
|
updateStats(p)
|
||||||
|
remote:FireClient(p, "BossReward", coins, xp, potion and potion.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs(Players:GetPlayers()) do
|
||||||
|
remote:FireClient(p, "BossDone", true, b.def.name, best and best.DisplayName, bestDmg)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
task.spawn(function()
|
||||||
|
task.wait(Config.Boss.firstDelay)
|
||||||
|
while true do
|
||||||
|
-- мир, где сейчас больше всего игроков
|
||||||
|
local counts = {}
|
||||||
|
for _, p in ipairs(Players:GetPlayers()) do
|
||||||
|
local w = playerWorld(p)
|
||||||
|
if w and Config.Boss.worlds[w.id] then
|
||||||
|
counts[w.id] = (counts[w.id] or 0) + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local bestId, n = nil, 0
|
||||||
|
for id, c in pairs(counts) do
|
||||||
|
if c > n then
|
||||||
|
bestId, n = id, c
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not bestId then
|
||||||
|
task.wait(30) -- никого нет в мирах: попробуем позже
|
||||||
|
else
|
||||||
|
local world = Config.Find(Config.Worlds, bestId)
|
||||||
|
local max = Config.Boss.hpPerPlayer * n
|
||||||
|
boss = {
|
||||||
|
world = world, def = Config.Boss.worlds[bestId], hp = max, max = max, dmg = {},
|
||||||
|
ends = workspace:GetServerTimeNow() + Config.Boss.duration,
|
||||||
|
}
|
||||||
|
setBossAttrs()
|
||||||
|
for _, p in ipairs(Players:GetPlayers()) do
|
||||||
|
remote:FireClient(p, "BossStart", boss.def.name, world.icon .. " " .. world.name)
|
||||||
|
end
|
||||||
|
local t0 = os.clock()
|
||||||
|
while boss and boss.hp > 0 and os.clock() - t0 < Config.Boss.duration do
|
||||||
|
task.wait(0.25)
|
||||||
|
end
|
||||||
|
if boss then
|
||||||
|
finishBoss(boss.hp <= 0)
|
||||||
|
end
|
||||||
|
task.wait(Config.Boss.interval)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
---------------------------------------------------------------- игроки
|
---------------------------------------------------------------- игроки
|
||||||
|
|
||||||
local function onPlayerAdded(player)
|
local function onPlayerAdded(player)
|
||||||
@@ -1321,7 +1486,7 @@ local function onPlayerAdded(player)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
loadPasses(player)
|
loadPasses(player)
|
||||||
ensureQuests(data)
|
ensureChain(data)
|
||||||
profiles[player] = data
|
profiles[player] = data
|
||||||
loadedOk[player] = ok
|
loadedOk[player] = ok
|
||||||
updateStats(player)
|
updateStats(player)
|
||||||
@@ -1348,6 +1513,7 @@ end
|
|||||||
|
|
||||||
Players.PlayerRemoving:Connect(function(player)
|
Players.PlayerRemoving:Connect(function(player)
|
||||||
stopFishing(player, false)
|
stopFishing(player, false)
|
||||||
|
combo[player], comboUntil[player] = nil, nil
|
||||||
saveData(player)
|
saveData(player)
|
||||||
profiles[player] = nil
|
profiles[player] = nil
|
||||||
loadedOk[player] = nil
|
loadedOk[player] = nil
|
||||||
@@ -1371,6 +1537,10 @@ task.spawn(function()
|
|||||||
if data and data.boostUntil > os.time() - 2 then
|
if data and data.boostUntil > os.time() - 2 then
|
||||||
updateStats(p)
|
updateStats(p)
|
||||||
end
|
end
|
||||||
|
-- серия сгорает, если долго нет улова (пока рыба на крючке — ждём)
|
||||||
|
if comboUntil[p] and os.time() > comboUntil[p] and not fishing[p] then
|
||||||
|
breakCombo(p)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if t % 60 == 0 then
|
if t % 60 == 0 then
|
||||||
for _, p in ipairs(Players:GetPlayers()) do
|
for _, p in ipairs(Players:GetPlayers()) do
|
||||||
|
|||||||
@@ -334,7 +334,8 @@ local function showCatch(fish, extra)
|
|||||||
catchName.TextColor3 = r.color
|
catchName.TextColor3 = r.color
|
||||||
catchInfo.Text = ("<font color=\"%s\">%s</font>%s · %.2f кг"):format(
|
catchInfo.Text = ("<font color=\"%s\">%s</font>%s · %.2f кг"):format(
|
||||||
hex(r.color), r.name, mut and (" · <font color=\"" .. hex(mut.color) .. "\">" .. mut.name .. " x" .. mut.mult .. "</font>") or "", fish.weight)
|
hex(r.color), r.name, mut and (" · <font color=\"" .. hex(mut.color) .. "\">" .. mut.name .. " x" .. mut.mult .. "</font>") or "", fish.weight)
|
||||||
catchValue.Text = ("💰 %s ⭐ +%d XP"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1))
|
catchValue.Text = ("💰 %s ⭐ +%d XP%s"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1),
|
||||||
|
(extra and extra.combo and extra.combo > 1.001) and (" 🔥 x%.1f"):format(extra.combo) or "")
|
||||||
catchCard.Visible = true
|
catchCard.Visible = true
|
||||||
TweenService:Create(catchCard, TweenInfo.new(0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Position = UDim2.new(0.5, 0, 0, 120) }):Play()
|
TweenService:Create(catchCard, TweenInfo.new(0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Position = UDim2.new(0.5, 0, 0, 120) }):Play()
|
||||||
task.delay(3.4, function()
|
task.delay(3.4, function()
|
||||||
@@ -505,7 +506,7 @@ end
|
|||||||
---------------------------------------------------------------- данные с сервера
|
---------------------------------------------------------------- данные с сервера
|
||||||
|
|
||||||
local inventory, discovered, claimed = {}, {}, {}
|
local inventory, discovered, claimed = {}, {}, {}
|
||||||
local quests, daily = {}, { available = false, streak = 0, nextStreak = 1 }
|
local chain, daily = nil, { available = false, streak = 0, nextStreak = 1 }
|
||||||
|
|
||||||
---------------------------------------------------------------- магазин
|
---------------------------------------------------------------- магазин
|
||||||
|
|
||||||
@@ -893,35 +894,55 @@ local questWin = makeWindow("📜 Задания", Color3.fromRGB(200, 140, 40),
|
|||||||
local questList = scrollArea(questWin.pages.quests)
|
local questList = scrollArea(questWin.pages.quests)
|
||||||
local dailyPage = questWin.pages.daily
|
local dailyPage = questWin.pages.daily
|
||||||
|
|
||||||
local function questText(q)
|
local function questText(kind, goal)
|
||||||
local t = Config.Quests[1]
|
local t = Config.QuestKinds[kind]
|
||||||
for _, def in ipairs(Config.Quests) do
|
if not t then
|
||||||
if def.kind == q.kind then
|
return kind
|
||||||
t = def
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return string.find(t.text, "%%d") and t.text:format(q.goal) or t.text
|
if t.forms then
|
||||||
|
local m10, m100 = goal % 10, goal % 100
|
||||||
|
local i = (m10 == 1 and m100 ~= 11) and 1 or ((m10 >= 2 and m10 <= 4 and (m100 < 12 or m100 > 14)) and 2 or 3)
|
||||||
|
return t.text:format(goal, t.forms[i])
|
||||||
|
end
|
||||||
|
return string.find(t.text, "%%d") and t.text:format(goal) or t.text
|
||||||
end
|
end
|
||||||
|
|
||||||
questWin.render = function(tab)
|
questWin.render = function(tab)
|
||||||
if tab == "quests" then
|
if tab == "quests" then
|
||||||
clear(questList)
|
clear(questList)
|
||||||
text({ Size = UDim2.new(1, -4, 0, 30), LayoutOrder = 0, Font = BODY2, TextSize = 14, TextColor3 = C.muted, Text = "Выполняй задания — после награды появится новое.", Parent = questList })
|
if not chain then
|
||||||
for i, q in ipairs(quests) do
|
return
|
||||||
local done = q.progress >= q.goal
|
|
||||||
local row = new("Frame", { Size = UDim2.new(1, -4, 0, 92), BackgroundColor3 = WHITE, LayoutOrder = i, Parent = questList },
|
|
||||||
{ corner(14), stroke(done and C.green or C.line, 2, done and 0 or 0.45), gradient(C.panel2, C.panel, 90) })
|
|
||||||
text({ Size = UDim2.new(1, -190, 0, 28), Position = UDim2.fromOffset(16, 8), Font = TITLE, TextSize = 19, Text = questText(q), TextTruncate = Enum.TextTruncate.AtEnd, Parent = row })
|
|
||||||
progressBar(row, UDim2.fromOffset(16, 42), UDim2.new(1, -200, 0, 14), q.progress / q.goal, done and C.green or C.gold)
|
|
||||||
text({ Size = UDim2.new(1, -190, 0, 20), Position = UDim2.fromOffset(16, 62), Font = BODY2, TextSize = 13, TextColor3 = C.muted, RichText = true,
|
|
||||||
Text = ("%s / %s · <font color=\"#FFD45A\">+%s 💰 +%s XP</font>"):format(fmt(q.progress), fmt(q.goal), fmt(q.coins), fmt(q.xp)), Parent = row })
|
|
||||||
btn({
|
|
||||||
Size = UDim2.fromOffset(150, 46), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 0),
|
|
||||||
BackgroundColor3 = done and C.green or C.grey, AutoButtonColor = done, Text = done and "🎁 Забрать" or "В процессе", TextSize = 18, Parent = row,
|
|
||||||
}, done and function()
|
|
||||||
remote:FireServer("ClaimQuest", i)
|
|
||||||
end or nil)
|
|
||||||
end
|
end
|
||||||
|
text({
|
||||||
|
Size = UDim2.new(1, -4, 0, 30), LayoutOrder = 0, Font = TITLE, TextSize = 22, RichText = true,
|
||||||
|
Text = ("%s <font color=\"#AAB4CD\" size=\"15\">круг %d · награда сразу, следующее задание — тоже</font>"):format(chain.name, chain.round), Parent = questList,
|
||||||
|
})
|
||||||
|
for i, st in ipairs(chain.steps) do
|
||||||
|
local done, cur = i < chain.step, i == chain.step
|
||||||
|
local row = new("Frame", { Size = UDim2.new(1, -4, 0, cur and 84 or 56), BackgroundColor3 = WHITE, LayoutOrder = i, Parent = questList },
|
||||||
|
{ corner(14), stroke(cur and C.gold or (done and C.green or C.line), cur and 3 or 2, (cur or done) and 0 or 0.5), gradient(cur and Color3.fromRGB(70, 60, 30) or C.panel2, C.panel, 90) })
|
||||||
|
text({
|
||||||
|
Size = UDim2.new(1, -200, 0, 28), Position = UDim2.fromOffset(16, cur and 8 or 14), Font = TITLE, TextSize = 19,
|
||||||
|
TextColor3 = (done or cur) and C.text or C.muted, Text = (done and "✅ " or (cur and "▶ " or "🔒 ")) .. questText(st.kind, st.goal),
|
||||||
|
TextTruncate = Enum.TextTruncate.AtEnd, Parent = row,
|
||||||
|
})
|
||||||
|
text({
|
||||||
|
Size = UDim2.fromOffset(180, 28), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -14, 0, cur and 8 or 14), Font = TITLE, TextSize = 17,
|
||||||
|
TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = done and C.muted or C.gold, Text = ("+%s 💰 +%s XP"):format(fmt(st.coins), fmt(st.xp)), Parent = row,
|
||||||
|
})
|
||||||
|
if cur then
|
||||||
|
progressBar(row, UDim2.fromOffset(16, 44), UDim2.new(1, -110, 0, 16), chain.progress / st.goal, C.gold)
|
||||||
|
text({ Size = UDim2.fromOffset(80, 20), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -14, 0, 42), Font = TITLE, TextSize = 16,
|
||||||
|
TextXAlignment = Enum.TextXAlignment.Right, Text = ("%s / %s"):format(fmt(chain.progress), fmt(st.goal)), Parent = row })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local b = chain.bonus
|
||||||
|
local row = new("Frame", { Size = UDim2.new(1, -4, 0, 56), BackgroundColor3 = WHITE, LayoutOrder = 100, Parent = questList },
|
||||||
|
{ corner(14), stroke(C.purple, 2, 0.2), gradient(Color3.fromRGB(70, 40, 100), C.panel, 90) })
|
||||||
|
text({
|
||||||
|
Size = UDim2.new(1, -32, 1, 0), Position = UDim2.fromOffset(16, 0), Font = TITLE, TextSize = 18, RichText = true,
|
||||||
|
Text = ("🎁 За всю цепочку: <font color=\"#FFD45A\">+%s 💰 +%s XP</font>%s"):format(fmt(b.coins), fmt(b.xp), b.potion and (" + " .. b.potion) or ""), Parent = row,
|
||||||
|
})
|
||||||
elseif tab == "daily" then
|
elseif tab == "daily" then
|
||||||
clear(dailyPage)
|
clear(dailyPage)
|
||||||
local myLevel = player:GetAttribute("Level") or 1
|
local myLevel = player:GetAttribute("Level") or 1
|
||||||
@@ -1008,13 +1029,8 @@ sideButton(5, "💎", "Донат", nil, Color3.fromRGB(150, 80, 210), function(
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
local function refreshDots()
|
local function refreshDots()
|
||||||
local q = false
|
-- задания цепочки награждаются сами, точка — только для ежедневной награды
|
||||||
for _, quest in ipairs(quests) do
|
sideDots["Задания"].Visible = daily.available
|
||||||
if quest.progress >= quest.goal then
|
|
||||||
q = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
sideDots["Задания"].Visible = q or daily.available
|
|
||||||
local c = false
|
local c = false
|
||||||
for _, w in ipairs(Config.Worlds) do
|
for _, w in ipairs(Config.Worlds) do
|
||||||
local zone = Config.Zones[w.id]
|
local zone = Config.Zones[w.id]
|
||||||
@@ -1537,18 +1553,58 @@ local snow = new("ParticleEmitter", {
|
|||||||
})
|
})
|
||||||
local lastWorldId = "none"
|
local lastWorldId = "none"
|
||||||
local terrain = workspace.Terrain
|
local terrain = workspace.Terrain
|
||||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
|
||||||
|
|
||||||
-- то, что мир может поменять под себя (вода, оттенок, цвета травы и песка); остальные миры — как в MapBuilder
|
-- то, что мир может поменять под себя (оттенок, цвета травы и песка); вода не трогается — она из свойств Terrain
|
||||||
local DEFAULT_LOOK = { waterTransparency = 0.15, waveSize = 0.3, tint = Color3.new(1, 1, 1) }
|
local DEFAULT_LOOK = { tint = Color3.new(1, 1, 1) }
|
||||||
local defaultTerrainColors = nil
|
local defaultTerrainColors = nil
|
||||||
|
|
||||||
|
-- world.look: свет и эффекты мира; при выходе свойства возвращаются к тем, что были до первого входа
|
||||||
|
local lookTargets = {
|
||||||
|
lighting = function() return Lighting end,
|
||||||
|
atmosphere = function() return Lighting:FindFirstChildOfClass("Atmosphere") end,
|
||||||
|
color = function() return Lighting:FindFirstChildOfClass("ColorCorrectionEffect") end,
|
||||||
|
bloom = function() return Lighting:FindFirstChildOfClass("BloomEffect") end,
|
||||||
|
sunRays = function() return Lighting:FindFirstChildOfClass("SunRaysEffect") end,
|
||||||
|
dof = function()
|
||||||
|
return Lighting:FindFirstChildOfClass("DepthOfFieldEffect")
|
||||||
|
or new("DepthOfFieldEffect", { Enabled = false, Parent = Lighting })
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
local lookDefaults = {}
|
||||||
|
|
||||||
|
local function applyLook(world)
|
||||||
|
-- исходные значения запоминаем до первой правки; эффект мог ещё не прийти с сервера, тогда в следующий раз
|
||||||
|
for _, w in ipairs(Config.Worlds) do
|
||||||
|
for section, props in pairs(w.look or {}) do
|
||||||
|
local obj = lookTargets[section] and lookTargets[section]()
|
||||||
|
if obj then
|
||||||
|
lookDefaults[section] = lookDefaults[section] or {}
|
||||||
|
for prop in pairs(props) do
|
||||||
|
if lookDefaults[section][prop] == nil then
|
||||||
|
lookDefaults[section][prop] = obj[prop]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local look = (world and world.look) or {}
|
||||||
|
for section, defaults in pairs(lookDefaults) do
|
||||||
|
local obj = lookTargets[section]()
|
||||||
|
if obj then
|
||||||
|
local goal = {}
|
||||||
|
for prop, def in pairs(defaults) do
|
||||||
|
local v = look[section] and look[section][prop]
|
||||||
|
if v == nil then v = def end
|
||||||
|
if typeof(v) == "boolean" then obj[prop] = v else goal[prop] = v end
|
||||||
|
end
|
||||||
|
TweenService:Create(obj, TweenInfo.new(2), goal):Play()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function applyAmbience(world)
|
local function applyAmbience(world)
|
||||||
local clock = (world and world.clock) or 14.5
|
local clock = (world and world.clock) or 14.5
|
||||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
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")
|
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||||
if cc then
|
if cc then
|
||||||
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
||||||
@@ -1556,7 +1612,7 @@ local function applyAmbience(world)
|
|||||||
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
||||||
if not defaultTerrainColors then
|
if not defaultTerrainColors then
|
||||||
defaultTerrainColors = {}
|
defaultTerrainColors = {}
|
||||||
for _, name in ipairs({ "Snow", "Salt", "Mud", "Sand" }) do
|
for _, name in ipairs({ "Snow", "Salt", "Mud", "Sand", "Rock", "Slate" }) do
|
||||||
defaultTerrainColors[name] = terrain:GetMaterialColor(Enum.Material[name])
|
defaultTerrainColors[name] = terrain:GetMaterialColor(Enum.Material[name])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1572,6 +1628,7 @@ local function applyAmbience(world)
|
|||||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
||||||
}):Play()
|
}):Play()
|
||||||
end
|
end
|
||||||
|
applyLook(world)
|
||||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1853,11 +1910,45 @@ local function guideRoute(step, pos, world)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ближайшая скупка в этом мире (или в лобби): прилавки с ProximityPrompt Action = "Sell"
|
||||||
|
local nearestSell
|
||||||
|
do
|
||||||
|
local sellSpots, sellScanAt = {}, -math.huge
|
||||||
|
nearestSell = function(pos, world)
|
||||||
|
if #sellSpots == 0 and os.clock() - sellScanAt > 3 then
|
||||||
|
sellScanAt = os.clock()
|
||||||
|
local map = workspace:FindFirstChild("FishingMap")
|
||||||
|
for _, d in ipairs(map and map:GetDescendants() or {}) do
|
||||||
|
if d:IsA("ProximityPrompt") and d:GetAttribute("Action") == "Sell" then
|
||||||
|
local p = d.Parent
|
||||||
|
local at = (p:IsA("BasePart") and p.Position) or (p:IsA("Attachment") and p.WorldPosition) or (p:IsA("Model") and p:GetPivot().Position)
|
||||||
|
if at then
|
||||||
|
table.insert(sellSpots, at)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local best, bestD = nil, nil
|
||||||
|
for _, at in ipairs(sellSpots) do
|
||||||
|
if Config.WorldAt(at) == world then
|
||||||
|
local d = (at - pos).Magnitude
|
||||||
|
if not bestD or d < bestD then
|
||||||
|
best, bestD = at, d
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return best
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
RunService.RenderStepped:Connect(function()
|
RunService.RenderStepped:Connect(function()
|
||||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
local step = tutorialStep()
|
local step = tutorialStep()
|
||||||
-- пока сервер не прислал шаг (данные ещё грузятся), ничего не показываем
|
-- пока сервер не прислал шаг (данные ещё грузятся), обучение не показываем;
|
||||||
if not hrp or player:GetAttribute("Tutorial") == nil or step >= Config.TutorialDone then
|
-- после обучения линия ведёт к скупщику, когда сумка полна
|
||||||
|
local tutorialOn = player:GetAttribute("Tutorial") ~= nil and step < Config.TutorialDone
|
||||||
|
local bagFull = (player:GetAttribute("BagCount") or 0) >= (player:GetAttribute("BagCap") or math.huge)
|
||||||
|
if not hrp or not (tutorialOn or bagFull) then
|
||||||
guideHint.Visible = false
|
guideHint.Visible = false
|
||||||
guideHighlight.Enabled = false
|
guideHighlight.Enabled = false
|
||||||
hideChevrons(1)
|
hideChevrons(1)
|
||||||
@@ -1873,7 +1964,9 @@ RunService.RenderStepped:Connect(function()
|
|||||||
local world = Config.WorldAt(pos)
|
local world = Config.WorldAt(pos)
|
||||||
|
|
||||||
-- переходы между шагами
|
-- переходы между шагами
|
||||||
if step <= 1 and world and world.id == "World1" then
|
if not tutorialOn then
|
||||||
|
-- обучение пройдено, остаётся только дорога к скупщику
|
||||||
|
elseif step <= 1 and world and world.id == "World1" then
|
||||||
advanceTutorial(2)
|
advanceTutorial(2)
|
||||||
elseif step == 0 then
|
elseif step == 0 then
|
||||||
local board = guideMarker("GuideBoard")
|
local board = guideMarker("GuideBoard")
|
||||||
@@ -1890,7 +1983,15 @@ RunService.RenderStepped:Connect(function()
|
|||||||
end
|
end
|
||||||
step = tutorialStep()
|
step = tutorialStep()
|
||||||
|
|
||||||
local route, hint, key = guideRoute(step, pos, world)
|
local route, hint, key
|
||||||
|
if tutorialOn then
|
||||||
|
route, hint, key = guideRoute(step, pos, world)
|
||||||
|
end
|
||||||
|
if not route and bagFull then
|
||||||
|
local inW1 = world and world.id == "World1"
|
||||||
|
local at = (inW1 and guideMarker("GuideSell")) or nearestSell(pos, world)
|
||||||
|
route, hint, key = at and { at } or nil, "🎒 Сумка полна — продай рыбу!", inW1 and "Sell" or nil
|
||||||
|
end
|
||||||
guideHintText.Text = hint or ""
|
guideHintText.Text = hint or ""
|
||||||
local showHint = hint ~= nil and state == "idle"
|
local showHint = hint ~= nil and state == "idle"
|
||||||
if showHint and (hint ~= lastHint or not guideHint.Visible) then
|
if showHint and (hint ~= lastHint or not guideHint.Visible) then
|
||||||
@@ -1957,9 +2058,365 @@ RunService.RenderStepped:Connect(function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
---------------------------------------------------------------- цели на экране: серия, трекер, босс, покупка у скупщика
|
||||||
|
-- в отдельной функции: у основного скрипта почти исчерпан лимит в 200 локальных переменных
|
||||||
|
|
||||||
|
local refreshTracker, bestOffer, showOffer
|
||||||
|
local offerState = { bagWasFull = false } -- была ли сумка полной перед продажей (тогда первым предлагаем сумку побольше)
|
||||||
|
;(function()
|
||||||
|
local CENTER = Enum.TextXAlignment.Center
|
||||||
|
local RIGHT = Enum.TextXAlignment.Right
|
||||||
|
local FIRE = Color3.fromRGB(255, 150, 60)
|
||||||
|
|
||||||
|
-- серия улова — справа от HUD; полоска показывает, сколько осталось до того, как серия сгорит
|
||||||
|
local comboBox = new("Frame", {
|
||||||
|
Size = UDim2.fromOffset(140, 66), Position = UDim2.fromOffset(310, 10), BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||||
|
}, { corner(14), stroke(FIRE, 2, 0.1), gradient(Color3.fromRGB(110, 50, 20), C.bg, 90) })
|
||||||
|
local comboMultText = text({ Size = UDim2.new(1, 0, 0, 34), Position = UDim2.fromOffset(0, 3), Font = TITLE, TextSize = 28, TextXAlignment = CENTER, TextColor3 = Color3.fromRGB(255, 195, 95), TextStrokeTransparency = 0.5, Text = "", Parent = comboBox })
|
||||||
|
local comboSub = text({ Size = UDim2.new(1, 0, 0, 16), Position = UDim2.fromOffset(0, 36), Font = BODY2, TextSize = 12, TextXAlignment = CENTER, TextColor3 = C.muted, Text = "", Parent = comboBox })
|
||||||
|
local comboBack = new("Frame", { Size = UDim2.new(1, -20, 0, 5), Position = UDim2.new(0, 10, 1, -10), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = comboBox }, { corner(3) })
|
||||||
|
local comboFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = FIRE, BorderSizePixel = 0, Parent = comboBack }, { corner(3) })
|
||||||
|
|
||||||
|
local function refreshCombo(pop)
|
||||||
|
local n = player:GetAttribute("Combo") or 0
|
||||||
|
comboBox.Visible = n > 0
|
||||||
|
if n > 0 then
|
||||||
|
-- множитель следующей рыбы (сервер считает так же)
|
||||||
|
comboMultText.Text = ("🔥 x%.1f"):format(math.min(Config.Combo.max, 1 + Config.Combo.step * n))
|
||||||
|
comboSub.Text = ("серия %d · не упусти!"):format(n)
|
||||||
|
if pop then
|
||||||
|
popIn(comboBox, 0.6)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
player:GetAttributeChangedSignal("Combo"):Connect(function()
|
||||||
|
refreshCombo(true)
|
||||||
|
end)
|
||||||
|
refreshCombo(false)
|
||||||
|
|
||||||
|
-- правая колонка: босс и цели
|
||||||
|
local rightCol = new("Frame", {
|
||||||
|
Size = UDim2.fromOffset(300, 0), AutomaticSize = Enum.AutomaticSize.Y, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 10),
|
||||||
|
BackgroundTransparency = 1, Parent = gui,
|
||||||
|
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||||
|
|
||||||
|
local bossBox = new("Frame", { Size = UDim2.fromOffset(300, 78), BackgroundColor3 = WHITE, Visible = false, LayoutOrder = 1, Parent = rightCol },
|
||||||
|
{ corner(14), stroke(C.red, 2.5, 0.05), gradient(Color3.fromRGB(110, 30, 40), C.bg, 90) })
|
||||||
|
local bossTitle = text({ Size = UDim2.new(1, -80, 0, 24), Position = UDim2.fromOffset(12, 5), Font = TITLE, TextSize = 18, TextColor3 = Color3.fromRGB(255, 205, 120), TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = bossBox })
|
||||||
|
local bossTime = text({ Size = UDim2.fromOffset(60, 24), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 5), Font = TITLE, TextSize = 17, TextXAlignment = RIGHT, Text = "", Parent = bossBox })
|
||||||
|
local bossBack = new("Frame", { Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 32), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = bossBox }, { corner(9) })
|
||||||
|
local bossFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = WHITE, Parent = bossBack }, { corner(9), gradient(Color3.fromRGB(255, 120, 90), Color3.fromRGB(190, 30, 50), 0) })
|
||||||
|
local bossHpText = text({ Size = UDim2.fromScale(1, 1), TextSize = 12, TextXAlignment = CENTER, ZIndex = 2, TextStrokeTransparency = 0.5, Text = "", Parent = bossBack })
|
||||||
|
local bossHint = text({ Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 54), Font = BODY2, TextSize = 12, TextColor3 = C.muted, Text = "", Parent = bossBox })
|
||||||
|
|
||||||
|
local tracker = new("Frame", { Size = UDim2.fromOffset(300, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundColor3 = WHITE, LayoutOrder = 2, Parent = rightCol }, {
|
||||||
|
corner(14), stroke(C.line, 2, 0.35), gradient(C.panel2, C.bg, 90),
|
||||||
|
new("UIPadding", { PaddingLeft = UDim.new(0, 12), PaddingRight = UDim.new(0, 12), PaddingTop = UDim.new(0, 8), PaddingBottom = UDim.new(0, 10) }),
|
||||||
|
new("UIListLayout", { Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder }),
|
||||||
|
})
|
||||||
|
text({ Size = UDim2.new(1, 0, 0, 20), LayoutOrder = 0, Font = TITLE, TextSize = 16, TextColor3 = C.muted, Text = "🎯 Цели", Parent = tracker })
|
||||||
|
|
||||||
|
local function trackerLine(order, onClick)
|
||||||
|
local root = new("TextButton", { Size = UDim2.new(1, 0, 0, 38), BackgroundTransparency = 1, AutoButtonColor = false, Text = "", LayoutOrder = order, Parent = tracker })
|
||||||
|
local label = text({ Size = UDim2.new(1, 0, 0, 22), Font = BODY, TextSize = 14, RichText = true, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = root })
|
||||||
|
local back = new("Frame", { Size = UDim2.new(1, 0, 0, 8), Position = UDim2.fromOffset(0, 26), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = root }, { corner(4) })
|
||||||
|
local fill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = C.gold, BorderSizePixel = 0, Parent = back }, { corner(4) })
|
||||||
|
if onClick then
|
||||||
|
root.MouseButton1Click:Connect(onClick)
|
||||||
|
end
|
||||||
|
return { root = root, label = label, back = back, fill = fill }
|
||||||
|
end
|
||||||
|
local function setLine(line, txt, frac, color)
|
||||||
|
line.root.Visible = txt ~= nil
|
||||||
|
if not txt then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
line.label.Text = txt
|
||||||
|
line.back.Visible = frac ~= nil
|
||||||
|
line.root.Size = UDim2.new(1, 0, 0, frac and 38 or 22)
|
||||||
|
if frac then
|
||||||
|
line.fill.Size = UDim2.fromScale(math.clamp(frac, 0, 1), 1)
|
||||||
|
line.fill.BackgroundColor3 = color or C.gold
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local questLine = trackerLine(1, function()
|
||||||
|
questWin.open("quests")
|
||||||
|
end)
|
||||||
|
local buyLine = trackerLine(2, function()
|
||||||
|
shopWin.open("rods")
|
||||||
|
end)
|
||||||
|
local dexLine = trackerLine(3, function()
|
||||||
|
bagWin.open("dex")
|
||||||
|
end)
|
||||||
|
local bagLine = trackerLine(4, function()
|
||||||
|
bagWin.open("fish")
|
||||||
|
end)
|
||||||
|
|
||||||
|
local function plural(n, one, few, many)
|
||||||
|
local m10, m100 = n % 10, n % 100
|
||||||
|
if m10 == 1 and m100 ~= 11 then
|
||||||
|
return one
|
||||||
|
elseif m10 >= 2 and m10 <= 4 and (m100 < 12 or m100 > 14) then
|
||||||
|
return few
|
||||||
|
end
|
||||||
|
return many
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ближайшая покупка: следующая удочка, а когда все куплены — улучшение текущей
|
||||||
|
local function buyGoal()
|
||||||
|
local coins, lvl = player:GetAttribute("Coins") or 0, player:GetAttribute("Level") or 1
|
||||||
|
local owned = attrSet("OwnedRods")
|
||||||
|
for _, r in ipairs(Config.Rods) do
|
||||||
|
if not owned[r.id] then
|
||||||
|
if lvl < r.level then
|
||||||
|
return ("🎣 %s · 🔒 нужен ур. %d"):format(r.name, r.level), lvl / r.level, C.blue
|
||||||
|
elseif coins >= r.price then
|
||||||
|
return ("🎣 <b>%s</b> — можно купить!"):format(r.name), 1, C.green
|
||||||
|
end
|
||||||
|
return ("🎣 До «%s»: ещё <b>%s</b> 💰"):format(r.name, fmt(r.price - coins)), coins / r.price, C.gold
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
|
||||||
|
local rl = player:GetAttribute("RodLevel") or 0
|
||||||
|
if rod and rl < Config.RodUpgrade.maxLevel then
|
||||||
|
local cost = Config.UpgradeCost(rod, rl)
|
||||||
|
if coins >= cost then
|
||||||
|
return ("✨ Улучшение до +%d — можно купить!"):format(rl + 1), 1, C.green
|
||||||
|
end
|
||||||
|
return ("✨ До улучшения +%d: ещё <b>%s</b> 💰"):format(rl + 1, fmt(cost - coins)), coins / cost, C.gold
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- коллекция текущего мира: ближайшая незакрытая редкость
|
||||||
|
local function dexGoal()
|
||||||
|
local w = currentWorld() or Config.Worlds[1]
|
||||||
|
local zone = Config.Zones[w.id]
|
||||||
|
if not zone then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
for _, rarity in ipairs(Config.RarityOrder) do
|
||||||
|
local total, found, missing = 0, 0, {}
|
||||||
|
for _, f in ipairs(zone.fish) do
|
||||||
|
if f.rarity == rarity then
|
||||||
|
total += 1
|
||||||
|
if discovered[f.id] then
|
||||||
|
found += 1
|
||||||
|
else
|
||||||
|
table.insert(missing, f.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if total > 0 and not claimed[w.id .. ":" .. rarity] then
|
||||||
|
local r = Config.Rarities[rarity]
|
||||||
|
if found >= total then
|
||||||
|
return ("📖 Награда за «%s» ждёт! (C)"):format(r.name), 1, C.green
|
||||||
|
end
|
||||||
|
local left = total - found
|
||||||
|
local what = left == 1 and ("осталась <b>%s</b>"):format(missing[1]) or ("ещё %d %s"):format(left, plural(left, "вид", "вида", "видов"))
|
||||||
|
return ("📖 «%s»: %s"):format(r.name, what), found / total, r.color
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local lastQuestKey = nil
|
||||||
|
refreshTracker = function()
|
||||||
|
if chain and chain.steps[chain.step] then
|
||||||
|
local st = chain.steps[chain.step]
|
||||||
|
setLine(questLine, ("📜 %s · <b>%s/%s</b>"):format(questText(st.kind, st.goal), fmt(chain.progress), fmt(st.goal)), chain.progress / st.goal, C.gold)
|
||||||
|
local key = chain.name .. chain.step
|
||||||
|
if key ~= lastQuestKey then
|
||||||
|
if lastQuestKey then
|
||||||
|
popIn(questLine.root, 0.6)
|
||||||
|
end
|
||||||
|
lastQuestKey = key
|
||||||
|
end
|
||||||
|
else
|
||||||
|
setLine(questLine, nil)
|
||||||
|
end
|
||||||
|
setLine(buyLine, buyGoal())
|
||||||
|
setLine(dexLine, dexGoal())
|
||||||
|
local count, cap = player:GetAttribute("BagCount") or 0, player:GetAttribute("BagCap") or 10
|
||||||
|
if count >= cap then
|
||||||
|
setLine(bagLine, ("<font color=\"#FF8080\">🎒 Сумка полна — продай рыбу!</font>"), 1, C.red)
|
||||||
|
elseif count >= cap * 0.75 then
|
||||||
|
setLine(bagLine, ("🎒 Сумка почти полна: %d / %d"):format(count, cap), count / cap, Color3.fromRGB(255, 170, 80))
|
||||||
|
else
|
||||||
|
setLine(bagLine, nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
task.spawn(function()
|
||||||
|
while true do
|
||||||
|
refreshTracker()
|
||||||
|
task.wait(0.5)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- босс: полоска здоровья и таймер
|
||||||
|
local function bossWorld()
|
||||||
|
local id = workspace:GetAttribute("BossWorld")
|
||||||
|
return id and Config.Find(Config.Worlds, id)
|
||||||
|
end
|
||||||
|
RunService.RenderStepped:Connect(function()
|
||||||
|
if comboBox.Visible then
|
||||||
|
local ends = player:GetAttribute("ComboEnds")
|
||||||
|
local left = ends and (ends - workspace:GetServerTimeNow()) or 0
|
||||||
|
comboFill.Size = UDim2.fromScale(math.clamp(left / Config.Combo.timeout, 0, 1), 1)
|
||||||
|
comboFill.BackgroundColor3 = left < 15 and C.red or FIRE
|
||||||
|
end
|
||||||
|
local bw = bossWorld()
|
||||||
|
bossBox.Visible = bw ~= nil
|
||||||
|
if bw then
|
||||||
|
local hp, max = workspace:GetAttribute("BossHP") or 0, math.max(1, workspace:GetAttribute("BossMax") or 1)
|
||||||
|
bossTitle.Text = "👑 " .. (workspace:GetAttribute("BossName") or "Босс")
|
||||||
|
bossTime.Text = timeStr((workspace:GetAttribute("BossEnds") or 0) - workspace:GetServerTimeNow())
|
||||||
|
bossFill.Size = UDim2.fromScale(math.clamp(hp / max, 0, 1), 1)
|
||||||
|
bossHpText.Text = ("%d / %d"):format(hp, max)
|
||||||
|
local here = currentWorld()
|
||||||
|
bossHint.Text = (here and here.id == bw.id) and "Лови рыбу — каждая бьёт босса! Редкие сильнее" or ("Он в мире «%s» — жми M"):format(bw.name)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- босс в воде: огромная рыба кружит по озеру и выпрыгивает (у каждого игрока своя копия, только для вида)
|
||||||
|
local bossModel, bossModelWorld = nil, nil
|
||||||
|
local function bossPath(world)
|
||||||
|
if world.lakes and not world.holes then
|
||||||
|
local l = world.lakes[1]
|
||||||
|
return world.center + Vector3.new(l[1], 0, l[2]), l[3] * 0.5
|
||||||
|
elseif world.sea then
|
||||||
|
return world.center, world.sea + 35
|
||||||
|
end
|
||||||
|
return nil -- Мир 3: босс подо льдом, его не видно
|
||||||
|
end
|
||||||
|
RunService.Heartbeat:Connect(function()
|
||||||
|
local bw = bossWorld()
|
||||||
|
local id = bw and bw.id
|
||||||
|
if id ~= bossModelWorld then
|
||||||
|
if bossModel then
|
||||||
|
bossModel:Destroy()
|
||||||
|
bossModel = nil
|
||||||
|
end
|
||||||
|
bossModelWorld = id
|
||||||
|
local def = id and Config.Boss.worlds[id]
|
||||||
|
if def and bossPath(bw) then
|
||||||
|
bossModel = Models.buildFish(def.fish, def.mutation, def.scale, true)
|
||||||
|
for _, p in ipairs(bossModel:GetDescendants()) do
|
||||||
|
if p:IsA("BasePart") then
|
||||||
|
p.CanCollide, p.CanQuery, p.CanTouch = false, false, false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
bossModel.Name = "LakeBoss"
|
||||||
|
bossModel.Parent = workspace
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if bossModel then
|
||||||
|
local center, r = bossPath(bw)
|
||||||
|
local a = os.clock() * 0.35
|
||||||
|
local pos = center + Vector3.new(math.cos(a) * r, (bw.waterY or 0) - 0.8, math.sin(a) * r)
|
||||||
|
local jump = os.clock() % 7
|
||||||
|
if jump < 1.4 then
|
||||||
|
pos += Vector3.new(0, math.sin(jump / 1.4 * math.pi) * 9, 0)
|
||||||
|
end
|
||||||
|
local dir = Vector3.new(-math.sin(a), 0, math.cos(a))
|
||||||
|
-- голова рыбы смотрит в +X модели, поэтому разворачиваем на 90°
|
||||||
|
bossModel:PivotTo(CFrame.lookAt(pos, pos + dir) * CFrame.Angles(0, math.rad(90), 0))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- у скупщика после продажи: предложение купить то, на что уже хватает
|
||||||
|
local offerCard = new("Frame", {
|
||||||
|
Size = UDim2.fromOffset(440, 96), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -110),
|
||||||
|
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||||
|
}, { corner(16), stroke(C.green, 2.5, 0.05), gradient(Color3.fromRGB(30, 85, 55), C.bg, 90) })
|
||||||
|
local offerIcon = text({ Size = UDim2.fromOffset(70, 70), Position = UDim2.fromOffset(12, 13), TextSize = 46, TextXAlignment = CENTER, Text = "", Parent = offerCard })
|
||||||
|
local offerTitle = text({ Size = UDim2.new(1, -250, 0, 26), Position = UDim2.fromOffset(90, 12), Font = TITLE, TextSize = 19, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = offerCard })
|
||||||
|
local offerDesc = text({ Size = UDim2.new(1, -250, 0, 44), Position = UDim2.fromOffset(90, 40), Font = BODY2, TextSize = 13, TextColor3 = C.muted, TextWrapped = true, TextYAlignment = Enum.TextYAlignment.Top, Text = "", Parent = offerCard })
|
||||||
|
local offerItem, offerToken = nil, 0
|
||||||
|
local function hideOffer()
|
||||||
|
offerCard.Visible = false
|
||||||
|
offerItem = nil
|
||||||
|
end
|
||||||
|
local offerBuy = btn({ Size = UDim2.fromOffset(146, 52), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -14, 0.5, 0), BackgroundColor3 = C.green, TextSize = 18, Text = "", Parent = offerCard }, function()
|
||||||
|
if offerItem then
|
||||||
|
remote:FireServer("Buy", offerItem.kind, offerItem.id)
|
||||||
|
playUiSound(DING, 0.5)
|
||||||
|
end
|
||||||
|
hideOffer()
|
||||||
|
end)
|
||||||
|
btn({ Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, -18, 0, -8), BackgroundColor3 = C.red, Text = "✕", TextSize = 14, Parent = offerCard }, hideOffer)
|
||||||
|
|
||||||
|
bestOffer = function(bagWasFull)
|
||||||
|
local coins, lvl = player:GetAttribute("Coins") or 0, player:GetAttribute("Level") or 1
|
||||||
|
local options = {}
|
||||||
|
local bag = Config.Find(Config.Bags, player:GetAttribute("Bag") or "Pouch")
|
||||||
|
local ownedBags = attrSet("OwnedBags")
|
||||||
|
for _, b in ipairs(Config.Bags) do
|
||||||
|
if not ownedBags[b.id] and b.capacity > (bag and bag.capacity or 0) and lvl >= b.level and coins >= b.price then
|
||||||
|
table.insert(options, { kind = "Bag", id = b.id, icon = "🎒", title = b.name, price = b.price, prio = bagWasFull and 3 or 1,
|
||||||
|
desc = ("%d мест вместо %d — реже бегать к скупщику"):format(b.capacity, bag and bag.capacity or 0) })
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local ownedRods = attrSet("OwnedRods")
|
||||||
|
local bestRod = nil
|
||||||
|
for _, r in ipairs(Config.Rods) do
|
||||||
|
if not ownedRods[r.id] and lvl >= r.level and coins >= r.price then
|
||||||
|
bestRod = r -- удочки по возрастанию цены: берём самую сильную из доступных
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if bestRod then
|
||||||
|
table.insert(options, { kind = "Rod", id = bestRod.id, icon = "🎣", title = bestRod.name, price = bestRod.price, prio = 2,
|
||||||
|
desc = ("Удача +%d%%, клюёт быстрее, шире зелёная зона"):format(bestRod.luck * 100) })
|
||||||
|
end
|
||||||
|
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
|
||||||
|
local rl = player:GetAttribute("RodLevel") or 0
|
||||||
|
if rod and rl < Config.RodUpgrade.maxLevel then
|
||||||
|
local cost = Config.UpgradeCost(rod, rl)
|
||||||
|
if coins >= cost then
|
||||||
|
table.insert(options, { kind = "Upgrade", id = rod.id, icon = "✨", title = ("%s +%d"):format(rod.name, rl + 1), price = cost, prio = 1.5,
|
||||||
|
desc = "Больше удачи и шире зелёная зона" })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local potion = Config.Potions[1]
|
||||||
|
if coins >= potion.price and (player:GetAttribute("BoostBonus") or 0) == 0 then
|
||||||
|
table.insert(options, { kind = "Potion", id = potion.id, icon = "🧪", title = potion.name, price = potion.price, prio = 0.5,
|
||||||
|
desc = ("+%d%% удачи на %d мин"):format(potion.bonus * 100, potion.duration / 60) })
|
||||||
|
end
|
||||||
|
table.sort(options, function(x, y)
|
||||||
|
return x.prio > y.prio
|
||||||
|
end)
|
||||||
|
return options[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
showOffer = function(o)
|
||||||
|
offerToken += 1
|
||||||
|
local my = offerToken
|
||||||
|
offerItem = o
|
||||||
|
offerIcon.Text = o.icon
|
||||||
|
offerTitle.Text = o.title
|
||||||
|
offerDesc.Text = o.desc
|
||||||
|
offerBuy.Text = ("Купить · %s 💰"):format(fmt(o.price))
|
||||||
|
offerCard.Visible = true
|
||||||
|
popIn(offerCard, 0.6)
|
||||||
|
task.delay(9, function()
|
||||||
|
if my == offerToken then
|
||||||
|
hideOffer()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
player:GetAttributeChangedSignal("BagCount"):Connect(function()
|
||||||
|
if (player:GetAttribute("BagCount") or 0) >= (player:GetAttribute("BagCap") or math.huge) then
|
||||||
|
offerState.bagWasFull = true
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)()
|
||||||
|
|
||||||
---------------------------------------------------------------- события от сервера
|
---------------------------------------------------------------- события от сервера
|
||||||
|
|
||||||
remote.OnClientEvent:Connect(function(action, a, b, c)
|
remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||||
if action == "Notify" then
|
if action == "Notify" then
|
||||||
notify(a, b)
|
notify(a, b)
|
||||||
elseif action == "Cast" then
|
elseif action == "Cast" then
|
||||||
@@ -1993,17 +2450,55 @@ remote.OnClientEvent:Connect(function(action, a, b, c)
|
|||||||
end
|
end
|
||||||
floatText("+" .. fmt(a) .. " 💰", C.gold)
|
floatText("+" .. fmt(a) .. " 💰", C.gold)
|
||||||
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||||
|
-- монеты приходят атрибутом чуть позже события, поэтому предложение — с задержкой
|
||||||
|
local wasFull = offerState.bagWasFull
|
||||||
|
offerState.bagWasFull = false
|
||||||
|
-- продать можно и с заброшенной удочкой; не мешаем только мини-игре поклёвки (она тоже внизу экрана)
|
||||||
|
task.delay(0.5, function()
|
||||||
|
local t0 = os.clock()
|
||||||
|
while state == "bite" and os.clock() - t0 < 10 do
|
||||||
|
task.wait(0.3)
|
||||||
|
end
|
||||||
|
local o = state ~= "bite" and bestOffer(wasFull)
|
||||||
|
if o then
|
||||||
|
showOffer(o)
|
||||||
|
end
|
||||||
|
end)
|
||||||
elseif action == "Inventory" then
|
elseif action == "Inventory" then
|
||||||
inventory = a or {}
|
inventory = a or {}
|
||||||
discovered = b or {}
|
discovered = b or {}
|
||||||
claimed = c or {}
|
claimed = c or {}
|
||||||
bagWin.refresh()
|
bagWin.refresh()
|
||||||
refreshDots()
|
refreshDots()
|
||||||
|
refreshTracker()
|
||||||
elseif action == "Quests" then
|
elseif action == "Quests" then
|
||||||
quests = a or {}
|
chain = a
|
||||||
daily = b or daily
|
daily = b or daily
|
||||||
questWin.refresh()
|
questWin.refresh()
|
||||||
refreshDots()
|
refreshDots()
|
||||||
|
refreshTracker()
|
||||||
|
elseif action == "QuestDone" then
|
||||||
|
notify(("✅ %s +%s 💰 +%s XP"):format(questText(a, b), fmt(c), fmt(d or 0)), Color3.fromRGB(120, 255, 140))
|
||||||
|
playUiSound(DING, 0.6)
|
||||||
|
elseif action == "ChainDone" then
|
||||||
|
floatText("🏆 Цепочка пройдена!", C.gold)
|
||||||
|
notify(("🎁 %s: +%s 💰 +%s XP%s"):format(a, fmt(b), fmt(c), d and (" + " .. d) or ""), C.gold)
|
||||||
|
playUiSound(DING, 0.8)
|
||||||
|
elseif action == "ComboLost" then
|
||||||
|
notify(("💔 Серия из %d прервана"):format(a), Color3.fromRGB(255, 130, 110))
|
||||||
|
elseif action == "BossStart" then
|
||||||
|
notify(("👑 %s в мире «%s»! Ловите всем сервером"):format(a, b), C.gold)
|
||||||
|
playUiSound(DING, 0.8)
|
||||||
|
elseif action == "BossHit" then
|
||||||
|
floatText(("⚔ -%d боссу"):format(a), Color3.fromRGB(255, 130, 100))
|
||||||
|
elseif action == "BossDone" then
|
||||||
|
if a then
|
||||||
|
notify(("🏆 %s пойман всем сервером!%s"):format(b, c and (" Лучший: " .. c) or ""), C.gold)
|
||||||
|
else
|
||||||
|
notify(("🌊 %s ушёл на глубину…"):format(b), C.muted)
|
||||||
|
end
|
||||||
|
elseif action == "BossReward" then
|
||||||
|
notify(("🎁 За босса: +%s 💰 +%s XP%s"):format(fmt(a), fmt(b), c and (" + " .. c) or ""), Color3.fromRGB(120, 255, 140))
|
||||||
elseif action == "OpenShop" then
|
elseif action == "OpenShop" then
|
||||||
shopWin.open("rods")
|
shopWin.open("rods")
|
||||||
elseif action == "OpenQuests" then
|
elseif action == "OpenQuests" then
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
-- Команда для Command Bar (строка внизу Studio):
|
-- Команда для Command Bar (строка внизу Studio):
|
||||||
-- require(game.ServerScriptService.World1Builder:Clone()).bake()
|
-- require(game.ServerScriptService.World1Builder:Clone()).bake()
|
||||||
-- bake() стирает старую папку Workspace.World1Map и террейн этого мира и строит всё заново.
|
-- bake() стирает старую папку Workspace.World1Map и террейн этого мира и строит всё заново.
|
||||||
-- Если папки World1Map в плейсе нет, MapBuilder при запуске игры строит уровень этим же модулем.
|
-- Обычно уровень собирается вместе со всей картой: WorldBuilder.bake() (см. README).
|
||||||
|
-- Если папки World1Map в плейсе нет, WorldBuilder строит уровень этим же модулем.
|
||||||
--
|
--
|
||||||
-- Что нужно игре от уровня (не удаляйте и не переименовывайте):
|
-- Что нужно игре от уровня (не удаляйте и не переименовывайте):
|
||||||
-- маркеры World1Spawn, GuideFishSpot, GuideSell, World1NpcSeller, World1NpcGrandpa — невидимые
|
-- маркеры World1Spawn, GuideFishSpot, GuideSell, World1NpcSeller, World1NpcGrandpa — невидимые
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
+2261
-1371
File diff suppressed because it is too large.
Load diff
@@ -63,6 +63,9 @@ Config.Worlds = {
|
|||||||
{ -45, 15 }, { 55, -25 }, { 75, -5 }, { 40, -50 }, { 5, -75 }, { -15, -60 }, { 25, -80 },
|
{ -45, 15 }, { 55, -25 }, { 75, -5 }, { 40, -50 }, { 5, -75 }, { -15, -60 }, { 25, -80 },
|
||||||
},
|
},
|
||||||
holeRadius = 6,
|
holeRadius = 6,
|
||||||
|
-- цвета террейна общие на весь плейс, а в нём сохранены цвета «Тихого озера» (зелёный Snow) —
|
||||||
|
-- поэтому снег фьорда задаём явно
|
||||||
|
terrainColors = { Snow = Color3.fromRGB(205, 212, 228) },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id = "World4", name = "Вулкан", icon = "🌋", level = 30, mult = 30, soon = true,
|
id = "World4", name = "Вулкан", icon = "🌋", level = 30, mult = 30, soon = true,
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -4,7 +4,8 @@
|
|||||||
-- Команда для Command Bar (строка внизу Studio):
|
-- Команда для Command Bar (строка внизу Studio):
|
||||||
-- require(game.ServerScriptService.World1Builder:Clone()).bake()
|
-- require(game.ServerScriptService.World1Builder:Clone()).bake()
|
||||||
-- bake() стирает старую папку Workspace.World1Map и террейн этого мира и строит всё заново.
|
-- bake() стирает старую папку Workspace.World1Map и террейн этого мира и строит всё заново.
|
||||||
-- Если папки World1Map в плейсе нет, MapBuilder при запуске игры строит уровень этим же модулем.
|
-- Обычно уровень собирается вместе со всей картой: WorldBuilder.bake() (см. README).
|
||||||
|
-- Если папки World1Map в плейсе нет, WorldBuilder строит уровень этим же модулем.
|
||||||
--
|
--
|
||||||
-- Что нужно игре от уровня (не удаляйте и не переименовывайте):
|
-- Что нужно игре от уровня (не удаляйте и не переименовывайте):
|
||||||
-- маркеры World1Spawn, GuideFishSpot, GuideSell, World1NpcSeller, World1NpcGrandpa — невидимые
|
-- маркеры World1Spawn, GuideFishSpot, GuideSell, World1NpcSeller, World1NpcGrandpa — невидимые
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user