皮肤技能表现

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(),
assistingSkill = heroEntity:getAssistingSkill(),
body = 2, -- 英雄默认是中体型
skin = heroEntity:getSkinId(),
attr = {
hp = hp,
max_hp = hp,

View File

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

View File

@ -18,11 +18,16 @@ function BattleUnitEntity:init(unitData, side, team)
end
function BattleUnitEntity:initSkill()
local skinConfig = ConfigManager:getConfig("skin")[self.unitData.skin]
local skinShow
if skinConfig then
skinShow = skinConfig.skill_show
end
self.activeSkills = {}
if self.unitData.normalSkills then
self.normalSkills = {}
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)
end
self.normalSkillCount = self.unitData.normalSkillCount or #self.normalSkills
@ -35,7 +40,11 @@ function BattleUnitEntity:initSkill()
end
if self.unitData.activeSkills then
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)
end
end
@ -435,6 +444,10 @@ function BattleUnitEntity:getBlock()
return self.team:getBlock()
end
function BattleUnitEntity:getSkinId()
return self.unitData.skin
end
function BattleUnitEntity:getExp()
return self.unitData.exp
end