皮肤技能表现

This commit is contained in:
xiekaidong 2023-08-10 10:48:30 +08:00
parent e17c9bf4cf
commit 5b8030552d
3 changed files with 74 additions and 3 deletions

View File

@ -762,6 +762,7 @@ function BattleBaseData:initHeroData(formation)
normalSkills = heroEntity:getHurtSkill(), normalSkills = heroEntity:getHurtSkill(),
assistingSkill = heroEntity:getAssistingSkill(), assistingSkill = heroEntity:getAssistingSkill(),
body = 2, -- 英雄默认是中体型 body = 2, -- 英雄默认是中体型
skin = heroEntity:getSkinId(),
attr = { attr = {
hp = hp, hp = hp,
max_hp = hp, max_hp = hp,

View File

@ -5,10 +5,15 @@ local BattleSkillEntity = class("BattleSkillEntity", BaseData)
BattleSkillEntity.sid = 0 BattleSkillEntity.sid = 0
function BattleSkillEntity:ctor(skillId, skillType, owner) function BattleSkillEntity:ctor(skillId, skillType, owner, skillShowId)
self.skillType = skillType self.skillType = skillType
self.skillId = skillId self.skillId = skillId
self.owner = owner self.owner = owner
if skillShowId then
self.skillShow = ConfigManager:getConfig("skin_skill")[skillShowId]
else
self.skillShow = nil
end
BattleSkillEntity.sid = BattleSkillEntity.sid + 1 BattleSkillEntity.sid = BattleSkillEntity.sid + 1
self.sid = BattleSkillEntity.sid self.sid = BattleSkillEntity.sid
self:init() self:init()
@ -240,6 +245,10 @@ function BattleSkillEntity:getMoveTypeParams()
end end
function BattleSkillEntity:getSkillAttackName() function BattleSkillEntity:getSkillAttackName()
if self.skillShow then
return self.skillShow.name_act
end
return self.skillInfo.name_act return self.skillInfo.name_act
end end
@ -300,6 +309,14 @@ function BattleSkillEntity:getPassiveTriggerId()
end end
function BattleSkillEntity:getFxSelf() function BattleSkillEntity:getFxSelf()
if self.skillShow then
if not self:getIsAtkSideSkill() and self:getUsePvpEffect() then
return self.skillShow.fx_self_mirror or self.skillShow.fx_self
else
return self.skillShow.fx_self
end
end
if not self:getIsAtkSideSkill() and self:getUsePvpEffect() then if not self:getIsAtkSideSkill() and self:getUsePvpEffect() then
return self.skillInfo.fx_self_mirror or self.skillInfo.fx_self return self.skillInfo.fx_self_mirror or self.skillInfo.fx_self
else else
@ -308,10 +325,22 @@ function BattleSkillEntity:getFxSelf()
end end
function BattleSkillEntity:getFxSelfDelay() function BattleSkillEntity:getFxSelfDelay()
if self.skillShow then
return self.skillShow.fx_self_delay
end
return self.skillInfo.fx_self_delay return self.skillInfo.fx_self_delay
end end
function BattleSkillEntity:getFxTarget() function BattleSkillEntity:getFxTarget()
if self.skillShow then
if not self:getIsAtkSideSkill() and self:getUsePvpEffect() then
return self.skillShow.fx_target_mirror or self.skillShow.fx_target
else
return self.skillShow.fx_target
end
end
if not self:getIsAtkSideSkill() and self:getUsePvpEffect() then if not self:getIsAtkSideSkill() and self:getUsePvpEffect() then
return self.skillInfo.fx_target_mirror or self.skillInfo.fx_target return self.skillInfo.fx_target_mirror or self.skillInfo.fx_target
else else
@ -320,26 +349,50 @@ function BattleSkillEntity:getFxTarget()
end end
function BattleSkillEntity:getFxTargetDelay() function BattleSkillEntity:getFxTargetDelay()
if self.skillShow then
return self.skillShow.fx_target_delay
end
return self.skillInfo.fx_target_delay return self.skillInfo.fx_target_delay
end end
function BattleSkillEntity:getShakeType() function BattleSkillEntity:getShakeType()
if self.skillShow then
return self.skillShow.shake_type
end
return self.skillInfo.shake_type return self.skillInfo.shake_type
end end
function BattleSkillEntity:getShakeTime() function BattleSkillEntity:getShakeTime()
if self.skillShow then
return self.skillShow.shake_time
end
return self.skillInfo.shake_time return self.skillInfo.shake_time
end end
function BattleSkillEntity:getSoundHit() function BattleSkillEntity:getSoundHit()
if self.skillShow then
return self.skillShow.sound_hit
end
return self.skillInfo.sound_hit return self.skillInfo.sound_hit
end end
function BattleSkillEntity:getSoundDelay() function BattleSkillEntity:getSoundDelay()
if self.skillShow then
return self.skillShow.sound_delay or 0
end
return self.skillInfo.sound_delay or 0 return self.skillInfo.sound_delay or 0
end end
function BattleSkillEntity:getSkillSound() function BattleSkillEntity:getSkillSound()
if self.skillShow then
return self.skillShow.sound
end
return self.skillInfo.sound return self.skillInfo.sound
end end
@ -367,6 +420,10 @@ end
-- 子弹时间参数 -- 子弹时间参数
function BattleSkillEntity:getSlowDownBulletTimeParams() function BattleSkillEntity:getSlowDownBulletTimeParams()
if self.skillShow then
return self.skillShow.bullet_time
end
return self.skillInfo.bullet_time return self.skillInfo.bullet_time
end end

View File

@ -18,11 +18,16 @@ function BattleUnitEntity:init(unitData, side, team)
end end
function BattleUnitEntity:initSkill() function BattleUnitEntity:initSkill()
local skinConfig = ConfigManager:getConfig("skin")[self.unitData.skin]
local skinShow
if skinConfig then
skinShow = skinConfig.skill_show
end
self.activeSkills = {} self.activeSkills = {}
if self.unitData.normalSkills then if self.unitData.normalSkills then
self.normalSkills = {} self.normalSkills = {}
for k, v in ipairs(self.unitData.normalSkills) do for k, v in ipairs(self.unitData.normalSkills) do
local skill = BattleSkillEntity:create(v, GConst.BattleConst.SKILL_TYPE_NORMAL, self) local skill = BattleSkillEntity:create(v, GConst.BattleConst.SKILL_TYPE_NORMAL, self, skinShow and skinShow[k])
table.insert(self.normalSkills, skill) table.insert(self.normalSkills, skill)
end end
self.normalSkillCount = self.unitData.normalSkillCount or #self.normalSkills self.normalSkillCount = self.unitData.normalSkillCount or #self.normalSkills
@ -35,7 +40,11 @@ function BattleUnitEntity:initSkill()
end end
if self.unitData.activeSkills then if self.unitData.activeSkills then
for k, v in ipairs(self.unitData.activeSkills) do for k, v in ipairs(self.unitData.activeSkills) do
local skill = BattleSkillEntity:create(v, GConst.BattleConst.SKILL_TYPE_ACTIVE, self) local skillShow
if k == 1 then
skillShow = skinShow and skinShow[#skinShow]
end
local skill = BattleSkillEntity:create(v, GConst.BattleConst.SKILL_TYPE_ACTIVE, self, skillShow)
table.insert(self.activeSkills, skill) table.insert(self.activeSkills, skill)
end end
end end
@ -435,6 +444,10 @@ function BattleUnitEntity:getBlock()
return self.team:getBlock() return self.team:getBlock()
end end
function BattleUnitEntity:getSkinId()
return self.unitData.skin
end
function BattleUnitEntity:getExp() function BattleUnitEntity:getExp()
return self.unitData.exp return self.unitData.exp
end end