更改近身攻击距离

This commit is contained in:
xiekaidong 2023-06-12 10:09:42 +08:00
parent 225fa8ad1f
commit 47ee292697
2 changed files with 15 additions and 5 deletions

View File

@ -898,10 +898,10 @@ function BattleUnitComp:enterSkillAttackState()
self:playAnimation(BattleConst.SPINE_ANIMATION_NAME.MOVE, true, false)
self.positionX = self.baseObject:fastGetLocalPosition()
if self.side == BattleConst.SIDE_ATK then
self.targetX = BattleConst.UNIT_FRONT_POS_X
self.targetX = - BattleConst.INIT_POS_X + skill:getMoveTypeParams()
self.moveDirection = 1
else
self.targetX = -BattleConst.UNIT_FRONT_POS_X
self.targetX = BattleConst.INIT_POS_X - skill:getMoveTypeParams()
self.moveDirection = -1
end
else
@ -1213,10 +1213,10 @@ function BattleUnitComp:enterNormalAttackState()
self:playAnimation(BattleConst.SPINE_ANIMATION_NAME.MOVE, true, false)
self.positionX = self.baseObject:fastGetLocalPosition()
if self.side == BattleConst.SIDE_ATK then
self.targetX = BattleConst.UNIT_FRONT_POS_X
self.targetX = - BattleConst.INIT_POS_X + skill:getMoveTypeParams()
self.moveDirection = 1
else
self.targetX = -BattleConst.UNIT_FRONT_POS_X
self.targetX = BattleConst.INIT_POS_X - skill:getMoveTypeParams()
self.moveDirection = -1
end
else

View File

@ -177,7 +177,17 @@ function BattleSkillEntity:changeSkillId(skillId)
end
function BattleSkillEntity:getMoveType()
return self.skillInfo.skill_position
if not self.skillInfo.skill_position then
return
end
return self.skillInfo.skill_position[1]
end
function BattleSkillEntity:getMoveTypeParams()
if not self.skillInfo.skill_position then
return 0
end
return self.skillInfo.skill_position[2] or 0
end
function BattleSkillEntity:getSkillAttackName()