diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 8298b46d..95c3a7ac 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -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 diff --git a/lua/app/userdata/battle/skill/battle_skill_entity.lua b/lua/app/userdata/battle/skill/battle_skill_entity.lua index fb15983f..209d25d3 100644 --- a/lua/app/userdata/battle/skill/battle_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_skill_entity.lua @@ -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()