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