战斗加速的逻辑
This commit is contained in:
parent
2e657ff39d
commit
c068622521
@ -618,7 +618,6 @@ function BattleUnitComp:enterAssistingAttackState()
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
self:attackAndSpeedUp()
|
||||
self:initPosition()
|
||||
end
|
||||
|
||||
@ -674,13 +673,13 @@ function BattleUnitComp:enterSkillAttackState()
|
||||
local attackName
|
||||
if self.normalSkillCount > 0 then
|
||||
attackName = skill:getRandomNormalAttackName()
|
||||
self:attackAndSpeedUp()
|
||||
else
|
||||
attackName = skill:getSkillAttackName()
|
||||
end
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
self:attackAndSpeedUp()
|
||||
end
|
||||
end
|
||||
|
||||
@ -834,7 +833,7 @@ function BattleUnitComp:doNextSkillAttack()
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
self:attackAndSpeedUp()
|
||||
DataManager.BattleData:resetTimeSpeed()
|
||||
end
|
||||
|
||||
function BattleUnitComp:doNextNormalAttack()
|
||||
@ -853,14 +852,19 @@ function BattleUnitComp:doNextAttack()
|
||||
if self.normalSkillCount > 0 then
|
||||
local skill = self.unitEntity:getNormalSkill()
|
||||
attackName = skill:getRandomNormalAttackName()
|
||||
if attackName then
|
||||
self:attackAndSpeedUp()
|
||||
end
|
||||
elseif self.currActiveSkill then
|
||||
attackName = self.currActiveSkill:getSkillAttackName()
|
||||
if attackName then
|
||||
DataManager.BattleData:resetTimeSpeed()
|
||||
end
|
||||
end
|
||||
if attackName then
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
self:attackAndSpeedUp()
|
||||
else -- 归位
|
||||
self:moveBackToInitPosition()
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user