This commit is contained in:
gechangfu 2025-08-25 10:54:42 +08:00
parent c605ade2a2
commit 350ac18417
2 changed files with 32 additions and 7 deletions

View File

@ -12,6 +12,7 @@ local ArchiveProxy = require(ServerStorage.Proxy.ArchiveProxy)
local PlayerInfoProxy = require(ServerStorage.Proxy.PlayerInfoProxy) local PlayerInfoProxy = require(ServerStorage.Proxy.PlayerInfoProxy)
local PlayerFightProxy = require(ServerStorage.Proxy.PlayerFightProxy) local PlayerFightProxy = require(ServerStorage.Proxy.PlayerFightProxy)
local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy) local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy)
local RuneProxy = require(ServerStorage.Proxy.RuneProxy)
--> Json --> Json
local JsonEquipment = require(ReplicatedStorage.Json.Equipment) local JsonEquipment = require(ReplicatedStorage.Json.Equipment)
@ -199,7 +200,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
end end
end end
-- 属性祝福处理 -- 祝福变量记录
local BookProxy = require(ServerStorage.Proxy.BookProxy) local BookProxy = require(ServerStorage.Proxy.BookProxy)
local blessingId, blessingRate = BookProxy:GetBlessingInfo(Player, EquipmentId) local blessingId, blessingRate = BookProxy:GetBlessingInfo(Player, EquipmentId)
local blessingType, blessingEffect local blessingType, blessingEffect
@ -211,6 +212,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
blessingEffect = blessingData.effect blessingEffect = blessingData.effect
end end
-- 属性祝福处理
if blessingType == 1 then if blessingType == 1 then
-- 找到对应祝福所属的表名 -- 找到对应祝福所属的表名
local attributeData = Utils:GetIdDataFromJson(JsonAttributes, blessingEffect) local attributeData = Utils:GetIdDataFromJson(JsonAttributes, blessingEffect)
@ -307,14 +309,35 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
if runeNumber > 0 then if runeNumber > 0 then
local spawnRunesId = {} 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 for i = 1, runeNumber do
-- 是否生成符文 -- 是否生成符文
local isTrigger = Rng:GetRandomInt(1, 100) <= 5 local isTrigger = Rng:GetRandomInt(1, 100) <= 5
if isTrigger then if isTrigger or blessingTrigger then
local newRuneId = RuneProxy:GetRandomRuneId(spawnRunesId) -- 随机生成符文如果祝福触发就指定符文id
local newRuneId = blessingRuneId or RuneProxy:GetRandomRuneId(spawnRunesId)
table.insert(spawnRunesId, newRuneId) table.insert(spawnRunesId, newRuneId)
local newRuneData, newRuneInstance = RuneProxy:AddRune(Player, newRuneId) local newRuneData, newRuneInstance = RuneProxy:AddRune(Player, newRuneId)
RuneProxy:WearRune(Player, newRuneData.id, UniqueId) RuneProxy:WearRune(Player, newRuneData.id, UniqueId)
-- 重置祝福状态触发1次就停止了
if blessingTrigger then
blessingTrigger = false
blessingRuneId = nil
end
end end
end end
end end
@ -487,7 +510,8 @@ function EquipmentProxy:GetPlayerAttributes(Player: Player)
if table.find(wearingOrgId, EquipmentData.specialRequire) then isActive = true end if table.find(wearingOrgId, EquipmentData.specialRequire) then isActive = true end
-- 晶石类型加成 -- 晶石类型加成
elseif EquipmentData.specialType == 3 then elseif EquipmentData.specialType == 3 then
local wearingRuneUniqueId, wearingOrgId = RuneProxy:GetPlayerRuneByEquipmentUniqueId(Player, EquipmentData.id)
if table.find(wearingOrgId, EquipmentData.specialRequire) then isActive = true end
end end
if isActive then if isActive then
local newAddAttribute = Utils:GetIdDataFromJson(JsonAttributes, EquipmentData.specialActive[1]) local newAddAttribute = Utils:GetIdDataFromJson(JsonAttributes, EquipmentData.specialActive[1])

View File

@ -10,6 +10,7 @@ local JsonEquipment = require(ReplicatedStorage.Json.Equipment)
local JsonAttributes = require(ReplicatedStorage.Json.Attributes) local JsonAttributes = require(ReplicatedStorage.Json.Attributes)
local JsonAbility = require(ReplicatedStorage.Json.Ability) local JsonAbility = require(ReplicatedStorage.Json.Ability)
local JsonBlessing = require(ReplicatedStorage.Json.Blessing) local JsonBlessing = require(ReplicatedStorage.Json.Blessing)
local JsonRune = require(ReplicatedStorage.Json.Rune)
function SpecialShow:Init(data: table) function SpecialShow:Init(data: table)
local self = {} local self = {}
@ -33,11 +34,11 @@ function SpecialShow:Refresh()
elseif self.Data.specialType == 2 then elseif self.Data.specialType == 2 then
firstDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonAbility, self.Data.specialRequire).nameId) firstDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonAbility, self.Data.specialRequire).nameId)
elseif self.Data.specialType == 3 then elseif self.Data.specialType == 3 then
firstDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonRune, self.Data.specialRequire).nameId)
end end
local equipmentData = Utils:GetIdDataFromJson(JsonEquipment, self.Data.orgId) local equipmentData = Utils:GetIdDataFromJson(JsonEquipment, self.Data.orgId)
-- 增长数值显示 -- 增长数值显示(镶嵌对应内容有属性增长)
local attributeData = Utils:GetIdDataFromJson(JsonAttributes, equipmentData.specialActive[1]) local attributeData = Utils:GetIdDataFromJson(JsonAttributes, equipmentData.specialActive[1])
secondDesc = Localization:GetLanguageData(attributeData.nameId) secondDesc = Localization:GetLanguageData(attributeData.nameId)
thirdDesc = equipmentData.specialActive[2] thirdDesc = equipmentData.specialActive[2]
@ -64,6 +65,7 @@ function SpecialShow:Refresh()
firstRateDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonAbility,blessingData.effect).nameId) firstRateDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonAbility,blessingData.effect).nameId)
elseif blessingData.type == 3 then elseif blessingData.type == 3 then
baseRateDesc = Localization:GetLanguageData(1013) baseRateDesc = Localization:GetLanguageData(1013)
firstRateDesc = Localization:GetLanguageData(Utils:GetIdDataFromJson(JsonRune, blessingData.effect).nameId)
end end
secondRateDesc = self.Data.blessingRate .. "%" secondRateDesc = self.Data.blessingRate .. "%"
specialRateDesc = Localization:FormatString(baseRateDesc, firstRateDesc, secondRateDesc) specialRateDesc = Localization:FormatString(baseRateDesc, firstRateDesc, secondRateDesc)
@ -75,7 +77,6 @@ function SpecialShow:Refresh()
else else
self.Variables._tmpSpecialRate.Visible = false self.Variables._tmpSpecialRate.Visible = false
end end
end end
function SpecialShow:Destroy() function SpecialShow:Destroy()