diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 653df0bb..8128adfe 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -554,10 +554,17 @@ function BattleTeam:onActionOver() self:getMainUnit().unitEntity:clearCounterAttackCount() local teamAction = function() - self.battleController.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ATK_STEP - self.battleController.curTeam = self.battleController.atkTeam ---- 普攻 - local skillMatch = self:getMainUnit().unitEntity:getMatchType() + local skillMatch + if self.side == BattleConst.SIDE_ATK then + self.battleController.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ATK_STEP + self.battleController.curTeam = self.battleController.atkTeam + skillMatch = self:getMainUnit().unitEntity:getMatchType() + else + self.battleController.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_DEF_STEP + self.battleController.curTeam = self.battleController.defTeam + end + self:useNormalSkill(skillMatch, counterAttackCount, true, BattleConst.EFFECT_TYPE.COUNTERATTACK, function() self.battleController:enterNextTeamAction() end) diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index c908cd6a..428e6d0e 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -530,16 +530,24 @@ end function BattleUI:initCounterAttack() self.counterAttackNode = self.uiMap["battle_ui.battle_root.battle_number_node.counter_attack"] self.counterTx = self.uiMap["battle_ui.battle_root.battle_number_node.counter_attack.text_number"] + self.counterTxTmp = self.counterTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) + self.counterTxbgComp = self.uiMap["battle_ui.battle_root.top_node.counter_attack.bg"] self.counterAttackNode:setVisible(false) end function BattleUI:showCounterAttack(count, side) local x = 280 + local horizontal = 180 if side == GConst.BattleConst.SIDE_ATK then x = -280 + horizontal = 0 + self.counterTxTmp.alignment = CS.TMPro.TextAlignmentOptions.MidlineLeft + else + self.counterTxTmp.alignment = CS.TMPro.TextAlignmentOptions.MidlineRight end + self.counterTxbgComp:setEulerAngles(0, horizontal, 0) self.counterAttackNode:setAnchoredPositionX(x) - self.counterTx:setText(I18N:getGlobalText(I18N.GlobalConst.COUNTER_ATTACK_DESC) .. "+" .. count) + self.counterTx:setText(I18N:getGlobalText(I18N.GlobalConst.COUNTER_ATTACK_DESC) .. "x" .. count) self.counterAttackNode:setVisible(true) end