From 350ac184176836ebde237ad4dd08d48371e265f5 Mon Sep 17 00:00:00 2001 From: gechangfu Date: Mon, 25 Aug 2025 10:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ServerStorage/Proxy/EquipmentProxy.luau | 32 ++++++++++++++++--- .../UI/Common/SpecialShow.luau | 7 ++-- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/ServerStorage/Proxy/EquipmentProxy.luau b/src/ServerStorage/Proxy/EquipmentProxy.luau index c9656f7..c64e9f7 100644 --- a/src/ServerStorage/Proxy/EquipmentProxy.luau +++ b/src/ServerStorage/Proxy/EquipmentProxy.luau @@ -12,6 +12,7 @@ local ArchiveProxy = require(ServerStorage.Proxy.ArchiveProxy) local PlayerInfoProxy = require(ServerStorage.Proxy.PlayerInfoProxy) local PlayerFightProxy = require(ServerStorage.Proxy.PlayerFightProxy) local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy) +local RuneProxy = require(ServerStorage.Proxy.RuneProxy) --> Json local JsonEquipment = require(ReplicatedStorage.Json.Equipment) @@ -199,7 +200,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number) end end - -- 属性祝福处理 + -- 祝福变量记录 local BookProxy = require(ServerStorage.Proxy.BookProxy) local blessingId, blessingRate = BookProxy:GetBlessingInfo(Player, EquipmentId) local blessingType, blessingEffect @@ -211,6 +212,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number) blessingEffect = blessingData.effect end + -- 属性祝福处理 if blessingType == 1 then -- 找到对应祝福所属的表名 local attributeData = Utils:GetIdDataFromJson(JsonAttributes, blessingEffect) @@ -307,14 +309,35 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number) if runeNumber > 0 then local spawnRunesId = {} + + -- 符文祝福处理 + local blessingTrigger = false + local blessingRuneId + + if blessingType == 3 and not blessingTrigger then + -- 没触发过,中了概率就指定符文id + local isTrigger = Rng:RandomPercent(blessingRate) + if isTrigger then + blessingTrigger = true + blessingRuneId = blessingEffect + end + end + for i = 1, runeNumber do -- 是否生成符文 local isTrigger = Rng:GetRandomInt(1, 100) <= 5 - if isTrigger then - local newRuneId = RuneProxy:GetRandomRuneId(spawnRunesId) + if isTrigger or blessingTrigger then + -- 随机生成符文,如果祝福触发,就指定符文id + local newRuneId = blessingRuneId or RuneProxy:GetRandomRuneId(spawnRunesId) table.insert(spawnRunesId, newRuneId) local newRuneData, newRuneInstance = RuneProxy:AddRune(Player, newRuneId) RuneProxy:WearRune(Player, newRuneData.id, UniqueId) + + -- 重置祝福状态(触发1次,就停止了) + if blessingTrigger then + blessingTrigger = false + blessingRuneId = nil + end end end end @@ -487,7 +510,8 @@ function EquipmentProxy:GetPlayerAttributes(Player: Player) if table.find(wearingOrgId, EquipmentData.specialRequire) then isActive = true end -- 晶石类型加成 elseif EquipmentData.specialType == 3 then - + local wearingRuneUniqueId, wearingOrgId = RuneProxy:GetPlayerRuneByEquipmentUniqueId(Player, EquipmentData.id) + if table.find(wearingOrgId, EquipmentData.specialRequire) then isActive = true end end if isActive then local newAddAttribute = Utils:GetIdDataFromJson(JsonAttributes, EquipmentData.specialActive[1]) diff --git a/src/StarterPlayerScripts/UI/Common/SpecialShow.luau b/src/StarterPlayerScripts/UI/Common/SpecialShow.luau index c9ef8c0..9476da5 100644 --- a/src/StarterPlayerScripts/UI/Common/SpecialShow.luau +++ b/src/StarterPlayerScripts/UI/Common/SpecialShow.luau @@ -10,6 +10,7 @@ local JsonEquipment = require(ReplicatedStorage.Json.Equipment) local JsonAttributes = require(ReplicatedStorage.Json.Attributes) local JsonAbility = require(ReplicatedStorage.Json.Ability) local JsonBlessing = require(ReplicatedStorage.Json.Blessing) +local JsonRune = require(ReplicatedStorage.Json.Rune) function SpecialShow:Init(data: table) local self = {} @@ -33,11 +34,11 @@ function SpecialShow:Refresh() elseif self.Data.specialType == 2 then firstDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonAbility, self.Data.specialRequire).nameId) elseif self.Data.specialType == 3 then - + firstDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonRune, self.Data.specialRequire).nameId) end local equipmentData = Utils:GetIdDataFromJson(JsonEquipment, self.Data.orgId) - -- 增长数值显示 + -- 增长数值显示(镶嵌对应内容有属性增长) local attributeData = Utils:GetIdDataFromJson(JsonAttributes, equipmentData.specialActive[1]) secondDesc = Localization:GetLanguageData(attributeData.nameId) thirdDesc = equipmentData.specialActive[2] @@ -64,6 +65,7 @@ function SpecialShow:Refresh() firstRateDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonAbility,blessingData.effect).nameId) elseif blessingData.type == 3 then baseRateDesc = Localization:GetLanguageData(1013) + firstRateDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonRune, blessingData.effect).nameId) end secondRateDesc = self.Data.blessingRate .. "%" specialRateDesc = Localization:FormatString(baseRateDesc, firstRateDesc, secondRateDesc) @@ -75,7 +77,6 @@ function SpecialShow:Refresh() else self.Variables._tmpSpecialRate.Visible = false end - end function SpecialShow:Destroy()