Диковинки: 21 необычная рыба с условиями поимки, загадками, секретами и записками в бутылках
This commit is contained in:
1 parent
f9c2ff77bd
commit
a78bdc46fe
2 files changed
+156
-3
No files matched your search
@@ -58,7 +58,8 @@ local function feedCatch(player, fish, world)
|
||||
name = player.DisplayName, userId = player.UserId,
|
||||
fish = fish.name, rarity = fish.rarity, mutation = fish.mutation, value = fish.value,
|
||||
world = world and (world.icon .. " " .. world.name) or nil,
|
||||
big = r.rank >= F.announceRank or F.announceMutations[fish.mutation or ""] == true,
|
||||
big = r.rank >= F.announceRank or F.announceMutations[fish.mutation or ""] == true or fish.curio == true,
|
||||
curio = fish.curio,
|
||||
}
|
||||
feed("catch", info)
|
||||
if r.rank >= F.globalRank or F.globalMutations[fish.mutation or ""] then
|
||||
@@ -973,7 +974,57 @@ local function stopFishing(player, tellClient)
|
||||
end
|
||||
end
|
||||
|
||||
-- mods: { bait = наживка из Config.Baits, maxRank = потолок редкости (автоловля), potion = Potions.effect }
|
||||
-- диковинка вместо обычной рыбы (Config.Curios): все условия выполнены и сработал шанс 1 к chance
|
||||
local function curioCondOk(player, data, cond, chosen, mods)
|
||||
if cond.night and not isNight() then
|
||||
return false
|
||||
end
|
||||
if cond.day and isNight() then
|
||||
return false
|
||||
end
|
||||
if cond.weathers and not cond.weathers[workspace:GetAttribute("Weather") or "Clear"] then
|
||||
return false
|
||||
end
|
||||
if cond.perfect and not mods.perfect then
|
||||
return false
|
||||
end
|
||||
if cond.event and not (currentEvent and currentEvent.id == cond.event) then
|
||||
return false
|
||||
end
|
||||
if cond.bait and not (mods.bait and mods.bait.id == cond.bait) then
|
||||
return false
|
||||
end
|
||||
if cond.replaces and chosen.id ~= cond.replaces then
|
||||
return false
|
||||
end
|
||||
if cond.minCombo and (combo[player] or 0) < cond.minCombo then
|
||||
return false
|
||||
end
|
||||
if cond.minLevel and (data.level or 1) < cond.minLevel then
|
||||
return false
|
||||
end
|
||||
if cond.hours then
|
||||
local h = Config.ClockAt(workspace:GetServerTimeNow(), workspace:GetAttribute("DayStart"))
|
||||
local a, b = cond.hours[1], cond.hours[2]
|
||||
local inside = (a <= b) and (h >= a and h < b) or (h >= a or h < b)
|
||||
if not inside then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local function pickCurio(player, data, worldId, chosen, mods)
|
||||
for _, c in ipairs(Config.Curios) do
|
||||
if c.world == worldId and curioCondOk(player, data, c.cond or {}, chosen, mods) and rng:NextNumber() < 1 / c.chance then
|
||||
return c
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- mods: { bait = наживка из Config.Baits, maxRank = потолок редкости (автоловля), potion = Potions.effect,
|
||||
-- manual = ручной заброс (только он может поймать диковинку), perfect = заброс в зелёную зону }
|
||||
-- Удача смягчается к потолку (Config.EffectiveLuck): лучшее снаряжение даёт больше дорогой рыбы,
|
||||
-- но мифическая не становится обычной, а мутации не чаще × Economy.mutationCap
|
||||
local function rollFish(player, data, worldId, luckMult, mods)
|
||||
@@ -1015,6 +1066,10 @@ local function rollFish(player, data, worldId, luckMult, mods)
|
||||
break
|
||||
end
|
||||
end
|
||||
local curio = mods.manual and pickCurio(player, data, worldId, chosen, mods) or nil
|
||||
if curio then
|
||||
chosen = curio
|
||||
end
|
||||
local mutation = nil
|
||||
local mm = Config.MutationMult(beff, ev("mutation", 1) * (weather().mutation or 1) * (bait and bait.mutation or 1) * (pot.mutation or 1))
|
||||
for _, m in ipairs(Config.Mutations) do
|
||||
@@ -1033,6 +1088,7 @@ local function rollFish(player, data, worldId, luckMult, mods)
|
||||
value = math.floor(chosen.price * (0.75 + 0.9 * wf) * (mutation and mutation.mult or 1) + 0.5),
|
||||
mutation = mutation and mutation.id or nil,
|
||||
world = worldId,
|
||||
curio = curio ~= nil or nil,
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1123,7 +1179,7 @@ local function onCast(player, power)
|
||||
local bait = Guild.useBait(player, data) -- 1 штука наживки на заброс
|
||||
-- зелье: эффект берём на момент заброса, попытку списываем при поклёвке (ниже)
|
||||
local potion = Potions.effect(data)
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1, { bait = bait, potion = potion })
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1, { bait = bait, potion = potion, manual = true, perfect = perfect })
|
||||
if not fish then
|
||||
remote:FireClient(player, "CastFail")
|
||||
return
|
||||
@@ -1288,6 +1344,33 @@ grantFish = function(player, data, fish, ctx)
|
||||
local h = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
feedCatch(player, fish, h and Config.WorldAt(h.Position))
|
||||
end
|
||||
-- диковинка: всем на сервере, а первая поимка — ещё и жемчуг
|
||||
if fish.curio then
|
||||
local def = Config.CurioById[fish.id]
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
notify(p, ("✨ %s поймал диковинку: %s!"):format(player.DisplayName, fish.name), Config.Rarities[fish.rarity].color)
|
||||
end
|
||||
-- бутылочная рыба несёт записку: подсказку к диковинке, которой у игрока ещё нет (секретные — тоже)
|
||||
if fish.id == "BottleFish" then
|
||||
local left = {}
|
||||
for _, c in ipairs(Config.Curios) do
|
||||
if not data.discovered[c.id] and c.id ~= "BottleFish" then
|
||||
table.insert(left, c)
|
||||
end
|
||||
end
|
||||
local c = left[rng:NextInteger(1, math.max(1, #left))]
|
||||
if c then
|
||||
notify(player, ("📜 В бутылке записка: «%s»"):format(c.hint or c.rumor or "Здесь водится то, о чём молчат даже старейшины…"), Color3.fromRGB(240, 225, 180))
|
||||
end
|
||||
end
|
||||
if isNew then
|
||||
local pearls = def and def.secret and Config.CurioPearls.secret or Config.CurioPearls.first
|
||||
data.pearls += pearls
|
||||
notify(player, ("📖 Новая диковинка в коллекции! +%d 🦪"):format(pearls), GOLD)
|
||||
Telemetry.event(player, "CurioFirst", 1, { fish.id })
|
||||
updateStats(player)
|
||||
end
|
||||
end
|
||||
|
||||
local rank = Config.Rarities[fish.rarity].rank
|
||||
-- задания засчитывают только ручную ловлю (автоловля — дополнительный доход, не прогресс)
|
||||
|
||||
Reference in new issue
Block a user