diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index aeb3949f13..4678587e0d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -89,8 +89,7 @@ function this.Initialize() end --获取技能数据(战斗用) -function this.GetSkillData(skillId, pos) - pos = pos or 0 +function this.GetSkillData(skillId,skinId) if not skillId or not SkillLogicConfig[skillId] then return end @@ -108,12 +107,12 @@ function this.GetSkillData(skillId, pos) local effectIds=SkillLogicConfig[skillId].SkillDisplay local eid=0 if effectIds then - for i = 1, #effectIds do - if effectIds[i][1]==skin then - eid=effectIds[i][2] + for i = 1, #effectIds do + if effectIds[i][1]==skin then + eid=effectIds[i][2] + end end end - end LogError("技能效果id:===="..eid) local EffectCombat = CombatControl[eid] @@ -195,8 +194,9 @@ function this.GetMonsterData(monsterId) camp = 1, type = 1, quality = 0, - skill = this.GetSkillData(monsterConfig.SkillList[1]), - superSkill = this.GetSkillData(monsterConfig.SkillList[2]), + skinId=monsterConfig.SkinId, + skill = this.GetSkillData(monsterConfig.SkillList[1],monsterConfig.SkinId), + superSkill = this.GetSkillData(monsterConfig.SkillList[2],monsterConfig.SkinId), element = monsterConfig.PropertyName, passivity = this.GetPassivityData(monsterConfig.PassiveSkillList), property = { @@ -290,12 +290,14 @@ function this.GetBattleServerData(msg, isFightPlayer) local rid = tonumber(data.fightUnitList[i].unitId) local position = tonumber(data.fightUnitList[i].position) local star = tonumber(data.fightUnitList[i].star) + local skin=tonumber(data.fightUnitList[i].skinId) local skills = string.split(data.fightUnitList[i].unitSkillIds, "#") local propertys = string.split(data.fightUnitList[i].property, "#") local role = { roleId = rid, position = position, star = star, + skinId=skin, camp = 0, type = 1, quality = 0, @@ -305,10 +307,10 @@ function this.GetBattleServerData(msg, isFightPlayer) property = { }, } if skills[1] then - role.skill = this.GetSkillData(tonumber(skills[1])) + role.skill = this.GetSkillData(tonumber(skills[1]),skin) end if skills[2] and skills[2] ~= "0" then - role.superSkill = this.GetSkillData(tonumber(skills[2])) + role.superSkill = this.GetSkillData(tonumber(skills[2]),skin) end if #skills > 2 then local passivityList = {} @@ -369,6 +371,7 @@ function this.GetBattleServerData(msg, isFightPlayer) local monsterConfig = ConfigManager.GetConfigData(ConfigName.MonsterConfig, tonumber(data2.fightUnitList[j].unitId)) local position = tonumber(data2.fightUnitList[j].position) local star = tonumber(data2.fightUnitList[j].star) + local skin=tonumber(data2.fightUnitList[j].skinId) skills = string.split(data2.fightUnitList[j].unitSkillIds, "#") propertys = string.split(data2.fightUnitList[j].property, "#") role = { @@ -376,6 +379,7 @@ function this.GetBattleServerData(msg, isFightPlayer) monsterId = tonumber(data2.fightUnitList[j].unitId), --非战斗数据,仅用于显示怪物名称 position = position, star = star, + skinId=skin, camp = 1, type = monsterConfig.Type, quality = monsterConfig.Quality, @@ -389,12 +393,14 @@ function this.GetBattleServerData(msg, isFightPlayer) local rid = tonumber(data2.fightUnitList[j].unitId) local position = tonumber(data2.fightUnitList[j].position) local star = tonumber(data2.fightUnitList[j].star) + local skin=tonumber(data2.fightUnitList[j].skinId) skills = string.split(data2.fightUnitList[j].unitSkillIds, "#") propertys = string.split(data2.fightUnitList[j].property, "#") role = { roleId = rid, position = position, star = star, + skinId=skin, camp = 1, type = 1, quality = 0, @@ -406,10 +412,10 @@ function this.GetBattleServerData(msg, isFightPlayer) end if skills[1] then - role.skill = this.GetSkillData(tonumber(skills[1])) + role.skill = this.GetSkillData(tonumber(skills[1]),role.skinId) end if skills[2] and skills[2] ~= "0" then - role.superSkill = this.GetSkillData(tonumber(skills[2])) + role.superSkill = this.GetSkillData(tonumber(skills[2]),role.skinId) end if #skills > 2 then local passivityList = {} diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 10ab48d98e..b3a589dcac 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -31,17 +31,33 @@ function EnemyView:onCreate(go, role, position, root) self.elementImg = Util.GetGameObject(go, "Pro/Image"):GetComponent("Image") -- + local roleId=role.roleData.roleId + local live=HeroConfig[role.roleData.roleId].Live + --如果英雄装备皮肤 + if role.roleData.skinId and role.roleData.skinId>0 then + roleId=role.roleData.skinId + local skin=ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",roleId) + if skin then + live=skin.Live + end + end + if not role.roleData.skinId then + self.skinId=0 + else + self.skinId=roleId + end + self.hpCache = self.role:GetRoleData(RoleDataName.Hp) / self.role:GetRoleData(RoleDataName.MaxHp) self.hpSlider.fillAmount = self.hpCache self.hpPassSlider.fillAmount = self.hpCache - self.livePath = GetResourcePath(HeroConfig[role.roleData.roleId].Live) - self.play_liveScale = RoleConfig[role.roleData.roleId].play_liveScale - self.enemy_liveScale = RoleConfig[role.roleData.roleId].enemy_liveScale - self.offset = RoleConfig[role.roleData.roleId].offset - self.outOffset = RoleConfig[role.roleData.roleId].enemy_offset - self.spAtkTime = RoleConfig[role.roleData.roleId].CastingSkills/1000 - self.atkSoundTime = RoleConfig[role.roleData.roleId].CastingAudio/1000 - self.attackSound = RoleConfig[role.roleData.roleId].sond + self.livePath = GetResourcePath(live) + self.play_liveScale = RoleConfig[roleId].play_liveScale + self.enemy_liveScale = RoleConfig[roleId].enemy_liveScale + self.offset = RoleConfig[roleId].offset + self.outOffset = RoleConfig[roleId].enemy_offset + self.spAtkTime = RoleConfig[roleId].CastingSkills/1000 + self.atkSoundTime = RoleConfig[roleId].CastingAudio/1000 + self.attackSound = RoleConfig[roleId].sond self.readingName = HeroConfig[role.roleData.roleId].ReadingName -- diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 6a409f1a12..cc87d96c37 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -37,14 +37,30 @@ function PlayerView:onCreate(go, role, position, root) self.hpCache = self.role:GetRoleData(RoleDataName.Hp) / self.role:GetRoleData(RoleDataName.MaxHp) self.hpSlider.fillAmount = self.hpCache self.hpPassSlider.fillAmount = self.hpCache - self.livePath = GetResourcePath(HeroConfig[role.roleData.roleId].Live) - self.play_liveScale = RoleConfig[role.roleData.roleId].play_liveScale - self.enemy_liveScale = RoleConfig[role.roleData.roleId].enemy_liveScale - self.offset = RoleConfig[role.roleData.roleId].offset - self.outOffset = RoleConfig[role.roleData.roleId].enemy_offset - self.spAtkTime = RoleConfig[role.roleData.roleId].CastingSkills/1000 - self.atkSoundTime = RoleConfig[role.roleData.roleId].CastingAudio/1000 - self.attackSound = RoleConfig[role.roleData.roleId].sond + local roleId=role.roleData.roleId + + local live=HeroConfig[role.roleData.roleId].Live + --如果英雄装备皮肤 + if role.roleData.skinId and role.roleData.skinId>0 then + roleId=role.roleData.skinId + local skin=ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",roleId) + if skin then + live=skin.Live + end + end + if not role.roleData.skinId then + self.skinId=0 + else + self.skinId=roleId + end + self.livePath = GetResourcePath(live) + self.play_liveScale = RoleConfig[roleId].play_liveScale + self.enemy_liveScale = RoleConfig[roleId].enemy_liveScale + self.offset = RoleConfig[roleId].offset + self.outOffset = RoleConfig[roleId].enemy_offset + self.spAtkTime = RoleConfig[roleId].CastingSkills/1000 + self.atkSoundTime = RoleConfig[roleId].CastingAudio/1000 + self.attackSound = RoleConfig[roleId].sond self.readingName = HeroConfig[role.roleData.roleId].ReadingName self.nameText.text = self.readingName diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index 0c59b6f8b7..91b45274c7 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -26,10 +26,23 @@ end function SkillCaster:OnSkillCast(skill) if not skill then return end - - local combat = BattleManager.GetSkillCombat(SkillLogicConfig[skill.id].SkillDisplay) + local effectIds=SkillLogicConfig[skill.id].SkillDisplay + local eid=0 + local skin=self.owner.skinId or 0 + if effectIds then + for i = 1, #effectIds do + if effectIds[i][1]==skin then + eid=effectIds[i][2] + end + end + end + if eid==0 then + eid=effectIds[1][2] + end + LogError("eid======"..eid.."skin: "..skin) + local combat = BattleManager.GetSkillCombat(eid) if not combat then return end - + LogError("qqqqqqqqqqqqqqqqq") -- 追击显示追击文字 if skill.isAdd then self.owner.Floater:ImageBuffFloating("z_zhandou_zhuiji")