From d10b9049f70b6de507c5e7ea88b811c76771a8a1 Mon Sep 17 00:00:00 2001 From: Fang Date: Mon, 24 Jul 2023 18:36:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=E5=B1=9E=E6=80=A7=E5=8A=A0?= =?UTF-8?q?=E6=88=90=E8=AE=A1=E7=AE=97fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/config/item.lua | 24 ++++----- lua/app/config/tutorial.lua | 15 +++++- lua/app/ui/hero/weapon_info_comp.lua | 2 +- .../userdata/dungeon/dungeon_armor_entity.lua | 1 + lua/app/userdata/equip/equip_entity.lua | 50 +++++++++++-------- lua/app/userdata/hero/hero_entity.lua | 2 +- 6 files changed, 56 insertions(+), 38 deletions(-) diff --git a/lua/app/config/item.lua b/lua/app/config/item.lua index 2cc08cef..fe2efc65 100644 --- a/lua/app/config/item.lua +++ b/lua/app/config/item.lua @@ -1638,7 +1638,7 @@ local item = { [1013]={ ["type"]=2, ["qlt"]=1, - ["icon"]="1013", + ["icon"]="1019", ["get_way_type"]=2, ["get_way"]={ 2, @@ -1658,7 +1658,7 @@ local item = { [1014]={ ["type"]=2, ["qlt"]=2, - ["icon"]="1014", + ["icon"]="1020", ["get_way_type"]=2, ["get_way"]={ 8, @@ -1681,7 +1681,7 @@ local item = { [1015]={ ["type"]=2, ["qlt"]=3, - ["icon"]="1015", + ["icon"]="1021", ["get_way_type"]=2, ["get_way"]={ 14, @@ -1707,7 +1707,7 @@ local item = { [1016]={ ["type"]=2, ["qlt"]=4, - ["icon"]="1016", + ["icon"]="1022", ["get_way_type"]=2, ["get_way"]={ 26, @@ -1733,7 +1733,7 @@ local item = { [1017]={ ["type"]=2, ["qlt"]=5, - ["icon"]="1017", + ["icon"]="1023", ["get_way_type"]=2, ["get_way"]={ 38, @@ -1753,7 +1753,7 @@ local item = { [1018]={ ["type"]=2, ["qlt"]=5, - ["icon"]="1018", + ["icon"]="1024", ["get_way_type"]=2, ["get_way"]={ 50, @@ -1767,7 +1767,7 @@ local item = { [1019]={ ["type"]=2, ["qlt"]=1, - ["icon"]="1019", + ["icon"]="1013", ["get_way_type"]=2, ["get_way"]={ 3, @@ -1787,7 +1787,7 @@ local item = { [1020]={ ["type"]=2, ["qlt"]=2, - ["icon"]="1020", + ["icon"]="1014", ["get_way_type"]=2, ["get_way"]={ 9, @@ -1810,7 +1810,7 @@ local item = { [1021]={ ["type"]=2, ["qlt"]=3, - ["icon"]="1021", + ["icon"]="1015", ["get_way_type"]=2, ["get_way"]={ 15, @@ -1836,7 +1836,7 @@ local item = { [1022]={ ["type"]=2, ["qlt"]=4, - ["icon"]="1022", + ["icon"]="1016", ["get_way_type"]=2, ["get_way"]={ 27, @@ -1862,7 +1862,7 @@ local item = { [1023]={ ["type"]=2, ["qlt"]=5, - ["icon"]="1023", + ["icon"]="1017", ["get_way_type"]=2, ["get_way"]={ 39, @@ -1882,7 +1882,7 @@ local item = { [1024]={ ["type"]=2, ["qlt"]=5, - ["icon"]="1024", + ["icon"]="1018", ["get_way_type"]=2, ["get_way"]={ 51, diff --git a/lua/app/config/tutorial.lua b/lua/app/config/tutorial.lua index e424ca55..350de8d7 100644 --- a/lua/app/config/tutorial.lua +++ b/lua/app/config/tutorial.lua @@ -673,7 +673,12 @@ local tutorial = { 0, 200 }, - ["target_name"]="hero_detail_ui(Clone)/common/btn_close" + ["target_name"]="hero_detail_ui(Clone)/common/btn_close", + ["arrow_direction"]=1, + ["arrow_offset"]={ + 0, + 0 + } }, [80050]={ ["next_id"]=80060, @@ -711,6 +716,7 @@ local tutorial = { } }, [80070]={ + ["type"]=2, ["target_name"]="main_ui(Clone)/sub_ui_node/main_comp/dungeon_comp/scrollrect/viewport/content/scroll_cell_2/btn_start", ["arrow_direction"]=2, ["arrow_offset"]={ @@ -776,7 +782,12 @@ local tutorial = { 0, 200 }, - ["target_name"]="hero_detail_ui(Clone)/common/btn_close" + ["target_name"]="hero_detail_ui(Clone)/common/btn_close", + ["arrow_direction"]=1, + ["arrow_offset"]={ + 0, + 0 + } }, [90050]={ ["next_id"]=90060, diff --git a/lua/app/ui/hero/weapon_info_comp.lua b/lua/app/ui/hero/weapon_info_comp.lua index 66d4c028..405a0a51 100644 --- a/lua/app/ui/hero/weapon_info_comp.lua +++ b/lua/app/ui/hero/weapon_info_comp.lua @@ -44,7 +44,7 @@ function WeaponInfoComp:refresh() self.txLevel:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_3) .. self.weaponEntity:getLevel().."/"..self.weaponEntity:getMaxLevel()) self.txAttr:setText(self.weaponEntity:getAttrDesc()) local height = self.txAttr:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight - self.attrContent:setSizeDeltaY(height) + self.attrContent:setSizeDeltaY(height + 5) self.attrContent:setAnchoredPosition(0, 0) -- 基础属性 diff --git a/lua/app/userdata/dungeon/dungeon_armor_entity.lua b/lua/app/userdata/dungeon/dungeon_armor_entity.lua index 4a133e14..a72c5f79 100644 --- a/lua/app/userdata/dungeon/dungeon_armor_entity.lua +++ b/lua/app/userdata/dungeon/dungeon_armor_entity.lua @@ -24,6 +24,7 @@ function DungeonArmorEntity:init(data) DataManager.FormationData:initDungeonArmor(self.heroes) DataManager:registerCrossDayFunc("DungeonArmorEntity", function() + self.fundAd = false self.farmCount = table.clear(self.farmCount) self:setDirty() end) diff --git a/lua/app/userdata/equip/equip_entity.lua b/lua/app/userdata/equip/equip_entity.lua index 64aee9a4..564240df 100644 --- a/lua/app/userdata/equip/equip_entity.lua +++ b/lua/app/userdata/equip/equip_entity.lua @@ -1,5 +1,5 @@ local EquipEntity = class("EquipEntity", BaseData) -local DEFAULT_FACTOR = GConst.BattleConst.DEFAULT_FACTOR +local ATTR_FACTOR = 100 function EquipEntity:ctor(heroId, part, level) self.level = level or 0 @@ -40,7 +40,7 @@ end -- 获取部位加成后生命值 function EquipEntity:getHp() local result = self:getBaseHp() - result = result + self:getHeroEntity():getTotalBaseHp() * self:getHpPercent() // DEFAULT_FACTOR + result = result + self:getHeroEntity():getTotalBaseHp() * self:getHpPercent() // ATTR_FACTOR return result end @@ -55,7 +55,7 @@ end -- 获取部位加成后攻击力 function EquipEntity:getAttack() local result = self:getBaseAttack() - result = result + self:getHeroEntity():getTotalBaseAtk() * self:getAtkPercent() // DEFAULT_FACTOR + result = result + self:getHeroEntity():getTotalBaseAtk() * self:getAtkPercent() // ATTR_FACTOR return result end @@ -78,12 +78,12 @@ end -- 获取攻击加成百分比 function EquipEntity:getAtkPercent() local attrs = self:getStageAttr() - if not attrs then + if not attrs or #attrs == 0 then return 0 end for index, attr in ipairs(attrs) do if table.containValue(GConst.MATCH_ATTACK_ADD_NAME, attr.type) then - return attr.num // DEFAULT_FACTOR + return attr.num // ATTR_FACTOR end end return 0 @@ -92,12 +92,12 @@ end -- 获取生命值加成百分比 function EquipEntity:getHpPercent() local attrs = self:getStageAttr() - if not attrs then + if not attrs or #attrs == 0 then return 0 end for index, attr in ipairs(attrs) do if table.containValue(GConst.MATCH_HP_ADD_NAME, attr.type) then - return attr.num // DEFAULT_FACTOR + return attr.num // ATTR_FACTOR end end return 0 @@ -106,12 +106,12 @@ end -- 获取暴击率百分比 function EquipEntity:getCritPercent() local attrs = self:getStageAttr() - if not attrs then + if not attrs or #attrs == 0 then return 0 end for index, attr in ipairs(attrs) do if table.containValue(GConst.MATCH_CRIT_NAME, attr.type) then - return attr.num // DEFAULT_FACTOR + return attr.num // ATTR_FACTOR end end return 0 @@ -120,12 +120,12 @@ end --获取暴击伤害百分比 function EquipEntity:getCritHurtPercent() local attrs = self:getStageAttr() - if not attrs then + if not attrs or #attrs == 0 then return 0 end for index, attr in ipairs(attrs) do if table.containValue(GConst.MATCH_CRIT_TIME_NAME, attr.type) then - return attr.num // DEFAULT_FACTOR + return attr.num // ATTR_FACTOR end end return 0 @@ -134,12 +134,12 @@ end -- 获取治疗百分比 function EquipEntity:getHealPercent() local attrs = self:getStageAttr() - if not attrs then + if not attrs or #attrs == 0 then return 0 end for index, attr in ipairs(attrs) do if table.containValue(GConst.MATCH_CURED_NAME, attr.type) then - return attr.num // DEFAULT_FACTOR + return attr.num // ATTR_FACTOR end end return 0 @@ -148,12 +148,12 @@ end -- 获取普攻增伤百分比 function EquipEntity:getNormalHurtPercent() local attrs = self:getStageAttr() - if not attrs then + if not attrs or #attrs == 0 then return 0 end for index, attr in ipairs(attrs) do if table.containValue(GConst.MATCH_NORMAL_HURTP_NAME, attr.type) then - return attr.num // DEFAULT_FACTOR + return attr.num // ATTR_FACTOR end end return 0 @@ -162,12 +162,12 @@ end -- 获取技能增伤百分比 function EquipEntity:getSkillHurtPercent() local attrs = self:getStageAttr() - if not attrs then + if not attrs or #attrs == 0 then return 0 end for index, attr in ipairs(attrs) do if table.containValue(GConst.MATCH_SKILL_HURTP_NAME, attr.type) then - return attr.num // DEFAULT_FACTOR + return attr.num // ATTR_FACTOR end end return 0 @@ -175,12 +175,14 @@ end -- 获取部位阶段等级,未达到最低阶段等级时,阶段为0 function EquipEntity:getStage() + local stage = 0 for idx, level in pairs(self.cfg.features_level) do if self.level < level then - return idx - 1 + break end + stage = idx - 1 end - return nil-- 超过最大阶段等级 + return stage end -- 获取属性描述 @@ -208,10 +210,14 @@ end -- 获取部位已获得属性 function EquipEntity:getStageAttr() local stage = self:getStage() - if stage and stage > 0 then - return self.cfg.features_attr[stage] + if self.curAttr == nil or #self.curAttr ~= stage then + self.curAttr = {} + for i = 1, stage do + table.insert(self.curAttr, self.cfg.features_attr[i]) + end end - return nil + + return self.curAttr end -- 获取部位图标id diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua index eadcdaa3..a5901926 100644 --- a/lua/app/userdata/hero/hero_entity.lua +++ b/lua/app/userdata/hero/hero_entity.lua @@ -108,7 +108,7 @@ function HeroEntity:updateEquipAttr() if EDITOR_MODE then local printStr = "" - printStr = printStr .. "更新装备数值:"..self:getCfgId().."-".. partName .. "\n" + printStr = printStr .. "更新装备数值:"..self:getCfgId().."-".. partName .. "-" .. equipEntity:getLevel() .. "\n" printStr = printStr .. "生命:".. hp .. "\n" printStr = printStr .. "攻击力:".. atk .. "\n" printStr = printStr .. "普攻增伤:".. normalHurt .. "\n"