diff --git a/excel/cha.xlsx b/excel/cha.xlsx index 9fdfa58..987f7da 100644 Binary files a/excel/cha.xlsx and b/excel/cha.xlsx differ diff --git a/excel/enemy.xlsx b/excel/enemy.xlsx index d0db41a..e032624 100644 Binary files a/excel/enemy.xlsx and b/excel/enemy.xlsx differ diff --git a/excel/equipment.xlsx b/excel/equipment.xlsx index 3efc7da..4b5c35e 100644 Binary files a/excel/equipment.xlsx and b/excel/equipment.xlsx differ diff --git a/excel/global.xlsx b/excel/global.xlsx index 98f592d..35b487e 100644 Binary files a/excel/global.xlsx and b/excel/global.xlsx differ diff --git a/excel/level.xlsx b/excel/level.xlsx index 80dfa16..207d387 100644 Binary files a/excel/level.xlsx and b/excel/level.xlsx differ diff --git a/src/ReplicatedStorage/Json/Param.json b/src/ReplicatedStorage/Json/Param.json index 4937522..9590136 100644 --- a/src/ReplicatedStorage/Json/Param.json +++ b/src/ReplicatedStorage/Json/Param.json @@ -2,7 +2,7 @@ {"id":1,"key":"quality_bonus","intValue":null,"stringValue":null,"intArray":[100,125,150,200,275,375]}, {"id":2,"key":"level_get_bonus","intValue":null,"stringValue":null,"intArray":[5,0]}, {"id":3,"key":"mob_died_get","intValue":null,"stringValue":null,"intArray":[2,4]}, -{"id":4,"key":"default_weapon","intValue":null,"stringValue":"Sword","intArray":[]}, +{"id":4,"key":"default_weapon","intValue":null,"stringValue":null,"intArray":[]}, {"id":5,"key":"quality_show","intValue":null,"stringValue":null,"intArray":[101,102,103,104,105,106,107,108]}, {"id":6,"key":"new_player_book_rewards","intValue":null,"stringValue":null,"intArray":[50000,1]}, {"id":7,"key":"new_player_item_rewards","intValue":null,"stringValue":null,"intArray":[2,10]} diff --git a/src/ServerStorage/Base/Character.luau b/src/ServerStorage/Base/Character.luau index bdf2095..9101f34 100644 --- a/src/ServerStorage/Base/Character.luau +++ b/src/ServerStorage/Base/Character.luau @@ -28,14 +28,16 @@ function Character.new(Player: Player, CharacterModel: Model, CharacterData: tab self.TargetPlayerUserID = Player.UserId self.Connections = {} self.Stats = {} + self.Character = CharacterModel -- 生成实例身上的配置数据 local Attributes = Instance.new("Configuration") Attributes.Name = "Attributes" Attributes.Parent = self.Instance + local ExceptAttributes = {"id", "name"} for attributeKey, attributeValue in self.Config do -- 只设置非表类型的属性值 - if type(attributeValue) ~= "table" then + if type(attributeValue) ~= "table" and not table.find(ExceptAttributes, attributeKey) then Attributes:SetAttribute(attributeKey, attributeValue) -- 设置限制值 if table.find(LIMIT_ATTRIBUTE, attributeKey) then @@ -44,6 +46,7 @@ function Character.new(Player: Player, CharacterModel: Model, CharacterData: tab end end end + self.Attributes = Attributes -- 通过函数调用了,不绑定事件了 -- local conAttribute = Attributes.AttributeChanged:Connect(function(attributeKey: string, attributeValue: number) diff --git a/src/ServerStorage/Proxy/BookProxy.luau b/src/ServerStorage/Proxy/BookProxy.luau index dcf04ba..5e91f13 100644 --- a/src/ServerStorage/Proxy/BookProxy.luau +++ b/src/ServerStorage/Proxy/BookProxy.luau @@ -53,6 +53,7 @@ function BookProxy:InitPlayer(Player: Player) Utils:CreateDataInstance(Player, BookId, BookData, BookFolder) end + -- 新玩家默认添加图鉴 if isNew then local ItemProxy = require(ServerStorage.Proxy.ItemProxy) local newData = Utils:GetIdDataFromJson(JsonParam, 6) diff --git a/src/ServerStorage/Proxy/MobsProxy/init.luau b/src/ServerStorage/Proxy/MobsProxy/init.luau index 77021e2..1885067 100644 --- a/src/ServerStorage/Proxy/MobsProxy/init.luau +++ b/src/ServerStorage/Proxy/MobsProxy/init.luau @@ -98,10 +98,10 @@ function MobsProxy:CreateMob(Player: Player, MobId: number, Position: Vector3, A local Mob = Mob.new(Player, MobId, Position, OnMobDied) AI:StartTracking(Mob) -- 关卡系数 - if AtkBonus then Mob:ChangeAttributeValue("attack", math.floor(Mob.Config.attack * (AtkBonus / 1000))) end + if AtkBonus then Mob:ChangeAttributeValue("attack", math.floor(Mob.Config.attack * (AtkBonus / 100))) end if HpBonus then - Mob:ChangeAttributeValue("hp", math.floor(Mob.Config.hp * (HpBonus / 1000))) - Mob:ChangeAttributeValue("maxhp", math.floor(Mob.Config.maxhp * (HpBonus / 1000))) + Mob:ChangeAttributeValue("hp", math.floor(Mob.Config.hp * (HpBonus / 100))) + Mob:ChangeAttributeValue("maxhp", math.floor(Mob.Config.maxhp * (HpBonus / 100))) end MobsProxy.pData[Player.UserId][Mob.Instance] = Mob return Mob diff --git a/src/ServerStorage/Proxy/PlayerFightProxy/init.luau b/src/ServerStorage/Proxy/PlayerFightProxy/init.luau index 89d95bc..95a1801 100644 --- a/src/ServerStorage/Proxy/PlayerFightProxy/init.luau +++ b/src/ServerStorage/Proxy/PlayerFightProxy/init.luau @@ -46,12 +46,12 @@ function PlayerRole.new(Player: Player, CharacterId: number) local CharacterData = Utils:GetIdDataFromJson(JsonCharacter, CharacterId) if not CharacterData then warn("CharacterId Data not found", CharacterId) return end - -- 补充默认没设置的属性,暂时不添加特殊属性,因为特殊属性是系统调用的,添加也没啥用 - for _, AttributeData in JsonCharacter do - if AttributeData.id < 50 then - if not CharacterData[AttributeData.name] then CharacterData[AttributeData.name] = 0 end - end - end + -- 补充默认没设置的属性,暂时不添加特殊属性,因为特殊属性是系统调用的,添加也没啥用 (忘了有啥用,暂时不管,可能是留属性填充口子) + -- for _, AttributeData in JsonCharacter do + -- if AttributeData.id < 50 then + -- if not CharacterData[AttributeData.name] then CharacterData[AttributeData.name] = 0 end + -- end + -- end -- 调用父类Character的new方法,初始化通用属性 @@ -133,16 +133,19 @@ function PlayerFightProxy:UpdatePlayerFightData(Player: Player) if PlayerInfoAttributes.UpgradeAttributes then Utils:TableSafeAddTableValue(AttributesData, PlayerInfoAttributes.UpgradeAttributes) end + -- print("PlayerInfoAttributes", AttributesData) local EquipmentAttributes = EquipmentProxy:GetPlayerAttributes(Player) if EquipmentAttributes then Utils:TableSafeAddTableValue(AttributesData, EquipmentAttributes) end + -- print("EquipmentAttributes", AttributesData) local GemAttributes = GemProxy:GetPlayerAttributes(Player) if GemAttributes.GemWearingAttributes then Utils:TableSafeAddTableValue(AttributesData, GemAttributes.GemWearingAttributes) end + -- print("GemAttributes", AttributesData) -- 角色基础数据 local PlayerRole = self:GetPlayerRole(Player) @@ -153,10 +156,11 @@ function PlayerFightProxy:UpdatePlayerFightData(Player: Player) if AttributesData.atkSpeed then table.insert(ExceptAttributes, "atkSpeed") end for AttributeName, AttributeValue in CharacterData do - if not table.find(ExceptAttributes, AttributeName) then + if not table.find(ExceptAttributes, AttributeName) then Utils:TableSafeAddValue(AttributesData, AttributeName, AttributeValue) end end + -- print("CharacterData", AttributesData) -- 根据汇总更新玩家属性——————实际生效计算部分 local PlayerRole = self:GetPlayerRole(Player) @@ -164,13 +168,24 @@ function PlayerFightProxy:UpdatePlayerFightData(Player: Player) -- 针对百分比特殊属性直接进行计算修改 if AttributesData["hpRate"] then AttributesData["hp"] = math.floor(AttributesData["hp"] * (1 + AttributesData["hpRate"] / 100)) - AttributesData["maxhp"] = AttributesData["hp"] end + AttributesData["maxhp"] = AttributesData["hp"] + if AttributesData["attackRate"] then AttributesData["attack"] = math.floor(AttributesData["attack"] * (1 + AttributesData["attackRate"] / 100)) end + -- 获取原玩家属性,把不存在新属性列表的内容排除掉 + local ConfigAttributes = PlayerRole.Attributes:GetAttributes() + -- print("ConfigAttributes", ConfigAttributes) + for oldName, oldValue in ConfigAttributes do + if not AttributesData[oldName] then + AttributesData[oldName] = 0 + end + end + -- 更新玩家属性 + -- print(AttributesData) for AttributeName, AttributeValue in AttributesData do -- TODO:这里可能涉及到战斗时更换装备的属性处理,还需要再函数内部再根据剩余百分比数值变化 PlayerRole:ChangeAttributeValue(AttributeName, AttributeValue) diff --git a/src/ServerStorage/Proxy/PlayerInfoProxy.luau b/src/ServerStorage/Proxy/PlayerInfoProxy.luau index a1bf3b5..7293695 100644 --- a/src/ServerStorage/Proxy/PlayerInfoProxy.luau +++ b/src/ServerStorage/Proxy/PlayerInfoProxy.luau @@ -119,6 +119,7 @@ function PlayerInfoProxy:InitPlayer(Player: Player) end CreateInfoInstance(Player, PlayerInfoFolder, "Forge", ENUM_STATE_TYPE.Number, ArchiveProxy.pData[Player.UserId][STORE_NAME].Forge) + -- 新玩家默认添加货币 if isNew then local newData = Utils:GetIdDataFromJson(JsonParam, 7) for i = 1, #newData.intArray, 2 do diff --git a/src/StarterPlayerScripts/ClientMain/WeaponModel.luau b/src/StarterPlayerScripts/ClientMain/WeaponModel.luau index 5ce0310..e05f2bb 100644 --- a/src/StarterPlayerScripts/ClientMain/WeaponModel.luau +++ b/src/StarterPlayerScripts/ClientMain/WeaponModel.luau @@ -40,6 +40,7 @@ end function WeaponModel:SetDefaultWeaponModel() local modelName = Utils:GetIdDataFromJson(JsonParam, 4).stringValue + if not modelName then return end local WeaponModel = FolderPrefabEquipments:FindFirstChild(modelName) if not WeaponModel then warn("DefaultWeaponModel not found") return end @@ -78,6 +79,13 @@ RE_WearEquipment.OnClientEvent:Connect(function(IsWear: boolean, EquipmentId: nu for _, child in FolderBackpack:GetChildren() do if child.Name == oldWeaponName then child:Destroy() + return + end + end + for _, child in LocalPlayer.Character:GetChildren() do + if child:IsA("Tool") and child.Name == oldWeaponName then + child:Destroy() + return end end end) diff --git a/src/StarterPlayerScripts/UI/Windows/MainWindow/init.luau b/src/StarterPlayerScripts/UI/Windows/MainWindow/init.luau index 3978378..3bc4894 100644 --- a/src/StarterPlayerScripts/UI/Windows/MainWindow/init.luau +++ b/src/StarterPlayerScripts/UI/Windows/MainWindow/init.luau @@ -19,7 +19,6 @@ local RE_ChallengeLevel = ReplicatedStorage.Events.RE_ChallengeLevel --> Local local LocalPlayer = game:GetService("Players").LocalPlayer -local forgeRedPointSignal = Signal.new(Signal.ENUM.FORGE_RED_POINT) local challengeLevelEndSignal = Signal.new(Signal.ENUM.CHALLENGE_LEVEL_END) -------------------------------------------------------------------------------- @@ -157,11 +156,6 @@ function MainWindow:OnOpenWindow() table.insert(self.Connections, attributeUpgradeCon) table.insert(self.Connections, startChallengeCon) - local forgeRedPointCon = forgeRedPointSignal:Connect(function(show: boolean) - self.Variables["_tmpRedCreate"].Visible = show - end) - table.insert(self.Connections, forgeRedPointCon) - local challengeLevelEndCon = challengeLevelEndSignal:Connect(function(result: boolean) self.Variables["_btnStartChallenge"].Visible = true end)