This commit is contained in:
gechangfu 2025-09-01 18:22:20 +08:00
parent fdf4e8f53d
commit e167d9cd48
19 changed files with 159 additions and 74 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,6 +4,7 @@ SignalEnum = {
SHOW_ABILITY = "SHOW_ABILITY",
CHALLENGE_LEVEL_END = "CHALLENGE_LEVEL_END",
SELECT_RUNE_INLAY_EQUIPMENT = "SELECT_RUNE_INLAY_EQUIPMENT",
SHOW_TIP = "SHOW_TIP",
}
return SignalEnum

View File

@ -1,43 +1,43 @@
[
{"id":1,"type":1,"specialType":null,"effectAttribute":"attack","battleValue":[1,15],"iconId":1,"nameId":201},
{"id":2,"type":1,"specialType":null,"effectAttribute":"hp","battleValue":[1,1],"iconId":2,"nameId":202},
{"id":3,"type":1,"specialType":null,"effectAttribute":"swordAtk","battleValue":[1,10],"iconId":3,"nameId":203},
{"id":4,"type":2,"specialType":null,"effectAttribute":"swordWearBase","battleValue":[1,10],"iconId":4,"nameId":204},
{"id":5,"type":2,"specialType":null,"effectAttribute":"swordWearSpe","battleValue":[1,10],"iconId":5,"nameId":205},
{"id":6,"type":2,"specialType":2,"effectAttribute":"fireAtk","battleValue":[1,10],"iconId":6,"nameId":206},
{"id":7,"type":2,"specialType":2,"effectAttribute":"iceAtk","battleValue":[1,10],"iconId":7,"nameId":207},
{"id":8,"type":2,"specialType":2,"effectAttribute":"lightAtk","battleValue":[1,10],"iconId":8,"nameId":208},
{"id":9,"type":2,"specialType":2,"effectAttribute":"shadowAtk","battleValue":[1,10],"iconId":9,"nameId":209},
{"id":10,"type":1,"specialType":3,"effectAttribute":"fireDef","battleValue":[1,10],"iconId":10,"nameId":210},
{"id":11,"type":1,"specialType":3,"effectAttribute":"iceDef","battleValue":[1,10],"iconId":11,"nameId":211},
{"id":12,"type":1,"specialType":3,"effectAttribute":"lightDef","battleValue":[1,10],"iconId":12,"nameId":212},
{"id":13,"type":1,"specialType":3,"effectAttribute":"shadowDef","battleValue":[1,10],"iconId":13,"nameId":213},
{"id":14,"type":2,"specialType":null,"effectAttribute":"attackRate","battleValue":[1,10],"iconId":14,"nameId":214},
{"id":15,"type":2,"specialType":null,"effectAttribute":"hpRate","battleValue":[1,10],"iconId":15,"nameId":215},
{"id":16,"type":2,"specialType":null,"effectAttribute":"atkSpeed","battleValue":[1,10],"iconId":16,"nameId":216},
{"id":20,"type":2,"specialType":1,"effectAttribute":"critRate","battleValue":[1,10],"iconId":17,"nameId":220},
{"id":21,"type":2,"specialType":1,"effectAttribute":"critDamageRate","battleValue":[1,10],"iconId":18,"nameId":221},
{"id":22,"type":2,"specialType":1,"effectAttribute":"atkSpeedRate","battleValue":[1,10],"iconId":19,"nameId":222},
{"id":23,"type":2,"specialType":null,"effectAttribute":"cdRate","battleValue":[1,10],"iconId":20,"nameId":223},
{"id":24,"type":1,"specialType":null,"effectAttribute":"mpBonus","battleValue":[1,10],"iconId":21,"nameId":224},
{"id":25,"type":2,"specialType":null,"effectAttribute":"mpReduceRate","battleValue":[1,10],"iconId":22,"nameId":225},
{"id":26,"type":1,"specialType":null,"effectAttribute":"mpRecoverBonus","battleValue":[1,10],"iconId":23,"nameId":226},
{"id":27,"type":2,"specialType":null,"effectAttribute":"vampireRate","battleValue":[1,10],"iconId":24,"nameId":227},
{"id":28,"type":2,"specialType":null,"effectAttribute":"coinBonus","battleValue":[1,10],"iconId":25,"nameId":228},
{"id":29,"type":2,"specialType":null,"effectAttribute":"critRateFire","battleValue":[1,10],"iconId":26,"nameId":229},
{"id":30,"type":2,"specialType":null,"effectAttribute":"critRateIce","battleValue":[1,10],"iconId":27,"nameId":230},
{"id":31,"type":2,"specialType":null,"effectAttribute":"critRateLight","battleValue":[1,10],"iconId":28,"nameId":231},
{"id":32,"type":2,"specialType":null,"effectAttribute":"critRateDark","battleValue":[1,10],"iconId":29,"nameId":232},
{"id":33,"type":2,"specialType":null,"effectAttribute":"critDamageRateFire","battleValue":[1,10],"iconId":26,"nameId":233},
{"id":34,"type":2,"specialType":null,"effectAttribute":"critDamageRateIce","battleValue":[1,10],"iconId":27,"nameId":234},
{"id":35,"type":2,"specialType":null,"effectAttribute":"critDamageRateLight","battleValue":[1,10],"iconId":28,"nameId":235},
{"id":36,"type":2,"specialType":null,"effectAttribute":"critDamageRateDark","battleValue":[1,10],"iconId":29,"nameId":236},
{"id":3,"type":1,"specialType":null,"effectAttribute":"swordAtk","battleValue":[1,0],"iconId":3,"nameId":203},
{"id":4,"type":2,"specialType":null,"effectAttribute":"swordWearBase","battleValue":[1,0],"iconId":4,"nameId":204},
{"id":5,"type":2,"specialType":null,"effectAttribute":"swordWearSpe","battleValue":[1,0],"iconId":5,"nameId":205},
{"id":6,"type":2,"specialType":2,"effectAttribute":"fireAtk","battleValue":[1,0],"iconId":6,"nameId":206},
{"id":7,"type":2,"specialType":2,"effectAttribute":"iceAtk","battleValue":[1,0],"iconId":7,"nameId":207},
{"id":8,"type":2,"specialType":2,"effectAttribute":"lightAtk","battleValue":[1,0],"iconId":8,"nameId":208},
{"id":9,"type":2,"specialType":2,"effectAttribute":"shadowAtk","battleValue":[1,0],"iconId":9,"nameId":209},
{"id":10,"type":1,"specialType":3,"effectAttribute":"fireDef","battleValue":[1,0],"iconId":10,"nameId":210},
{"id":11,"type":1,"specialType":3,"effectAttribute":"iceDef","battleValue":[1,0],"iconId":11,"nameId":211},
{"id":12,"type":1,"specialType":3,"effectAttribute":"lightDef","battleValue":[1,0],"iconId":12,"nameId":212},
{"id":13,"type":1,"specialType":3,"effectAttribute":"shadowDef","battleValue":[1,0],"iconId":13,"nameId":213},
{"id":14,"type":2,"specialType":null,"effectAttribute":"attackRate","battleValue":[1,0],"iconId":14,"nameId":214},
{"id":15,"type":2,"specialType":null,"effectAttribute":"hpRate","battleValue":[1,0],"iconId":15,"nameId":215},
{"id":16,"type":2,"specialType":null,"effectAttribute":"atkSpeed","battleValue":[1,0],"iconId":16,"nameId":216},
{"id":20,"type":2,"specialType":1,"effectAttribute":"critRate","battleValue":[1,0],"iconId":17,"nameId":220},
{"id":21,"type":2,"specialType":1,"effectAttribute":"critDamageRate","battleValue":[1,0],"iconId":18,"nameId":221},
{"id":22,"type":2,"specialType":1,"effectAttribute":"atkSpeedRate","battleValue":[1,0],"iconId":19,"nameId":222},
{"id":23,"type":2,"specialType":null,"effectAttribute":"cdRate","battleValue":[1,0],"iconId":20,"nameId":223},
{"id":24,"type":1,"specialType":null,"effectAttribute":"mpBonus","battleValue":[1,0],"iconId":21,"nameId":224},
{"id":25,"type":2,"specialType":null,"effectAttribute":"mpReduceRate","battleValue":[1,0],"iconId":22,"nameId":225},
{"id":26,"type":1,"specialType":null,"effectAttribute":"mpRecoverBonus","battleValue":[1,0],"iconId":23,"nameId":226},
{"id":27,"type":2,"specialType":null,"effectAttribute":"vampireRate","battleValue":[1,0],"iconId":24,"nameId":227},
{"id":28,"type":2,"specialType":null,"effectAttribute":"coinBonus","battleValue":[1,0],"iconId":25,"nameId":228},
{"id":29,"type":2,"specialType":null,"effectAttribute":"critRateFire","battleValue":[1,0],"iconId":26,"nameId":229},
{"id":30,"type":2,"specialType":null,"effectAttribute":"critRateIce","battleValue":[1,0],"iconId":27,"nameId":230},
{"id":31,"type":2,"specialType":null,"effectAttribute":"critRateLight","battleValue":[1,0],"iconId":28,"nameId":231},
{"id":32,"type":2,"specialType":null,"effectAttribute":"critRateDark","battleValue":[1,0],"iconId":29,"nameId":232},
{"id":33,"type":2,"specialType":null,"effectAttribute":"critDamageRateFire","battleValue":[1,0],"iconId":26,"nameId":233},
{"id":34,"type":2,"specialType":null,"effectAttribute":"critDamageRateIce","battleValue":[1,0],"iconId":27,"nameId":234},
{"id":35,"type":2,"specialType":null,"effectAttribute":"critDamageRateLight","battleValue":[1,0],"iconId":28,"nameId":235},
{"id":36,"type":2,"specialType":null,"effectAttribute":"critDamageRateDark","battleValue":[1,0],"iconId":29,"nameId":236},
{"id":37,"type":2,"specialType":null,"effectAttribute":"ironBonus","battleValue":[1,0],"iconId":37,"nameId":237},
{"id":50,"type":1,"specialType":null,"effectAttribute":"wearNumber","battleValue":[1,10],"iconId":50,"nameId":250},
{"id":51,"type":1,"specialType":null,"effectAttribute":"abilityNumber","battleValue":[1,10],"iconId":51,"nameId":251},
{"id":52,"type":1,"specialType":null,"effectAttribute":"extraAttributeNumber","battleValue":[1,10],"iconId":52,"nameId":252},
{"id":53,"type":1,"specialType":null,"effectAttribute":"elementNumber","battleValue":[1,10],"iconId":53,"nameId":253},
{"id":54,"type":1,"specialType":null,"effectAttribute":"elementDefNumber","battleValue":[1,10],"iconId":54,"nameId":254},
{"id":55,"type":1,"specialType":null,"effectAttribute":"gemNumber","battleValue":[1,10],"iconId":55,"nameId":255},
{"id":56,"type":1,"specialType":null,"effectAttribute":"runeNumber","battleValue":[1,10],"iconId":56,"nameId":256}
{"id":50,"type":1,"specialType":null,"effectAttribute":"wearNumber","battleValue":[1,0],"iconId":50,"nameId":250},
{"id":51,"type":1,"specialType":null,"effectAttribute":"abilityNumber","battleValue":[1,0],"iconId":51,"nameId":251},
{"id":52,"type":1,"specialType":null,"effectAttribute":"extraAttributeNumber","battleValue":[1,0],"iconId":52,"nameId":252},
{"id":53,"type":1,"specialType":null,"effectAttribute":"elementNumber","battleValue":[1,0],"iconId":53,"nameId":253},
{"id":54,"type":1,"specialType":null,"effectAttribute":"elementDefNumber","battleValue":[1,0],"iconId":54,"nameId":254},
{"id":55,"type":1,"specialType":null,"effectAttribute":"gemNumber","battleValue":[1,0],"iconId":55,"nameId":255},
{"id":56,"type":1,"specialType":null,"effectAttribute":"runeNumber","battleValue":[1,0],"iconId":56,"nameId":256}
]

View File

@ -1,12 +1,9 @@
[
{"id":1,"type":1,"effectAttribute":"attack","cost":[1,150,0],"lvAdd":[40,10985],"battleValueLimit":[5,20],"maxLv":null},
{"id":2,"type":1,"effectAttribute":"hp","cost":[1,150,0],"lvAdd":[600,10985],"battleValueLimit":[5,20],"maxLv":null},
{"id":3,"type":1,"effectAttribute":"swordAtk","cost":[1,300,0],"lvAdd":[10,0],"battleValueLimit":[5,20],"maxLv":null},
{"id":4,"type":1,"effectAttribute":"swordWearBase","cost":[1,300,0],"lvAdd":[10,0],"battleValueLimit":[5,20],"maxLv":null},
{"id":5,"type":1,"effectAttribute":"swordWearSpe","cost":[1,300,0],"lvAdd":[10,0],"battleValueLimit":[5,20],"maxLv":null},
{"id":10,"type":2,"effectAttribute":"abilityNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[5,20],"maxLv":3},
{"id":11,"type":2,"effectAttribute":"extraAttributeNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[5,20],"maxLv":3},
{"id":12,"type":2,"effectAttribute":"elementNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[5,20],"maxLv":4},
{"id":13,"type":2,"effectAttribute":"elementDefNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[5,20],"maxLv":4},
{"id":14,"type":2,"effectAttribute":"runeNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[5,20],"maxLv":4}
{"id":10,"type":2,"effectAttribute":"abilityNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[4800,9506,15211,29372],"maxLv":3},
{"id":11,"type":2,"effectAttribute":"extraAttributeNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[2464,7170,11471,20165],"maxLv":3},
{"id":12,"type":2,"effectAttribute":"elementNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[3581,7877,12603,22154],"maxLv":4},
{"id":13,"type":2,"effectAttribute":"elementDefNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[3936,8653,13844,24337],"maxLv":4},
{"id":14,"type":2,"effectAttribute":"runeNumber","cost":[1,300,0],"lvAdd":[1,1],"battleValueLimit":[5272,10444,16711,32266],"maxLv":4}
]

View File

@ -1,5 +1,5 @@
[
{"id":1,"type":1,"name":1,"attack":10,"hp":150,"walkSpeed":8,"attackSpeed":1,"model":"Thief"},
{"id":2,"type":1,"name":2,"attack":10,"hp":150,"walkSpeed":8,"attackSpeed":1,"model":"Thief"},
{"id":1000,"type":2,"name":1000,"attack":30,"hp":1000,"walkSpeed":4,"attackSpeed":1,"model":"Thief"}
{"id":1000,"type":2,"name":1000,"attack":35,"hp":1000,"walkSpeed":4,"attackSpeed":1,"model":"Thief"}
]

View File

@ -11,10 +11,21 @@ function BattleUtils:GetPlayerBattleValue(player)
local attributes = character:FindFirstChild("Attributes")
if not attributes then warn("attributes not found") return 0 end
-- 临时将attackRate加到attack中进行计算因为生命值已经设置过了
local attackRate = attributes:GetAttribute("attackRate")
local battleValue = 0
for attributeKey, attributeValue in attributes:GetAttributes() do
local attributeData = Utils:GetSpecialKeyDataFromJson(JsonAttributes, "effectAttribute", attributeKey)
if not attributeData then continue end
if attackRate and attributeKey == "attack" then
attributeValue = math.floor(attributeValue * (1 + attackRate / 100))
end
-- 如果是血量,就选择最大生命值,要不战斗时会浮动
if attributeKey == "hp" then
attributeValue = attributes:GetAttribute("maxhp")
end
battleValue += math.floor(attributeValue / attributeData.battleValue[1] * attributeData.battleValue[2])
end

View File

@ -224,7 +224,7 @@ function AbilityProxy:GetPlayerWearingAbilityData(Player: Player)
local EquipmentProxy = require(ServerStorage.Proxy.EquipmentProxy)
local wearingEquipments = EquipmentProxy:GetPlayerWearingEquipmentUniqueId(Player)
for _, AbilityData in ArchiveProxy.pData[Player.UserId][STORE_NAME].Ability do
if AbilityData.wearing > 0 and table.find(wearingEquipments, AbilityData.wearing) then
if tonumber(AbilityData.wearing) > 0 and table.find(wearingEquipments, AbilityData.wearing) then
table.insert(wearingAbilityUniqueId, AbilityData.id)
local AbilityData = Utils:GetIdDataFromJson(JsonAbility, AbilityData.orgId)
table.insert(behaviourNames, AbilityData.behaviourName)

View File

@ -139,7 +139,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
local playerInfo = PlayerInfoProxy:GetPlayerInfo(Player)
-- TODO: 其他随机词条内容添加在下面
-- 随机生成额外属性数量
local maxExAttributeNumber = playerInfo["AttributesUpgrade"]["12"] or 0
local maxExAttributeNumber = playerInfo["AttributesUpgrade"]["11"] or 0
local exAttributeNumber = rng:NextInteger(0, maxExAttributeNumber)
ResultData.maxExAttributeNumber = exAttributeNumber
ResultData.exAttributes = {}
@ -160,7 +160,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
end
-- 随机生成元素属性数量(暂时跟额外属性相同,之后可以改逻辑)
local maxElementNumber = playerInfo["AttributesUpgrade"]["13"] or 0
local maxElementNumber = playerInfo["AttributesUpgrade"]["12"] or 0
local elementNumber = rng:NextInteger(0, maxElementNumber)
ResultData.maxElementNumber = elementNumber
ResultData.elements = {}
@ -181,7 +181,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
end
-- 随机生成元素抗性数量
local maxElementDefNumber = playerInfo["AttributesUpgrade"]["14"] or 0
local maxElementDefNumber = playerInfo["AttributesUpgrade"]["13"] or 0
local elementDefNumber = rng:NextInteger(0, maxElementDefNumber)
ResultData.maxElementDefNumber = elementDefNumber
ResultData.elementDef = {}
@ -253,7 +253,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
-- 随机生成技能槽位数量
local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy)
local maxAbilityNumber = playerInfo["AttributesUpgrade"]["11"] or 0
local maxAbilityNumber = playerInfo["AttributesUpgrade"]["10"] or 0
local abilityNumber = rng:NextInteger(0, maxAbilityNumber)
ResultData.maxAbilityNumber = abilityNumber
@ -266,7 +266,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
-- 随机生成符文数量
local RuneProxy = require(ServerStorage.Proxy.RuneProxy)
local maxRuneNumber = playerInfo["AttributesUpgrade"]["15"] or 0
local maxRuneNumber = playerInfo["AttributesUpgrade"]["14"] or 0
local runeNumber = rng:NextInteger(0, maxRuneNumber)
ResultData.maxRuneNumber = runeNumber
@ -360,8 +360,8 @@ function EquipmentProxy:RecycleEquipment(Player: Player, EquipmentId: number)
if not EquipmentData then return end
-- 根据对应功能模块进行对应回收
-- local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy)
-- AbilityProxy:RecycleAbility(Player, EquipmentData.id)
local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy)
AbilityProxy:RecycleAbility(Player, EquipmentData.id)
-- 回收对应装备符文
local RuneProxy = require(ServerStorage.Proxy.RuneProxy)

View File

@ -171,9 +171,9 @@ function PlayerFightProxy:UpdatePlayerFightData(Player: Player)
end
AttributesData["maxhp"] = AttributesData["hp"]
if AttributesData["attackRate"] then
AttributesData["attack"] = math.floor(AttributesData["attack"] * (1 + AttributesData["attackRate"] / 100))
end
-- if AttributesData["attackRate"] then
-- AttributesData["attack"] = math.floor(AttributesData["attack"] * (1 + AttributesData["attackRate"] / 100))
-- end
-- 获取原玩家属性,把不存在新属性列表的内容排除掉
local ConfigAttributes = PlayerRole.Attributes:GetAttributes()

View File

@ -9,6 +9,7 @@ local ServerStorage = game:GetService("ServerStorage")
local Utils = require(ReplicatedStorage.Tools.Utils)
local ArchiveProxy = require(ServerStorage.Proxy.ArchiveProxy)
local BookProxy = require(ServerStorage.Proxy.BookProxy)
local BattleUtils = require(ReplicatedStorage.Tools.BattleUtils)
--> Json
local JsonLvUpgrade = require(ReplicatedStorage.Json.LvUpgrade)
@ -158,6 +159,7 @@ function PlayerInfoProxy:UpgradeAttribute(Player: Player, AttributeId: number)
local upgradeTable = ArchiveProxy.pData[Player.UserId][STORE_NAME].AttributesUpgrade
local nowLv = upgradeTable[AttributeId]
if nowLv == nil then nowLv = 0 end
local nowBattleValue = BattleUtils:GetPlayerBattleValue(Player)
local attributeData = Utils:GetIdDataFromJson(JsonAttributesUpgrade, AttributeId)
local requireBattleValue, requireMoney
@ -167,7 +169,11 @@ function PlayerInfoProxy:UpgradeAttribute(Player: Player, AttributeId: number)
requireBattleValue = attributeData["battleValueLimit"][1]
else
requireMoney = attributeData["cost"][2]
requireBattleValue = attributeData["battleValueLimit"][1] + (nowLv - 1) * attributeData["battleValueLimit"][2]
if attributeData["type"] == 1 then
requireBattleValue = attributeData["battleValueLimit"][1] + (nowLv - 1) * attributeData["battleValueLimit"][2]
elseif attributeData["type"] == 2 then
requireBattleValue = attributeData["battleValueLimit"][math.min(nowLv, #attributeData.battleValueLimit)]
end
end
-- TODO 判断战力是否足够(暂无战力计算)
@ -187,6 +193,14 @@ function PlayerInfoProxy:UpgradeAttribute(Player: Player, AttributeId: number)
RE_PlayerTip:FireClient(Player, tip)
return
end
-- 判断战力是否足够
if requireBattleValue > nowBattleValue then
local tip = '升级属性失败: ' .. AttributeId .. ' 战力不够'
RE_PlayerTip:FireClient(Player, tip)
return
end
-- 扣钱
self:ChangeItemCount(Player, 1, -requireMoney)

View File

@ -1,3 +1,6 @@
-- 俯视角相机
-- 45度俯视角相机脚本
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

View File

@ -0,0 +1,33 @@
-- 简化版相机设置 - 只调整初始镜头距离
local Players = game:GetService("Players")
local StarterPlayer = game:GetService("StarterPlayer")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
-- 设置更远的初始镜头距离
local CAMERA_DISTANCE = 200 -- 比默认距离更远
local CAMERA_MIN_DISTANCE = 25
local CAMERA_HEIGHT_OFFSET = 20 -- 相机高度偏移
-- 设置StarterPlayer的相机缩放距离属性
player.CameraMaxZoomDistance = CAMERA_DISTANCE
player.CameraMinZoomDistance = CAMERA_MIN_DISTANCE
-- 当角色生成时,重新设置相机属性
player.CharacterAdded:Connect(function(character)
character:WaitForChild("HumanoidRootPart")
wait(1) -- 等待角色完全初始化
-- 重新设置相机属性
StarterPlayer.CameraMaxZoomDistance = CAMERA_DISTANCE
StarterPlayer.CameraMinZoomDistance = CAMERA_MIN_DISTANCE
end)
-- 如果角色已经存在,立即设置
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
StarterPlayer.CameraMaxZoomDistance = CAMERA_DISTANCE
StarterPlayer.CameraMinZoomDistance = CAMERA_MIN_DISTANCE
end

View File

@ -9,6 +9,9 @@ local JsonAttributesUpgrade = require(ReplicatedStorage.Json.AttributesUpgrade)
local JsonAttributes = require(ReplicatedStorage.Json.Attributes)
local BattleUtils = require(ReplicatedStorage.Tools.BattleUtils)
local Signal = require(ReplicatedStorage.Tools.Signal)
local showTipSignal = Signal.new(Signal.ENUM.SHOW_TIP)
local RE_UpgradeAttributes = ReplicatedStorage.Events.RE_UpgradeAttributes
local LocalPlayer = game:GetService("Players").LocalPlayer
@ -68,10 +71,14 @@ function AttributeLvupShow:Refresh()
if nowLv == 0 then
limitBattleValue = attributesUpgradeData.battleValueLimit[1]
else
if self.Data.maxLv then
limitBattleValue = attributesUpgradeData.battleValueLimit[1] + math.min(nowLv, self.Data.maxLv - 1) * attributesUpgradeData.battleValueLimit[2]
else
limitBattleValue = attributesUpgradeData.battleValueLimit[1] + (nowLv - 1) * attributesUpgradeData.battleValueLimit[2]
if attributesUpgradeData.type == 1 then
if self.Data.maxLv then
limitBattleValue = attributesUpgradeData.battleValueLimit[1] + math.min(nowLv, self.Data.maxLv - 1) * attributesUpgradeData.battleValueLimit[2]
else
limitBattleValue = attributesUpgradeData.battleValueLimit[1] + (nowLv - 1) * attributesUpgradeData.battleValueLimit[2]
end
elseif attributesUpgradeData.type == 2 then
limitBattleValue = attributesUpgradeData.battleValueLimit[math.min(nowLv + 1, #attributesUpgradeData.battleValueLimit)]
end
end
@ -115,6 +122,7 @@ function AttributeLvupShow:OnInitFinish()
if self.Data.maxLv then
if self:GetNowLv() >= self.Data.maxLv then
-- TODO: 之后做提示弹窗
showTipSignal:Fire("属性已满级")
else
RE_UpgradeAttributes:FireServer(self.Data.id)
end

View File

@ -39,7 +39,7 @@ function AttributeLvupWindow:Init(UIManager: table, Data: table?)
["__moneyCoin"] = 0,
["_btnClose"] = 0,
["_btnBgClose"] = 0,
-- ["_btnBgClose"] = 0,
}
self.UIRootName = "ui_w_attribute_lvup"
self.UIParentName = UIEnums.UIParent.UIRoot
@ -77,13 +77,13 @@ function AttributeLvupWindow:OnOpenWindow()
self.Variables["__listSpecialAttributes"]:SetLayoutOrder("id")
self.Variables["__listBaseAttributes"]:SetLayoutOrder("id")
local bgCloseCon = self.Variables["_btnBgClose"].Activated:Connect(function()
self.UIManager:CloseWindow(script.Name)
end)
-- local bgCloseCon = self.Variables["_btnBgClose"].Activated:Connect(function()
-- self.UIManager:CloseWindow(script.Name)
-- end)
local closeCon = self.Variables["_btnClose"].Activated:Connect(function()
self.UIManager:CloseWindow(script.Name)
end)
table.insert(self.Connections, bgCloseCon)
-- table.insert(self.Connections, bgCloseCon)
table.insert(self.Connections, closeCon)
end

View File

@ -4,6 +4,8 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
--> Dependencies
local UIWindow = require(ReplicatedStorage.Base.UIWindow)
local UIEnums = require(ReplicatedStorage.Base.UIEnums)
local BattleUtils = require(ReplicatedStorage.Tools.BattleUtils)
local Localization = require(ReplicatedStorage.Tools.Localization)
--> Components
local WearingShow = require(script.WearingShowOne)
@ -33,7 +35,7 @@ function ChaWindow:Init(UIManager: table, Data: table?)
["_tmpCombatValue"] = 0,
["_imgIcon"] = 0,
["_btnClose"] = 0,
["_btnBgClose"] = 0,
-- ["_btnBgClose"] = 0,
["_btnRecycle"] = 0,
}
self.UIRootName = "ui_w_cha"
@ -49,6 +51,10 @@ function ChaWindow:ShowDetailData(uniqueId: number)
self.UIManager:OpenWindow("EquipmentDetailWindow", data)
end
function ChaWindow:UpdateCombatValue()
self.Variables["_tmpCombatValue"].Text = Localization:FormatString(Localization:GetLanguageData(1020), BattleUtils:GetPlayerBattleValue(LocalPlayer))
end
function ChaWindow:WearRefresh(data: table)
local newSlot = data.instance:GetAttribute("wearing")
self.Variables["__listWeaing"]:RemoveData("slot"..newSlot)
@ -58,6 +64,8 @@ function ChaWindow:WearRefresh(data: table)
data.wearing = newSlot
self.Variables["__listWeaing"]:AddData("slot"..newSlot, data)
self:UpdateCombatValue()
-- 关闭装备详情窗口
if self.UIManager:IsOpened("EquipmentDetailWindow") then
self.UIManager:CloseWindow("EquipmentDetailWindow")
@ -74,6 +82,8 @@ function ChaWindow:UnwearRefresh(data: table)
}
self.Variables["__listWeaing"]:AddData("slot"..oldSlot, self.Data.Wearing["slot"..oldSlot])
self:UpdateCombatValue()
-- 关闭装备详情窗口
if self.UIManager:IsOpened("EquipmentDetailWindow") then
self.UIManager:CloseWindow("EquipmentDetailWindow")
@ -117,6 +127,7 @@ end
function ChaWindow:OnOpenWindow()
UIWindow.OnOpenWindow(self)
self:UpdateCombatValue()
-- 自己进行数据处理
local DataFolder = Utils:WaitPlayerDataFolder(LocalPlayer):FindFirstChild("Equipment")
local data = {
@ -165,9 +176,9 @@ function ChaWindow:OnOpenWindow()
end
end)
local bgCloseCon = self.Variables["_btnBgClose"].Activated:Connect(function()
self.UIManager:CloseWindow(script.Name)
end)
-- local bgCloseCon = self.Variables["_btnBgClose"].Activated:Connect(function()
-- self.UIManager:CloseWindow(script.Name)
-- end)
local closeCon = self.Variables["_btnClose"].Activated:Connect(function()
self.UIManager:CloseWindow(script.Name)
end)
@ -177,7 +188,7 @@ function ChaWindow:OnOpenWindow()
table.insert(self.Connections, addCon)
table.insert(self.Connections, removeCon)
table.insert(self.Connections, bgCloseCon)
-- table.insert(self.Connections, bgCloseCon)
table.insert(self.Connections, closeCon)
table.insert(self.Connections, recycleCon)

View File

@ -5,6 +5,8 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UIWindow = require(ReplicatedStorage.Base.UIWindow)
local UIEnums = require(ReplicatedStorage.Base.UIEnums)
local Tween = require(ReplicatedStorage.Modules.Tween)
local Signal = require(ReplicatedStorage.Tools.Signal)
local showTipSignal = Signal.new(Signal.ENUM.SHOW_TIP)
--> Components
@ -52,12 +54,17 @@ end
function TipsWindow:OnOpenWindow()
UIWindow.OnOpenWindow(self)
self.Variables["__goPanel1"].Visible = false
local con = RE_PlayerTip.OnClientEvent:Connect(function(data)
self:ShowPanel1(data)
end)
table.insert(self.Connections, con)
local conClient = showTipSignal:Connect(function(data)
self:ShowPanel1(data)
end)
table.insert(self.Connections, conClient)
end
return TipsWindow