Merge branch 'dev' of http://git.juzugame.com/b6-client/b6-lua into dev
This commit is contained in:
commit
70e90b0386
@ -288,7 +288,7 @@ end
|
||||
|
||||
function BattleUnitComp:useSkill(index, count, callback)
|
||||
self.actionOverCallback = callback
|
||||
self.activeSkillIndex = index
|
||||
self.activeSkillIndex = nil
|
||||
self.currActiveSkill = self.unitEntity:getAvailableActiveSkill(index)
|
||||
if count <= 0 then
|
||||
self.normalSkillCount = 0
|
||||
@ -296,7 +296,6 @@ function BattleUnitComp:useSkill(index, count, callback)
|
||||
self.normalSkillCount = count + self.unitEntity:getNormalAttackAddCount()
|
||||
end
|
||||
if self.currActiveSkill == nil then -- 没有技能就用普攻
|
||||
self.activeSkillIndex = nil
|
||||
if self.normalSkillCount <= 0 then
|
||||
self.actionOverCallback = nil
|
||||
self.battleController:setIsPauseHpProgress(false)
|
||||
@ -321,7 +320,6 @@ function BattleUnitComp:useSkill(index, count, callback)
|
||||
else
|
||||
if not self:changeState(UNIT_STATE.SKILL_ATTACK) then
|
||||
self.actionOverCallback = nil
|
||||
self.activeSkillIndex = nil
|
||||
self.battleController:setIsPauseHpProgress(false)
|
||||
self.team:setCentralizedAttack(false)
|
||||
callback()
|
||||
@ -837,7 +835,8 @@ end
|
||||
|
||||
function BattleUnitComp:getIsHaveNextAvailableActiveSkill()
|
||||
local skillCanUseTimes = self.currActiveSkill:getSkillCanUseTimes()
|
||||
if skillCanUseTimes and skillCanUseTimes > 0 then -- 当前技能可以多次使用
|
||||
-- 当前技能可以多次使用,onSkillTakeEffect才会次数减1,所以这次大于1的时候才说明可以多次使用
|
||||
if skillCanUseTimes and skillCanUseTimes > 1 then
|
||||
return true
|
||||
elseif self.activeSkillIndex then
|
||||
local currActiveSkill = nil
|
||||
|
||||
@ -961,7 +961,7 @@ function BattleController:generateInstructions(skillEntity, elementType, lineCou
|
||||
count = elementTypeCount,
|
||||
})
|
||||
else
|
||||
if skillEntity:getSkillEffectType() ~= nil then
|
||||
if skillEntity:getEffect() ~= nil then
|
||||
table.insert(self.instructions, {
|
||||
name = BattleConst.INSTRUCTION_NAME.PLAY_SKILL,
|
||||
skillMatch = skillEntity:getPosition(),
|
||||
@ -1958,15 +1958,15 @@ local function _addCurRoundAttr(self, instruction, callback)
|
||||
end
|
||||
|
||||
local function _assisting(self, instruction, callback)
|
||||
self.atkTeam:useAssistingSkill(instruction.assistingList, callback)
|
||||
self.atkTeam:useAssistingSkill(instruction.assistingList, #self.instructions == 0, callback)
|
||||
end
|
||||
|
||||
local function _generalAttack(self, instruction, callback)
|
||||
self.atkTeam:useNormalSkill(instruction.skillMatch, instruction.count, callback)
|
||||
self.atkTeam:useNormalSkill(instruction.skillMatch, instruction.count, #self.instructions == 0, callback)
|
||||
end
|
||||
|
||||
local function _playSkill(self, instruction, callback)
|
||||
self.atkTeam:useSkill(instruction.skillMatch, instruction.count, callback)
|
||||
self.atkTeam:useSkill(instruction.skillMatch, instruction.count, #self.instructions == 0, callback)
|
||||
end
|
||||
|
||||
BattleController._doInstruction = {
|
||||
|
||||
@ -49,7 +49,8 @@ function BattleTeam:removeAllUnits()
|
||||
self.mainUnit = nil
|
||||
end
|
||||
|
||||
function BattleTeam:useNormalSkill(matchType, count, callback)
|
||||
function BattleTeam:useNormalSkill(matchType, count, isFinalAction, callback)
|
||||
self.isFinalAction = isFinalAction
|
||||
local unit = nil
|
||||
if matchType == nil then
|
||||
unit = self.unitList[1]
|
||||
@ -68,7 +69,8 @@ function BattleTeam:useNormalSkill(matchType, count, callback)
|
||||
unit:useNormalSkill(count, callback)
|
||||
end
|
||||
|
||||
function BattleTeam:useSkill(matchType, count, callback)
|
||||
function BattleTeam:useSkill(matchType, count, isFinalAction, callback)
|
||||
self.isFinalAction = isFinalAction
|
||||
local unit = nil
|
||||
if matchType == nil then
|
||||
unit = self.unitList[1]
|
||||
@ -96,7 +98,8 @@ function BattleTeam:useSkill(matchType, count, callback)
|
||||
end
|
||||
end
|
||||
|
||||
function BattleTeam:useAssistingSkill(assistingList, callback)
|
||||
function BattleTeam:useAssistingSkill(assistingList, isFinalAction, callback)
|
||||
self.isFinalAction = isFinalAction
|
||||
if self.mainUnit == nil then
|
||||
return callback()
|
||||
end
|
||||
@ -339,8 +342,10 @@ function BattleTeam:getCentralizedAttack()
|
||||
return self.centralizedAttack
|
||||
end
|
||||
|
||||
|
||||
function BattleTeam:setCentralizedAttack(centralizedAttack)
|
||||
if not self.isFinalAction and not centralizedAttack then
|
||||
return
|
||||
end
|
||||
self.centralizedAttack = centralizedAttack
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user