Merge branch 'battle' into dev
This commit is contained in:
commit
fb0ebff007
@ -1,5 +1,7 @@
|
|||||||
local LocalizationGlobalConst =
|
local LocalizationGlobalConst =
|
||||||
{
|
{
|
||||||
|
COUNTER_ATTACK_DESC = "COUNTER_ATTACK_DESC",
|
||||||
|
BLOCK_DESC = "BLOCK_DESC",
|
||||||
MAIN_BTN_1 = "MAIN_BTN_1",
|
MAIN_BTN_1 = "MAIN_BTN_1",
|
||||||
QLT_DESC_1 = "QLT_DESC_1",
|
QLT_DESC_1 = "QLT_DESC_1",
|
||||||
QLT_DESC_2 = "QLT_DESC_2",
|
QLT_DESC_2 = "QLT_DESC_2",
|
||||||
|
|||||||
@ -118,6 +118,9 @@ local localization_global =
|
|||||||
["BTN_READ"] = "读取",
|
["BTN_READ"] = "读取",
|
||||||
["BATTLE_DESC_9"] = "{0}攻击力:<color=#ffffff>{1}</color>",
|
["BATTLE_DESC_9"] = "{0}攻击力:<color=#ffffff>{1}</color>",
|
||||||
["BATTLE_DESC_10"] = "已激活效果",
|
["BATTLE_DESC_10"] = "已激活效果",
|
||||||
|
|
||||||
|
["BLOCK_DESC"] = "格挡",
|
||||||
|
["COUNTER_ATTACK_DESC"] = "反击",
|
||||||
}
|
}
|
||||||
|
|
||||||
return localization_global
|
return localization_global
|
||||||
@ -30,6 +30,8 @@ BattleConst.HURT_STATE_CRIT = 1 -- 暴击
|
|||||||
BattleConst.EFFECT_COLOR_RED = 1
|
BattleConst.EFFECT_COLOR_RED = 1
|
||||||
BattleConst.EFFECT_COLOR_GREEN = 2
|
BattleConst.EFFECT_COLOR_GREEN = 2
|
||||||
BattleConst.EFFECT_COLOR_BLUE = 3
|
BattleConst.EFFECT_COLOR_BLUE = 3
|
||||||
|
BattleConst.EFFECT_COLOR_WHILTE = 4
|
||||||
|
BattleConst.EFFECT_COLOR_SPECIAL = 5
|
||||||
BattleConst.EFFECT_TYPE_MOVE_L = 1
|
BattleConst.EFFECT_TYPE_MOVE_L = 1
|
||||||
BattleConst.EFFECT_TYPE_MOVE_R = 2
|
BattleConst.EFFECT_TYPE_MOVE_R = 2
|
||||||
BattleConst.EFFECT_TYPE_CRIT = 3
|
BattleConst.EFFECT_TYPE_CRIT = 3
|
||||||
@ -178,6 +180,7 @@ BattleConst.SPINE_ANIMATION_NAME = {
|
|||||||
DEAD = "death",
|
DEAD = "death",
|
||||||
BORN = "born",
|
BORN = "born",
|
||||||
OUT = "out",
|
OUT = "out",
|
||||||
|
BLOCK = "block",
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleConst.EFFECT_TYPE = {
|
BattleConst.EFFECT_TYPE = {
|
||||||
@ -193,6 +196,7 @@ BattleConst.EFFECT_TYPE = {
|
|||||||
BattleConst.SPECIAL_DAMAGE_OR_CURE_TYPE = {
|
BattleConst.SPECIAL_DAMAGE_OR_CURE_TYPE = {
|
||||||
ROUND_BEGIN_HEAL = "round_begin_heal",
|
ROUND_BEGIN_HEAL = "round_begin_heal",
|
||||||
KILL_MAX_ELEMENT_AND_HEAL = "kill_max_element_and_heal",
|
KILL_MAX_ELEMENT_AND_HEAL = "kill_max_element_and_heal",
|
||||||
|
BE_SUCKED = "be_sucked",
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleConst.SKILL_RECORD_DATA_NAME = {
|
BattleConst.SKILL_RECORD_DATA_NAME = {
|
||||||
|
|||||||
@ -5,6 +5,9 @@ function BattleNumberComp:init()
|
|||||||
local uiMap = self.baseObject:genAllChildren()
|
local uiMap = self.baseObject:genAllChildren()
|
||||||
self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
||||||
self.effectText = uiMap["battle_number.text_number"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT)
|
self.effectText = uiMap["battle_number.text_number"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT)
|
||||||
|
if not self.effectText then
|
||||||
|
self.effectText = uiMap["battle_number.text_number"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||||
|
end
|
||||||
self.time = 0
|
self.time = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ function BattleUnitComp:_initBase()
|
|||||||
self.currAttackBlockIndex = 0 -- 多段伤害索引
|
self.currAttackBlockIndex = 0 -- 多段伤害索引
|
||||||
self.validEffectIdx = {}
|
self.validEffectIdx = {}
|
||||||
self.switchTime = 0
|
self.switchTime = 0
|
||||||
self.isPlayHurt = 0
|
self.playIdleSubAniDuration = {}
|
||||||
self.attackDurationMap = {}
|
self.attackDurationMap = {}
|
||||||
self.attackKeyFrameTimeMap = {}
|
self.attackKeyFrameTimeMap = {}
|
||||||
self.shieldBuffList = {}
|
self.shieldBuffList = {}
|
||||||
@ -227,11 +227,6 @@ function BattleUnitComp:stopRunAction()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:playAnimation(name, loop, forceRefresh)
|
function BattleUnitComp:playAnimation(name, loop, forceRefresh)
|
||||||
if name == SPINE_ANIMATION_NAME.HIT then
|
|
||||||
self.isPlayHurt = 1
|
|
||||||
else
|
|
||||||
self.isPlayHurt = 0
|
|
||||||
end
|
|
||||||
self.currAnimationName = name
|
self.currAnimationName = name
|
||||||
self.baseObject:playAnimation(name, loop, forceRefresh)
|
self.baseObject:playAnimation(name, loop, forceRefresh)
|
||||||
end
|
end
|
||||||
@ -651,28 +646,58 @@ function BattleUnitComp:enterIdleState()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:updateIdle(dt)
|
function BattleUnitComp:updateIdle(dt)
|
||||||
self:updateHurt(dt)
|
self:updateIdleSubAni(dt)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUnitComp:updateIdleSubAni(...)
|
||||||
|
if not self.currAnimationName then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if self.currAnimationName == SPINE_ANIMATION_NAME.HIT then
|
||||||
|
self:updateHurt(...)
|
||||||
|
elseif self.currAnimationName == SPINE_ANIMATION_NAME.BLOCK then
|
||||||
|
self:updateBlock(...)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:playHurt()
|
function BattleUnitComp:playHurt()
|
||||||
self.hurtTime = 0
|
local name = SPINE_ANIMATION_NAME.HIT
|
||||||
if self.currHitDuration == nil then
|
self.playIdleSubAniTime = 0
|
||||||
self.currHitDuration = self:getAnimationDuration(SPINE_ANIMATION_NAME.HIT)
|
if self.playIdleSubAniDuration[name] == nil then
|
||||||
|
self.playIdleSubAniDuration[name] = self:getAnimationDuration(name)
|
||||||
end
|
end
|
||||||
self:playAnimation(SPINE_ANIMATION_NAME.HIT, false, false)
|
self:playAnimation(name, false, false)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:updateHurt(dt)
|
function BattleUnitComp:updateHurt(dt)
|
||||||
if self.isPlayHurt == 0 then
|
self.playIdleSubAniTime = self.playIdleSubAniTime + dt
|
||||||
return
|
if self.playIdleSubAniTime >= self.playIdleSubAniDuration[SPINE_ANIMATION_NAME.HIT] then
|
||||||
|
self:playAnimation(SPINE_ANIMATION_NAME.IDLE, true, false)
|
||||||
end
|
end
|
||||||
if self.isPlayHurt == 1 then
|
end
|
||||||
self.hurtTime = self.hurtTime + dt
|
|
||||||
if self.hurtTime >= self.currHitDuration then
|
function BattleUnitComp:playBlock()
|
||||||
self:playAnimation(SPINE_ANIMATION_NAME.IDLE, true, false)
|
local name = SPINE_ANIMATION_NAME.BLOCK
|
||||||
self.isPlayHurt = 0
|
self.playIdleSubAniTime = 0
|
||||||
end
|
if self.playIdleSubAniDuration[name] == nil then
|
||||||
|
self.playIdleSubAniDuration[name] = self:getAnimationDuration(name)
|
||||||
|
end
|
||||||
|
self:playAnimation(name, false, false)
|
||||||
|
|
||||||
|
local direction = BattleConst.EFFECT_TYPE_MOVE_R
|
||||||
|
local x, y = self.baseObject:fastGetLocalPosition()
|
||||||
|
if self.side == BattleConst.SIDE_ATK then
|
||||||
|
direction = BattleConst.EFFECT_TYPE_MOVE_L
|
||||||
|
end
|
||||||
|
|
||||||
|
self:showEffectNumber(BattleConst.EFFECT_COLOR_SPECIAL, direction, I18N:getGlobalText(I18N.GlobalConst.BLOCK_DESC), x, y, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function BattleUnitComp:updateBlock(dt)
|
||||||
|
self.playIdleSubAniTime = self.playIdleSubAniTime + dt
|
||||||
|
if self.playIdleSubAniTime >= self.playIdleSubAniDuration[SPINE_ANIMATION_NAME.BLOCK] then
|
||||||
|
self:playAnimation(SPINE_ANIMATION_NAME.IDLE, true, false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1210,6 +1235,7 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx)
|
|||||||
local block = target.unitEntity:getBlock()
|
local block = target.unitEntity:getBlock()
|
||||||
if block > 0 then
|
if block > 0 then
|
||||||
if BattleHelper:random(1, DEFAULT_FACTOR) <= block then -- 格挡成功
|
if BattleHelper:random(1, DEFAULT_FACTOR) <= block then -- 格挡成功
|
||||||
|
target:playBlock()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1407,11 +1433,26 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
|||||||
if effectStatus == HURT_STATE_CRIT then
|
if effectStatus == HURT_STATE_CRIT then
|
||||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_RED, BattleConst.EFFECT_TYPE_CRIT, "c" .. damage, x, y, delayTime)
|
self:showEffectNumber(BattleConst.EFFECT_COLOR_RED, BattleConst.EFFECT_TYPE_CRIT, "c" .. damage, x, y, delayTime)
|
||||||
else
|
else
|
||||||
if self.side == BattleConst.SIDE_ATK then
|
local effectColor = BattleConst.EFFECT_COLOR_RED
|
||||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_RED, BattleConst.EFFECT_TYPE_MOVE_L, damage, x, y, delayTime)
|
local damageStr = damage
|
||||||
|
local direction = BattleConst.EFFECT_TYPE_MOVE_R
|
||||||
|
local elementType = BattleHelper:getDamageOrCureType2MatchType(damageOrCureType)
|
||||||
|
local weekNessValue = self.unitEntity:getWeakness(elementType)
|
||||||
|
if weekNessValue > 0 then
|
||||||
|
damageStr = "a" .. damage
|
||||||
else
|
else
|
||||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_RED, BattleConst.EFFECT_TYPE_MOVE_R, damage, x, y, delayTime)
|
local decGmgValue = self.unitEntity:getDecDmg(elementType)
|
||||||
|
if decGmgValue > 0 then
|
||||||
|
effectColor = BattleConst.EFFECT_COLOR_WHILTE
|
||||||
|
damageStr = "d" .. damage
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.side == BattleConst.SIDE_ATK then
|
||||||
|
direction = BattleConst.EFFECT_TYPE_MOVE_L
|
||||||
|
end
|
||||||
|
|
||||||
|
self:showEffectNumber(effectColor, direction, damageStr, x, y, delayTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if effectType == EFFECT_TYPE.DIRECT then
|
if effectType == EFFECT_TYPE.DIRECT then
|
||||||
@ -1419,7 +1460,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
|||||||
atker:takeDamageOrCure(self, num*self.unitEntity:getShieldRebound() // DEFAULT_FACTOR, EFFECT_TYPE.REBOUND, 0, BattleConst.BUFF_NAME.SHIELD_REBOUND_200)
|
atker:takeDamageOrCure(self, num*self.unitEntity:getShieldRebound() // DEFAULT_FACTOR, EFFECT_TYPE.REBOUND, 0, BattleConst.BUFF_NAME.SHIELD_REBOUND_200)
|
||||||
end
|
end
|
||||||
if self.unitEntity:getBeSucked() > 0 then -- 吸血
|
if self.unitEntity:getBeSucked() > 0 then -- 吸血
|
||||||
atker:takeDamageOrCure(self, -num*self.unitEntity:getBeSucked() // DEFAULT_FACTOR, EFFECT_TYPE.HEAL, 0, BattleConst.ATTR_NAME.BE_SUCKED)
|
atker:takeDamageOrCure(self, -num*self.unitEntity:getBeSucked() // DEFAULT_FACTOR, EFFECT_TYPE.HEAL, 0, BattleConst.SPECIAL_DAMAGE_OR_CURE_TYPE.BE_SUCKED)
|
||||||
end
|
end
|
||||||
if self.unitEntity:getIsLethargy() then -- 移除昏睡
|
if self.unitEntity:getIsLethargy() then -- 移除昏睡
|
||||||
self:removeBuffByName(BattleConst.BUFF_NAME.LETHARGY)
|
self:removeBuffByName(BattleConst.BUFF_NAME.LETHARGY)
|
||||||
@ -1431,6 +1472,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
|||||||
local counterattack = self.unitEntity:getCounterAttack()
|
local counterattack = self.unitEntity:getCounterAttack()
|
||||||
if counterattack > DEFAULT_FACTOR or BattleHelper:random(1, DEFAULT_FACTOR) <= counterattack then -- 通过命中概率
|
if counterattack > DEFAULT_FACTOR or BattleHelper:random(1, DEFAULT_FACTOR) <= counterattack then -- 通过命中概率
|
||||||
self.unitEntity:addCounterAttackCount(1)
|
self.unitEntity:addCounterAttackCount(1)
|
||||||
|
self.battleController:showCounterAttack(self.unitEntity:getCounterAttackCount(), self.side)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -282,6 +282,14 @@ function BattleController:hideCombo()
|
|||||||
self.battleUI:hideCombo()
|
self.battleUI:hideCombo()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleController:showCounterAttack(count, side)
|
||||||
|
self.battleUI:showCounterAttack(count, side)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleController:hideCounterAttack()
|
||||||
|
self.battleUI:hideCounterAttack()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleController:prepareFight()
|
function BattleController:prepareFight()
|
||||||
local count = 0
|
local count = 0
|
||||||
local totalCount = 3
|
local totalCount = 3
|
||||||
@ -297,7 +305,9 @@ function BattleController:prepareFight()
|
|||||||
self.battleUI:addLoadUICompleteListener(function()
|
self.battleUI:addLoadUICompleteListener(function()
|
||||||
BattleHelper:setEffectTextCache(self.battleUI:getBattleNumberRed(),
|
BattleHelper:setEffectTextCache(self.battleUI:getBattleNumberRed(),
|
||||||
self.battleUI:getBattleNumberGreen(),
|
self.battleUI:getBattleNumberGreen(),
|
||||||
self.battleUI:getBattleNumberBlue())
|
self.battleUI:getBattleNumberBlue(),
|
||||||
|
self.battleUI:getBattleNumberWhite(),
|
||||||
|
self.battleUI:getBattleNumberSpecial())
|
||||||
self:initAtkUnits(onPreloadFinished)
|
self:initAtkUnits(onPreloadFinished)
|
||||||
self:initDefUnits(onPreloadFinished)
|
self:initDefUnits(onPreloadFinished)
|
||||||
self.battleUI:refreshChessBoard(self:getChessBoardBgName())
|
self.battleUI:refreshChessBoard(self:getChessBoardBgName())
|
||||||
@ -577,6 +587,7 @@ function BattleController:enterNextTeamAction()
|
|||||||
|
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_TEAM_ACTION_OVER
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_TEAM_ACTION_OVER
|
||||||
self:hideCombo()
|
self:hideCombo()
|
||||||
|
self:hideCounterAttack()
|
||||||
|
|
||||||
if self:checkTeamIsDead(function() self:enterRoundEnd() end) then
|
if self:checkTeamIsDead(function() self:enterRoundEnd() end) then
|
||||||
return
|
return
|
||||||
|
|||||||
@ -20,6 +20,7 @@ function BattleHelper:init()
|
|||||||
self.seed = tonumber(tostring(os.time()):reverse():sub(1,6))
|
self.seed = tonumber(tostring(os.time()):reverse():sub(1,6))
|
||||||
self.baseOrder = 0
|
self.baseOrder = 0
|
||||||
self.skillSoundPath = {}
|
self.skillSoundPath = {}
|
||||||
|
self.damageOrCureType2MatchType = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleHelper:setBaseOrder(baseOrder)
|
function BattleHelper:setBaseOrder(baseOrder)
|
||||||
@ -175,13 +176,15 @@ function BattleHelper:addSpineBoneFollowerGraphic(effectObj)
|
|||||||
return boneFollower
|
return boneFollower
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleHelper:setEffectTextCache(cache1, cache2, cache3)
|
function BattleHelper:setEffectTextCache(cache1, cache2, cache3, cache4, cache5)
|
||||||
if self.effectTextCacheList == nil then
|
if self.effectTextCacheList == nil then
|
||||||
self.effectTextCacheList = {}
|
self.effectTextCacheList = {}
|
||||||
end
|
end
|
||||||
self.effectTextCacheList[1] = cache1
|
self.effectTextCacheList[1] = cache1
|
||||||
self.effectTextCacheList[2] = cache2
|
self.effectTextCacheList[2] = cache2
|
||||||
self.effectTextCacheList[3] = cache3
|
self.effectTextCacheList[3] = cache3
|
||||||
|
self.effectTextCacheList[4] = cache4
|
||||||
|
self.effectTextCacheList[5] = cache5
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleHelper:getEffectText(parent, colorType)
|
function BattleHelper:getEffectText(parent, colorType)
|
||||||
@ -256,6 +259,30 @@ function BattleHelper:playSkillSound(name, delay)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleHelper:getDamageOrCureType2MatchType(damageOrCureType)
|
||||||
|
if not damageOrCureType then
|
||||||
|
return GConst.BattleConst.ELEMENT_TYPE.NONE
|
||||||
|
end
|
||||||
|
|
||||||
|
if not self.damageOrCureType2MatchType[damageOrCureType] then
|
||||||
|
local elementType = GConst.BattleConst.ELEMENT_TYPE.NONE
|
||||||
|
if string.match(damageOrCureType, "red") then
|
||||||
|
elementType = GConst.BattleConst.ELEMENT_TYPE.RED
|
||||||
|
elseif string.match(damageOrCureType, "yellow") then
|
||||||
|
elementType = GConst.BattleConst.ELEMENT_TYPE.YELLOW
|
||||||
|
elseif string.match(damageOrCureType, "green") then
|
||||||
|
elementType = GConst.BattleConst.ELEMENT_TYPE.GREEN
|
||||||
|
elseif string.match(damageOrCureType, "blue") then
|
||||||
|
elementType = GConst.BattleConst.ELEMENT_TYPE.BLUE
|
||||||
|
elseif string.match(damageOrCureType, "purple") then
|
||||||
|
elementType = GConst.BattleConst.ELEMENT_TYPE.PURPLE
|
||||||
|
end
|
||||||
|
self.damageOrCureType2MatchType[damageOrCureType] = elementType
|
||||||
|
end
|
||||||
|
|
||||||
|
return self.damageOrCureType2MatchType[damageOrCureType]
|
||||||
|
end
|
||||||
|
|
||||||
function BattleHelper:performDurationDelay(delay, func)
|
function BattleHelper:performDurationDelay(delay, func)
|
||||||
return BattleScheduler:performWithDelayGlobal(func, delay)
|
return BattleScheduler:performWithDelayGlobal(func, delay)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -67,6 +67,7 @@ function BattleUI:_display()
|
|||||||
self:initSelectSkillNode()
|
self:initSelectSkillNode()
|
||||||
self:initCommonSkillDescTips()
|
self:initCommonSkillDescTips()
|
||||||
self:initBossEnterAni()
|
self:initBossEnterAni()
|
||||||
|
self:initCounterAttack()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:_addListeners()
|
function BattleUI:_addListeners()
|
||||||
@ -384,6 +385,8 @@ function BattleUI:initNumberNode()
|
|||||||
self.battleNumberRed = self.uiMap["battle_ui.cache_node.battle_number_red"]
|
self.battleNumberRed = self.uiMap["battle_ui.cache_node.battle_number_red"]
|
||||||
self.battleNumberGreen = self.uiMap["battle_ui.cache_node.battle_number_green"]
|
self.battleNumberGreen = self.uiMap["battle_ui.cache_node.battle_number_green"]
|
||||||
self.battleNumberBlue = self.uiMap["battle_ui.cache_node.battle_number_blue"]
|
self.battleNumberBlue = self.uiMap["battle_ui.cache_node.battle_number_blue"]
|
||||||
|
self.battleNumberWhite = self.uiMap["battle_ui.cache_node.battle_number_white"]
|
||||||
|
self.battleNumberSpecial = self.uiMap["battle_ui.cache_node.battle_number_special"]
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:getNumberNode()
|
function BattleUI:getNumberNode()
|
||||||
@ -402,6 +405,14 @@ function BattleUI:getBattleNumberBlue()
|
|||||||
return self.battleNumberBlue
|
return self.battleNumberBlue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUI:getBattleNumberWhite()
|
||||||
|
return self.battleNumberWhite
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUI:getBattleNumberSpecial()
|
||||||
|
return self.battleNumberSpecial
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUI:initComboNode()
|
function BattleUI:initComboNode()
|
||||||
self.comboNode = self.uiMap["battle_ui.top_node.combo"]
|
self.comboNode = self.uiMap["battle_ui.top_node.combo"]
|
||||||
self.comboAnimator = self.comboNode:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
self.comboAnimator = self.comboNode:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
||||||
@ -516,6 +527,26 @@ function BattleUI:showCombo(count)
|
|||||||
end
|
end
|
||||||
end
|
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.counterAttackNode:setVisible(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUI:showCounterAttack(count, side)
|
||||||
|
local x = 280
|
||||||
|
if side == GConst.BattleConst.SIDE_ATK then
|
||||||
|
x = -280
|
||||||
|
end
|
||||||
|
self.counterAttackNode:setAnchoredPositionX(x)
|
||||||
|
self.counterTx:setText(I18N:getGlobalText(I18N.GlobalConst.COUNTER_ATTACK_DESC) .. "+" .. count)
|
||||||
|
self.counterAttackNode:setVisible(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUI:hideCounterAttack()
|
||||||
|
self.counterAttackNode:setVisible(false)
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUI:initFxNode()
|
function BattleUI:initFxNode()
|
||||||
self.fxNode = self.uiMap["battle_ui.battle_root.batttle_fx_node"]
|
self.fxNode = self.uiMap["battle_ui.battle_root.batttle_fx_node"]
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user