Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
ed77fc7695
@ -128,6 +128,11 @@ BattleConst.UNIT_STATE = {
|
|||||||
VERITGO = 12, -- 昏睡
|
VERITGO = 12, -- 昏睡
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BattleConst.ATTACK_ACTION_STATE = {
|
||||||
|
NORMAL = "normal",
|
||||||
|
COUNTERATTACK = "counterattack",
|
||||||
|
}
|
||||||
|
|
||||||
BattleConst.MATCH_DMG_ADDITION_NAME = {
|
BattleConst.MATCH_DMG_ADDITION_NAME = {
|
||||||
[0] = "dmg_addition_none",
|
[0] = "dmg_addition_none",
|
||||||
[1] = "dmg_addition_red",
|
[1] = "dmg_addition_red",
|
||||||
@ -194,7 +199,6 @@ BattleConst.EFFECT_TYPE = {
|
|||||||
HEAL = 101,
|
HEAL = 101,
|
||||||
HOT = 102,
|
HOT = 102,
|
||||||
REBOUND = 201, -- 反弹
|
REBOUND = 201, -- 反弹
|
||||||
COUNTERATTACK = 301, -- 反击
|
|
||||||
}
|
}
|
||||||
|
|
||||||
---- 特殊的伤害类型,其余都是buffname
|
---- 特殊的伤害类型,其余都是buffname
|
||||||
|
|||||||
@ -286,12 +286,14 @@ function BattleUnitComp:getIsCentralizedAttack()
|
|||||||
return self.team:getCentralizedAttack()
|
return self.team:getCentralizedAttack()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:beforeAttack(effectType)
|
function BattleUnitComp:getCurAttackActionState()
|
||||||
|
return self.curAttackActionState
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUnitComp:beforeAttack(actionState)
|
||||||
self.team:setCentralizedAttack(true)
|
self.team:setCentralizedAttack(true)
|
||||||
self.battleController:setIsPauseHpProgress(true)
|
self.battleController:setIsPauseHpProgress(true)
|
||||||
if effectType == BattleConst.EFFECT_TYPE.DIRECT then
|
self.curAttackActionState = actionState
|
||||||
self:checkPassiveEvent(PASSIVE_EVENT.ON_UNI_ATTACK_START, self)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:useAssistingSkill(count, delay, callback)
|
function BattleUnitComp:useAssistingSkill(count, delay, callback)
|
||||||
@ -1509,6 +1511,15 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
|||||||
self:showEffectNumber(effectColor, direction, damageStr, x, y, delayTime)
|
self:showEffectNumber(effectColor, direction, damageStr, x, y, delayTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if atker:getCurAttackActionState() == BattleConst.ATTACK_ACTION_STATE.NORMAL then
|
||||||
|
if self.unitEntity:getCounterAttack() > 0 then -- 触发反击
|
||||||
|
local counterattack = self.unitEntity:getCounterAttack()
|
||||||
|
if counterattack > DEFAULT_FACTOR or BattleHelper:random(1, DEFAULT_FACTOR) <= counterattack then -- 通过命中概率
|
||||||
|
self.unitEntity:addCounterAttackCount(1)
|
||||||
|
self.battleController:showCounterAttack(self.unitEntity:getCounterAttackCount(), self.side)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
if effectType == EFFECT_TYPE.DIRECT then
|
if effectType == EFFECT_TYPE.DIRECT then
|
||||||
if hp > 0 and self.unitEntity:getShieldRebound() then -- 伤害反弹
|
if hp > 0 and self.unitEntity:getShieldRebound() then -- 伤害反弹
|
||||||
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)
|
||||||
@ -1522,13 +1533,6 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
|||||||
if self.unitEntity:getThorns() > 0 then -- 反伤
|
if self.unitEntity:getThorns() > 0 then -- 反伤
|
||||||
atker:takeDamageOrCure(self, num*self.unitEntity:getThorns() // DEFAULT_FACTOR, EFFECT_TYPE.REBOUND, 0, BattleConst.BUFF_NAME.THORNS)
|
atker:takeDamageOrCure(self, num*self.unitEntity:getThorns() // DEFAULT_FACTOR, EFFECT_TYPE.REBOUND, 0, BattleConst.BUFF_NAME.THORNS)
|
||||||
end
|
end
|
||||||
if self.unitEntity:getCounterAttack() > 0 then -- 触发反击
|
|
||||||
local counterattack = self.unitEntity:getCounterAttack()
|
|
||||||
if counterattack > DEFAULT_FACTOR or BattleHelper:random(1, DEFAULT_FACTOR) <= counterattack then -- 通过命中概率
|
|
||||||
self.unitEntity:addCounterAttackCount(1)
|
|
||||||
self.battleController:showCounterAttack(self.unitEntity:getCounterAttackCount(), self.side)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
elseif num > 0 then -- 治疗
|
elseif num > 0 then -- 治疗
|
||||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_GREEN, BattleConst.EFFECT_TYPE_BUFF, "+" .. num, x, y, 0)
|
self:showEffectNumber(BattleConst.EFFECT_COLOR_GREEN, BattleConst.EFFECT_TYPE_BUFF, "+" .. num, x, y, 0)
|
||||||
|
|||||||
@ -556,7 +556,7 @@ function BattleController:enterBattleStep()
|
|||||||
|
|
||||||
local defAction = function()
|
local defAction = function()
|
||||||
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_DEF_STEP
|
self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_DEF_STEP
|
||||||
self.defTeam:mainUnitUseAllSkills(function()
|
self.defTeam:mainUnitUseAllSkills(BattleConst.ATTACK_ACTION_STATE.NORMAL, function()
|
||||||
self:enterNextTeamAction()
|
self:enterNextTeamAction()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@ -1206,9 +1206,6 @@ function BattleController:generateInstructions(skillEntity, elementType, lineCou
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:exeInstructions(callback)
|
function BattleController:exeInstructions(callback)
|
||||||
if EDITOR_MODE then
|
|
||||||
Logger.logHighlight("--------exeInstructions----------")
|
|
||||||
end
|
|
||||||
if not self.instructions or #self.instructions <= 0 then
|
if not self.instructions or #self.instructions <= 0 then
|
||||||
callback()
|
callback()
|
||||||
return
|
return
|
||||||
@ -2520,11 +2517,11 @@ local function _assisting(self, instruction, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function _generalAttack(self, instruction, callback)
|
local function _generalAttack(self, instruction, callback)
|
||||||
self.atkTeam:useNormalSkill(instruction.skillMatch, instruction.count, #self.instructions == 0, BattleConst.EFFECT_TYPE.DIRECT, callback)
|
self.atkTeam:useNormalSkill(instruction.skillMatch, instruction.count, #self.instructions == 0, BattleConst.EFFECT_TYPE.DIRECT, BattleConst.ATTACK_ACTION_STATE.NORMAL, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function _playSkill(self, instruction, callback)
|
local function _playSkill(self, instruction, callback)
|
||||||
self.atkTeam:useSkill(instruction.skillMatch, instruction.count, #self.instructions == 0, BattleConst.EFFECT_TYPE.DIRECT, callback)
|
self.atkTeam:useSkill(instruction.skillMatch, instruction.count, #self.instructions == 0, BattleConst.EFFECT_TYPE.DIRECT, BattleConst.ATTACK_ACTION_STATE.NORMAL, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
BattleController._doInstruction = {
|
BattleController._doInstruction = {
|
||||||
|
|||||||
@ -58,7 +58,7 @@ function BattleTeam:removeAllUnits()
|
|||||||
self.mainUnit = nil
|
self.mainUnit = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleTeam:useNormalSkill(matchType, count, isFinalAction, effectType, callback)
|
function BattleTeam:useNormalSkill(matchType, count, isFinalAction, effectType, actionState, callback)
|
||||||
self.isFinalAction = isFinalAction
|
self.isFinalAction = isFinalAction
|
||||||
local unit = nil
|
local unit = nil
|
||||||
if matchType == nil then
|
if matchType == nil then
|
||||||
@ -73,12 +73,12 @@ function BattleTeam:useNormalSkill(matchType, count, isFinalAction, effectType,
|
|||||||
return callback()
|
return callback()
|
||||||
end
|
end
|
||||||
self.mainUnit = unit
|
self.mainUnit = unit
|
||||||
unit:beforeAttack(effectType)
|
unit:beforeAttack(actionState)
|
||||||
unit:resetBeforeAttack()
|
unit:resetBeforeAttack()
|
||||||
unit:useNormalSkill(count, effectType, callback)
|
unit:useNormalSkill(count, effectType, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleTeam:useSkill(matchType, count, isFinalAction, effectType, callback)
|
function BattleTeam:useSkill(matchType, count, isFinalAction, effectType, actionState, callback)
|
||||||
self.isFinalAction = isFinalAction
|
self.isFinalAction = isFinalAction
|
||||||
local unit = nil
|
local unit = nil
|
||||||
if matchType == nil then
|
if matchType == nil then
|
||||||
@ -94,7 +94,7 @@ function BattleTeam:useSkill(matchType, count, isFinalAction, effectType, callba
|
|||||||
end
|
end
|
||||||
local lastMainUnit = self.mainUnit
|
local lastMainUnit = self.mainUnit
|
||||||
self.mainUnit = unit
|
self.mainUnit = unit
|
||||||
unit:beforeAttack(effectType)
|
unit:beforeAttack(actionState)
|
||||||
unit:resetBeforeAttack()
|
unit:resetBeforeAttack()
|
||||||
if unit:useSkill(1, count, callback) then
|
if unit:useSkill(1, count, callback) then
|
||||||
if lastMainUnit and lastMainUnit ~= unit then
|
if lastMainUnit and lastMainUnit ~= unit then
|
||||||
@ -140,7 +140,7 @@ function BattleTeam:useAssistingSkill(assistingList, isFinalAction, callback)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleTeam:mainUnitUseAllSkills(callback)
|
function BattleTeam:mainUnitUseAllSkills(actionState, callback)
|
||||||
self.isFinalAction = true
|
self.isFinalAction = true
|
||||||
if self.mainUnit == nil then
|
if self.mainUnit == nil then
|
||||||
return callback()
|
return callback()
|
||||||
@ -148,7 +148,7 @@ function BattleTeam:mainUnitUseAllSkills(callback)
|
|||||||
if self.mainUnit:getIsLimit() then
|
if self.mainUnit:getIsLimit() then
|
||||||
return callback()
|
return callback()
|
||||||
end
|
end
|
||||||
self.mainUnit:beforeAttack()
|
self.mainUnit:beforeAttack(actionState)
|
||||||
self.mainUnit:resetBeforeAttack()
|
self.mainUnit:resetBeforeAttack()
|
||||||
self.mainUnit:useAllSkills(callback)
|
self.mainUnit:useAllSkills(callback)
|
||||||
end
|
end
|
||||||
@ -565,7 +565,7 @@ function BattleTeam:onActionOver()
|
|||||||
self.battleController.curTeam = self.battleController.defTeam
|
self.battleController.curTeam = self.battleController.defTeam
|
||||||
end
|
end
|
||||||
|
|
||||||
self:useNormalSkill(skillMatch, counterAttackCount, true, BattleConst.EFFECT_TYPE.COUNTERATTACK, function()
|
self:useNormalSkill(skillMatch, counterAttackCount, true, BattleConst.EFFECT_TYPE.DIRECT, BattleConst.ATTACK_ACTION_STATE.COUNTERATTACK, function()
|
||||||
self.battleController:enterNextTeamAction()
|
self.battleController:enterNextTeamAction()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user