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