Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dfded2fe1 | ||
|
|
86cb60fde0 | ||
|
|
631a6c03e4 | ||
|
|
5722b6180a | ||
|
|
8cf3be75c2 | ||
|
|
3402fe5edb | ||
|
|
860a6d2220 | ||
|
|
eade0cd2ae | ||
|
|
9682ed0987 | ||
|
|
306cbfcbef |
No files matched your search
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"Roblox_Studio": {
|
||||||
|
"type": "stdio",
|
||||||
|
"command": "cmd.exe",
|
||||||
|
"args": ["/c", "cd /d %LOCALAPPDATA%\\Roblox && .\\mcp.bat"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+2381191
-3724
File diff suppressed because it is too large.
Load diff
@@ -17,6 +17,26 @@ 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/WorldBuilder.lua` («Тихое озеро» он берёт из `World1Builder.lua`). Порядок:
|
||||||
|
|
||||||
|
1. Откройте плейс в Studio и подключите Rojo (**Plugins → Rojo → Connect**).
|
||||||
|
2. В **Command Bar** выполните:
|
||||||
|
```lua
|
||||||
|
require(game.ServerScriptService.WorldBuilder:Clone()).bake()
|
||||||
|
```
|
||||||
|
В `Workspace` появится папка `FishingMap` (лобби и миры: детали и модели), а на месте миров — террейн.
|
||||||
|
3. Сохраните плейс (**Ctrl+S**). Дальше двигайте, удаляйте и добавляйте объекты как обычно, в том числе модели из Toolbox. Игра возьмёт карту из плейса и не будет генерировать её заново.
|
||||||
|
|
||||||
|
Повторный `bake()` стирает `FishingMap` и террейн миров и строит всё заново, ручные правки при этом пропадут. Исключение — «Тихое озеро» (`FishingMap/World1Map`): его `bake()` переносит в новую карту как есть, вместе с террейном. Чтобы собрать и его заново, сначала удалите `World1Map`.
|
||||||
|
|
||||||
|
Цвета материалов террейна общие на весь плейс, и в нём сохранены цвета «Тихого озера» (зелёный `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. Откройте плейс в Roblox Studio (например, шаблон **Baseplate**).
|
1. Откройте плейс в Roblox Studio (например, шаблон **Baseplate**).
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# 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 map is baked in Studio
|
||||||
|
# (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).
|
||||||
|
param([switch]$Force)
|
||||||
|
|
||||||
$root = $PSScriptRoot
|
$root = $PSScriptRoot
|
||||||
$enc = New-Object System.Text.UTF8Encoding($false)
|
$enc = New-Object System.Text.UTF8Encoding($false)
|
||||||
@@ -9,6 +13,8 @@ $scripts = @(
|
|||||||
@{ Name = 'GameModels'; Class = 'ModuleScript'; Service = 'ReplicatedStorage'; Path = 'src\ReplicatedStorage\GameModels.lua'; Rbxmx = '2_GameModels_ReplicatedStorage.rbxmx' },
|
@{ Name = 'GameModels'; Class = 'ModuleScript'; Service = 'ReplicatedStorage'; Path = 'src\ReplicatedStorage\GameModels.lua'; Rbxmx = '2_GameModels_ReplicatedStorage.rbxmx' },
|
||||||
@{ 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 = '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' }
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -36,7 +42,13 @@ $place = $header + "`n" +
|
|||||||
(ServiceItem 'ServerScriptService' $sss) +
|
(ServiceItem 'ServerScriptService' $sss) +
|
||||||
(ServiceItem 'StarterPlayer' (ServiceItem 'StarterPlayerScripts' $sps)) +
|
(ServiceItem 'StarterPlayer' (ServiceItem 'StarterPlayerScripts' $sps)) +
|
||||||
"</roblox>`n"
|
"</roblox>`n"
|
||||||
[System.IO.File]::WriteAllText((Join-Path $root 'Fishing.rbxlx'), $place, $enc)
|
$placePath = Join-Path $root 'Fishing.rbxlx'
|
||||||
|
if ($Force -or -not (Test-Path $placePath)) {
|
||||||
|
[System.IO.File]::WriteAllText($placePath, $place, $enc)
|
||||||
|
Write-Host "Built Fishing.rbxlx"
|
||||||
|
} else {
|
||||||
|
Write-Host "Fishing.rbxlx already exists - left untouched (it holds the map built in Studio; scripts come via Rojo). Use -Force to recreate."
|
||||||
|
}
|
||||||
|
|
||||||
# --- install/*.rbxmx and install/INSTALL.lua ---
|
# --- install/*.rbxmx and install/INSTALL.lua ---
|
||||||
$installDir = Join-Path $root 'install'
|
$installDir = Join-Path $root 'install'
|
||||||
@@ -52,7 +64,7 @@ foreach ($s in $scripts) {
|
|||||||
$xml = $header + "`n" + (ScriptItem $s) + "</roblox>`n"
|
$xml = $header + "`n" + (ScriptItem $s) + "</roblox>`n"
|
||||||
[System.IO.File]::WriteAllText((Join-Path $installDir $s.Rbxmx), $xml, $enc)
|
[System.IO.File]::WriteAllText((Join-Path $installDir $s.Rbxmx), $xml, $enc)
|
||||||
}
|
}
|
||||||
[void]$sb.Append("print('DONE! 5 scripts installed. Press Play (F5).')`n")
|
[void]$sb.Append("print('DONE! $($scripts.Count) scripts installed. Press Play (F5).')`n")
|
||||||
[System.IO.File]::WriteAllText((Join-Path $installDir 'INSTALL.lua'), $sb.ToString(), $enc)
|
[System.IO.File]::WriteAllText((Join-Path $installDir 'INSTALL.lua'), $sb.ToString(), $enc)
|
||||||
|
|
||||||
Write-Host "Built Fishing.rbxlx and install/"
|
Write-Host "Built install/"
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Low-poly landscape — 2026-11-03
|
||||||
|
|
||||||
|
The baked scene uses flat, matte MaterialVariants for Snow (olive grass), Salt
|
||||||
|
(ochre paths), and Slate/Rock (cool gray stone). Color and roughness use the
|
||||||
|
opaque white Roblox built-in `rbxasset://textures/SelfView/whiteRect.png` map;
|
||||||
|
normal and metalness maps are empty. Geometry supplies the facets.
|
||||||
|
|
||||||
|
## Toolbox credits
|
||||||
|
|
||||||
|
- **FracturedSkies** — [Low Poly Rock Pack FREE](https://create.roblox.com/store/asset/2128776869), used for shoreline boulders and cliff foot rocks. Credit is also stored on `World1Map.LowPolyRockwork`.
|
||||||
|
- **DaveCam456** — [Low-Poly Rocky Cliff](https://create.roblox.com/store/asset/11751641277), used for cliff faces.
|
||||||
|
- **DaveCam456** — [Low-Poly Rocky Mountain Border](https://create.roblox.com/store/asset/11751636142), used for perimeter ridges.
|
||||||
|
|
||||||
|
Imported templates are in `ServerStorage.LandscapeAssetLibrary`; only anchored
|
||||||
|
geometry is copied into the landscape. No imported scripts are used.
|
||||||
|
|
||||||
|
## Reapply
|
||||||
|
|
||||||
|
`install/LOW_POLY_LANDSCAPE.lua` applies materials and places rock meshes onto an
|
||||||
|
existing baked World1Map. It requires the above templates in the asset library.
|
||||||
|
The source palette and the live FishConfig/FishingClient were updated together
|
||||||
|
so entering World1 does not restore the old grass colors.
|
||||||
|
|
||||||
|
Studio changes must be saved with the place. The filesystem build does not
|
||||||
|
automatically serialize the edited Terrain or imported meshes from Studio.
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
# Модели из Toolbox для локации «Тихое озеро»
|
||||||
|
|
||||||
|
Подобраны 2026-11-03 по макету. Как отбирал:
|
||||||
|
|
||||||
|
- искал через официальный поиск Creator Store;
|
||||||
|
- брал только **бесплатные модели без скриптов**;
|
||||||
|
- у модели должно быть **не меньше 8 лайков**, лайков минимум в 4 раза больше, чем дизлайков;
|
||||||
|
- каждую модель проверил по превью;
|
||||||
|
- `tri` — число треугольников, чем меньше, тем легче для FPS.
|
||||||
|
|
||||||
|
Ссылка на модель: `https://create.roblox.com/store/asset/<ID>`.
|
||||||
|
|
||||||
|
## Основной набор (подходят по стилю)
|
||||||
|
|
||||||
|
| Элемент макета | Модель | ID | tri | 👍/👎 | Комментарий |
|
||||||
|
|---|---|---|---|---|---|
|
||||||
|
| Сосны (лес, задний план) | Low-Poly Pine Trees Asset Pack | 8559395722 | 26 476 (весь пак) | 67/3 | Ярусные мультяшные ёлки, почти как на макете. Основа леса. |
|
||||||
|
| Лиственные деревья у воды | Yasu's Stylized Tree Pack | 79689531752352 | 40 144 (весь пак) | 400/0 | Самый популярный стилизованный пак. Брать 2–3 вида. |
|
||||||
|
| Простая ёлка (дальний фон) | Pine Tree Cartoon | 8611822577 | 276 | 9/1 | Очень лёгкая: для дальних рядов леса. |
|
||||||
|
| Бревенчатый дом | Log cabin | 4696763099 | 4 424 | 18/2 | Дом из брёвен с крыльцом. Крышу перекрасить в тёмно-зелёный, трубу добавить. |
|
||||||
|
| Лавка рыбака (скупка) | Shop Stand | 16407780460 | 1 752 | 44/6 | Прилавок под навесом с ящиками. Навес перекрасить в зелёно-кремовую полоску. |
|
||||||
|
| Лавка (вариант с тентом) | tent market stall | 10970560969 | 40 032 | 10/0 | Полосатый тент как на макете, но тяжёлая. |
|
||||||
|
| Фонарь на столбе | Low poly Street Lantern | 8990192177 | 700 | 99/1 | Столб с висящим фонарём, ровно как у лавки на макете. |
|
||||||
|
| Сваи с канатом на причале | Rope-Fence | 7845357309 | 1 344 | 10/0 | Деревянный столб с канатом, похож на кнехты с макета. |
|
||||||
|
| Причал | Realistic Dock | 1902636966 | 1 104 | 36/4 | Деревянные мостки на сваях. Подойдут для правых мостков. Главный причал лучше оставить нашим: к нему привязаны обучение и заброс. |
|
||||||
|
| Лодка с вёслами | Boat Model | 9617142471 | 6 404 | 166/34 | Деревянная лодка в мультяшном стиле. |
|
||||||
|
| Лодка (запасной вариант) | boat | 704501925 | 1 372 | 86/14 | Легче, но проще. |
|
||||||
|
| Водопад | Low Poly Waterfall | 16444908253 | — | 96/4 | Мультяшный голубой водопад, лучшее совпадение со стилем. |
|
||||||
|
| Арочный мост над водопадом | Wooden Bridge | 11935185367 | 2 923 | 192/8 | Деревянный арочный мост с перилами, как на макете. |
|
||||||
|
| Смотровая вышка на холме | Fire Lookout Tower | 937377053 | 44 382 | 18/2 | Деревянная вышка с домиком наверху. Тяжёлая, но она одна. Флаг с рыбой добавить отдельно. |
|
||||||
|
| Валуны у воды | Low Poly Rock Pack [FREE] | 2128776869 | 750 | 19/1 | Лёгкие серые low-poly камни. |
|
||||||
|
| Скалы / горы на горизонте | Low-Poly Rocky Mountain Border | 11751636142 | 557 | 74/6 | Серые зубчатые скалы. Годятся и для скалы водопада, и для гор за краем мира (крупно, без коллизии). |
|
||||||
|
| Камыш (рогоз) | Pond Cattail | 216373354 | 924 | 56/4 | Одобрено Roblox (Endorsed). Ставить группами. |
|
||||||
|
| Тростник | Reeds | 217647458 | 5 712 | 64/6 | Одобрено Roblox (Endorsed). |
|
||||||
|
| Кувшинки с цветами | lily pad | 13503798787 | 2 493 | 40/0 | Розовые цветы на листьях. |
|
||||||
|
| Забор вдоль тропинки | Farm Fence | 4831942116 | 804 | 658/42 | Деревянный забор из жердей. |
|
||||||
|
| Бочки и ящики | Barrels and Crates | 13018691172 | 18 252 | 50/0 | Бочки и ящики к лавке и на причал. |
|
||||||
|
| Ящик для снастей | Toolbox | 11464827472 | 464 | 10/0 | Ящик с ручкой. Перекрасить в серо-зелёный. |
|
||||||
|
| Костёр | Campfire | 1084175510 | 372 | 10/0 | Лёгкий, если нужен костёр у домика. |
|
||||||
|
|
||||||
|
## Чего в Toolbox нет — делаем сами из деталей
|
||||||
|
|
||||||
|
| Элемент | Как сделать |
|
||||||
|
|---|---|
|
||||||
|
| Вывеска с силуэтом рыбы над лавкой | Доска + наш `surfaceText` с эмодзи 🐟 или силуэт из 3–4 Part'ов |
|
||||||
|
| Тёмно-зелёное знамя с белой рыбой (на столбе и на вышке) | Part `Fabric` тёмно-зелёный + `surfaceText("🐟")` |
|
||||||
|
| Поплавки и воблеры на прилавке | Маленькие шары `ball()` красно-белые, цветные «рыбки» из 2 Part'ов |
|
||||||
|
| Дым из труб | `ParticleEmitter` с `rbxasset://textures/particles/smoke_main.dds` |
|
||||||
|
| Тени рыб под водой | Тёмные полупрозрачные силуэты, медленно плавают (из нашего `Models.buildFish`) |
|
||||||
|
| Пена и брызги у водопада | Белые сплюснутые шары + `ParticleEmitter` |
|
||||||
|
|
||||||
|
## Безопасность — важно
|
||||||
|
|
||||||
|
- Модели из Toolbox бывают с **бэкдорами** — скрытыми скриптами, через которые чужой человек может управлять игрой. Пример из этого поиска: модель «Low Poly Log» (117538820047265) в описании пишет «No scripts», а внутри у неё 2 скрипта и звук. **Её не брать.**
|
||||||
|
- Все модели в таблице выше по данным Creator Store **без скриптов**. Скрипт импорта ниже всё равно удаляет любые скрипты из вставленных моделей.
|
||||||
|
- После вставки загляните в окно **Output**: скрипт напишет, сколько скриптов удалил. Если у модели из таблицы вдруг найдутся скрипты, её лучше не использовать.
|
||||||
|
|
||||||
|
## Как перенести модели в проект
|
||||||
|
|
||||||
|
Наш плейс `Fishing.rbxlx` пересобирается из `src/`. Если просто вставить модели в Studio и сохранить, при следующей сборке они пропадут. Поэтому порядок такой.
|
||||||
|
|
||||||
|
### Шаг 1. Вставить все модели одной командой
|
||||||
|
|
||||||
|
Откройте плейс в Studio, вставьте этот код в **Command Bar** (строка внизу) и нажмите **Enter**. Модели появятся в `ServerStorage → Assets`, все скрипты из них будут удалены.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
local ids = {
|
||||||
|
PinePack = 8559395722, YasuTrees = 79689531752352, PineCartoon = 8611822577,
|
||||||
|
LogCabin = 4696763099, ShopStand = 16407780460, StreetLantern = 8990192177,
|
||||||
|
RopePost = 7845357309, SideDock = 1902636966, Rowboat = 9617142471,
|
||||||
|
Waterfall = 16444908253, Bridge = 11935185367, Lookout = 937377053,
|
||||||
|
Rocks = 2128776869, Mountains = 11751636142, Cattail = 216373354, Reeds = 217647458,
|
||||||
|
LilyPad = 13503798787, Fence = 4831942116, BarrelsCrates = 13018691172,
|
||||||
|
TackleBox = 11464827472, Campfire = 1084175510,
|
||||||
|
}
|
||||||
|
local folder = game.ServerStorage:FindFirstChild("Assets") or Instance.new("Folder")
|
||||||
|
folder.Name = "Assets"
|
||||||
|
folder.Parent = game.ServerStorage
|
||||||
|
for name, id in pairs(ids) do
|
||||||
|
local ok, objs = pcall(function() return game:GetObjects("rbxassetid://" .. id) end)
|
||||||
|
if ok and objs[1] then
|
||||||
|
local m = Instance.new("Model")
|
||||||
|
m.Name = name
|
||||||
|
for _, o in ipairs(objs) do o.Parent = m end
|
||||||
|
local removed = 0
|
||||||
|
for _, d in ipairs(m:GetDescendants()) do
|
||||||
|
if d:IsA("LuaSourceContainer") then d:Destroy(); removed += 1 end
|
||||||
|
end
|
||||||
|
m.Parent = folder
|
||||||
|
print(("OK %s (%d) скриптов удалено: %d"):format(name, id, removed))
|
||||||
|
else
|
||||||
|
warn("НЕ ВСТАВИЛОСЬ", name, id, objs)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Шаг 2. Посмотреть и выбрать
|
||||||
|
|
||||||
|
Перетащите модели из `ServerStorage/Assets` в Workspace и посмотрите вблизи. Неподходящие удалите.
|
||||||
|
|
||||||
|
### Шаг 3. Сохранить в проект
|
||||||
|
|
||||||
|
Правый клик по папке `Assets` → **Save to File…** → сохраните как `C:\Fishing\assets\Assets.rbxmx` (формат XML, `.rbxmx`). Дальше я:
|
||||||
|
|
||||||
|
- подключу этот файл в `build.ps1` и `default.project.json`, чтобы модели попадали в `ServerStorage` при каждой сборке;
|
||||||
|
- научу `MapBuilder` расставлять копии моделей по локации (вместо части деталей), с перекраской и масштабом под макет.
|
||||||
|
|
||||||
|
## Про производительность
|
||||||
|
|
||||||
|
Самые тяжёлые модели в списке: вышка (44 тыс. треугольников), тент-лавка (40 тыс.), пак Yasu (40 тыс. на весь пак). Их ставить по одной штуке.
|
||||||
|
|
||||||
|
Много копий можно делать только с лёгких моделей: «Pine Tree Cartoon», камни, камыш.
|
||||||
@@ -12,17 +12,43 @@ 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.2, water = Color3.fromRGB(40, 170, 165),
|
clock = 16.2,
|
||||||
waterTransparency = 0.6,
|
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
|
||||||
|
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
|
||||||
|
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; здесь они перекрашиваются
|
||||||
|
terrainColors = {
|
||||||
|
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),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
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, -- всё дальше этого радиуса от центра — море
|
||||||
},
|
},
|
||||||
@@ -30,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 = {
|
||||||
@@ -38,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,
|
||||||
@@ -284,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
|
||||||
|
|
||||||
---------------------------------------------------------------- телепорт
|
---------------------------------------------------------------- телепорт
|
||||||
@@ -1122,7 +1190,7 @@ local function teleportTo(player, worldId)
|
|||||||
markerName = world.id .. "Spawn"
|
markerName = world.id .. "Spawn"
|
||||||
end
|
end
|
||||||
local map = workspace:FindFirstChild("FishingMap")
|
local map = workspace:FindFirstChild("FishingMap")
|
||||||
local m = map and map:FindFirstChild(markerName)
|
local m = map and map:FindFirstChild(markerName, true) -- маркеры могут лежать в папках уровня (World1Map)
|
||||||
if m then
|
if m then
|
||||||
stopFishing(player, true)
|
stopFishing(player, true)
|
||||||
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
|
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
|
||||||
@@ -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,110 +1553,136 @@ 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)
|
|
||||||
|
|
||||||
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
-- то, что мир может поменять под себя (оттенок, цвета травы и песка); вода не трогается — она из свойств Terrain
|
||||||
local lakeDefaults
|
local DEFAULT_LOOK = { tint = Color3.new(1, 1, 1) }
|
||||||
|
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 lake = world and world.id == "World1"
|
local clock = (world and world.clock) or 14.5
|
||||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
||||||
local bloom = Lighting:FindFirstChildOfClass("BloomEffect")
|
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||||
local grade = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
if cc then
|
||||||
local rays = Lighting:FindFirstChildOfClass("SunRaysEffect")
|
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
||||||
if not lakeDefaults then
|
|
||||||
lakeDefaults = {
|
|
||||||
ambient = Lighting.Ambient, outdoor = Lighting.OutdoorAmbient,
|
|
||||||
brightness = Lighting.Brightness, exposure = Lighting.ExposureCompensation,
|
|
||||||
latitude = Lighting.GeographicLatitude, reflectance = terrain.WaterReflectance,
|
|
||||||
haze = atm and atm.Haze or 0.6, decay = atm and atm.Decay or Color3.fromRGB(110, 140, 175),
|
|
||||||
bloom = bloom and bloom.Intensity or 0.5, threshold = bloom and bloom.Threshold or 1.4,
|
|
||||||
tint = grade and grade.TintColor or Color3.new(1, 1, 1),
|
|
||||||
contrast = grade and grade.Contrast or 0.06, rays = rays and rays.Intensity or 0.05,
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
local base = lakeDefaults
|
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
||||||
TweenService:Create(Lighting, TweenInfo.new(2), {
|
if not defaultTerrainColors then
|
||||||
ClockTime = (world and world.clock) or 14.5,
|
defaultTerrainColors = {}
|
||||||
Ambient = lake and Color3.fromRGB(108, 100, 85) or base.ambient,
|
for _, name in ipairs({ "Snow", "Salt", "Mud", "Sand", "Rock", "Slate" }) do
|
||||||
OutdoorAmbient = lake and Color3.fromRGB(157, 160, 144) or base.outdoor,
|
defaultTerrainColors[name] = terrain:GetMaterialColor(Enum.Material[name])
|
||||||
Brightness = lake and 2.5 or base.brightness,
|
end
|
||||||
ExposureCompensation = lake and 0.08 or base.exposure,
|
end
|
||||||
GeographicLatitude = lake and 35 or base.latitude,
|
local colors = (world and world.terrainColors) or {}
|
||||||
}):Play()
|
for name, def in pairs(defaultTerrainColors) do
|
||||||
terrain.WaterColor = (world and world.water) or defaultWater
|
terrain:SetMaterialColor(Enum.Material[name], colors[name] or def)
|
||||||
terrain.WaterTransparency = (world and world.waterTransparency) or 0.15
|
end
|
||||||
terrain.WaterReflectance = lake and 0.12 or base.reflectance
|
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||||
if atm then
|
if atm then
|
||||||
local frost = world and world.id == "World3"
|
local frost = world and world.id == "World3"
|
||||||
TweenService:Create(atm, TweenInfo.new(2), {
|
TweenService:Create(atm, TweenInfo.new(2), {
|
||||||
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
Density = frost and 0.38 or 0.25,
|
||||||
Color = lake and Color3.fromRGB(205, 222, 232) or (frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232)),
|
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
||||||
Decay = lake and Color3.fromRGB(155, 173, 177) or base.decay,
|
|
||||||
Haze = lake and 1 or base.haze,
|
|
||||||
}):Play()
|
}):Play()
|
||||||
end
|
end
|
||||||
if bloom then TweenService:Create(bloom, TweenInfo.new(2), { Intensity = lake and 0.25 or base.bloom, Threshold = lake and 1.5 or base.threshold }):Play() end
|
applyLook(world)
|
||||||
if grade then
|
|
||||||
TweenService:Create(grade, TweenInfo.new(2), {
|
|
||||||
TintColor = lake and Color3.fromRGB(255, 242, 220) or base.tint,
|
|
||||||
Contrast = lake and 0.08 or base.contrast,
|
|
||||||
}):Play()
|
|
||||||
end
|
|
||||||
if rays then rays.Intensity = lake and 0.06 or base.rays end
|
|
||||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Восемь силуэтов обновляются локально 20 раз в секунду и только рядом с озером.
|
-- тёмные силуэты рыб под прозрачной водой «Тихого озера», медленно плавают по кругу (только у этого игрока)
|
||||||
local fishScenery, ambientFish, waterfallRipples = nil, {}, {}
|
do
|
||||||
local fishElapsed = 0
|
local w1 = Config.Worlds[1]
|
||||||
RunService.Heartbeat:Connect(function(dt)
|
local fishList = Config.Zones.World1.fish
|
||||||
fishElapsed += dt
|
local frng = Random.new(11)
|
||||||
if fishElapsed < 0.05 then return end
|
local folder = new("Folder", { Name = "FishShadows", Parent = workspace })
|
||||||
fishElapsed = 0
|
local swimmers = {}
|
||||||
local world = currentWorld()
|
for i = 1, 10 do
|
||||||
if not world or world.id ~= "World1" then return end
|
local l = w1.lakes[(i - 1) % #w1.lakes + 1]
|
||||||
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
local ok, model = pcall(Models.buildFish, fishList[(i - 1) % #fishList + 1].id, nil, frng:NextNumber(1.3, 2), true)
|
||||||
if not root or (root.Position - world.center).Magnitude > 180 then return end
|
if ok and model then
|
||||||
if not fishScenery or not fishScenery.Parent or #ambientFish == 0 then
|
for _, d in ipairs(model:GetDescendants()) do
|
||||||
local map = workspace:FindFirstChild("FishingMap")
|
if d:IsA("BasePart") then
|
||||||
fishScenery = map and map:FindFirstChild("World1Scenery")
|
d.Color = Color3.fromRGB(22, 70, 74)
|
||||||
ambientFish, waterfallRipples = {}, {}
|
d.Material = Enum.Material.SmoothPlastic
|
||||||
if fishScenery then
|
d.Transparency = 0.5
|
||||||
for _, child in ipairs(fishScenery:GetChildren()) do
|
d.CanCollide, d.CanQuery, d.CanTouch, d.CastShadow = false, false, false, false
|
||||||
if child:IsA("Model") and child.Name == "AmbientFish" then table.insert(ambientFish, child) end
|
elseif d:IsA("Decal") or d:IsA("ParticleEmitter") or d:IsA("Light") then
|
||||||
if child:IsA("Model") and child.Name == "WaterfallRipple" then table.insert(waterfallRipples, child) end
|
d:Destroy()
|
||||||
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
local now = workspace:GetServerTimeNow()
|
local acc = 0
|
||||||
for _, ripple in ipairs(waterfallRipples) do
|
RunService.Heartbeat:Connect(function(dt)
|
||||||
if ripple.Parent then
|
acc += dt
|
||||||
local center = ripple:GetAttribute("RippleCenter")
|
if acc < 1 / 30 then
|
||||||
local phase = (now * 0.3 + ripple:GetAttribute("RipplePhase")) % 1
|
return
|
||||||
local radius = 2 + phase * 8
|
|
||||||
for _, segment in ipairs(ripple:GetChildren()) do
|
|
||||||
local index = segment:GetAttribute("RippleSegment")
|
|
||||||
local a, b = index * math.pi / 6, (index + 1) * math.pi / 6
|
|
||||||
local p = center + Vector3.new(math.cos(a) * radius, 0, math.sin(a) * radius)
|
|
||||||
local q = center + Vector3.new(math.cos(b) * radius, 0, math.sin(b) * radius)
|
|
||||||
segment.Size = Vector3.new((q - p).Magnitude, 0.07, 0.07)
|
|
||||||
segment.CFrame = CFrame.lookAt((p + q) / 2, q) * CFrame.Angles(0, math.pi / 2, 0)
|
|
||||||
segment.Transparency = 0.6 + phase * 0.4
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
local step = acc
|
||||||
for _, fish in ipairs(ambientFish) do
|
acc = 0
|
||||||
if fish.Parent then
|
local w = currentWorld()
|
||||||
local center, radius = fish:GetAttribute("SwimCenter"), fish:GetAttribute("SwimRadius")
|
if not (w and w.id == "World1") then
|
||||||
local angle = now * fish:GetAttribute("SwimSpeed") + fish:GetAttribute("SwimPhase")
|
return
|
||||||
local pos = center + Vector3.new(math.cos(angle) * radius, 0, math.sin(angle) * radius * 0.65)
|
|
||||||
local direction = Vector3.new(-math.sin(angle), 0, math.cos(angle) * 0.65)
|
|
||||||
fish:PivotTo(CFrame.lookAt(pos, pos + direction))
|
|
||||||
end
|
end
|
||||||
end
|
for _, s in ipairs(swimmers) do
|
||||||
end)
|
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()
|
task.spawn(function()
|
||||||
while true do
|
while true do
|
||||||
@@ -1675,7 +1717,6 @@ end)
|
|||||||
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
||||||
|
|
||||||
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
||||||
local W1 = Config.Worlds[1].center
|
|
||||||
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
||||||
|
|
||||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||||
@@ -1733,7 +1774,7 @@ end
|
|||||||
|
|
||||||
local function guideMarker(name)
|
local function guideMarker(name)
|
||||||
local map = workspace:FindFirstChild("FishingMap")
|
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
|
return m and m.Position
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1864,22 +1905,50 @@ local function guideRoute(step, pos, world)
|
|||||||
elseif step == 2 and inW1 then
|
elseif step == 2 and inW1 then
|
||||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||||
elseif step == 3 and inW1 then
|
elseif step == 3 and inW1 then
|
||||||
local route = {}
|
return { guideMarker("GuideSell") }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||||
local rel = pos - W1
|
|
||||||
if math.abs(rel.X) < 6 and rel.Z < 80 then
|
|
||||||
table.insert(route, W1 + Vector3.new(0, 4.5, 84)) -- сначала сойти с причала
|
|
||||||
end
|
|
||||||
table.insert(route, guideMarker("GuideSell"))
|
|
||||||
return route, "💰 Продай рыбу", "Sell"
|
|
||||||
end
|
end
|
||||||
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)
|
||||||
@@ -1895,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")
|
||||||
@@ -1912,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
|
||||||
@@ -1979,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
|
||||||
@@ -2015,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
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,61 @@
|
|||||||
|
-- Apply after REBUILD_LANDSCAPE.lua in Studio Edit mode.
|
||||||
|
local V,CF=Vector3.new,CFrame.new
|
||||||
|
local map=workspace.World1Map
|
||||||
|
local folder=map.LandscapeDetails
|
||||||
|
local cabin=map.BigCabin;cabin:ScaleTo(1.65)
|
||||||
|
local c,s=cabin:GetBoundingBox()
|
||||||
|
cabin:PivotTo(cabin:GetPivot()+V(-80-c.X,10-(c.Y-s.Y/2),1450-c.Z))
|
||||||
|
local old=folder:FindFirstChild('CabinRamp');if old then old:Destroy() end
|
||||||
|
local ramp=Instance.new('Model');ramp.Name='CabinRamp';ramp.Parent=folder
|
||||||
|
local function part(name,size,cf,color,mat,parent)
|
||||||
|
local p=Instance.new('Part');p.Name=name;p.Anchored=true;p.Size=size;p.CFrame=cf;p.Color=color;p.Material=mat or Enum.Material.Wood;p.TopSurface=Enum.SurfaceType.Smooth;p.BottomSurface=Enum.SurfaceType.Smooth;p.Parent=parent or ramp;return p
|
||||||
|
end
|
||||||
|
local function beam(a,b,w,color,parent)
|
||||||
|
return part('Rail',V(w,w,(a-b).Magnitude),CFrame.lookAt((a+b)/2,b),color,Enum.Material.Wood,parent)
|
||||||
|
end
|
||||||
|
local wood=Color3.fromRGB(137,89,48)
|
||||||
|
local a,b=V(-68.1,12.15,1457.1),V(-68.1,4.3,1479)
|
||||||
|
local cf=CFrame.lookAt((a+b)/2,b)
|
||||||
|
part('WalkableRamp',V(6.5,0.55,(b-a).Magnitude+0.5),cf,wood,Enum.Material.WoodPlanks)
|
||||||
|
for j=0,16 do
|
||||||
|
local p=a:Lerp(b,j/16)
|
||||||
|
local strip=part('CrossPlank',V(6.55,0.12,0.10),CF(p+V(0,0.33,0))*cf.Rotation,Color3.fromRGB(103,65,37))
|
||||||
|
strip.CanCollide=false
|
||||||
|
end
|
||||||
|
for _,side in {-1,1} do
|
||||||
|
local prev
|
||||||
|
for j=0,4 do
|
||||||
|
local p=a:Lerp(b,j/4)+V(side*3,0,0)
|
||||||
|
part('RampPost',V(0.45,3.5,0.45),CF(p+V(0,1.5,0)),wood)
|
||||||
|
if prev then beam(prev+V(0,2.9,0),p+V(0,2.9,0),0.32,wood) end
|
||||||
|
prev=p
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- Warm lamps at the cabin and along the uphill trail.
|
||||||
|
for _,p in {V(-65,12,1457),V(-88,7,1530),V(-104,20,1464),V(-93,37,1415),V(-46,60,1385)} do
|
||||||
|
part('LanternPost',V(0.6,6,0.6),CF(p+V(0,3,0)),wood,nil,folder)
|
||||||
|
local lamp=part('AmberLantern',V(1.1,1.6,1.1),CF(p+V(0,6,0)),Color3.fromRGB(255,199,99),Enum.Material.Neon,folder)
|
||||||
|
part('LanternCap',V(1.5,0.3,1.5),CF(p+V(0,6.95,0)),Color3.fromRGB(64,57,41),Enum.Material.Metal,folder)
|
||||||
|
local light=Instance.new('PointLight');light.Color=lamp.Color;light.Brightness=1.3;light.Range=13;light.Parent=lamp
|
||||||
|
end
|
||||||
|
-- Broaden the cascade while retaining its original animation and particles.
|
||||||
|
local sheet=map.Waterfall:GetChildren()[1]
|
||||||
|
if not sheet:GetAttribute('LandscapeWidened') then
|
||||||
|
sheet.Size=V(19,sheet.Size.Y,sheet.Size.Z)
|
||||||
|
for _,a in sheet:GetChildren() do if a:IsA('Attachment') then a.Position=V(a.Position.X*1.9,a.Position.Y,a.Position.Z) end end
|
||||||
|
sheet:SetAttribute('LandscapeWidened',true)
|
||||||
|
end
|
||||||
|
-- The small waterside cabin sits on the opposite shore, below the lookout.
|
||||||
|
local small=map.SmallCabin;local sc,ss=small:GetBoundingBox()
|
||||||
|
small:PivotTo(small:GetPivot()+V(-10-sc.X,5.05-(sc.Y-ss.Y/2),1424-sc.Z))
|
||||||
|
local bridge=map.Bridge
|
||||||
|
local low=math.huge
|
||||||
|
for _,p in bridge:GetDescendants() do
|
||||||
|
if p:IsA('BasePart') and math.abs(p.Size.Y-0.5)<0.01 then low=math.min(low,p.Position.Y+0.25) end
|
||||||
|
end
|
||||||
|
if low<math.huge then bridge:PivotTo(bridge:GetPivot()+V(0,39.1-low,0)) end
|
||||||
|
local generated=workspace:FindFirstChild('HouseWithRamp')
|
||||||
|
if generated then generated.Parent=game.ServerStorage end
|
||||||
|
workspace.CurrentCamera.CFrame=CFrame.lookAt(V(22,14,1570),V(-22,25,1443))
|
||||||
|
return {rampSlopeDegrees=math.deg(math.atan((a.Y-b.Y)/(a.Z-b.Z)))*-1}
|
||||||
|
|
||||||
+3333
-1945
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,107 @@
|
|||||||
|
-- Apply to the baked World1Map in Edit mode.
|
||||||
|
-- Toolbox assets: DaveCam456 / 11751641277; FracturedSkies / 2128776869.
|
||||||
|
local V,CF=Vector3.new,CFrame.new
|
||||||
|
local terrain=workspace.Terrain
|
||||||
|
local map=workspace.World1Map
|
||||||
|
local lib=game.ServerStorage.LandscapeAssetLibrary
|
||||||
|
local ms=game:GetService('MaterialService')
|
||||||
|
for x=-288,287,48 do
|
||||||
|
terrain:ReplaceMaterial(Region3.new(V(x,-24,1212),V(x+48,160,1788)):ExpandToGrid(4),4,Enum.Material.Rock,Enum.Material.Slate)
|
||||||
|
task.wait()
|
||||||
|
end
|
||||||
|
local colors={Snow=Color3.fromRGB(127,163,63),Salt=Color3.fromRGB(191,155,105),Rock=Color3.fromRGB(132,139,155),Slate=Color3.fromRGB(132,139,155)}
|
||||||
|
for name,color in colors do
|
||||||
|
local material=Enum.Material[name]
|
||||||
|
local variant=ms:FindFirstChild('LowPolyFlat'..name) or Instance.new('MaterialVariant')
|
||||||
|
variant.Name='LowPolyFlat'..name;variant.BaseMaterial=material
|
||||||
|
variant.ColorMap='rbxasset://textures/SelfView/whiteRect.png'
|
||||||
|
variant.RoughnessMap='rbxasset://textures/SelfView/whiteRect.png'
|
||||||
|
variant.NormalMap='';variant.MetalnessMap='';variant.StudsPerTile=32;variant.Parent=ms
|
||||||
|
ms:SetBaseMaterialOverride(material,variant.Name);terrain:SetMaterialColor(material,color)
|
||||||
|
end
|
||||||
|
local old=map:FindFirstChild('LowPolyRockwork');if old then old:Destroy() end
|
||||||
|
local folder=Instance.new('Folder');folder.Name='LowPolyRockwork';folder.Parent=map
|
||||||
|
folder:SetAttribute('CliffCreator','DaveCam456')
|
||||||
|
folder:SetAttribute('CliffAssetId','11751641277')
|
||||||
|
folder:SetAttribute('RockCreator','FracturedSkies')
|
||||||
|
folder:SetAttribute('RockAssetId','2128776869')
|
||||||
|
local cliff=lib.LowPolyRockyCliff:FindFirstChildWhichIsA('MeshPart',true)
|
||||||
|
local mountain=lib.MountainBorder:FindFirstChildWhichIsA('MeshPart',true)
|
||||||
|
local stones={}
|
||||||
|
for _,p in lib.LowPolyRockPack:GetDescendants() do if p:IsA('MeshPart') then table.insert(stones,p) end end
|
||||||
|
table.sort(stones,function(a,b) return a.Name<b.Name end)
|
||||||
|
local rng=Random.new(320)
|
||||||
|
local function place(source,name,pos,size,angle,color)
|
||||||
|
local p=source:Clone()
|
||||||
|
for _,v in p:GetDescendants() do if v:IsA('LuaSourceContainer') or v:IsA('SurfaceAppearance') or v:IsA('Decal') or v:IsA('Texture') then v:Destroy() end end
|
||||||
|
p.Name=name;p.Anchored=true;p.TextureID='';p.Material=Enum.Material.SmoothPlastic;p.MaterialVariant='';p.Reflectance=0
|
||||||
|
p.Size=size;p.CFrame=CF(pos)*CFrame.Angles(0,angle or 0,0)
|
||||||
|
p.Color=color or Color3.fromRGB(130+rng:NextInteger(-7,7),135+rng:NextInteger(-5,5),149+rng:NextInteger(-5,5))
|
||||||
|
p.Parent=folder;return p
|
||||||
|
end
|
||||||
|
-- Broad vertical facets under the grassy lookout and beside the waterfall.
|
||||||
|
local columns={
|
||||||
|
{-75,18,1415,23,38,24},{-58,21,1417,26,44,25},{-38,22,1415,25,46,23},{-19,18,1408,24,38,23},
|
||||||
|
{5,13,1410,22,28,24},
|
||||||
|
{25,16,1427,23,36,27},{12,13,1423,22,29,26},
|
||||||
|
{68,17,1425,25,39,29},{85,15,1420,25,34,30},{98,10,1410,24,25,27},
|
||||||
|
}
|
||||||
|
for i,p in columns do
|
||||||
|
place(cliff,'CliffFace_'..i,V(p[1],p[2],p[3]+(i<=5 and 9 or 0)),V(p[4]*(i<=5 and 1.2 or 1),p[5],p[6]*(i<=5 and 1.15 or 1)),i*0.71)
|
||||||
|
end
|
||||||
|
-- Large irregular rock silhouettes replace the fine-grained mountain surface.
|
||||||
|
for i=0,23 do
|
||||||
|
local a=i*math.pi*2/24
|
||||||
|
local r=239+17*math.sin(i*2.17)
|
||||||
|
local radius=66+23*math.sin(i*3.1)^2
|
||||||
|
local ht=76+43*math.sin(i*1.87)^2
|
||||||
|
local pos=V(math.cos(a)*r,ht*0.43,1500+math.sin(a)*r)
|
||||||
|
local mass=place(mountain,'MountainMass_'..i,V(pos.X-math.cos(a)*19,ht*0.51-4,pos.Z-math.sin(a)*19),V(radius*1.95,ht*1.344,radius*2.295),0,Color3.fromRGB(125+i%3*4,136+i%3*3,147+i%3*4))
|
||||||
|
mass.CFrame=CFrame.lookAt(mass.Position,mass.Position+V(math.cos(a),0,math.sin(a)))
|
||||||
|
task.wait()
|
||||||
|
end
|
||||||
|
local feet={{-64,12,1426,25,30,22},{-44,15,1428,29,35,24},{-25,10,1424,20,24,19},{27,12,1433,24,29,27},{70,15,1430,29,35,30},{92,9,1421,28,25,27}}
|
||||||
|
for i,a in feet do
|
||||||
|
place(stones[i],'CliffFootBoulder',V(a[1],a[2],a[3]),V(a[4],a[5],a[6]),i*0.6,Color3.fromRGB(128+i%3*3,132+i%3*3,146+i%3*3))
|
||||||
|
end
|
||||||
|
local rp=RaycastParams.new();rp.FilterType=Enum.RaycastFilterType.Include;rp.FilterDescendantsInstances={terrain};rp.IgnoreWater=true
|
||||||
|
local lakes=require(game.ReplicatedStorage.FishConfig).Worlds[1].lakes
|
||||||
|
local function gap(x,z)
|
||||||
|
local g=math.huge
|
||||||
|
for _,l in lakes do g=math.min(g,math.sqrt((x-l[1])^2+(z-1500-l[2])^2)-l[3]) end
|
||||||
|
return g
|
||||||
|
end
|
||||||
|
-- Discrete clusters, with the dock, ramp, and trail kept open.
|
||||||
|
for i=1,120 do
|
||||||
|
local x,z=rng:NextNumber(-112,116),rng:NextNumber(1408,1557)
|
||||||
|
local g=gap(x,z)
|
||||||
|
local clear=not (math.abs(x)<27 and z>1530) and not (x< -58 and x> -95 and z>1430 and z<1494) and not (x> -24 and x<8 and z<1440)
|
||||||
|
if g>-1 and g<7 and clear then
|
||||||
|
local hit=workspace:Raycast(V(x,180,z),V(0,-230,0),rp)
|
||||||
|
if hit then
|
||||||
|
local s=rng:NextNumber(3,7)
|
||||||
|
place(stones[i%#stones+1],'ShoreBoulder',hit.Position+V(0,s*0.18,0),V(s,s*0.8,s*0.9),rng:NextNumber(0,6.28))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- Put trees on the new rock surfaces instead of leaving them inside the mountains.
|
||||||
|
local rockRay=RaycastParams.new();rockRay.FilterType=Enum.RaycastFilterType.Include;rockRay.FilterDescendantsInstances={folder,terrain};rockRay.IgnoreWater=true
|
||||||
|
local moved=0
|
||||||
|
for _,tree in map.LandscapeDetails:GetChildren() do
|
||||||
|
if tree:IsA('Model') and tree.Name=='Pine' then
|
||||||
|
local c,s=tree:GetBoundingBox()
|
||||||
|
local base=c.Y-s.Y/2
|
||||||
|
local hit=workspace:Raycast(V(c.X,220,c.Z),V(0,-260,0),rockRay)
|
||||||
|
if hit and math.abs(hit.Position.Y-base)>0.5 then tree:PivotTo(tree:GetPivot()+V(0,hit.Position.Y-base-0.3,0));moved+=1 end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _,n in {'AssetPreview','MountainPreview'} do local preview=workspace:FindFirstChild(n);if preview then preview:Destroy() end end
|
||||||
|
map:SetAttribute('LandscapeStyle','LowPolyMatte')
|
||||||
|
local small=map.SmallCabin
|
||||||
|
local sc,ss=small:GetBoundingBox()
|
||||||
|
local shore=workspace:Raycast(V(-8,180,1438),V(0,-220,0),rp)
|
||||||
|
local sy=math.max(3.5,shore and shore.Position.Y or 3.5)
|
||||||
|
small:PivotTo(small:GetPivot()+V(-8-sc.X,sy-(sc.Y-ss.Y/2),1438-sc.Z))
|
||||||
|
return {rocks=#folder:GetChildren(),treesGrounded=moved}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
-- Run in Studio Edit mode. Rebuilds only World1 landscape; keep a scene backup first.
|
||||||
|
local V, CF = Vector3.new, CFrame.new
|
||||||
|
local terrain, map = workspace.Terrain, workspace.World1Map
|
||||||
|
local W = V(0,0,1500)
|
||||||
|
local lakes = require(game.ReplicatedStorage.FishConfig).Worlds[1].lakes
|
||||||
|
local path = {{-24,62,4},{-64,52,5},{-87,32,7},{-100,4,10},{-106,-27,17},{-103,-57,27},{-91,-83,37},{-66,-92,46},{-39,-105,54},{-46,-123,60}}
|
||||||
|
local function gap(x,z)
|
||||||
|
local g=1e5
|
||||||
|
for _,l in lakes do g=math.min(g,math.sqrt((x-l[1])^2+(z-l[2])^2)-l[3]) end
|
||||||
|
return g
|
||||||
|
end
|
||||||
|
local function pathInfo(x,z)
|
||||||
|
local best,h=1e5,4
|
||||||
|
for i=2,#path do
|
||||||
|
local a,b=path[i-1],path[i]; local dx,dz=b[1]-a[1],b[2]-a[2]
|
||||||
|
local t=math.clamp(((x-a[1])*dx+(z-a[2])*dz)/(dx*dx+dz*dz),0,1)
|
||||||
|
local d=math.sqrt((x-a[1]-dx*t)^2+(z-a[2]-dz*t)^2)
|
||||||
|
if d<best then best,h=d,a[3]+(b[3]-a[3])*t end
|
||||||
|
end
|
||||||
|
return best,h
|
||||||
|
end
|
||||||
|
local peaks={}
|
||||||
|
for i=0,23 do
|
||||||
|
local a=i*math.pi*2/24
|
||||||
|
local r=239+17*math.sin(i*2.17)
|
||||||
|
table.insert(peaks,{math.cos(a)*r,math.sin(a)*r,66+23*math.sin(i*3.1)^2,76+43*math.sin(i*1.87)^2})
|
||||||
|
end
|
||||||
|
local function height(x,z)
|
||||||
|
local g=gap(x,z)
|
||||||
|
if g<0 then return -10+math.clamp((g+10)/10,0,1)*8 end
|
||||||
|
local y=4+math.noise(x/48,z/48)*2
|
||||||
|
for _,p in peaks do
|
||||||
|
local d=math.sqrt((x-p[1])^2+(z-p[2])^2)/p[3]
|
||||||
|
y=math.max(y,4+p[4]*math.max(0,1-d)^0.85)
|
||||||
|
end
|
||||||
|
local d=math.sqrt(((x+46)/70)^2+((z+123)/64)^2)
|
||||||
|
y=math.max(y,4+56*math.max(0,1-d^2)^0.7)
|
||||||
|
-- Broad, grassy summit with a firm level base for the lookout.
|
||||||
|
if ((x+46)/15)^2+((z+123)/14)^2<1 then y=60 end
|
||||||
|
-- River escarpment behind the waterfall, with a steep lake-facing wall.
|
||||||
|
local cliff=math.clamp((x-17)/15,0,1)*math.clamp((112-x)/22,0,1)*math.clamp((-z-68)/12,0,1)*math.clamp((z+172)/28,0,1)
|
||||||
|
y=math.max(y,4+32*cliff)
|
||||||
|
local pd,ph=pathInfo(x,z)
|
||||||
|
local mix=1-math.clamp((pd-4)/9,0,1)
|
||||||
|
y=y*(1-mix)+ph*mix
|
||||||
|
-- Level building terrace on the left bank.
|
||||||
|
local cd=math.sqrt(((x+80)/22)^2+((z+50)/19)^2)
|
||||||
|
if cd<1.5 then local b=math.clamp((1.5-cd)/0.5,0,1); y=y*(1-b)+10*b end
|
||||||
|
-- Preserve the low, usable shoreline.
|
||||||
|
y=4+(y-4)*math.clamp(g/11,0,1)
|
||||||
|
return y
|
||||||
|
end
|
||||||
|
terrain:SetMaterialColor(Enum.Material.Snow,Color3.fromRGB(122,182,74))
|
||||||
|
terrain:SetMaterialColor(Enum.Material.Salt,Color3.fromRGB(190,153,102))
|
||||||
|
terrain:SetMaterialColor(Enum.Material.Rock,Color3.fromRGB(111,124,137))
|
||||||
|
terrain:SetMaterialColor(Enum.Material.Sand,Color3.fromRGB(205,190,140))
|
||||||
|
terrain.WaterColor=Color3.fromRGB(38,158,157)
|
||||||
|
terrain.WaterTransparency=0.5
|
||||||
|
terrain.WaterWaveSize=0.12
|
||||||
|
terrain.WaterWaveSpeed=8
|
||||||
|
-- 48-stud chunks keep every WriteVoxels small and allow Studio to repaint.
|
||||||
|
for x0=-288,287,48 do
|
||||||
|
for z0=-288,287,48 do
|
||||||
|
local region=Region3.new(W+V(x0,-24,z0),W+V(x0+48,160,z0+48)):ExpandToGrid(4)
|
||||||
|
local mats,occ=terrain:ReadVoxels(region,4)
|
||||||
|
for ix=1,12 do for iz=1,12 do
|
||||||
|
local x,z=x0+(ix-0.5)*4,z0+(iz-0.5)*4
|
||||||
|
local h,g=height(x,z)-2,gap(x,z)
|
||||||
|
local pd=pathInfo(x,z)
|
||||||
|
local slope=math.max(math.abs(height(x+2,z)-height(x-2,z)),math.abs(height(x,z+2)-height(x,z-2)))/4
|
||||||
|
for iy=1,46 do
|
||||||
|
local bottom=-24+(iy-1)*4
|
||||||
|
local o=math.clamp((h-bottom)/4,0,1)
|
||||||
|
local m=Enum.Material.Air
|
||||||
|
if o>0 then
|
||||||
|
m=Enum.Material.Rock
|
||||||
|
if bottom>h-7 then
|
||||||
|
m=(slope>1.05 and h>14) and Enum.Material.Rock or Enum.Material.Snow
|
||||||
|
if pd<4.5 and g>2 then m=Enum.Material.Salt end
|
||||||
|
if g<3 then m=Enum.Material.Sand end
|
||||||
|
end
|
||||||
|
elseif g<0 and bottom<0 then m=Enum.Material.Water; o=1 end
|
||||||
|
mats[ix][iy][iz],occ[ix][iy][iz]=m,o
|
||||||
|
end
|
||||||
|
end end
|
||||||
|
terrain:WriteVoxels(region,4,mats,occ)
|
||||||
|
task.wait()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local old=map:FindFirstChild('LandscapeDetails'); if old then old:Destroy() end
|
||||||
|
local details=Instance.new('Folder');details.Name='LandscapeDetails';details.Parent=map
|
||||||
|
local rng=Random.new(103)
|
||||||
|
local function part(name,size,cf,color,material,parent)
|
||||||
|
local p=Instance.new('Part'); p.Name=name;p.Size=size;p.CFrame=cf;p.Color=color;p.Material=material or Enum.Material.SmoothPlastic;p.Anchored=true;p.TopSurface=Enum.SurfaceType.Smooth;p.BottomSurface=Enum.SurfaceType.Smooth;p.Parent=parent or details;return p
|
||||||
|
end
|
||||||
|
local wood=Color3.fromRGB(125,78,43)
|
||||||
|
local function beam(a,b,width,color,parent)
|
||||||
|
return part('Rail',V(width,width,(b-a).Magnitude),CFrame.lookAt((a+b)/2,b),color or wood,Enum.Material.Wood,parent)
|
||||||
|
end
|
||||||
|
-- Move existing assets, keeping game markers and identifiers intact.
|
||||||
|
local tower=map.Watchtower
|
||||||
|
local tc,ts=tower:GetBoundingBox()
|
||||||
|
tower:PivotTo(tower:GetPivot()+V(-46-tc.X,60-(tc.Y-ts.Y/2),1377-tc.Z))
|
||||||
|
local cabin=map.BigCabin
|
||||||
|
local bc,bs=cabin:GetBoundingBox()
|
||||||
|
cabin:PivotTo(cabin:GetPivot()+V(-89-bc.X,8-(bc.Y-bs.Y/2),1512-bc.Z))
|
||||||
|
local small=map.SmallCabin;local sc,sz=small:GetBoundingBox()
|
||||||
|
small:PivotTo(small:GetPivot()+V(-24-sc.X,5-(sc.Y-sz.Y/2),1416-sc.Z))
|
||||||
|
-- An upper river runs beneath the existing bridge to the waterfall lip.
|
||||||
|
terrain:FillBlock(CF(46,34,1394),V(12,4,54),Enum.Material.Water)
|
||||||
|
terrain:FillBlock(CF(46,40,1394),V(12,8,54),Enum.Material.Air)
|
||||||
|
-- Cliff buttresses flank the falling water and support both bridge ends.
|
||||||
|
for _,b in {{27,17,1422,20,34,24},{68,17,1423,23,34,27}} do
|
||||||
|
terrain:FillBlock(CF(b[1],b[2],b[3]),V(b[4],b[5],b[6]),Enum.Material.Rock)
|
||||||
|
terrain:FillBlock(CF(b[1],35,b[3]-5),V(b[4],4,b[6]-10),Enum.Material.Snow)
|
||||||
|
end
|
||||||
|
-- Trail fencing follows the graded path, leaving the entrance open.
|
||||||
|
for i=3,#path do
|
||||||
|
local a,b=path[i-1],path[i]
|
||||||
|
local av,bv=V(a[1],a[3],a[2]),V(b[1],b[3],b[2])
|
||||||
|
local dir=V(b[1]-a[1],0,b[2]-a[2]).Unit;local side=V(-dir.Z,0,dir.X)*6
|
||||||
|
local steps=math.ceil((bv-av).Magnitude/9)
|
||||||
|
for _,sign in {-1,1} do
|
||||||
|
local prev
|
||||||
|
for j=0,steps do
|
||||||
|
local p=W+av:Lerp(bv,j/steps)+side*sign
|
||||||
|
part('TrailPost',V(0.65,3.7,0.65),CF(p+V(0,1.6,0)),wood,Enum.Material.Wood)
|
||||||
|
if prev then beam(prev+V(0,2.7,0),p+V(0,2.7,0),0.4);beam(prev+V(0,1.3,0),p+V(0,1.3,0),0.3) end
|
||||||
|
prev=p
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- Restore the established low-poly evergreen style from World1Builder.
|
||||||
|
local crownRotation=CFrame.Angles(math.rad(-35.264),0,0)*CFrame.Angles(0,0,math.rad(45))
|
||||||
|
local count=0
|
||||||
|
for i=1,520 do
|
||||||
|
local x,z=rng:NextNumber(-235,235),rng:NextNumber(-235,235)
|
||||||
|
local g=gap(x,z);local pd=pathInfo(x,z);local h=height(x,z)
|
||||||
|
local blocked=(x>-38 and x<38 and z>42 and z<100) or (math.abs(x+80)<29 and math.abs(z+50)<26) or (math.abs(x+24)<16 and math.abs(z+84)<15) or (math.abs(x+46)<20 and math.abs(z+123)<18) or (x>12 and x<86 and z< -65 and z> -152)
|
||||||
|
if g>10 and pd>12 and not blocked and h<100 then
|
||||||
|
local tree=Instance.new('Model');tree.Name='Pine'
|
||||||
|
local ht=rng:NextNumber(17,32);local p=W+V(x,h-0.5,z)
|
||||||
|
part('Trunk',V(ht*0.065,ht*0.55,ht*0.065),CF(p+V(0,ht*0.25,0)),Color3.fromRGB(91,65,39),Enum.Material.Wood,tree)
|
||||||
|
for tier=0,3 do
|
||||||
|
local s=ht*(0.43-tier*0.075)
|
||||||
|
local leaf=part('Needles',V(s,s,s),CF(p+V(0,ht*(0.3+tier*0.18),0))*CFrame.Angles(0,i*1.73,0)*crownRotation,Color3.fromRGB(43+tier*11,91+tier*12,51+tier*3),nil,tree)
|
||||||
|
leaf.CanCollide=false
|
||||||
|
end
|
||||||
|
tree.Parent=details;count+=1
|
||||||
|
end
|
||||||
|
if i%40==0 then task.wait() end
|
||||||
|
end
|
||||||
|
-- Shore rocks and low shrubs frame the lake without hiding the main landmarks.
|
||||||
|
for i=1,250 do
|
||||||
|
local x,z=rng:NextNumber(-125,125),rng:NextNumber(-145,90)
|
||||||
|
local g=gap(x,z);local pd=pathInfo(x,z)
|
||||||
|
if g>2 and g<13 and pd>9 and not (math.abs(x)<25 and z>35) and not (x>20 and x<78 and z< -60) then
|
||||||
|
local h=height(x,z);local s=rng:NextNumber(2,6)
|
||||||
|
local p=part('ShoreRock',V(s,s*0.65,s*0.8),CF(W+V(x,h,z))*CFrame.Angles(0.2,i,0.3),Color3.fromRGB(115,125,132))
|
||||||
|
if i%2==0 then
|
||||||
|
for j=1,3 do local q=part('Shrub',V(2.8,2.8,2.8),CF(W+V(x+j*1.1,h+1,z-2)),Color3.fromRGB(91+j*12,138+j*8,51));q.Shape=Enum.PartType.Ball;q.CanCollide=false end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local lighting=game:GetService('Lighting');lighting.ClockTime=15.2;lighting.Brightness=2.5;lighting.Ambient=Color3.fromRGB(125,137,145);lighting.OutdoorAmbient=Color3.fromRGB(145,152,139)
|
||||||
|
workspace.CurrentCamera.CFrame=CFrame.lookAt(V(8,17,1575),V(-10,25,1435))
|
||||||
|
map:SetAttribute('LandscapeRevision','ReferenceLandscape_v1')
|
||||||
|
return {trees=count,details=#details:GetDescendants(),pathPoints=#path}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
-- Requires the generated SpruceTree template, retained in ServerStorage after use.
|
||||||
|
local source=workspace:FindFirstChild('SpruceTree') or game.ServerStorage:FindFirstChild('SpruceTree')
|
||||||
|
assert(source,'Generate or restore SpruceTree first')
|
||||||
|
local template=Instance.new('Model');template.Name='SpruceTemplate'
|
||||||
|
for _,p in source:GetDescendants() do
|
||||||
|
if p:IsA('BasePart') then
|
||||||
|
local q=p:Clone();q.Anchored=true
|
||||||
|
if q.Name:find('Foliage') then q.CanCollide=false;q.Material=Enum.Material.SmoothPlastic;q.UsePartColor=true end
|
||||||
|
q.Parent=template
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local templateBounds=template:GetBoundingBox()
|
||||||
|
template.WorldPivot=CFrame.new(templateBounds.Position)
|
||||||
|
local rng=Random.new(58)
|
||||||
|
local folder=workspace.World1Map.LandscapeDetails
|
||||||
|
local n=0
|
||||||
|
for _,tree in folder:GetChildren() do
|
||||||
|
if tree.Name=='Pine' and tree:IsA('Model') then
|
||||||
|
local trunk=tree:FindFirstChild('Trunk')
|
||||||
|
if trunk then
|
||||||
|
local base=trunk.Position-Vector3.new(0,trunk.Size.Y/2,0)
|
||||||
|
local copy=template:Clone();copy.Name='Pine';copy:ScaleTo(rng:NextNumber(0.75,1.25))
|
||||||
|
local cf,size=copy:GetBoundingBox()
|
||||||
|
copy:PivotTo(CFrame.new(base+Vector3.new(0,size.Y/2,0))*CFrame.Angles(0,rng:NextNumber(0,6.28),0))
|
||||||
|
local c,s=copy:GetBoundingBox();copy:PivotTo(copy:GetPivot()+Vector3.new(base.X-c.X,base.Y-(c.Y-s.Y/2),base.Z-c.Z))
|
||||||
|
local shade=rng:NextNumber(-0.03,0.04)
|
||||||
|
for _,p in copy:GetChildren() do
|
||||||
|
if p.Name:find('Foliage') then local k=tonumber(p.Name:match('%d+')) or 1;p.Color=Color3.fromRGB(50+k*5,95+k*7,44+k*4):Lerp(Color3.fromRGB(120,145,60),math.max(0,shade*7)) end
|
||||||
|
end
|
||||||
|
copy.Parent=folder;tree:Destroy();n+=1
|
||||||
|
if n%25==0 then task.wait() end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
template:Destroy();source.Parent=game.ServerStorage
|
||||||
|
return {replaced=n}
|
||||||
|
|
||||||
@@ -11,17 +11,43 @@ 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.2, water = Color3.fromRGB(40, 170, 165),
|
clock = 16.2,
|
||||||
waterTransparency = 0.6,
|
|
||||||
waterY = 0,
|
waterY = 0,
|
||||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
|
||||||
|
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
|
||||||
|
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; здесь они перекрашиваются
|
||||||
|
terrainColors = {
|
||||||
|
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),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
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, -- всё дальше этого радиуса от центра — море
|
||||||
},
|
},
|
||||||
@@ -29,7 +55,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 = {
|
||||||
@@ -37,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,
|
||||||
@@ -283,17 +312,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 = {
|
||||||
|
|||||||
@@ -41,7 +41,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 = {},
|
||||||
}
|
}
|
||||||
@@ -168,13 +168,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),
|
||||||
@@ -255,79 +300,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)
|
||||||
@@ -608,6 +628,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)
|
||||||
@@ -812,7 +860,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 }
|
||||||
@@ -875,6 +923,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
|
||||||
@@ -903,11 +952,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,
|
||||||
@@ -933,22 +989,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
|
||||||
|
|
||||||
---------------------------------------------------------------- скупка
|
---------------------------------------------------------------- скупка
|
||||||
@@ -1004,6 +1064,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
|
||||||
|
|
||||||
@@ -1037,6 +1098,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
|
||||||
@@ -1056,6 +1118,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
|
||||||
@@ -1070,6 +1133,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)
|
||||||
@@ -1081,6 +1145,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
|
||||||
@@ -1092,6 +1157,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
|
||||||
|
|
||||||
---------------------------------------------------------------- телепорт
|
---------------------------------------------------------------- телепорт
|
||||||
@@ -1121,7 +1189,7 @@ local function teleportTo(player, worldId)
|
|||||||
markerName = world.id .. "Spawn"
|
markerName = world.id .. "Spawn"
|
||||||
end
|
end
|
||||||
local map = workspace:FindFirstChild("FishingMap")
|
local map = workspace:FindFirstChild("FishingMap")
|
||||||
local m = map and map:FindFirstChild(markerName)
|
local m = map and map:FindFirstChild(markerName, true) -- маркеры могут лежать в папках уровня (World1Map)
|
||||||
if m then
|
if m then
|
||||||
stopFishing(player, true)
|
stopFishing(player, true)
|
||||||
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
|
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
|
||||||
@@ -1214,8 +1282,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
|
||||||
@@ -1303,6 +1369,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)
|
||||||
@@ -1320,7 +1485,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)
|
||||||
@@ -1347,6 +1512,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
|
||||||
@@ -1370,6 +1536,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
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,998 @@
|
|||||||
|
-- World1Builder (ModuleScript) -> ServerScriptService
|
||||||
|
-- Генератор локации «Тихое озеро» (Мир 1). Им ОДИН РАЗ собирают уровень прямо в Roblox Studio,
|
||||||
|
-- в режиме редактирования, а дальше уровень правится руками как обычные детали и модели.
|
||||||
|
-- Команда для Command Bar (строка внизу Studio):
|
||||||
|
-- require(game.ServerScriptService.World1Builder:Clone()).bake()
|
||||||
|
-- bake() стирает старую папку Workspace.World1Map и террейн этого мира и строит всё заново.
|
||||||
|
-- Обычно уровень собирается вместе со всей картой: WorldBuilder.bake() (см. README).
|
||||||
|
-- Если папки World1Map в плейсе нет, WorldBuilder строит уровень этим же модулем.
|
||||||
|
--
|
||||||
|
-- Что нужно игре от уровня (не удаляйте и не переименовывайте):
|
||||||
|
-- маркеры World1Spawn, GuideFishSpot, GuideSell, World1NpcSeller, World1NpcGrandpa — невидимые
|
||||||
|
-- плитки; их можно двигать, NPC и точка появления встанут туда при запуске;
|
||||||
|
-- атрибут GuideTarget = "Pier" (модель MainDock) и "Sell" (модель BaitShop) — подсветка в обучении;
|
||||||
|
-- ProximityPrompt с атрибутом Action = "Sell" на прилавке и портал «В лобби» (Action = "Portal");
|
||||||
|
-- деталь World1Bestiary — доска «Кто водится в озере», текст на неё пишет MapBuilder при запуске.
|
||||||
|
-- Форма воды для заброса берётся из FishConfig (Worlds[1].lakes) — если меняете озеро руками,
|
||||||
|
-- поправьте там круги, иначе игра будет считать водой старые места.
|
||||||
|
|
||||||
|
local Workspace = game:GetService("Workspace")
|
||||||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
|
|
||||||
|
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||||
|
|
||||||
|
local V = Vector3.new
|
||||||
|
local terrain = Workspace.Terrain
|
||||||
|
local W1 = Config.Worlds[1]
|
||||||
|
local W = W1.center -- центр Мира 1
|
||||||
|
local GROUND_Y = 4 -- верх земли
|
||||||
|
local WATER_Y = W1.waterY -- поверхность воды
|
||||||
|
local LAKES = W1.lakes -- озеро из кругов { x, z, радиус } от W
|
||||||
|
|
||||||
|
-- холмы: { x, z, радиус, высота центра шара } — верх холма = высота центра + радиус
|
||||||
|
local HILLS = {
|
||||||
|
{ -78, -138, 62, -22 }, -- холм с вышкой
|
||||||
|
{ -175, -55, 58, -34 }, { 175, -165, 62, -30 }, { -175, 160, 52, -32 },
|
||||||
|
{ 180, 130, 48, -30 }, { 10, -225, 60, -34 }, { -60, 175, 45, -28 }, { 95, 190, 40, -26 },
|
||||||
|
}
|
||||||
|
-- тропинка на холм к вышке (точки от W)
|
||||||
|
local HILL_PATH = { { -22, -76 }, { -40, -92 }, { -28, -106 }, { -52, -114 }, { -44, -127 }, { -66, -131 } }
|
||||||
|
-- «трава» — материал Snow: у него нет травинок и почти нет рисунка, получается ровная мультяшная
|
||||||
|
-- поверхность. В зелёный (а дорожки из Salt — в коричневый) его красит клиент только в этом мире.
|
||||||
|
local GROUND_MAT, PATH_MAT = Enum.Material.Snow, Enum.Material.Salt
|
||||||
|
|
||||||
|
local Builder = {}
|
||||||
|
|
||||||
|
-- вода ниже WATER_Y и воздух над ней прямо по вокселям (Fill* с Air иногда оставляет песок над водой)
|
||||||
|
function Builder.carveLake(l)
|
||||||
|
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 12, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
||||||
|
local mats, occ = terrain:ReadVoxels(region, 4)
|
||||||
|
local size = mats.Size
|
||||||
|
local corner = region.CFrame.Position - region.Size / 2
|
||||||
|
local center = W + V(l[1], 0, l[2])
|
||||||
|
for x = 1, size.X do
|
||||||
|
for y = 1, size.Y do
|
||||||
|
for z = 1, size.Z do
|
||||||
|
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
||||||
|
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
||||||
|
local water = c.Y < WATER_Y
|
||||||
|
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
||||||
|
occ[x][y][z] = water and 1 or 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
terrain:WriteVoxels(region, 4, mats, occ)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- высота земли с учётом холмов: считаем по формуле (лучи по только что залитому террейну ненадёжны)
|
||||||
|
local function hillY(x, z)
|
||||||
|
local y = GROUND_Y
|
||||||
|
for _, h in ipairs(HILLS) do
|
||||||
|
local d2 = (x - h[1]) ^ 2 + (z - h[2]) ^ 2
|
||||||
|
if d2 < h[3] ^ 2 then
|
||||||
|
y = math.max(y, h[4] + math.sqrt(h[3] ^ 2 - d2))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return y
|
||||||
|
end
|
||||||
|
|
||||||
|
local function inLake(x, z, extra)
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------- террейн
|
||||||
|
local function buildTerrain()
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), GROUND_MAT)
|
||||||
|
for _, h in ipairs(HILLS) do
|
||||||
|
terrain:FillBall(W + V(h[1], h[4], h[2]), h[3], GROUND_MAT)
|
||||||
|
end
|
||||||
|
-- порядок важен: узкая песчаная кромка → выемка → ил → вода
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 3, Enum.Material.Sand)
|
||||||
|
end
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 2, Enum.Material.Air)
|
||||||
|
end
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 1, Enum.Material.Air)
|
||||||
|
end
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -18, l[2])), 12, l[3], Enum.Material.Mud)
|
||||||
|
end
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||||
|
end
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
Builder.carveLake(l)
|
||||||
|
end
|
||||||
|
-- земляные дорожки: меняем материал травы на материал дорожки, объём не меняется
|
||||||
|
local function dirtPath(points, width)
|
||||||
|
for i = 2, #points do
|
||||||
|
local a, b = points[i - 1], points[i]
|
||||||
|
local len = math.sqrt((b[1] - a[1]) ^ 2 + (b[2] - a[2]) ^ 2)
|
||||||
|
for s = 0, len, 2 do
|
||||||
|
local x, z = a[1] + (b[1] - a[1]) * s / len, a[2] + (b[2] - a[2]) * s / len
|
||||||
|
local half = V(width / 2, 3, width / 2)
|
||||||
|
local p = W + V(x, hillY(x, z), z)
|
||||||
|
terrain:ReplaceMaterial(Region3.new(p - half, p + half):ExpandToGrid(4), 4, GROUND_MAT, PATH_MAT)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
dirtPath(HILL_PATH, 4)
|
||||||
|
dirtPath({ { 0, 84 }, { 0, 64 } }, 6) -- площадка у корня причала
|
||||||
|
dirtPath({ { 8, -84 }, { 8, -100 } }, 4) -- к домику у мостков
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------- детали
|
||||||
|
-- parent — куда положить папку World1Map (Workspace при сборке в Studio, FishingMap при запуске игры)
|
||||||
|
function Builder.build(parent)
|
||||||
|
buildTerrain()
|
||||||
|
|
||||||
|
local rng = Random.new(7)
|
||||||
|
local map = Instance.new("Folder")
|
||||||
|
map.Name = "World1Map"
|
||||||
|
|
||||||
|
-------------------------------------------------- помощники
|
||||||
|
local function P(props)
|
||||||
|
local p = Instance.new("Part")
|
||||||
|
if props.Shape then
|
||||||
|
p.Shape = props.Shape
|
||||||
|
end
|
||||||
|
p.Anchored = true
|
||||||
|
p.TopSurface = Enum.SurfaceType.Smooth
|
||||||
|
p.BottomSurface = Enum.SurfaceType.Smooth
|
||||||
|
for k, v in pairs(props) do
|
||||||
|
if k ~= "Parent" and k ~= "Shape" then
|
||||||
|
p[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
p.Parent = props.Parent or map
|
||||||
|
return p
|
||||||
|
end
|
||||||
|
local function vcyl(pos, h, d, props)
|
||||||
|
props.Shape = Enum.PartType.Cylinder
|
||||||
|
props.Size = V(h, d, d)
|
||||||
|
props.CFrame = CFrame.new(pos) * CFrame.Angles(0, 0, math.rad(90))
|
||||||
|
return P(props)
|
||||||
|
end
|
||||||
|
local function ball(pos, d, props)
|
||||||
|
props.Shape = Enum.PartType.Ball
|
||||||
|
props.Size = V(d, d, d)
|
||||||
|
props.Position = pos
|
||||||
|
return P(props)
|
||||||
|
end
|
||||||
|
-- цилиндр между двумя точками (брёвна, балки, перила, вёсла)
|
||||||
|
local function rod(a, b, d, props)
|
||||||
|
props.Shape = Enum.PartType.Cylinder
|
||||||
|
props.Size = V(math.max(0.05, (b - a).Magnitude), d, d)
|
||||||
|
props.CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.rad(90), 0)
|
||||||
|
return P(props)
|
||||||
|
end
|
||||||
|
local function surfaceText(part, face, text, color)
|
||||||
|
local sg = Instance.new("SurfaceGui")
|
||||||
|
sg.Face = face
|
||||||
|
sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||||
|
sg.PixelsPerStud = 40
|
||||||
|
sg.LightInfluence = 0
|
||||||
|
sg.Parent = part
|
||||||
|
local t = Instance.new("TextLabel")
|
||||||
|
t.Size = UDim2.fromScale(1, 1)
|
||||||
|
t.BackgroundTransparency = 1
|
||||||
|
t.Font = Enum.Font.FredokaOne
|
||||||
|
t.TextScaled = true
|
||||||
|
t.TextColor3 = color
|
||||||
|
t.TextStrokeTransparency = 1
|
||||||
|
t.Text = text
|
||||||
|
t.Parent = sg
|
||||||
|
end
|
||||||
|
local function prompt(target, actionText, objectText, action)
|
||||||
|
local pp = Instance.new("ProximityPrompt")
|
||||||
|
pp.ActionText = actionText
|
||||||
|
pp.ObjectText = objectText
|
||||||
|
pp.HoldDuration = 0
|
||||||
|
pp.MaxActivationDistance = 14
|
||||||
|
pp.RequiresLineOfSight = false
|
||||||
|
pp:SetAttribute("Action", action)
|
||||||
|
pp.Parent = target
|
||||||
|
return pp
|
||||||
|
end
|
||||||
|
local function marker(name, cf)
|
||||||
|
return P({ Name = name, Size = V(4, 1, 4), CFrame = cf, Transparency = 1, CanCollide = false, CanQuery = false, CanTouch = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
local COL = {
|
||||||
|
plank = Color3.fromRGB(196, 140, 88), plankDark = Color3.fromRGB(160, 110, 68),
|
||||||
|
log = Color3.fromRGB(156, 102, 60), logDark = Color3.fromRGB(105, 70, 44),
|
||||||
|
rope = Color3.fromRGB(218, 184, 128), roof = Color3.fromRGB(62, 104, 78), stone = Color3.fromRGB(150, 146, 150),
|
||||||
|
rock = Color3.fromRGB(150, 146, 162), rockDark = Color3.fromRGB(112, 108, 128), moss = Color3.fromRGB(108, 152, 72),
|
||||||
|
pine = Color3.fromRGB(58, 126, 70), pineDark = Color3.fromRGB(30, 82, 52),
|
||||||
|
leaf = Color3.fromRGB(110, 170, 64), leafDark = Color3.fromRGB(72, 136, 56),
|
||||||
|
glow = Color3.fromRGB(255, 200, 120), awnA = Color3.fromRGB(46, 106, 72), awnB = Color3.fromRGB(242, 232, 204),
|
||||||
|
banner = Color3.fromRGB(40, 92, 62), metal = Color3.fromRGB(48, 44, 42), water = Color3.fromRGB(70, 200, 195),
|
||||||
|
}
|
||||||
|
local WOOD, PLANKS, SMOOTH = Enum.Material.Wood, Enum.Material.WoodPlanks, Enum.Material.SmoothPlastic
|
||||||
|
-- куб, повёрнутый вершиной вверх: три грани сходятся в острый пик (ёлки, горы, обломки скал)
|
||||||
|
local CUBE_UP = CFrame.Angles(math.rad(-35.264), 0, 0) * CFrame.Angles(0, 0, math.rad(45))
|
||||||
|
|
||||||
|
-- столб с кронштейном и висящим фонарём; facing — куда смотрит кронштейн
|
||||||
|
local function postLantern(base, facing, h)
|
||||||
|
h = h or 8
|
||||||
|
local top = base + V(0, h, 0)
|
||||||
|
vcyl(base + V(0, h / 2, 0), h, 0.8, { Color = COL.logDark, Material = WOOD })
|
||||||
|
rod(top - V(0, 0.3, 0), top + facing * 2.4 - V(0, 0.3, 0), 0.35, { Color = COL.logDark, Material = WOOD })
|
||||||
|
local hang = top + facing * 2 - V(0, 1.8, 0)
|
||||||
|
rod(hang + V(0, 0.9, 0), top + facing * 2 - V(0, 0.3, 0), 0.08, { Color = COL.metal, Material = Enum.Material.Metal, CanCollide = false })
|
||||||
|
P({ Size = V(1.2, 0.3, 1.2), Position = hang + V(0, 0.85, 0), Color = COL.metal, Material = Enum.Material.Metal, CanCollide = false })
|
||||||
|
local glass = P({ Size = V(0.9, 1.3, 0.9), Position = hang, Color = COL.glow, Material = Enum.Material.Neon, CanCollide = false, CastShadow = false })
|
||||||
|
P({ Size = V(1.2, 0.3, 1.2), Position = hang - V(0, 0.8, 0), Color = COL.metal, Material = Enum.Material.Metal, CanCollide = false })
|
||||||
|
local light = Instance.new("PointLight")
|
||||||
|
light.Range = 18
|
||||||
|
light.Brightness = 1.5
|
||||||
|
light.Color = COL.glow
|
||||||
|
light.Parent = glass
|
||||||
|
end
|
||||||
|
|
||||||
|
-- low-poly ёлка: ствол и ярусы-«ромбы» (кубы вершиной вверх), к верху меньше
|
||||||
|
local function pine(pos, h, tiers)
|
||||||
|
tiers = tiers or 3
|
||||||
|
vcyl(pos + V(0, h * 0.15, 0), h * 0.3, math.max(0.8, h * 0.07), { Color = COL.logDark, Material = WOOD, CastShadow = false })
|
||||||
|
local shade = rng:NextNumber(0, 0.3)
|
||||||
|
for i = 0, tiers - 1 do
|
||||||
|
local t = tiers > 1 and i / (tiers - 1) or 1
|
||||||
|
local s = h * (0.42 - 0.22 * t)
|
||||||
|
P({
|
||||||
|
Size = V(s, s, s),
|
||||||
|
CFrame = CFrame.new(pos + V(0, h * (0.34 + 0.48 * t), 0)) * CFrame.Angles(0, rng:NextNumber(0, 6.28), 0) * CUBE_UP,
|
||||||
|
Color = COL.pineDark:Lerp(COL.pine, 0.2 + 0.5 * t + shade), Material = SMOOTH, CanCollide = false,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- круглое лиственное дерево
|
||||||
|
local function leafy(pos, s)
|
||||||
|
vcyl(pos + V(0, s * 0.4, 0), s * 0.8, s * 0.14, { Color = COL.log, Material = WOOD })
|
||||||
|
local c = COL.leafDark:Lerp(COL.leaf, rng:NextNumber(0.3, 1))
|
||||||
|
ball(pos + V(0, s * 1.05, 0), s * 0.95, { Color = c, Material = SMOOTH, CanCollide = false })
|
||||||
|
ball(pos + V(s * 0.38, s * 0.85, s * 0.1), s * 0.65, { Color = c:Lerp(COL.leaf, 0.3), Material = SMOOTH, CanCollide = false })
|
||||||
|
ball(pos + V(-s * 0.35, s * 0.9, -s * 0.2), s * 0.6, { Color = c:Lerp(COL.leafDark, 0.3), Material = SMOOTH, CanCollide = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- угловатый low-poly камень
|
||||||
|
local function rock(pos, s, col)
|
||||||
|
return P({
|
||||||
|
Size = V(s, s * rng:NextNumber(0.55, 0.85), s * rng:NextNumber(0.7, 1)),
|
||||||
|
CFrame = CFrame.new(pos) * CFrame.Angles(rng:NextNumber(-0.4, 0.4), rng:NextNumber(0, 6.28), rng:NextNumber(-0.4, 0.4)),
|
||||||
|
Color = (col or COL.rock):Lerp(COL.rockDark, rng:NextNumber(0, 0.6)), Material = SMOOTH,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
-- острый обломок скалы (куб вершиной вверх), наполовину утоплен
|
||||||
|
local function crag(pos, s)
|
||||||
|
return P({
|
||||||
|
Size = V(s, s, s),
|
||||||
|
CFrame = CFrame.new(pos) * CFrame.Angles(rng:NextNumber(-0.2, 0.2), rng:NextNumber(0, 6.28), rng:NextNumber(-0.2, 0.2)) * CUBE_UP,
|
||||||
|
Color = COL.rock:Lerp(COL.rockDark, rng:NextNumber(0, 0.6)), Material = SMOOTH,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- рогоз: несколько стеблей с коричневыми «початками» и листья
|
||||||
|
local function cattails(pos)
|
||||||
|
for _ = 1, rng:NextInteger(3, 6) do
|
||||||
|
local p = pos + V(rng:NextNumber(-1.3, 1.3), 0, rng:NextNumber(-1.3, 1.3))
|
||||||
|
local top = p + V(rng:NextNumber(-0.4, 0.4), rng:NextNumber(3.5, 6), rng:NextNumber(-0.4, 0.4))
|
||||||
|
rod(p, top, 0.16, { Color = Color3.fromRGB(96, 140, 62), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||||
|
local dir = (top - p).Unit
|
||||||
|
rod(top - dir * 2, top - dir * 0.6, 0.5, { Color = Color3.fromRGB(122, 74, 40), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||||
|
end
|
||||||
|
for _ = 1, 3 do
|
||||||
|
P({
|
||||||
|
Size = V(0.35, rng:NextNumber(3, 4.5), 0.08),
|
||||||
|
CFrame = CFrame.new(pos + V(0, 1.6, 0)) * CFrame.Angles(0, rng:NextNumber(0, 6.28), rng:NextNumber(-0.35, 0.35)),
|
||||||
|
Color = Color3.fromRGB(110, 160, 70), Material = SMOOTH, CanCollide = false, CastShadow = false,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- круглая свая с намотанным канатом; y0 — низ (под водой), top — верх сваи
|
||||||
|
local function ropePost(x, z, y0, top, d, parent)
|
||||||
|
d = d or 1.6
|
||||||
|
vcyl(W + V(x, (y0 + top) / 2, z), top - y0, d, { Color = COL.log, Material = WOOD, Parent = parent })
|
||||||
|
vcyl(W + V(x, top + 0.1, z), 0.2, d * 0.9, { Color = COL.plankDark, Material = WOOD, Parent = parent })
|
||||||
|
for i = 1, 3 do
|
||||||
|
vcyl(W + V(x, top - 0.5 - i * 0.38, z), 0.3, d + 0.25, { Color = COL.rope, Material = Enum.Material.Fabric, CanCollide = false, Parent = parent })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- маленькие мостки: доски поперёк и сваи
|
||||||
|
local function smallDock(x, z0, z1, w, y)
|
||||||
|
local dir = z1 > z0 and 1 or -1
|
||||||
|
for z = z0, z1, dir * 1.6 do
|
||||||
|
P({ Size = V(w, 0.45, 1.45), Position = W + V(x, y - 0.22, z), Color = COL.plank:Lerp(COL.plankDark, rng:NextNumber(0, 0.6)), Material = PLANKS })
|
||||||
|
end
|
||||||
|
for z = z0 + dir * 2, z1, dir * 6 do
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
vcyl(W + V(x + s * (w / 2 - 0.3), y - 4, z), 8, 0.8, { Color = COL.logDark, Material = WOOD })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- бревенчатый дом: стены из брёвен, двускатная зелёная крыша, тёплые окна, труба с дымом, крыльцо.
|
||||||
|
-- cf — центр пола на земле, сторона -Z (LookVector) — фасад с дверью
|
||||||
|
local function logCabin(name, cf, w, d, wallH)
|
||||||
|
local house = Instance.new("Model")
|
||||||
|
house.Name = name
|
||||||
|
house.Parent = map
|
||||||
|
local function part(props)
|
||||||
|
props.Parent = house
|
||||||
|
return P(props)
|
||||||
|
end
|
||||||
|
local LOG = 1.25
|
||||||
|
local rows = math.floor(wallH / LOG)
|
||||||
|
local wallTop = 1 + rows * LOG
|
||||||
|
local function at(x, y, z)
|
||||||
|
return (cf * CFrame.new(x, y, z)).Position
|
||||||
|
end
|
||||||
|
part({ Size = V(w + 1.5, 1, d + 1.5), CFrame = cf * CFrame.new(0, 0.5, 0), Color = COL.stone, Material = Enum.Material.Slate })
|
||||||
|
for r = 0, rows - 1 do
|
||||||
|
local y = 1 + LOG / 2 + r * LOG
|
||||||
|
local col = (r % 2 == 0) and COL.log or COL.log:Lerp(COL.logDark, 0.3)
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
rod(at(-w / 2 - 0.9, y, s * d / 2), at(w / 2 + 0.9, y, s * d / 2), LOG, { Color = col, Material = WOOD, Parent = house })
|
||||||
|
rod(at(s * w / 2, y, -d / 2 - 0.9), at(s * w / 2, y, d / 2 + 0.9), LOG, { Color = col, Material = WOOD, Parent = house })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- фронтоны (по бокам) — брёвна всё короче к коньку
|
||||||
|
local a = math.rad(34)
|
||||||
|
local rise = (d / 2) * math.tan(a)
|
||||||
|
for k = 0, math.floor(rise / LOG) - 1 do
|
||||||
|
local y = wallTop + LOG / 2 + k * LOG
|
||||||
|
local half = (d / 2) * (1 - (k + 1) * LOG / rise)
|
||||||
|
if half > 0.6 then
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
rod(at(s * w / 2, y, -half), at(s * w / 2, y, half), LOG, { Color = COL.log:Lerp(COL.logDark, 0.15), Material = WOOD, Parent = house })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- крыша: два ската, конёк вдоль X
|
||||||
|
local run = d / 2 + 1.6
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
part({ Size = V(w + 3, 0.7, run / math.cos(a)), CFrame = cf * CFrame.new(0, wallTop + run * math.tan(a) / 2 + 0.35, s * run / 2) * CFrame.Angles(s * a, 0, 0), Color = COL.roof, Material = SMOOTH })
|
||||||
|
end
|
||||||
|
part({ Size = V(w + 3.2, 0.6, 0.9), CFrame = cf * CFrame.new(0, wallTop + run * math.tan(a) + 0.2, 0), Color = COL.roof:Lerp(Color3.new(0, 0, 0), 0.25), Material = SMOOTH })
|
||||||
|
-- дверь и окна с тёплым светом
|
||||||
|
part({ Size = V(3, 5.2, 0.5), CFrame = cf * CFrame.new(0, 3.6, -d / 2 - 0.7), Color = COL.logDark, Material = PLANKS })
|
||||||
|
for i, wdw in ipairs({ { -w / 4, -d / 2 - 0.65, 0 }, { w / 4, -d / 2 - 0.65, 0 }, { -w / 2 - 0.65, 0, 90 }, { w / 2 + 0.65, 0, 90 } }) do
|
||||||
|
local wcf = cf * CFrame.new(wdw[1], 4.6, wdw[2]) * CFrame.Angles(0, math.rad(wdw[3]), 0)
|
||||||
|
part({ Size = V(3, 2.6, 0.4), CFrame = wcf, Color = COL.logDark, Material = WOOD })
|
||||||
|
local g = part({ Size = V(2.4, 2, 0.45), CFrame = wcf, Color = COL.glow, Material = Enum.Material.Neon, CastShadow = false })
|
||||||
|
part({ Size = V(0.2, 2, 0.5), CFrame = wcf, Color = COL.logDark, Material = WOOD })
|
||||||
|
if i == 1 then
|
||||||
|
local l = Instance.new("PointLight")
|
||||||
|
l.Range = 14
|
||||||
|
l.Brightness = 1
|
||||||
|
l.Color = COL.glow
|
||||||
|
l.Parent = g
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- крыльцо
|
||||||
|
part({ Size = V(w * 0.55, 0.6, 4), CFrame = cf * CFrame.new(0, 1.1, -d / 2 - 2.8), Color = COL.plank, Material = PLANKS })
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
vcyl(at(s * w * 0.25, 4.2, -d / 2 - 4.4), 6.2, 0.6, { Color = COL.log, Material = WOOD, Parent = house })
|
||||||
|
end
|
||||||
|
part({ Size = V(w * 0.62, 0.5, 4.8), CFrame = cf * CFrame.new(0, 7.3, -d / 2 - 2.6) * CFrame.Angles(-math.rad(14), 0, 0), Color = COL.roof, Material = SMOOTH })
|
||||||
|
-- труба с дымом
|
||||||
|
local ch = at(w / 2 - 2.2, 0, d / 4)
|
||||||
|
local chTop = wallTop + rise + 3
|
||||||
|
part({ Size = V(2.2, chTop, 2.2), Position = ch + V(0, chTop / 2, 0), Color = Color3.fromRGB(150, 110, 95), Material = Enum.Material.Brick })
|
||||||
|
local smokeAt = part({ Size = V(1, 1, 1), Position = ch + V(0, chTop + 0.5, 0), Transparency = 1, CanCollide = false, CanQuery = false })
|
||||||
|
local smoke = Instance.new("ParticleEmitter")
|
||||||
|
smoke.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
smoke.Color = ColorSequence.new(Color3.fromRGB(235, 235, 235))
|
||||||
|
smoke.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1.5), NumberSequenceKeypoint.new(1, 6) })
|
||||||
|
smoke.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.4), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
smoke.Lifetime = NumberRange.new(4, 6)
|
||||||
|
smoke.Rate = 4
|
||||||
|
smoke.Speed = NumberRange.new(2, 3)
|
||||||
|
smoke.SpreadAngle = Vector2.new(10, 10)
|
||||||
|
smoke.Acceleration = V(1, 0.4, 0)
|
||||||
|
smoke.Parent = smokeAt
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------- прибытие, причал, лавка
|
||||||
|
local DOCK = { z0 = 64, z1 = 36, w = 12 } -- от берега (z0) в воду (z1), по оси X = 0
|
||||||
|
local DECK_Y = GROUND_Y + 0.6 -- верх настила
|
||||||
|
local spawnAt = W + V(0, DECK_Y, 60)
|
||||||
|
marker("World1Spawn", CFrame.lookAt(spawnAt + V(0, 1, 0), spawnAt + V(0, 1, -10)))
|
||||||
|
marker("GuideFishSpot", CFrame.new(W + V(0, DECK_Y + 0.5, DOCK.z1 + 3)))
|
||||||
|
|
||||||
|
-- главный причал: доски поперёк, толстые сваи с канатом по краям, ящик для снастей
|
||||||
|
do
|
||||||
|
local dock = Instance.new("Model")
|
||||||
|
dock.Name = "MainDock"
|
||||||
|
dock:SetAttribute("GuideTarget", "Pier") -- подсвечивается на шаге обучения
|
||||||
|
dock.Parent = map
|
||||||
|
for z = DOCK.z1 + 0.8, DOCK.z0 - 0.8, 1.6 do
|
||||||
|
P({
|
||||||
|
Size = V(DOCK.w + rng:NextNumber(-0.3, 0.3), 0.5, 1.48), Position = W + V(0, DECK_Y - 0.25, z),
|
||||||
|
Color = COL.plank:Lerp(COL.plankDark, rng:NextNumber(0, 0.7)), Material = PLANKS, Parent = dock,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
P({ Size = V(0.8, 0.8, DOCK.z0 - DOCK.z1), Position = W + V(s * (DOCK.w / 2 - 1), DECK_Y - 0.9, (DOCK.z0 + DOCK.z1) / 2), Color = COL.logDark, Material = WOOD, Parent = dock })
|
||||||
|
for z = DOCK.z1 + 1, DOCK.z0 - 2, 8 do
|
||||||
|
ropePost(s * (DOCK.w / 2 - 0.2), z, -6, DECK_Y + 2.4, 1.7, dock)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local tb = W + V(-3.4, DECK_Y, 46)
|
||||||
|
P({ Size = V(2.6, 1.3, 1.5), Position = tb + V(0, 0.65, 0), Color = Color3.fromRGB(120, 142, 124), Material = SMOOTH, Parent = dock })
|
||||||
|
P({ Size = V(2.7, 0.35, 1.6), Position = tb + V(0, 1.45, 0), Color = Color3.fromRGB(96, 116, 100), Material = SMOOTH, Parent = dock })
|
||||||
|
rod(tb + V(-0.7, 1.65, 0), tb + V(0.7, 1.65, 0), 0.18, { Color = COL.metal, Material = Enum.Material.Metal, Parent = dock })
|
||||||
|
P({ Size = V(0.35, 0.35, 0.1), Position = tb + V(0, 1.2, -0.8), Color = Color3.fromRGB(230, 190, 70), Material = Enum.Material.Metal, Parent = dock })
|
||||||
|
P({ Size = V(2, 2, 2), CFrame = CFrame.new(W + V(-4.2, DECK_Y + 1, 49.5)) * CFrame.Angles(0, 0.25, 0), Color = COL.plankDark, Material = PLANKS, Parent = dock })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- лавка рыбака (скупка) слева от корня причала, прилавком к причалу: тент, вывеска, поплавки,
|
||||||
|
-- воблеры, бочки и ящики, фонарь на столбе. Продавца ставит MapBuilder на маркер World1NpcSeller.
|
||||||
|
do
|
||||||
|
local cf = CFrame.lookAt(W + V(-15, GROUND_Y, 60), W + V(0, GROUND_Y, 57))
|
||||||
|
local shop = Instance.new("Model")
|
||||||
|
shop.Name = "BaitShop"
|
||||||
|
shop:SetAttribute("GuideTarget", "Sell") -- подсвечивается на шаге обучения
|
||||||
|
shop.Parent = map
|
||||||
|
local function at(x, y, z)
|
||||||
|
return cf * CFrame.new(x, y, z)
|
||||||
|
end
|
||||||
|
local function part(props)
|
||||||
|
props.Parent = shop
|
||||||
|
return P(props)
|
||||||
|
end
|
||||||
|
part({ Size = V(14, 0.8, 10), CFrame = at(0, 0.4, 0), Color = COL.plankDark, Material = PLANKS })
|
||||||
|
part({ Size = V(14, 9, 0.8), CFrame = at(0, 5, 4.6), Color = COL.plank, Material = PLANKS })
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
part({ Size = V(0.8, 9, 10), CFrame = at(s * 6.6, 5, 0), Color = COL.plank, Material = PLANKS })
|
||||||
|
part({ Size = V(1.2, 10.4, 1.2), CFrame = at(s * 6.6, 5.2, -4.8), Color = COL.logDark, Material = WOOD })
|
||||||
|
end
|
||||||
|
part({ Size = V(15.5, 0.7, 11), CFrame = at(0, 10.4, 0), Color = COL.logDark, Material = PLANKS })
|
||||||
|
local counter = part({ Name = "Counter", Size = V(12, 3.4, 2.4), CFrame = at(0, 2.5, -3.6), Color = COL.plank, Material = PLANKS })
|
||||||
|
part({ Size = V(13, 0.4, 3), CFrame = at(0, 4.4, -3.6), Color = COL.logDark, Material = WOOD })
|
||||||
|
prompt(counter, "Продать всю рыбу", "Скупка", "Sell")
|
||||||
|
-- полосатый тент и фестончики
|
||||||
|
local n = 8
|
||||||
|
for i = 0, n - 1 do
|
||||||
|
local c = (i % 2 == 0) and COL.awnA or COL.awnB
|
||||||
|
local x = -7.5 + (i + 0.5) * 15 / n
|
||||||
|
part({ Size = V(15 / n + 0.02, 0.25, 5), CFrame = at(x, 9.7, -6.9) * CFrame.Angles(math.rad(-24), 0, 0), Color = c, Material = Enum.Material.Fabric })
|
||||||
|
part({ Shape = Enum.PartType.Cylinder, Size = V(0.25, 15 / n, 15 / n), CFrame = at(x, 8.7, -9.25) * CFrame.Angles(0, math.rad(90), 0), Color = c, Material = Enum.Material.Fabric, CanCollide = false })
|
||||||
|
end
|
||||||
|
-- вывеска над тентом
|
||||||
|
local sign = part({ Size = V(8, 3, 0.5), CFrame = at(0, 12.6, -4.9), Color = COL.plank, Material = PLANKS })
|
||||||
|
part({ Size = V(8.6, 3.6, 0.3), CFrame = at(0, 12.6, -4.6), Color = COL.logDark, Material = WOOD })
|
||||||
|
surfaceText(sign, Enum.NormalId.Front, "🐟 СКУПКА", Color3.fromRGB(60, 40, 25))
|
||||||
|
-- воблеры на задней стене
|
||||||
|
for i, c in ipairs({ Color3.fromRGB(90, 200, 80), Color3.fromRGB(245, 210, 60), Color3.fromRGB(245, 140, 50), Color3.fromRGB(70, 150, 230), Color3.fromRGB(230, 70, 70) }) do
|
||||||
|
local x = -4.4 + (i - 1) * 2.2
|
||||||
|
part({ Size = V(0.08, 1.4, 0.08), CFrame = at(x, 8.4, 4.05), Color = COL.metal, CanCollide = false })
|
||||||
|
part({ Size = V(0.55, 1.6, 0.5), CFrame = at(x, 7, 4.0), Color = c, Material = SMOOTH, CanCollide = false })
|
||||||
|
part({ Size = V(0.3, 0.5, 0.45), CFrame = at(x, 6, 4.0), Color = c:Lerp(Color3.new(1, 1, 1), 0.4), Material = SMOOTH, CanCollide = false })
|
||||||
|
end
|
||||||
|
-- поплавки и ящички на прилавке
|
||||||
|
for i = 0, 3 do
|
||||||
|
local p = at(-4.5 + i * 1.3, 5.05, -3.4).Position
|
||||||
|
ball(p, 0.9, { Color = Color3.fromRGB(225, 50, 45), Material = SMOOTH, Parent = shop, CanCollide = false })
|
||||||
|
ball(p + V(0, 0.55, 0), 0.6, { Color = Color3.fromRGB(250, 250, 250), Material = SMOOTH, Parent = shop, CanCollide = false })
|
||||||
|
end
|
||||||
|
part({ Size = V(2.2, 1, 1.4), CFrame = at(2.6, 5.1, -3.5), Color = Color3.fromRGB(120, 140, 125), Material = SMOOTH })
|
||||||
|
part({ Size = V(1.6, 0.8, 1.2), CFrame = at(4.8, 5, -3.4), Color = COL.plankDark, Material = PLANKS })
|
||||||
|
-- бочки и ящики сбоку
|
||||||
|
for i, off in ipairs({ { 8.6, -2.6 }, { 9.2, 0.6 } }) do
|
||||||
|
local p = at(off[1], 1.7, off[2]).Position
|
||||||
|
vcyl(p, 3.4, 2.8, { Color = COL.log, Material = WOOD, Parent = shop })
|
||||||
|
for _, dy in ipairs({ -1, 1 }) do
|
||||||
|
vcyl(p + V(0, dy, 0), 0.3, 2.95, { Color = COL.metal, Material = Enum.Material.Metal, Parent = shop, CanCollide = false })
|
||||||
|
end
|
||||||
|
if i == 2 then
|
||||||
|
part({ Size = V(2.2, 2.2, 2.2), CFrame = at(9, 4.5, 0.6) * CFrame.Angles(0, 0.3, 0), Color = COL.plankDark, Material = PLANKS })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
part({ Size = V(2.6, 2.6, 2.6), CFrame = at(-9, 1.3, -1.5) * CFrame.Angles(0, 0.2, 0), Color = COL.plankDark, Material = PLANKS })
|
||||||
|
marker("World1NpcSeller", at(0, 3.9, 1.6))
|
||||||
|
marker("GuideSell", cf * CFrame.new(0, 0, -9))
|
||||||
|
postLantern(at(-7.8, 0, -6.2).Position, (cf.LookVector * V(1, 0, 1)).Unit, 9)
|
||||||
|
end
|
||||||
|
leafy(W + V(-27, GROUND_Y, 70), 13) -- большое дерево над лавкой, как на макете
|
||||||
|
postLantern(W + V(7.5, GROUND_Y, 66), V(-1, 0, 0), 8)
|
||||||
|
|
||||||
|
-- деревянная лодка с вёслами справа от причала у двух свай
|
||||||
|
do
|
||||||
|
local cf = CFrame.new(W + V(12.5, WATER_Y + 0.25, 46)) * CFrame.Angles(0, math.rad(12), 0)
|
||||||
|
local boat = Instance.new("Model")
|
||||||
|
boat.Name = "Rowboat"
|
||||||
|
boat.Parent = map
|
||||||
|
local hull, inner = Color3.fromRGB(150, 92, 52), Color3.fromRGB(196, 140, 88)
|
||||||
|
P({ Size = V(3.4, 0.4, 8.4), CFrame = cf, Color = inner, Material = PLANKS, Parent = boat })
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
P({ Size = V(0.4, 1.7, 8.6), CFrame = cf * CFrame.new(s * 1.95, 0.7, 0.2) * CFrame.Angles(0, 0, math.rad(-s * 14)), Color = hull, Material = WOOD, Parent = boat })
|
||||||
|
P({ Size = V(0.4, 1.7, 3), CFrame = cf * CFrame.new(s * 1.05, 0.8, -5) * CFrame.Angles(0, math.rad(s * 38), 0), Color = hull, Material = WOOD, Parent = boat })
|
||||||
|
P({ Size = V(0.5, 0.3, 8.6), CFrame = cf * CFrame.new(s * 2.2, 1.6, 0.2), Color = COL.logDark, Material = WOOD, Parent = boat })
|
||||||
|
local a = (cf * CFrame.new(s * 1.6, 1.4, 0.2)).Position
|
||||||
|
local b = (cf * CFrame.new(s * 5.2, -0.1, 1.4)).Position
|
||||||
|
rod(a, b, 0.22, { Color = COL.plank, Material = WOOD, CanCollide = false, Parent = boat })
|
||||||
|
P({ Size = V(0.15, 0.9, 1.9), CFrame = CFrame.lookAt(b, b + (b - a)) * CFrame.Angles(0, math.rad(90), 0), Color = COL.plank, Material = WOOD, CanCollide = false, Parent = boat })
|
||||||
|
end
|
||||||
|
P({ Size = V(4.4, 1.7, 0.4), CFrame = cf * CFrame.new(0, 0.7, 4.5), Color = hull, Material = WOOD, Parent = boat })
|
||||||
|
for _, z in ipairs({ -1.6, 1.8 }) do
|
||||||
|
P({ Size = V(3.8, 0.3, 1.1), CFrame = cf * CFrame.new(0, 1.1, z), Color = inner, Material = PLANKS, Parent = boat })
|
||||||
|
end
|
||||||
|
ropePost(9.8, 52, -6, 3.4, 1.4, boat)
|
||||||
|
ropePost(16, 40, -6, 2.8, 1.4, boat)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- за спиной игрока: портал в лобби, место деда-рыбака, доска «Кто водится в озере»
|
||||||
|
do
|
||||||
|
local baseCF = CFrame.lookAt(W + V(15, GROUND_Y, 86), W + V(0, GROUND_Y, 62))
|
||||||
|
local color = Color3.fromRGB(255, 200, 80)
|
||||||
|
local portalModel = Instance.new("Model")
|
||||||
|
portalModel.Name = "PortalToLobby"
|
||||||
|
portalModel.Parent = map
|
||||||
|
local center = baseCF * CFrame.new(0, 10, 0)
|
||||||
|
P({ Size = V(17, 1, 9), CFrame = baseCF * CFrame.new(0, 0.5, 0), Material = Enum.Material.Slate, Color = Color3.fromRGB(95, 100, 115), Parent = portalModel })
|
||||||
|
P({ Size = V(14, 1, 7), CFrame = baseCF * CFrame.new(0, 1.5, 0), Material = Enum.Material.Slate, Color = Color3.fromRGB(110, 115, 130), Parent = portalModel })
|
||||||
|
local R, n = 7, 20
|
||||||
|
for i = 0, n - 1 do
|
||||||
|
local a = (i + 0.5) / n * math.pi * 2
|
||||||
|
P({ Size = V(2 * math.pi * R / n + 0.4, 1.7, 1.7), CFrame = center * CFrame.Angles(0, 0, a) * CFrame.new(0, R, 0), Material = Enum.Material.Slate, Color = Color3.fromRGB(80, 85, 100), Parent = portalModel })
|
||||||
|
if i % 2 == 0 then
|
||||||
|
P({ Size = V(0.6, 0.6, 1.9), CFrame = center * CFrame.Angles(0, 0, a) * CFrame.new(0, R + 0.95, 0), Material = Enum.Material.Neon, Color = color, Parent = portalModel })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local disc = P({
|
||||||
|
Name = "Portal_Lobby", Shape = Enum.PartType.Cylinder, Size = V(0.3, 2 * R - 1, 2 * R - 1), CFrame = center * CFrame.Angles(0, math.rad(90), 0),
|
||||||
|
Material = Enum.Material.Neon, Color = color, Transparency = 0.3, CanCollide = false, Parent = portalModel,
|
||||||
|
})
|
||||||
|
local pe = Instance.new("ParticleEmitter")
|
||||||
|
pe.Color = ColorSequence.new(color, Color3.new(1, 1, 1))
|
||||||
|
pe.LightEmission = 1
|
||||||
|
pe.Rate = 25
|
||||||
|
pe.Lifetime = NumberRange.new(1, 1.8)
|
||||||
|
pe.Speed = NumberRange.new(0.5, 2)
|
||||||
|
pe.SpreadAngle = Vector2.new(180, 180)
|
||||||
|
pe.Size = NumberSequence.new(0.5, 0)
|
||||||
|
pe.Transparency = NumberSequence.new(0.2, 1)
|
||||||
|
pe.Parent = disc
|
||||||
|
local bb = Instance.new("BillboardGui")
|
||||||
|
bb.Size = UDim2.fromOffset(250, 64)
|
||||||
|
bb.StudsOffset = V(0, 10, 0)
|
||||||
|
bb.MaxDistance = 160
|
||||||
|
bb.LightInfluence = 0
|
||||||
|
bb.Parent = disc
|
||||||
|
local t = Instance.new("TextLabel")
|
||||||
|
t.Size = UDim2.fromScale(1, 1)
|
||||||
|
t.BackgroundTransparency = 1
|
||||||
|
t.Font = Enum.Font.FredokaOne
|
||||||
|
t.TextScaled = true
|
||||||
|
t.TextColor3 = color:Lerp(Color3.new(1, 1, 1), 0.4)
|
||||||
|
t.TextStrokeTransparency = 0.15
|
||||||
|
t.Text = "🏠 В лобби"
|
||||||
|
t.Parent = bb
|
||||||
|
prompt(disc, "Перейти", "🏠 В лобби", "Portal"):SetAttribute("World", "Lobby")
|
||||||
|
end
|
||||||
|
marker("World1NpcGrandpa", CFrame.lookAt(W + V(9, GROUND_Y + 3, 72), W + V(0, GROUND_Y + 3, 62)))
|
||||||
|
do
|
||||||
|
local cf = CFrame.lookAt(W + V(-12, GROUND_Y, 80), W + V(0, GROUND_Y, 62))
|
||||||
|
for _, x in ipairs({ -5.5, 5.5 }) do
|
||||||
|
P({ Size = V(0.8, 10, 0.8), CFrame = cf * CFrame.new(x, 5, 0.3), Material = WOOD, Color = COL.logDark })
|
||||||
|
end
|
||||||
|
P({ Name = "World1Bestiary", Size = V(12, 9, 0.5), CFrame = cf * CFrame.new(0, 6.5, 0), Material = PLANKS, Color = Color3.fromRGB(70, 48, 32) })
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------- дальний берег: дом, холм с тропинкой и вышкой
|
||||||
|
logCabin("BigCabin", CFrame.lookAt(W + V(-58, GROUND_Y, -62), W + V(-20, GROUND_Y, 10)), 16, 12, 8)
|
||||||
|
postLantern(W + V(-44, GROUND_Y, -58), V(1, 0, 0), 8)
|
||||||
|
|
||||||
|
-- столб-вывеска с зелёным знаменем и белой рыбой у начала тропинки
|
||||||
|
do
|
||||||
|
local base = W + V(-17, GROUND_Y, -80)
|
||||||
|
vcyl(base + V(0, 6, 0), 12, 0.9, { Color = COL.logDark, Material = WOOD })
|
||||||
|
rod(base + V(0, 11.4, 0), base + V(3.6, 11.4, 0), 0.5, { Color = COL.logDark, Material = WOOD })
|
||||||
|
local flag = P({ Size = V(3, 5, 0.2), CFrame = CFrame.lookAt(base + V(2.2, 8.6, 0), base + V(2.2, 8.6, 10)), Color = COL.banner, Material = Enum.Material.Fabric, CanCollide = false })
|
||||||
|
surfaceText(flag, Enum.NormalId.Front, "🐟", Color3.new(1, 1, 1))
|
||||||
|
surfaceText(flag, Enum.NormalId.Back, "🐟", Color3.new(1, 1, 1))
|
||||||
|
end
|
||||||
|
|
||||||
|
-- забор вдоль тропинки и фонари
|
||||||
|
do
|
||||||
|
local posts = {}
|
||||||
|
for i = 2, #HILL_PATH do
|
||||||
|
local a, b = HILL_PATH[i - 1], HILL_PATH[i]
|
||||||
|
local dx, dz = b[1] - a[1], b[2] - a[2]
|
||||||
|
local len = math.sqrt(dx * dx + dz * dz)
|
||||||
|
local nx, nz = -dz / len, dx / len -- влево от направления
|
||||||
|
for s = 0, len - 0.1, 4.5 do
|
||||||
|
local x, z = a[1] + dx * s / len + nx * 3, a[2] + dz * s / len + nz * 3
|
||||||
|
table.insert(posts, W + V(x, hillY(x, z), z))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i, p in ipairs(posts) do
|
||||||
|
vcyl(p + V(0, 1.3, 0), 3, 0.45, { Color = COL.log, Material = WOOD })
|
||||||
|
local q = posts[i + 1]
|
||||||
|
if q and (q - p).Magnitude < 8 then
|
||||||
|
for _, h in ipairs({ 1.2, 2.3 }) do
|
||||||
|
rod(p + V(0, h, 0), q + V(0, h, 0), 0.3, { Color = COL.log, Material = WOOD, CanCollide = false })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, i in ipairs({ 2, 4 }) do
|
||||||
|
local x, z = HILL_PATH[i][1] + 3, HILL_PATH[i][2]
|
||||||
|
postLantern(W + V(x, hillY(x, z), z), V(-1, 0, 0), 7)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- смотровая вышка на вершине холма с зелёным флагом
|
||||||
|
do
|
||||||
|
local tower = Instance.new("Model")
|
||||||
|
tower.Name = "Watchtower"
|
||||||
|
tower.Parent = map
|
||||||
|
local c = W + V(-76, hillY(-76, -136) - 0.5, -136)
|
||||||
|
local H = 14
|
||||||
|
local function wood(props)
|
||||||
|
props.Parent = tower
|
||||||
|
return props
|
||||||
|
end
|
||||||
|
for _, sx in ipairs({ -1, 1 }) do
|
||||||
|
for _, sz in ipairs({ -1, 1 }) do
|
||||||
|
rod(c + V(sx * 4.2, 0, sz * 4.2), c + V(sx * 3.2, H, sz * 3.2), 1.1, wood({ Color = COL.log, Material = WOOD }))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, y in ipairs({ 4.5, 9 }) do
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
local k = 4.2 - y / H
|
||||||
|
rod(c + V(-k, y, s * k), c + V(k, y - 3, s * k), 0.4, wood({ Color = COL.logDark, Material = WOOD, CanCollide = false }))
|
||||||
|
rod(c + V(s * k, y, -k), c + V(s * k, y - 3, k), 0.4, wood({ Color = COL.logDark, Material = WOOD, CanCollide = false }))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
P(wood({ Size = V(9, 0.6, 9), Position = c + V(0, H, 0), Color = COL.plank, Material = PLANKS }))
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
P(wood({ Size = V(9, 1.4, 0.3), Position = c + V(0, H + 1.2, s * 4.4), Color = COL.log, Material = WOOD }))
|
||||||
|
P(wood({ Size = V(0.3, 1.4, 9), Position = c + V(s * 4.4, H + 1.2, 0), Color = COL.log, Material = WOOD }))
|
||||||
|
end
|
||||||
|
for _, sx in ipairs({ -1, 1 }) do
|
||||||
|
for _, sz in ipairs({ -1, 1 }) do
|
||||||
|
vcyl(c + V(sx * 4.2, H + 2.6, sz * 4.2), 5.2, 0.4, wood({ Color = COL.log, Material = WOOD }))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
P(wood({ Size = V(11, 0.5, 6.4), CFrame = CFrame.new(c + V(0, H + 6.2, s * 2.7)) * CFrame.Angles(s * math.rad(30), 0, 0), Color = COL.roof, Material = SMOOTH }))
|
||||||
|
end
|
||||||
|
vcyl(c + V(0, H + 10.5, 0), 7, 0.25, wood({ Color = COL.logDark, Material = WOOD }))
|
||||||
|
local flag = P(wood({ Size = V(4, 2.6, 0.15), CFrame = CFrame.new(c + V(2.1, H + 12.6, 0)), Color = COL.banner, Material = Enum.Material.Fabric, CanCollide = false }))
|
||||||
|
surfaceText(flag, Enum.NormalId.Front, "🐟", Color3.new(1, 1, 1))
|
||||||
|
surfaceText(flag, Enum.NormalId.Back, "🐟", Color3.new(1, 1, 1))
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------- северо-восток: домик с мостками, скала, водопад, мост
|
||||||
|
logCabin("SmallCabin", CFrame.lookAt(W + V(8, GROUND_Y, -96), W + V(4, GROUND_Y, 0)), 11, 9, 7)
|
||||||
|
smallDock(8, -86, -68, 6, GROUND_Y + 0.4)
|
||||||
|
postLantern(W + V(10.6, GROUND_Y + 0.4, -70), V(-1, 0, 0), 6)
|
||||||
|
|
||||||
|
local CLIFF_FRONT = -66 -- передняя кромка скалы по Z
|
||||||
|
local RIVER_X, RIVER_W, LIP_Y = 48, 10, 35 -- русло реки над водопадом и высота уступа
|
||||||
|
local cliff = Instance.new("Model")
|
||||||
|
cliff.Name = "Cliff"
|
||||||
|
cliff.Parent = map
|
||||||
|
do
|
||||||
|
-- скала уступами: три ряда блоков всё выше к заднему плану; у русла — вровень с уступом водопада
|
||||||
|
local rows = { { CLIFF_FRONT, 14, 22 }, { CLIFF_FRONT - 18, 26, 34 }, { CLIFF_FRONT - 40, 38, 50 } } -- { кромка, мин. высота, макс. высота }
|
||||||
|
for ri, row in ipairs(rows) do
|
||||||
|
local x = 28
|
||||||
|
while x < 116 do
|
||||||
|
local w = rng:NextNumber(11, 16)
|
||||||
|
local cx = x + w / 2
|
||||||
|
if math.abs(cx - RIVER_X) > RIVER_W / 2 + w / 2 - 1 then
|
||||||
|
local h = rng:NextNumber(row[2], row[3])
|
||||||
|
if ri <= 2 and math.abs(cx - RIVER_X) < 16 then
|
||||||
|
h = LIP_Y + rng:NextNumber(-0.5, 1.5) -- берега реки вровень с уступом: на них стоит мост
|
||||||
|
end
|
||||||
|
local d = rng:NextNumber(18, 24)
|
||||||
|
local cf = CFrame.new(W + V(cx, h / 2, row[1] - d / 2)) * CFrame.Angles(rng:NextNumber(-0.06, 0.06), rng:NextNumber(-0.25, 0.25), rng:NextNumber(-0.06, 0.06))
|
||||||
|
P({ Size = V(w, h, d), CFrame = cf, Color = COL.rock:Lerp(COL.rockDark, rng:NextNumber(0, 0.5)), Material = SMOOTH, Parent = cliff })
|
||||||
|
P({ Size = V(w - 1, 1.2, d - 1), CFrame = cf * CFrame.new(0, h / 2 + 0.3, 0), Color = COL.moss:Lerp(COL.leaf, rng:NextNumber(0, 0.5)), Material = SMOOTH, Parent = cliff })
|
||||||
|
-- острые обломки на кромке и на гранях — чтобы скала не выглядела ровной стеной
|
||||||
|
for _ = 1, 2 do
|
||||||
|
local s = rng:NextNumber(5, 9)
|
||||||
|
local cr = crag((cf * CFrame.new(rng:NextNumber(-w / 2, w / 2), rng:NextNumber(-h / 2, h / 2 - 2), -d / 2 + s * 0.2)).Position, s)
|
||||||
|
cr.Parent = cliff
|
||||||
|
end
|
||||||
|
if rng:NextNumber() < 0.7 then
|
||||||
|
pine((cf * CFrame.new(rng:NextNumber(-w / 4, w / 4), h / 2 + 0.8, rng:NextNumber(-d / 4, d / 4))).Position, rng:NextNumber(12, 20), 3)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
x += w - 0.5
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for x = 30, 112, 9 do
|
||||||
|
local cr = crag(W + V(x + rng:NextNumber(-3, 3), 2, CLIFF_FRONT + rng:NextNumber(0, 3)), rng:NextNumber(6, 11))
|
||||||
|
cr.Parent = cliff
|
||||||
|
end
|
||||||
|
-- ложе реки и стена за водопадом, река наверху
|
||||||
|
P({ Size = V(RIVER_W + 4, LIP_Y, 70), Position = W + V(RIVER_X, LIP_Y / 2, CLIFF_FRONT - 35), Color = COL.rockDark, Material = SMOOTH, Parent = cliff })
|
||||||
|
P({ Size = V(RIVER_W, 0.8, 70), Position = W + V(RIVER_X, LIP_Y + 0.4, CLIFF_FRONT - 35), Color = COL.water, Material = Enum.Material.Glass, Transparency = 0.15, CanCollide = false, Parent = cliff })
|
||||||
|
for z = CLIFF_FRONT - 4, CLIFF_FRONT - 66, -7 do
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
rock(W + V(RIVER_X + s * (RIVER_W / 2 + 0.5), LIP_Y + 1, z + rng:NextNumber(-2, 2)), rng:NextNumber(2.5, 4.5)).Parent = cliff
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- водопад: полупрозрачная «простыня», бегущие вниз струи (Beam с текстурой), пена и туман внизу
|
||||||
|
do
|
||||||
|
local fall = Instance.new("Model")
|
||||||
|
fall.Name = "Waterfall"
|
||||||
|
fall.Parent = map
|
||||||
|
local zf = CLIFF_FRONT - 1.2
|
||||||
|
local sheet = P({
|
||||||
|
Size = V(RIVER_W - 1, LIP_Y + 0.8, 1), Position = W + V(RIVER_X, LIP_Y / 2, zf),
|
||||||
|
Color = Color3.fromRGB(170, 236, 240), Material = Enum.Material.Glass, Transparency = 0.25, CanCollide = false, CastShadow = false, Parent = fall,
|
||||||
|
})
|
||||||
|
for i = 0, 4 do
|
||||||
|
local x = -RIVER_W / 2 + 1.5 + i * (RIVER_W - 3) / 4
|
||||||
|
local a0 = Instance.new("Attachment")
|
||||||
|
a0.Position = V(x, LIP_Y / 2, -0.6)
|
||||||
|
a0.Parent = sheet
|
||||||
|
local a1 = Instance.new("Attachment")
|
||||||
|
a1.Position = V(x + rng:NextNumber(-0.5, 0.5), -LIP_Y / 2, -0.6)
|
||||||
|
a1.Parent = sheet
|
||||||
|
local b = Instance.new("Beam")
|
||||||
|
b.Attachment0, b.Attachment1 = a0, a1
|
||||||
|
b.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
b.TextureMode = Enum.TextureMode.Wrap
|
||||||
|
b.TextureLength = 5
|
||||||
|
b.TextureSpeed = rng:NextNumber(1.6, 2.4)
|
||||||
|
b.Width0, b.Width1 = 2.6, 3.2
|
||||||
|
b.FaceCamera = true
|
||||||
|
b.LightEmission = 0.35
|
||||||
|
b.Color = ColorSequence.new(Color3.new(1, 1, 1))
|
||||||
|
b.Transparency = NumberSequence.new(0.25)
|
||||||
|
b.Parent = sheet
|
||||||
|
end
|
||||||
|
for _ = 1, 9 do
|
||||||
|
vcyl(W + V(RIVER_X + rng:NextNumber(-6, 6), WATER_Y + 0.2, zf + rng:NextNumber(0.5, 6)), 0.5, rng:NextNumber(3, 6), {
|
||||||
|
Color = Color3.fromRGB(240, 252, 252), Material = SMOOTH, Transparency = 0.15, CanCollide = false, CastShadow = false, Parent = fall,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
local function mistAt(pos, size, rate, s0, s1)
|
||||||
|
local holder = P({ Size = size, Position = pos, Transparency = 1, CanCollide = false, CanQuery = false, Parent = fall })
|
||||||
|
local mist = Instance.new("ParticleEmitter")
|
||||||
|
mist.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||||
|
mist.Color = ColorSequence.new(Color3.new(1, 1, 1))
|
||||||
|
mist.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, s0), NumberSequenceKeypoint.new(1, s1) })
|
||||||
|
mist.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.45), NumberSequenceKeypoint.new(1, 1) })
|
||||||
|
mist.Lifetime = NumberRange.new(2, 3.5)
|
||||||
|
mist.Rate = rate
|
||||||
|
mist.Speed = NumberRange.new(2, 5)
|
||||||
|
mist.SpreadAngle = Vector2.new(70, 70)
|
||||||
|
mist.Parent = holder
|
||||||
|
end
|
||||||
|
mistAt(W + V(RIVER_X, WATER_Y + 1, zf + 2), V(RIVER_W, 1, 2), 14, 4, 11)
|
||||||
|
mistAt(W + V(RIVER_X, LIP_Y, zf), V(RIVER_W, 1, 1), 5, 2, 5)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- арочный деревянный мост через реку над водопадом
|
||||||
|
do
|
||||||
|
local bridge = Instance.new("Model")
|
||||||
|
bridge.Name = "Bridge"
|
||||||
|
bridge.Parent = map
|
||||||
|
local z, x0, x1, y0, rise = CLIFF_FRONT - 22, RIVER_X - 11, RIVER_X + 11, LIP_Y + 1, 3.2
|
||||||
|
local N = 12
|
||||||
|
local function arc(t)
|
||||||
|
return W + V(x0 + (x1 - x0) * t, y0 + math.sin(t * math.pi) * rise, z)
|
||||||
|
end
|
||||||
|
for i = 0, N - 1 do
|
||||||
|
local a, b = arc(i / N), arc((i + 1) / N)
|
||||||
|
P({ Size = V((b - a).Magnitude + 0.1, 0.5, 5), CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.rad(90), 0), Color = COL.plank:Lerp(COL.plankDark, (i % 2) * 0.4), Material = PLANKS, Parent = bridge })
|
||||||
|
end
|
||||||
|
for _, s in ipairs({ -1, 1 }) do
|
||||||
|
local prev
|
||||||
|
for i = 0, N, 2 do
|
||||||
|
local p = arc(i / N) + V(0, 0, s * 2.3)
|
||||||
|
vcyl(p + V(0, 1.4, 0), 2.8, 0.4, { Color = COL.log, Material = WOOD, Parent = bridge })
|
||||||
|
if prev then
|
||||||
|
rod(prev + V(0, 2.6, 0), p + V(0, 2.6, 0), 0.32, { Color = COL.log, Material = WOOD, Parent = bridge })
|
||||||
|
end
|
||||||
|
prev = p
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------- у воды: камни, рогоз, кувшинки
|
||||||
|
local function nearDock(x, z)
|
||||||
|
return math.abs(x) < 9 and z > 28 and z < 70
|
||||||
|
end
|
||||||
|
local function inCliff(x, z)
|
||||||
|
return x > 24 and x < 118 and z < -58 and z > -150
|
||||||
|
end
|
||||||
|
for _, l in ipairs(LAKES) do
|
||||||
|
for _ = 1, 9 do
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local r = l[3] + rng:NextNumber(-1, 2.5)
|
||||||
|
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||||
|
if not inLake(x, z, -4) and not nearDock(x, z) and not inCliff(x, z) then
|
||||||
|
rock(W + V(x, rng:NextNumber(0.5, 2.5), z), rng:NextNumber(2.5, 5.5))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _ = 1, 5 do
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local r = l[3] + rng:NextNumber(-1.5, 0.5)
|
||||||
|
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||||
|
if not inLake(x, z, -3) and not nearDock(x, z) and not inCliff(x, z) then
|
||||||
|
cattails(W + V(x, WATER_Y - 0.5, z))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, p in ipairs({ { 11, 55 }, { 15, 52 }, { -9, 53 }, { 20, 47 } }) do -- рогоз в правом нижнем углу кадра
|
||||||
|
cattails(W + V(p[1], WATER_Y - 0.5, p[2]))
|
||||||
|
end
|
||||||
|
for _ = 1, 14 do -- кувшинки группами
|
||||||
|
local l = LAKES[rng:NextInteger(1, #LAKES)]
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local r = l[3] * rng:NextNumber(0.5, 0.88)
|
||||||
|
local cx, cz = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||||
|
for _ = 1, rng:NextInteger(2, 5) do
|
||||||
|
local x, z = cx + rng:NextNumber(-3, 3), cz + rng:NextNumber(-3, 3)
|
||||||
|
if inLake(x, z, -2) and not nearDock(x, z) and not (x > 6 and x < 20 and z > 36 and z < 56) then
|
||||||
|
local size = rng:NextNumber(2, 3.4)
|
||||||
|
P({ Shape = Enum.PartType.Cylinder, Size = V(0.15, size, size), CFrame = CFrame.new(W + V(x, WATER_Y + 0.12, z)) * CFrame.Angles(0, 0, math.rad(90)), Color = Color3.fromRGB(78, 168, 70):Lerp(Color3.fromRGB(110, 190, 80), rng:NextNumber()), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||||
|
if rng:NextNumber() < 0.35 then
|
||||||
|
ball(W + V(x + 0.3, WATER_Y + 0.45, z), 0.8, { Color = Color3.fromRGB(255, 150, 195), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||||
|
ball(W + V(x + 0.3, WATER_Y + 0.75, z), 0.4, { Color = Color3.fromRGB(255, 235, 120), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------- лес, кусты, цветы
|
||||||
|
local function nearPath(x, z, dist)
|
||||||
|
for i = 2, #HILL_PATH do
|
||||||
|
local a, b = HILL_PATH[i - 1], HILL_PATH[i]
|
||||||
|
local abx, abz = b[1] - a[1], b[2] - a[2]
|
||||||
|
local t = math.clamp(((x - a[1]) * abx + (z - a[2]) * abz) / (abx * abx + abz * abz), 0, 1)
|
||||||
|
if (x - a[1] - abx * t) ^ 2 + (z - a[2] - abz * t) ^ 2 < dist * dist then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local function freeSpot(x, z)
|
||||||
|
if math.abs(x) > 236 or math.abs(z) > 236 or inLake(x, z, 6) or inCliff(x, z) or nearPath(x, z, 6) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if x > -32 and x < 30 and z > 44 and z < 100 then -- прибытие, лавка, портал
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
for _, c in ipairs({ { -58, -62, 16 }, { 8, -96, 13 }, { -76, -136, 11 }, { -17, -80, 5 } }) do
|
||||||
|
if (x - c[1]) ^ 2 + (z - c[2]) ^ 2 < c[3] * c[3] then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return not (x > 2 and x < 14 and z > -100 and z < -64) -- мостки у домика
|
||||||
|
end
|
||||||
|
|
||||||
|
local placed = 0
|
||||||
|
for _ = 1, 700 do
|
||||||
|
if placed >= 210 then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
local x, z = rng:NextNumber(-236, 236), rng:NextNumber(-236, 236)
|
||||||
|
-- за озером лес гуще, перед ним (за спиной игрока) реже
|
||||||
|
if (z < 0 or rng:NextNumber() < 0.45) and freeSpot(x, z) then
|
||||||
|
local far = math.max(math.abs(x), math.abs(z)) > 150
|
||||||
|
pine(W + V(x, hillY(x, z) - 0.3, z), far and rng:NextNumber(22, 32) or rng:NextNumber(15, 25), far and 2 or 3)
|
||||||
|
placed += 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _ = 1, 25 do -- лиственные деревья у берегов
|
||||||
|
local l = LAKES[rng:NextInteger(1, #LAKES)]
|
||||||
|
local a = rng:NextNumber(0, math.pi * 2)
|
||||||
|
local r = l[3] + rng:NextNumber(8, 18)
|
||||||
|
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||||
|
if freeSpot(x, z) then
|
||||||
|
leafy(W + V(x, hillY(x, z) - 0.3, z), rng:NextNumber(8, 12))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _ = 1, 50 do -- кусты
|
||||||
|
local x, z = rng:NextNumber(-150, 150), rng:NextNumber(-150, 120)
|
||||||
|
if freeSpot(x, z) then
|
||||||
|
local y = hillY(x, z)
|
||||||
|
local c = COL.leafDark:Lerp(COL.leaf, rng:NextNumber())
|
||||||
|
for _ = 1, 3 do
|
||||||
|
ball(W + V(x + rng:NextNumber(-1.5, 1.5), y + 0.8, z + rng:NextNumber(-1.5, 1.5)), rng:NextNumber(2.5, 4), { Color = c, Material = SMOOTH, CanCollide = false })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _ = 1, 80 do -- цветы
|
||||||
|
local x, z = rng:NextNumber(-120, 120), rng:NextNumber(-140, 110)
|
||||||
|
if freeSpot(x, z) or nearPath(x, z, 6) and not nearPath(x, z, 3) then
|
||||||
|
ball(W + V(x, hillY(x, z) + 0.4, z), 0.6, {
|
||||||
|
Color = ({ Color3.fromRGB(255, 120, 150), Color3.fromRGB(255, 230, 90), Color3.fromRGB(245, 245, 255), Color3.fromRGB(190, 140, 255) })[rng:NextInteger(1, 4)],
|
||||||
|
Material = SMOOTH, CanCollide = false, CastShadow = false,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- отдельные детали (деревья, камни, кусты, фонари) — в папку Decor, чтобы в Explorer было видно
|
||||||
|
-- главное: модели и маркеры World1*/Guide*
|
||||||
|
local decor = Instance.new("Folder")
|
||||||
|
decor.Name = "Decor"
|
||||||
|
decor.Parent = map
|
||||||
|
for _, c in ipairs(map:GetChildren()) do
|
||||||
|
if c:IsA("BasePart") and not c.Name:match("^World1") and not c.Name:match("^Guide") then
|
||||||
|
c.Parent = decor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------- горизонт: горы и облака
|
||||||
|
do
|
||||||
|
local horizon = Instance.new("Folder")
|
||||||
|
horizon.Name = "Horizon"
|
||||||
|
horizon.Parent = map
|
||||||
|
-- гора — несколько острых пиков (кубы вершиной вверх) разного размера
|
||||||
|
local function mountain(a, dist, s)
|
||||||
|
local base = W + V(math.cos(a) * dist, 0, math.sin(a) * dist)
|
||||||
|
for k = 1, 3 do
|
||||||
|
local ss = k == 1 and s or s * rng:NextNumber(0.45, 0.7)
|
||||||
|
local off = k == 1 and V(0, 0, 0) or V(rng:NextNumber(-0.7, 0.7) * s, 0, rng:NextNumber(-0.4, 0.4) * s)
|
||||||
|
local apex = ss * rng:NextNumber(0.55, 0.75) -- высота пика над землёй
|
||||||
|
P({
|
||||||
|
Size = V(ss, ss, ss),
|
||||||
|
CFrame = CFrame.new(base + off + V(0, apex - ss * 0.866, 0)) * CFrame.Angles(rng:NextNumber(-0.1, 0.1), rng:NextNumber(0, 6.28), rng:NextNumber(-0.1, 0.1)) * CUBE_UP,
|
||||||
|
Color = Color3.fromRGB(152, 166, 190):Lerp(Color3.fromRGB(118, 134, 164), rng:NextNumber()), Material = SMOOTH,
|
||||||
|
CanCollide = false, CanQuery = false, CastShadow = false, Parent = horizon,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i = 0, 13 do -- север (за озером) — крупнее и плотнее
|
||||||
|
mountain(math.rad(-160 + i * 10 + rng:NextNumber(-4, 4)), rng:NextNumber(340, 470), rng:NextNumber(130, 220))
|
||||||
|
end
|
||||||
|
for i = 0, 9 do -- остальные стороны
|
||||||
|
mountain(math.rad(20 + i * 16 + rng:NextNumber(-5, 5)), rng:NextNumber(360, 480), rng:NextNumber(100, 160))
|
||||||
|
end
|
||||||
|
for _ = 1, 9 do
|
||||||
|
local c = W + V(rng:NextNumber(-380, 380), rng:NextNumber(170, 230), rng:NextNumber(-420, 200))
|
||||||
|
for _ = 1, rng:NextInteger(4, 6) do
|
||||||
|
ball(c + V(rng:NextNumber(-30, 30), rng:NextNumber(-5, 8), rng:NextNumber(-12, 12)), rng:NextNumber(22, 42), {
|
||||||
|
Color = Color3.new(1, 1, 1), Material = SMOOTH, CanCollide = false, CanQuery = false, CastShadow = false, Parent = horizon,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- невидимые стены по краю мира
|
||||||
|
for _, w in ipairs({
|
||||||
|
{ V(0, 0, 245), V(500, 120, 2) },
|
||||||
|
{ V(0, 0, -245), V(500, 120, 2) },
|
||||||
|
{ V(245, 0, 0), V(2, 120, 500) },
|
||||||
|
{ V(-245, 0, 0), V(2, 120, 500) },
|
||||||
|
}) do
|
||||||
|
P({ Name = "WorldWall", Size = w[2], Position = W + w[1] + V(0, 50, 0), Transparency = 1, CanQuery = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
map.Parent = parent
|
||||||
|
return map
|
||||||
|
end
|
||||||
|
|
||||||
|
-- сборка в Studio: стирает старую папку и террейн мира, строит заново прямо в Workspace
|
||||||
|
function Builder.bake()
|
||||||
|
local old = Workspace:FindFirstChild("World1Map")
|
||||||
|
if old then
|
||||||
|
old:Destroy()
|
||||||
|
end
|
||||||
|
terrain:FillBlock(CFrame.new(W + V(0, 30, 0)), V(504, 120, 504), Enum.Material.Air)
|
||||||
|
local map = Builder.build(Workspace)
|
||||||
|
print(("✅ «Тихое озеро» собрано: Workspace.World1Map, деталей: %d. Сохраните плейс (Ctrl+S)."):format(#map:GetDescendants()))
|
||||||
|
return map
|
||||||
|
end
|
||||||
|
|
||||||
|
return Builder
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -333,7 +333,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()
|
||||||
@@ -504,7 +505,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 }
|
||||||
|
|
||||||
---------------------------------------------------------------- магазин
|
---------------------------------------------------------------- магазин
|
||||||
|
|
||||||
@@ -892,35 +893,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
|
||||||
@@ -1007,13 +1028,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]
|
||||||
@@ -1536,110 +1552,136 @@ 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)
|
|
||||||
|
|
||||||
-- Исходный свет восстанавливается при выходе из Тихого озера.
|
-- то, что мир может поменять под себя (оттенок, цвета травы и песка); вода не трогается — она из свойств Terrain
|
||||||
local lakeDefaults
|
local DEFAULT_LOOK = { tint = Color3.new(1, 1, 1) }
|
||||||
|
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 lake = world and world.id == "World1"
|
local clock = (world and world.clock) or 14.5
|
||||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
||||||
local bloom = Lighting:FindFirstChildOfClass("BloomEffect")
|
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||||
local grade = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
if cc then
|
||||||
local rays = Lighting:FindFirstChildOfClass("SunRaysEffect")
|
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
||||||
if not lakeDefaults then
|
|
||||||
lakeDefaults = {
|
|
||||||
ambient = Lighting.Ambient, outdoor = Lighting.OutdoorAmbient,
|
|
||||||
brightness = Lighting.Brightness, exposure = Lighting.ExposureCompensation,
|
|
||||||
latitude = Lighting.GeographicLatitude, reflectance = terrain.WaterReflectance,
|
|
||||||
haze = atm and atm.Haze or 0.6, decay = atm and atm.Decay or Color3.fromRGB(110, 140, 175),
|
|
||||||
bloom = bloom and bloom.Intensity or 0.5, threshold = bloom and bloom.Threshold or 1.4,
|
|
||||||
tint = grade and grade.TintColor or Color3.new(1, 1, 1),
|
|
||||||
contrast = grade and grade.Contrast or 0.06, rays = rays and rays.Intensity or 0.05,
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
local base = lakeDefaults
|
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
||||||
TweenService:Create(Lighting, TweenInfo.new(2), {
|
if not defaultTerrainColors then
|
||||||
ClockTime = (world and world.clock) or 14.5,
|
defaultTerrainColors = {}
|
||||||
Ambient = lake and Color3.fromRGB(108, 100, 85) or base.ambient,
|
for _, name in ipairs({ "Snow", "Salt", "Mud", "Sand", "Rock", "Slate" }) do
|
||||||
OutdoorAmbient = lake and Color3.fromRGB(157, 160, 144) or base.outdoor,
|
defaultTerrainColors[name] = terrain:GetMaterialColor(Enum.Material[name])
|
||||||
Brightness = lake and 2.5 or base.brightness,
|
end
|
||||||
ExposureCompensation = lake and 0.08 or base.exposure,
|
end
|
||||||
GeographicLatitude = lake and 35 or base.latitude,
|
local colors = (world and world.terrainColors) or {}
|
||||||
}):Play()
|
for name, def in pairs(defaultTerrainColors) do
|
||||||
terrain.WaterColor = (world and world.water) or defaultWater
|
terrain:SetMaterialColor(Enum.Material[name], colors[name] or def)
|
||||||
terrain.WaterTransparency = (world and world.waterTransparency) or 0.15
|
end
|
||||||
terrain.WaterReflectance = lake and 0.12 or base.reflectance
|
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||||
if atm then
|
if atm then
|
||||||
local frost = world and world.id == "World3"
|
local frost = world and world.id == "World3"
|
||||||
TweenService:Create(atm, TweenInfo.new(2), {
|
TweenService:Create(atm, TweenInfo.new(2), {
|
||||||
Density = lake and 0.23 or (frost and 0.38 or 0.25),
|
Density = frost and 0.38 or 0.25,
|
||||||
Color = lake and Color3.fromRGB(205, 222, 232) or (frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232)),
|
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
||||||
Decay = lake and Color3.fromRGB(155, 173, 177) or base.decay,
|
|
||||||
Haze = lake and 1 or base.haze,
|
|
||||||
}):Play()
|
}):Play()
|
||||||
end
|
end
|
||||||
if bloom then TweenService:Create(bloom, TweenInfo.new(2), { Intensity = lake and 0.25 or base.bloom, Threshold = lake and 1.5 or base.threshold }):Play() end
|
applyLook(world)
|
||||||
if grade then
|
|
||||||
TweenService:Create(grade, TweenInfo.new(2), {
|
|
||||||
TintColor = lake and Color3.fromRGB(255, 242, 220) or base.tint,
|
|
||||||
Contrast = lake and 0.08 or base.contrast,
|
|
||||||
}):Play()
|
|
||||||
end
|
|
||||||
if rays then rays.Intensity = lake and 0.06 or base.rays end
|
|
||||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Восемь силуэтов обновляются локально 20 раз в секунду и только рядом с озером.
|
-- тёмные силуэты рыб под прозрачной водой «Тихого озера», медленно плавают по кругу (только у этого игрока)
|
||||||
local fishScenery, ambientFish, waterfallRipples = nil, {}, {}
|
do
|
||||||
local fishElapsed = 0
|
local w1 = Config.Worlds[1]
|
||||||
RunService.Heartbeat:Connect(function(dt)
|
local fishList = Config.Zones.World1.fish
|
||||||
fishElapsed += dt
|
local frng = Random.new(11)
|
||||||
if fishElapsed < 0.05 then return end
|
local folder = new("Folder", { Name = "FishShadows", Parent = workspace })
|
||||||
fishElapsed = 0
|
local swimmers = {}
|
||||||
local world = currentWorld()
|
for i = 1, 10 do
|
||||||
if not world or world.id ~= "World1" then return end
|
local l = w1.lakes[(i - 1) % #w1.lakes + 1]
|
||||||
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
local ok, model = pcall(Models.buildFish, fishList[(i - 1) % #fishList + 1].id, nil, frng:NextNumber(1.3, 2), true)
|
||||||
if not root or (root.Position - world.center).Magnitude > 180 then return end
|
if ok and model then
|
||||||
if not fishScenery or not fishScenery.Parent or #ambientFish == 0 then
|
for _, d in ipairs(model:GetDescendants()) do
|
||||||
local map = workspace:FindFirstChild("FishingMap")
|
if d:IsA("BasePart") then
|
||||||
fishScenery = map and map:FindFirstChild("World1Scenery")
|
d.Color = Color3.fromRGB(22, 70, 74)
|
||||||
ambientFish, waterfallRipples = {}, {}
|
d.Material = Enum.Material.SmoothPlastic
|
||||||
if fishScenery then
|
d.Transparency = 0.5
|
||||||
for _, child in ipairs(fishScenery:GetChildren()) do
|
d.CanCollide, d.CanQuery, d.CanTouch, d.CastShadow = false, false, false, false
|
||||||
if child:IsA("Model") and child.Name == "AmbientFish" then table.insert(ambientFish, child) end
|
elseif d:IsA("Decal") or d:IsA("ParticleEmitter") or d:IsA("Light") then
|
||||||
if child:IsA("Model") and child.Name == "WaterfallRipple" then table.insert(waterfallRipples, child) end
|
d:Destroy()
|
||||||
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
local now = workspace:GetServerTimeNow()
|
local acc = 0
|
||||||
for _, ripple in ipairs(waterfallRipples) do
|
RunService.Heartbeat:Connect(function(dt)
|
||||||
if ripple.Parent then
|
acc += dt
|
||||||
local center = ripple:GetAttribute("RippleCenter")
|
if acc < 1 / 30 then
|
||||||
local phase = (now * 0.3 + ripple:GetAttribute("RipplePhase")) % 1
|
return
|
||||||
local radius = 2 + phase * 8
|
|
||||||
for _, segment in ipairs(ripple:GetChildren()) do
|
|
||||||
local index = segment:GetAttribute("RippleSegment")
|
|
||||||
local a, b = index * math.pi / 6, (index + 1) * math.pi / 6
|
|
||||||
local p = center + Vector3.new(math.cos(a) * radius, 0, math.sin(a) * radius)
|
|
||||||
local q = center + Vector3.new(math.cos(b) * radius, 0, math.sin(b) * radius)
|
|
||||||
segment.Size = Vector3.new((q - p).Magnitude, 0.07, 0.07)
|
|
||||||
segment.CFrame = CFrame.lookAt((p + q) / 2, q) * CFrame.Angles(0, math.pi / 2, 0)
|
|
||||||
segment.Transparency = 0.6 + phase * 0.4
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
local step = acc
|
||||||
for _, fish in ipairs(ambientFish) do
|
acc = 0
|
||||||
if fish.Parent then
|
local w = currentWorld()
|
||||||
local center, radius = fish:GetAttribute("SwimCenter"), fish:GetAttribute("SwimRadius")
|
if not (w and w.id == "World1") then
|
||||||
local angle = now * fish:GetAttribute("SwimSpeed") + fish:GetAttribute("SwimPhase")
|
return
|
||||||
local pos = center + Vector3.new(math.cos(angle) * radius, 0, math.sin(angle) * radius * 0.65)
|
|
||||||
local direction = Vector3.new(-math.sin(angle), 0, math.cos(angle) * 0.65)
|
|
||||||
fish:PivotTo(CFrame.lookAt(pos, pos + direction))
|
|
||||||
end
|
end
|
||||||
end
|
for _, s in ipairs(swimmers) do
|
||||||
end)
|
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()
|
task.spawn(function()
|
||||||
while true do
|
while true do
|
||||||
@@ -1674,7 +1716,6 @@ end)
|
|||||||
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
||||||
|
|
||||||
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
||||||
local W1 = Config.Worlds[1].center
|
|
||||||
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
||||||
|
|
||||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||||
@@ -1732,7 +1773,7 @@ end
|
|||||||
|
|
||||||
local function guideMarker(name)
|
local function guideMarker(name)
|
||||||
local map = workspace:FindFirstChild("FishingMap")
|
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
|
return m and m.Position
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1863,22 +1904,50 @@ local function guideRoute(step, pos, world)
|
|||||||
elseif step == 2 and inW1 then
|
elseif step == 2 and inW1 then
|
||||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||||
elseif step == 3 and inW1 then
|
elseif step == 3 and inW1 then
|
||||||
local route = {}
|
return { guideMarker("GuideSell") }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||||
local rel = pos - W1
|
|
||||||
if math.abs(rel.X) < 6 and rel.Z < 80 then
|
|
||||||
table.insert(route, W1 + Vector3.new(0, 4.5, 84)) -- сначала сойти с причала
|
|
||||||
end
|
|
||||||
table.insert(route, guideMarker("GuideSell"))
|
|
||||||
return route, "💰 Продай рыбу", "Sell"
|
|
||||||
end
|
end
|
||||||
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)
|
||||||
@@ -1894,7 +1963,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")
|
||||||
@@ -1911,7 +1982,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
|
||||||
@@ -1978,9 +2057,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
|
||||||
@@ -2014,17 +2449,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
|
||||||
|
|||||||
Reference in new issue
Block a user