From 47ee292697a168e0de3ff167a230ee38d92ccb89 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 12 Jun 2023 10:09:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=BF=91=E8=BA=AB=E6=94=BB?= =?UTF-8?q?=E5=87=BB=E8=B7=9D=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/component/battle_unit_comp.lua | 8 ++++---- .../userdata/battle/skill/battle_skill_entity.lua | 12 +++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) 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()