Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
2ff99edc4e
@ -7,51 +7,61 @@ local buff = {
|
|||||||
[2]={
|
[2]={
|
||||||
["name"]="hurt_red",
|
["name"]="hurt_red",
|
||||||
["buff_type"]=3,
|
["buff_type"]=3,
|
||||||
|
["position"]=1,
|
||||||
["formula"]=1
|
["formula"]=1
|
||||||
},
|
},
|
||||||
[3]={
|
[3]={
|
||||||
["name"]="hurt_yellow",
|
["name"]="hurt_yellow",
|
||||||
["buff_type"]=3,
|
["buff_type"]=3,
|
||||||
|
["position"]=2,
|
||||||
["formula"]=1
|
["formula"]=1
|
||||||
},
|
},
|
||||||
[4]={
|
[4]={
|
||||||
["name"]="hurt_green",
|
["name"]="hurt_green",
|
||||||
["buff_type"]=3,
|
["buff_type"]=3,
|
||||||
|
["position"]=3,
|
||||||
["formula"]=1
|
["formula"]=1
|
||||||
},
|
},
|
||||||
[5]={
|
[5]={
|
||||||
["name"]="hurt_blue",
|
["name"]="hurt_blue",
|
||||||
["buff_type"]=3,
|
["buff_type"]=3,
|
||||||
|
["position"]=4,
|
||||||
["formula"]=1
|
["formula"]=1
|
||||||
},
|
},
|
||||||
[6]={
|
[6]={
|
||||||
["name"]="hurt_purple",
|
["name"]="hurt_purple",
|
||||||
["buff_type"]=3,
|
["buff_type"]=3,
|
||||||
|
["position"]=5,
|
||||||
["formula"]=1
|
["formula"]=1
|
||||||
},
|
},
|
||||||
[7]={
|
[7]={
|
||||||
["name"]="dec_dmg_red_add",
|
["name"]="dec_dmg_red_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=1,
|
||||||
["icon"]="dec_dmg_red_add"
|
["icon"]="dec_dmg_red_add"
|
||||||
},
|
},
|
||||||
[8]={
|
[8]={
|
||||||
["name"]="dec_dmg_yellow_add",
|
["name"]="dec_dmg_yellow_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=2,
|
||||||
["icon"]="dec_dmg_yellow_add"
|
["icon"]="dec_dmg_yellow_add"
|
||||||
},
|
},
|
||||||
[9]={
|
[9]={
|
||||||
["name"]="dec_dmg_green_add",
|
["name"]="dec_dmg_green_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=3,
|
||||||
["icon"]="dec_dmg_green_add"
|
["icon"]="dec_dmg_green_add"
|
||||||
},
|
},
|
||||||
[10]={
|
[10]={
|
||||||
["name"]="dec_dmg_blue_add",
|
["name"]="dec_dmg_blue_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=4,
|
||||||
["icon"]="dec_dmg_blue_add"
|
["icon"]="dec_dmg_blue_add"
|
||||||
},
|
},
|
||||||
[11]={
|
[11]={
|
||||||
["name"]="dec_dmg_purple_add",
|
["name"]="dec_dmg_purple_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=5,
|
||||||
["icon"]="dec_dmg_purple_add"
|
["icon"]="dec_dmg_purple_add"
|
||||||
},
|
},
|
||||||
[12]={
|
[12]={
|
||||||
@ -62,26 +72,31 @@ local buff = {
|
|||||||
[13]={
|
[13]={
|
||||||
["name"]="weakness_red_add",
|
["name"]="weakness_red_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=1,
|
||||||
["icon"]="weakness_red_add"
|
["icon"]="weakness_red_add"
|
||||||
},
|
},
|
||||||
[14]={
|
[14]={
|
||||||
["name"]="weakness_yellow_add",
|
["name"]="weakness_yellow_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=2,
|
||||||
["icon"]="weakness_yellow_add"
|
["icon"]="weakness_yellow_add"
|
||||||
},
|
},
|
||||||
[15]={
|
[15]={
|
||||||
["name"]="weakness_green_add",
|
["name"]="weakness_green_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=3,
|
||||||
["icon"]="weakness_green_add"
|
["icon"]="weakness_green_add"
|
||||||
},
|
},
|
||||||
[16]={
|
[16]={
|
||||||
["name"]="weakness_blue_add",
|
["name"]="weakness_blue_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=4,
|
||||||
["icon"]="weakness_blue_add"
|
["icon"]="weakness_blue_add"
|
||||||
},
|
},
|
||||||
[17]={
|
[17]={
|
||||||
["name"]="weakness_purple_add",
|
["name"]="weakness_purple_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=5,
|
||||||
["icon"]="weakness_purple_add"
|
["icon"]="weakness_purple_add"
|
||||||
},
|
},
|
||||||
[18]={
|
[18]={
|
||||||
@ -92,26 +107,31 @@ local buff = {
|
|||||||
[19]={
|
[19]={
|
||||||
["name"]="dmg_addition_red_add",
|
["name"]="dmg_addition_red_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=1,
|
||||||
["icon"]="dmg_addition_red_add"
|
["icon"]="dmg_addition_red_add"
|
||||||
},
|
},
|
||||||
[20]={
|
[20]={
|
||||||
["name"]="dmg_addition_yellow_add",
|
["name"]="dmg_addition_yellow_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=2,
|
||||||
["icon"]="dmg_addition_yellow_add"
|
["icon"]="dmg_addition_yellow_add"
|
||||||
},
|
},
|
||||||
[21]={
|
[21]={
|
||||||
["name"]="dmg_addition_green_add",
|
["name"]="dmg_addition_green_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=3,
|
||||||
["icon"]="dmg_addition_green_add"
|
["icon"]="dmg_addition_green_add"
|
||||||
},
|
},
|
||||||
[22]={
|
[22]={
|
||||||
["name"]="dmg_addition_blue_add",
|
["name"]="dmg_addition_blue_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=4,
|
||||||
["icon"]="dmg_addition_blue_add"
|
["icon"]="dmg_addition_blue_add"
|
||||||
},
|
},
|
||||||
[23]={
|
[23]={
|
||||||
["name"]="dmg_addition_purple_add",
|
["name"]="dmg_addition_purple_add",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
|
["position"]=5,
|
||||||
["icon"]="dmg_addition_purple_add"
|
["icon"]="dmg_addition_purple_add"
|
||||||
},
|
},
|
||||||
[24]={
|
[24]={
|
||||||
@ -125,23 +145,28 @@ local buff = {
|
|||||||
},
|
},
|
||||||
[26]={
|
[26]={
|
||||||
["name"]="atkp_red_add",
|
["name"]="atkp_red_add",
|
||||||
["buff_type"]=1
|
["buff_type"]=1,
|
||||||
|
["position"]=1
|
||||||
},
|
},
|
||||||
[27]={
|
[27]={
|
||||||
["name"]="atkp_yellow_add",
|
["name"]="atkp_yellow_add",
|
||||||
["buff_type"]=1
|
["buff_type"]=1,
|
||||||
|
["position"]=2
|
||||||
},
|
},
|
||||||
[28]={
|
[28]={
|
||||||
["name"]="atkp_green_add",
|
["name"]="atkp_green_add",
|
||||||
["buff_type"]=1
|
["buff_type"]=1,
|
||||||
|
["position"]=3
|
||||||
},
|
},
|
||||||
[29]={
|
[29]={
|
||||||
["name"]="atkp_blue_add",
|
["name"]="atkp_blue_add",
|
||||||
["buff_type"]=1
|
["buff_type"]=1,
|
||||||
|
["position"]=4
|
||||||
},
|
},
|
||||||
[30]={
|
[30]={
|
||||||
["name"]="atkp_purple_add",
|
["name"]="atkp_purple_add",
|
||||||
["buff_type"]=1
|
["buff_type"]=1,
|
||||||
|
["position"]=5
|
||||||
},
|
},
|
||||||
[31]={
|
[31]={
|
||||||
["name"]="wavehealp",
|
["name"]="wavehealp",
|
||||||
@ -216,6 +241,10 @@ local buff = {
|
|||||||
[44]={
|
[44]={
|
||||||
["name"]="add_skill",
|
["name"]="add_skill",
|
||||||
["buff_type"]=7
|
["buff_type"]=7
|
||||||
|
},
|
||||||
|
[45]={
|
||||||
|
["name"]="skill_fire_times",
|
||||||
|
["buff_type"]=7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local keys = {
|
local keys = {
|
||||||
@ -263,12 +292,13 @@ local keys = {
|
|||||||
["crit_time_add"]=buff[41],
|
["crit_time_add"]=buff[41],
|
||||||
["exp_time_add"]=buff[42],
|
["exp_time_add"]=buff[42],
|
||||||
["cured_add"]=buff[43],
|
["cured_add"]=buff[43],
|
||||||
["add_skill"]=buff[44]
|
["add_skill"]=buff[44],
|
||||||
|
["skill_fire_times"]=buff[45]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local config = {
|
local config = {
|
||||||
data=buff,
|
data=buff,
|
||||||
keys=keys,
|
keys=keys,
|
||||||
count=44
|
count=45
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
@ -4,7 +4,6 @@ BattleConst.ROW_COUNT = 7
|
|||||||
BattleConst.COLUMN_COUNT = 7
|
BattleConst.COLUMN_COUNT = 7
|
||||||
BattleConst.HALF_ROW_COUNT = 4 -- 计算偏移 math.ceil(ROW_COUNT / 2)
|
BattleConst.HALF_ROW_COUNT = 4 -- 计算偏移 math.ceil(ROW_COUNT / 2)
|
||||||
BattleConst.HALF_COLUMN_COUNT = 4 -- 计算偏移 math.ceil(COLUMN_COUNT / 2)
|
BattleConst.HALF_COLUMN_COUNT = 4 -- 计算偏移 math.ceil(COLUMN_COUNT / 2)
|
||||||
BattleConst.ELIMINATION_MIN_COUNT = 2
|
|
||||||
BattleConst.GRID_STEP_H = 94
|
BattleConst.GRID_STEP_H = 94
|
||||||
BattleConst.ROW_STEP = 10
|
BattleConst.ROW_STEP = 10
|
||||||
BattleConst.ONE_STEP_TIME = 0.2
|
BattleConst.ONE_STEP_TIME = 0.2
|
||||||
@ -95,6 +94,16 @@ BattleConst.MATCH_WEAKNESS_NAME = {
|
|||||||
[5] = "weakness_purple",
|
[5] = "weakness_purple",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BattleConst.BUFF_MATCH_NAME = {
|
||||||
|
["atkp"] = {
|
||||||
|
[1] = "atkp_red_add",
|
||||||
|
[2] = "atkp_yellow_add",
|
||||||
|
[3] = "atkp_green_add",
|
||||||
|
[4] = "atkp_blue_add",
|
||||||
|
[5] = "atkp_purple_add",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
BattleConst.SPINE_ANIMATION_NAME = {
|
BattleConst.SPINE_ANIMATION_NAME = {
|
||||||
IDLE = "idle",
|
IDLE = "idle",
|
||||||
ATTACK = "attack01",
|
ATTACK = "attack01",
|
||||||
@ -484,12 +493,4 @@ BattleConst.INSTRUCTION_NAME = {
|
|||||||
PLAY_SKILL = "play_skill",
|
PLAY_SKILL = "play_skill",
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleConst.ELEMENT_TYPE_ATKP_NAME = {
|
|
||||||
[BattleConst.ELEMENT_TYPE.RED] = "red_atkp",
|
|
||||||
[BattleConst.ELEMENT_TYPE.YELLOW] = "yellow_atkp",
|
|
||||||
[BattleConst.ELEMENT_TYPE.GREEN] = "green_atkp",
|
|
||||||
[BattleConst.ELEMENT_TYPE.BLUE] = "blue_atkp",
|
|
||||||
[BattleConst.ELEMENT_TYPE.PURPLE] = "purple_atkp"
|
|
||||||
}
|
|
||||||
|
|
||||||
return BattleConst
|
return BattleConst
|
||||||
@ -261,6 +261,11 @@ function BattleManager:getPosRC(posId)
|
|||||||
return BattleConst.POS_ID_2_RC[posId]
|
return BattleConst.POS_ID_2_RC[posId]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleManager:getBuffElementType(buffName)
|
||||||
|
local cfg = ConfigManager:getConfigWithOtherKey("buff", "name")[buffName]
|
||||||
|
return cfg and cfg.position
|
||||||
|
end
|
||||||
|
|
||||||
----------------------- end 一些公共相关的方法 -----------------------------
|
----------------------- end 一些公共相关的方法 -----------------------------
|
||||||
|
|
||||||
function BattleManager:bindBattleUnitAttribute(hashCode, side)
|
function BattleManager:bindBattleUnitAttribute(hashCode, side)
|
||||||
|
|||||||
@ -583,6 +583,7 @@ function BattleUnitComp:updateSkillAttack(dt)
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
self.currActiveSkill:startUse()
|
||||||
self:doNextSkillAttack()
|
self:doNextSkillAttack()
|
||||||
end
|
end
|
||||||
else -- 继续普攻
|
else -- 继续普攻
|
||||||
@ -590,7 +591,8 @@ function BattleUnitComp:updateSkillAttack(dt)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
local currActiveSkill = nil
|
local currActiveSkill = nil
|
||||||
if self.currActiveSkill:getSkillCanUseTimes() > 0 then -- 当前技能可以多次使用
|
local skillCanUseTimes = self.currActiveSkill:getSkillCanUseTimes()
|
||||||
|
if skillCanUseTimes and skillCanUseTimes > 0 then -- 当前技能可以多次使用
|
||||||
currActiveSkill = self.currActiveSkill
|
currActiveSkill = self.currActiveSkill
|
||||||
elseif self.activeSkillIndex then
|
elseif self.activeSkillIndex then
|
||||||
self.activeSkillIndex = self.activeSkillIndex + 1
|
self.activeSkillIndex = self.activeSkillIndex + 1
|
||||||
@ -765,7 +767,7 @@ end
|
|||||||
|
|
||||||
function BattleUnitComp:onSkillTakeEffect(skill)
|
function BattleUnitComp:onSkillTakeEffect(skill)
|
||||||
skill:endUse()
|
skill:endUse()
|
||||||
if skill == self.unitEntity:getNormalSkill() then
|
if self.side == GConst.BattleConst.SIDE_ATK and skill == self.unitEntity:getNormalSkill() then
|
||||||
self.battleController:addBattleExp(self.side)
|
self.battleController:addBattleExp(self.side)
|
||||||
end
|
end
|
||||||
local effectList = skill:getEffectList()
|
local effectList = skill:getEffectList()
|
||||||
|
|||||||
@ -53,6 +53,13 @@ function BattleController:getMaxWave()
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleController:getMinEliminationCount()
|
||||||
|
if not self.minEliminationCount then
|
||||||
|
self.minEliminationCount = GFunc.getConstIntValue("element_combo")
|
||||||
|
end
|
||||||
|
return self.minEliminationCount
|
||||||
|
end
|
||||||
|
|
||||||
function BattleController:initDefUnits(callback)
|
function BattleController:initDefUnits(callback)
|
||||||
callback()
|
callback()
|
||||||
end
|
end
|
||||||
@ -366,8 +373,13 @@ function BattleController:enterRoundEnd()
|
|||||||
end
|
end
|
||||||
self.atkTeam:onRoundEnd()
|
self.atkTeam:onRoundEnd()
|
||||||
self.defTeam:onRoundEnd()
|
self.defTeam:onRoundEnd()
|
||||||
|
|
||||||
|
if self.battleData:useAddlvCount() then
|
||||||
|
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
|
||||||
|
else
|
||||||
self:enterRoundBegin()
|
self:enterRoundBegin()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---- end回合步骤
|
---- end回合步骤
|
||||||
|
|
||||||
@ -376,7 +388,7 @@ function BattleController:onTouchEvent(eventType, posId)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local entity = self.battleData:getGridEntity(posId)
|
local entity = self.battleData:getGridEntity(posId)
|
||||||
if not entity:canLink() then
|
if not entity or not entity:canLink() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -477,7 +489,7 @@ function BattleController:onTouchEvent(eventType, posId)
|
|||||||
self.battleUI:showBoardMask(nil)
|
self.battleUI:showBoardMask(nil)
|
||||||
local sequence = self.battleData:getGridSequence()
|
local sequence = self.battleData:getGridSequence()
|
||||||
local count = #sequence
|
local count = #sequence
|
||||||
if count < BattleConst.ELIMINATION_MIN_COUNT then
|
if count < self:getMinEliminationCount() then
|
||||||
if count <= 0 then
|
if count <= 0 then
|
||||||
self.battleData:clearGridSequence()
|
self.battleData:clearGridSequence()
|
||||||
self:onLinkChange()
|
self:onLinkChange()
|
||||||
@ -506,7 +518,7 @@ end
|
|||||||
function BattleController:onLinkOver()
|
function BattleController:onLinkOver()
|
||||||
local sequence = self.battleData:getGridSequence()
|
local sequence = self.battleData:getGridSequence()
|
||||||
local count = #sequence
|
local count = #sequence
|
||||||
if count < BattleConst.ELIMINATION_MIN_COUNT then
|
if count < self:getMinEliminationCount() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -521,6 +533,7 @@ function BattleController:onLinkOver()
|
|||||||
local elementTypeMap = {}
|
local elementTypeMap = {}
|
||||||
local eliminationPosIds = {}
|
local eliminationPosIds = {}
|
||||||
local boomGridIds = {}
|
local boomGridIds = {}
|
||||||
|
local lineCount = 0
|
||||||
|
|
||||||
for _, info in ipairs(sequence) do
|
for _, info in ipairs(sequence) do
|
||||||
if not eliminationPosIds[info.posId] then
|
if not eliminationPosIds[info.posId] then
|
||||||
@ -529,6 +542,7 @@ function BattleController:onLinkOver()
|
|||||||
local elementType = entity:getElementType()
|
local elementType = entity:getElementType()
|
||||||
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
||||||
linkElementType = elementType
|
linkElementType = elementType
|
||||||
|
lineCount = lineCount + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local outline = BattleConst.GRID_OUT_LINE_POS_ID[info.posId]
|
local outline = BattleConst.GRID_OUT_LINE_POS_ID[info.posId]
|
||||||
@ -588,7 +602,7 @@ function BattleController:onLinkOver()
|
|||||||
|
|
||||||
self.battleUI:disableUITouch()
|
self.battleUI:disableUITouch()
|
||||||
self.battleUI:eliminationAni(sequence, function()
|
self.battleUI:eliminationAni(sequence, function()
|
||||||
self:generateInstructions(skillEntity, linkElementType, influenceElementType, elementTypeMap)
|
self:generateInstructions(skillEntity, linkElementType, lineCount, influenceElementType, elementTypeMap)
|
||||||
self:enterAtkStep()
|
self:enterAtkStep()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@ -641,10 +655,6 @@ function BattleController:fillBoard()
|
|||||||
self.battleUI:fallGrid(pathMap, function()
|
self.battleUI:fallGrid(pathMap, function()
|
||||||
self:onFillBoardOver()
|
self:onFillBoardOver()
|
||||||
self.battleUI:enableUITouch()
|
self.battleUI:enableUITouch()
|
||||||
|
|
||||||
if self.battleData:useAddlvCount() then
|
|
||||||
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -655,38 +665,7 @@ function BattleController:onFillBoardOver()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:generateInstructions(skillEntity, elementType, influenceElementType, elementTypeMap)
|
function BattleController:generateInstructions(skillEntity, elementType, lineCount, influenceElementTypeMap, elementTypeMap)
|
||||||
---- 加buff
|
|
||||||
if skillEntity then
|
|
||||||
-- if skillEntity:getLinkEffects() > 0 and elementType then
|
|
||||||
-- local attrType = BattleConst.ELEMENT_TYPE_ATKP_NAME[elementType]
|
|
||||||
-- if attrType then
|
|
||||||
-- table.insert(self.instructions, {
|
|
||||||
-- name = BattleConst.INSTRUCTION_NAME.ADD_CUR_ROUND_ATTR,
|
|
||||||
-- attr = {
|
|
||||||
-- type = attrType,
|
|
||||||
-- num = skillEntity:getLinkEffects()
|
|
||||||
-- }
|
|
||||||
-- })
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
if skillEntity:getInInfluenceAtkp() > 0 and influenceElementType then
|
|
||||||
for elementType, _ in pairs(influenceElementType) do
|
|
||||||
local attrType = BattleConst.ELEMENT_TYPE_ATKP_NAME[elementType]
|
|
||||||
if attrType then
|
|
||||||
table.insert(self.instructions, {
|
|
||||||
name = BattleConst.INSTRUCTION_NAME.ADD_CUR_ROUND_ATTR,
|
|
||||||
attr = {
|
|
||||||
type = attrType,
|
|
||||||
num = skillEntity:getInInfluenceAtkp()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local elementTypeCount = 0
|
local elementTypeCount = 0
|
||||||
local assistingList = nil
|
local assistingList = nil
|
||||||
---- 援助
|
---- 援助
|
||||||
@ -729,11 +708,76 @@ function BattleController:generateInstructions(skillEntity, elementType, influen
|
|||||||
assistingList = assistingList,
|
assistingList = assistingList,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---- 加buff
|
||||||
|
if skillEntity then
|
||||||
|
if skillEntity:getLinkEffects() and elementType then
|
||||||
|
local effectList
|
||||||
|
for type, buffEntities in pairs(skillEntity:getLinkEffects()) do
|
||||||
|
local buffEntity = buffEntities[elementType]
|
||||||
|
if buffEntity then
|
||||||
|
if not effectList then
|
||||||
|
effectList = {}
|
||||||
|
end
|
||||||
|
table.insert(effectList, buffEntity)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if effectList then
|
||||||
|
local unit = {
|
||||||
|
name = BattleConst.INSTRUCTION_NAME.ADD_CUR_ROUND_ATTR,
|
||||||
|
effectList = effectList
|
||||||
|
}
|
||||||
|
table.insert(self.instructions, unit)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if skillEntity:getInInfluenceEffects() and influenceElementTypeMap then
|
||||||
|
for influenceElementType , _ in pairs(influenceElementTypeMap) do
|
||||||
|
local effectList
|
||||||
|
for type, buffEntities in pairs(skillEntity:getInInfluenceEffects()) do
|
||||||
|
local buffEntity = buffEntities[influenceElementType]
|
||||||
|
if buffEntity then
|
||||||
|
if not effectList then
|
||||||
|
effectList = {}
|
||||||
|
end
|
||||||
|
table.insert(effectList, buffEntity)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if effectList then
|
||||||
|
table.insert(self.instructions, {
|
||||||
|
name = BattleConst.INSTRUCTION_NAME.ADD_CUR_ROUND_ATTR,
|
||||||
|
effectList = effectList
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if skillEntity:getElementCountEffect() and elementType then
|
||||||
|
local effectList
|
||||||
|
for type, buffEntities in pairs(skillEntity:getElementCountEffect()) do
|
||||||
|
local originBuffEntity = buffEntities.origin
|
||||||
|
local useBuffEntity = buffEntities.use
|
||||||
|
if not effectList then
|
||||||
|
effectList = {}
|
||||||
|
end
|
||||||
|
local newNum = originBuffEntity:getEffectNum() * lineCount
|
||||||
|
useBuffEntity:setEffectNum(newNum)
|
||||||
|
table.insert(effectList, useBuffEntity)
|
||||||
|
end
|
||||||
|
if effectList then
|
||||||
|
table.insert(self.instructions, {
|
||||||
|
name = BattleConst.INSTRUCTION_NAME.ADD_CUR_ROUND_ATTR,
|
||||||
|
effectList = effectList
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 其他的buff
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:exeInstructions(callback)
|
function BattleController:exeInstructions(callback)
|
||||||
Logger.logHighlight("--------exeInstructions----------")
|
Logger.logHighlight("--------exeInstructions----------")
|
||||||
Logger.printTable(self.instructions)
|
|
||||||
if not self.instructions or #self.instructions <= 0 then
|
if not self.instructions or #self.instructions <= 0 then
|
||||||
callback()
|
callback()
|
||||||
return
|
return
|
||||||
@ -1085,7 +1129,7 @@ function BattleController:getRandomSkillList(getCount)
|
|||||||
getCount = getCount - 1
|
getCount = getCount - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
for skillId, info in ipairs(cfg) do
|
for skillId, info in pairs(cfg) do
|
||||||
if not self:getNotInvolvedSkills()[skillId] then
|
if not self:getNotInvolvedSkills()[skillId] then
|
||||||
if info.universal then
|
if info.universal then
|
||||||
if not info.limit_times or self.battleData:getSkillCount(skillId) < info.limit_times then
|
if not info.limit_times or self.battleData:getSkillCount(skillId) < info.limit_times then
|
||||||
@ -1117,6 +1161,12 @@ function BattleController:onSelectSkill(skillId)
|
|||||||
|
|
||||||
if self.battleData:useAddlvCount() then
|
if self.battleData:useAddlvCount() then
|
||||||
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
|
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
|
||||||
|
else
|
||||||
|
self:enterRoundBegin()
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.battleUI then
|
||||||
|
self.battleUI:refreshBoard()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1141,6 +1191,7 @@ end
|
|||||||
|
|
||||||
function BattleController:addHeroAttr(attrName, value)
|
function BattleController:addHeroAttr(attrName, value)
|
||||||
Logger.logHighlight("------addHeroAttr------ " .. attrName .. " " .. value)
|
Logger.logHighlight("------addHeroAttr------ " .. attrName .. " " .. value)
|
||||||
|
Logger.logHighlight(self.battleData.atkTeam == nil)
|
||||||
if not self.battleData or not self.battleData.atkTeam then
|
if not self.battleData or not self.battleData.atkTeam then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -1202,6 +1253,9 @@ function BattleController:_tick(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:battleEnd()
|
function BattleController:battleEnd()
|
||||||
|
if self.battleUI then
|
||||||
|
self.battleUI:enableUITouch()
|
||||||
|
end
|
||||||
self:controllBattleEnd()
|
self:controllBattleEnd()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1230,6 +1284,20 @@ function BattleController:showEffectNumber(num, x, y)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function _addCurRoundAttr(self, instruction, callback)
|
local function _addCurRoundAttr(self, instruction, callback)
|
||||||
|
if instruction.effectList then
|
||||||
|
local defComp = self:getOtherSideMainUnit(BattleConst.SIDE_ATK)
|
||||||
|
local mainComp = self:getOtherSideMainUnit(BattleConst.SIDE_DEF)
|
||||||
|
for _, effect in ipairs(instruction.effectList) do
|
||||||
|
local target
|
||||||
|
if effect:getTartgetSide() == BattleConst.SIDE_DEF then
|
||||||
|
target = defComp
|
||||||
|
else
|
||||||
|
target = mainComp
|
||||||
|
end
|
||||||
|
mainComp:takeEffect(effect, target)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
callback()
|
callback()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,7 @@ local function _removeEffectAttr(buffSender, target, buff, buffEffect)
|
|||||||
local buffName = buff:getName()
|
local buffName = buff:getName()
|
||||||
local attr = BUFF_NAME_TO_ATTR[buffName]
|
local attr = BUFF_NAME_TO_ATTR[buffName]
|
||||||
if attr then
|
if attr then
|
||||||
target.unitEntity:addAttr(attr[1], -buffEffect.effectResult, false)
|
target.unitEntity:addAttr(attr[1], -buffEffect.result, false)
|
||||||
else
|
else
|
||||||
local func = BattleBuffHandle.addAttribute[buffName]
|
local func = BattleBuffHandle.addAttribute[buffName]
|
||||||
if func then
|
if func then
|
||||||
|
|||||||
@ -96,8 +96,7 @@ function BattleHelper:getBuffEffect()
|
|||||||
if #self.buffEffectPool > 0 then
|
if #self.buffEffectPool > 0 then
|
||||||
return table.remove(self.buffEffectPool)
|
return table.remove(self.buffEffectPool)
|
||||||
end
|
end
|
||||||
local sid = self.buffSid + 1
|
return {}
|
||||||
return {sid = sid}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleHelper:recycleBuffEffect(buffEffect)
|
function BattleHelper:recycleBuffEffect(buffEffect)
|
||||||
|
|||||||
@ -40,7 +40,7 @@ local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntit
|
|||||||
for _, info in ipairs(posIdInfos) do
|
for _, info in ipairs(posIdInfos) do
|
||||||
local entity = gridEntities[info.posId]
|
local entity = gridEntities[info.posId]
|
||||||
if entity then
|
if entity then
|
||||||
entity:setElementType(skillEntity:getSkillTypeParameter())
|
entity:setElementType(skillEntity:getSkillTypeParameter()[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -68,7 +68,7 @@ local _addLinkAtkp = function(skillInfo, battleData, battleController)
|
|||||||
for _, effect in ipairs(skillInfo.effect) do
|
for _, effect in ipairs(skillInfo.effect) do
|
||||||
local entity = battleData:getSkillEntityByElement(elementType)
|
local entity = battleData:getSkillEntityByElement(elementType)
|
||||||
if entity then
|
if entity then
|
||||||
entity:addLinkEffect(effect, unitEntity)
|
entity:addLinkEffect(effect, unitEntity, skillInfo.obj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -107,7 +107,16 @@ local _addSkillReleaseCount = function(skillInfo, battleData, battleController)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- battleController:addSkillReleaseCount(elementType, count)
|
local unitEntity = battleController.battleData.atkTeam:getAllMembers()[elementType]
|
||||||
|
if not unitEntity then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local skillEntity = battleData:getSkillEntityByElement(elementType)
|
||||||
|
if skillEntity then
|
||||||
|
local skillId = skillEntity:getSkillId()
|
||||||
|
unitEntity:addSkillExtraUseTimes(skillId, count)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local _addSkillEffectParams = function(skillInfo, battleData, battleController)
|
local _addSkillEffectParams = function(skillInfo, battleData, battleController)
|
||||||
@ -142,7 +151,7 @@ local _addSkillEffectParams = function(skillInfo, battleData, battleController)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if battleData.atkTeam:getAllMembers()[elementType] then
|
if battleData.atkTeam:getAllMembers()[elementType] then
|
||||||
battleData.atkTeam:getAllMembers()[elementType]:addSkillEffectParams(skillId, effect)
|
battleData.atkTeam:getAllMembers()[elementType]:addActiveSkillParams(skillId, effect)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -217,7 +226,7 @@ local _addSkillInInfluenceAtkp = function(skillInfo, battleData, battleControlle
|
|||||||
|
|
||||||
local entity = battleData:getSkillEntityByElement(elementType)
|
local entity = battleData:getSkillEntityByElement(elementType)
|
||||||
for _, effect in ipairs(skillInfo.effect) do
|
for _, effect in ipairs(skillInfo.effect) do
|
||||||
entity:addInInfluenceEffect(effect, unitEntity)
|
entity:addInInfluenceEffect(effect, unitEntity, skillInfo.obj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -239,7 +248,7 @@ local _addSkillGeneralAttackEffect = function(skillInfo, battleData, battleContr
|
|||||||
local entity = battleData:getSkillEntityByElement(elementType)
|
local entity = battleData:getSkillEntityByElement(elementType)
|
||||||
if entity then
|
if entity then
|
||||||
for _, effect in ipairs(skillInfo.effect) do
|
for _, effect in ipairs(skillInfo.effect) do
|
||||||
entity:addGeneralAttackEffect(effect, unitEntity)
|
entity:addGeneralAttackEffect(effect, unitEntity, skillInfo.obj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -262,7 +271,7 @@ local _addSkillElementCountEffect = function(skillInfo, battleData, battleContro
|
|||||||
local entity = battleData:getSkillEntityByElement(elementType)
|
local entity = battleData:getSkillEntityByElement(elementType)
|
||||||
if entity then
|
if entity then
|
||||||
for _, effect in ipairs(skillInfo.effect) do
|
for _, effect in ipairs(skillInfo.effect) do
|
||||||
entity:addElementCountEffect(effect, unitEntity)
|
entity:addElementCountEffect(effect, unitEntity, skillInfo.obj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -280,7 +289,7 @@ BattleRogueSkillHandle._effectOn = {
|
|||||||
[10] = _changeElementType, -- 将场上随机几个元素变为某元素
|
[10] = _changeElementType, -- 将场上随机几个元素变为某元素
|
||||||
[11] = _addSkillInInfluenceAtkp, -- 技能消除的增加伤害
|
[11] = _addSkillInInfluenceAtkp, -- 技能消除的增加伤害
|
||||||
[12] = _addSkillGeneralAttackEffect, -- 技能链接中的每一个元素,都触发的技能效果
|
[12] = _addSkillGeneralAttackEffect, -- 技能链接中的每一个元素,都触发的技能效果
|
||||||
[11] = _addSkillElementCountEffect, -- 技能链接中每一个元素累加的技能效果
|
[13] = _addSkillElementCountEffect, -- 技能链接中每一个元素累加的技能效果
|
||||||
}
|
}
|
||||||
|
|
||||||
function BattleRogueSkillHandle.takeEffect(skillId, battleData, battleController)
|
function BattleRogueSkillHandle.takeEffect(skillId, battleData, battleController)
|
||||||
|
|||||||
@ -124,15 +124,15 @@ function BattleTeam:handleShield(reduceShield, unit)
|
|||||||
local shieldNum = 0
|
local shieldNum = 0
|
||||||
local currShieldBuff = self.shieldBuffList[1]
|
local currShieldBuff = self.shieldBuffList[1]
|
||||||
while currShieldBuff do
|
while currShieldBuff do
|
||||||
reduceShield = reduceShield + currShieldBuff.effectResult
|
reduceShield = reduceShield + currShieldBuff.result
|
||||||
if reduceShield > 0 then
|
if reduceShield > 0 then
|
||||||
shieldNum = shieldNum + reduceShield - currShieldBuff.effectResult
|
shieldNum = shieldNum + reduceShield - currShieldBuff.result
|
||||||
currShieldBuff.effectResult = reduceShield
|
currShieldBuff.result = reduceShield
|
||||||
reduceShield = 0
|
reduceShield = 0
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
shieldNum = shieldNum - currShieldBuff.effectResult
|
shieldNum = shieldNum - currShieldBuff.result
|
||||||
currShieldBuff.effectResult = 0
|
currShieldBuff.result = 0
|
||||||
for k, v in ipairs(self.buffList) do
|
for k, v in ipairs(self.buffList) do
|
||||||
if v == currShieldBuff then
|
if v == currShieldBuff then
|
||||||
self:updateBuffState(currShieldBuff.buff, -1)
|
self:updateBuffState(currShieldBuff.buff, -1)
|
||||||
|
|||||||
@ -73,9 +73,8 @@ function BattleSkillSelectUI:refreshRogueSkill()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleSkillSelectUI:onClickSkill(skillId)
|
function BattleSkillSelectUI:onClickSkill(skillId)
|
||||||
Logger.logHighlight(skillId)
|
|
||||||
ModuleManager.BattleManager:onSelectSkill(skillId)
|
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
|
ModuleManager.BattleManager:onSelectSkill(skillId)
|
||||||
end
|
end
|
||||||
|
|
||||||
return BattleSkillSelectUI
|
return BattleSkillSelectUI
|
||||||
@ -191,6 +191,10 @@ function BattleUI:showBoardMask(elementType)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.curElementType = elementType
|
self.curElementType = elementType
|
||||||
|
self:refreshBoard()
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUI:refreshBoard()
|
||||||
local entities = DataManager.BattleData:getGridEnties()
|
local entities = DataManager.BattleData:getGridEnties()
|
||||||
for posId, entity in pairs(entities) do
|
for posId, entity in pairs(entities) do
|
||||||
if entity and entity:getCell() then
|
if entity and entity:getCell() then
|
||||||
|
|||||||
@ -37,7 +37,11 @@ function HeroListCell:refresh(index, heroList, stageFormation, allHeroCount, act
|
|||||||
end
|
end
|
||||||
local heroStartIndex = (index-1)*4 + 1
|
local heroStartIndex = (index-1)*4 + 1
|
||||||
if heroStartIndex > activeCount then
|
if heroStartIndex > activeCount then
|
||||||
heroStartIndex = heroStartIndex - (4 - activeCount%4)
|
local count = (4 - activeCount%4)
|
||||||
|
if count == 4 then
|
||||||
|
count = 0
|
||||||
|
end
|
||||||
|
heroStartIndex = heroStartIndex - count
|
||||||
end
|
end
|
||||||
local heroIndex = heroStartIndex
|
local heroIndex = heroStartIndex
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
|
|||||||
@ -5,8 +5,8 @@ function BattleBoardSkillEnity:ctor(skillId)
|
|||||||
self:refreshSkillId(skillId)
|
self:refreshSkillId(skillId)
|
||||||
self.curEnergy = 0
|
self.curEnergy = 0
|
||||||
self.addRange = {}
|
self.addRange = {}
|
||||||
self.linkEffectEntities = 0
|
self.linkEffectEntities = {}
|
||||||
self.inInfluenceEntities = 0
|
self.inInfluenceEntities = {}
|
||||||
self.generalAttackEffectEntities = {}
|
self.generalAttackEffectEntities = {}
|
||||||
self.elementCountEffectEntities = {}
|
self.elementCountEffectEntities = {}
|
||||||
self.cacheBuffEntities = {}
|
self.cacheBuffEntities = {}
|
||||||
@ -159,37 +159,67 @@ function BattleBoardSkillEnity:getLinkEffects()
|
|||||||
return self.linkEffectEntities
|
return self.linkEffectEntities
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEnity:addLinkEffect(effect, unitEntity)
|
function BattleBoardSkillEnity:addLinkEffect(effect, unitEntity, targetSide)
|
||||||
local buffEntity = self.linkEffectEntities[effect.type]
|
effect = GFunc.getTable(effect)
|
||||||
if not buffEntity then
|
local buffEntities = self.linkEffectEntities[effect.type]
|
||||||
buffEntity = BattleBuffEntity:create()
|
if not buffEntities then
|
||||||
|
self.linkEffectEntities[effect.type] = {}
|
||||||
|
buffEntities = self.linkEffectEntities[effect.type]
|
||||||
|
local list = GConst.BattleConst.BUFF_MATCH_NAME[effect.type]
|
||||||
|
if not list then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
for elementType, buffName in ipairs(list) do
|
||||||
|
local buffEntity = BattleBuffEntity:create()
|
||||||
|
effect.type = buffName
|
||||||
buffEntity:init(effect, unitEntity)
|
buffEntity:init(effect, unitEntity)
|
||||||
self.linkEffectEntities[effect.type] = buffEntity
|
buffEntity:setTargetSide(targetSide)
|
||||||
|
buffEntities[elementType] = buffEntity
|
||||||
|
end
|
||||||
else
|
else
|
||||||
|
for elementType, buffEntity in pairs(buffEntities) do
|
||||||
local buffNum = buffEntity:getEffectNum()
|
local buffNum = buffEntity:getEffectNum()
|
||||||
buffEntity:init(effect, unitEntity)
|
buffEntity:setOwner(unitEntity)
|
||||||
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
|
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
|
||||||
|
buffEntity:setTargetSide(targetSide)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEnity:getInInfluenceAtkp()
|
function BattleBoardSkillEnity:getInInfluenceEffects()
|
||||||
return self.inInfluenceEntities
|
return self.inInfluenceEntities
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEnity:addInInfluenceEffect(effect, unitEntity)
|
function BattleBoardSkillEnity:addInInfluenceEffect(effect, unitEntity, targetSide)
|
||||||
local buffEntity = self.inInfluenceEntities[effect.type]
|
effect = GFunc.getTable(effect)
|
||||||
if not buffEntity then
|
local buffEntities = self.inInfluenceEntities[effect.type]
|
||||||
buffEntity = BattleBuffEntity:create()
|
if not buffEntities then
|
||||||
|
self.inInfluenceEntities[effect.type] = {}
|
||||||
|
buffEntities = self.inInfluenceEntities[effect.type]
|
||||||
|
local list = GConst.BattleConst.BUFF_MATCH_NAME[effect.type]
|
||||||
|
if not list then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
for elementType, buffName in ipairs(list) do
|
||||||
|
local buffEntity = BattleBuffEntity:create()
|
||||||
|
effect.type = buffName
|
||||||
buffEntity:init(effect, unitEntity)
|
buffEntity:init(effect, unitEntity)
|
||||||
self.inInfluenceEntities[effect.type] = buffEntity
|
buffEntity:setTargetSide(targetSide)
|
||||||
|
buffEntities[elementType] = buffEntity
|
||||||
|
end
|
||||||
else
|
else
|
||||||
|
for elementType, buffEntity in pairs(buffEntities) do
|
||||||
local buffNum = buffEntity:getEffectNum()
|
local buffNum = buffEntity:getEffectNum()
|
||||||
buffEntity:init(effect, unitEntity)
|
buffEntity:setOwner(unitEntity)
|
||||||
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
|
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
|
||||||
|
buffEntity:setTargetSide(targetSide)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEnity:addGeneralAttackEffect(effect, unitEntity)
|
function BattleBoardSkillEnity:addGeneralAttackEffect(effect, unitEntity, targetSide)
|
||||||
local buffEntity = self.generalAttackEffectEntities[effect.type]
|
local buffEntity = self.generalAttackEffectEntities[effect.type]
|
||||||
if not buffEntity then
|
if not buffEntity then
|
||||||
buffEntity = BattleBuffEntity:create()
|
buffEntity = BattleBuffEntity:create()
|
||||||
@ -200,22 +230,39 @@ function BattleBoardSkillEnity:addGeneralAttackEffect(effect, unitEntity)
|
|||||||
buffEntity:init(effect, unitEntity)
|
buffEntity:init(effect, unitEntity)
|
||||||
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
|
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
|
||||||
end
|
end
|
||||||
|
buffEntity:setTargetSide(targetSide)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEnity:getGeneralAttackEffect()
|
function BattleBoardSkillEnity:getGeneralAttackEffect()
|
||||||
return self.generalAttackEffectEntities
|
return self.generalAttackEffectEntities
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEnity:addElementCountEffect(effect, unitEntity)
|
function BattleBoardSkillEnity:addElementCountEffect(effect, unitEntity, targetSide)
|
||||||
local buffEntity = self.elementCountEffectEntities[effect.type]
|
local buffEntities = self.elementCountEffectEntities[effect.type]
|
||||||
if not buffEntity then
|
if not buffEntities then
|
||||||
buffEntity = BattleBuffEntity:create()
|
self.elementCountEffectEntities[effect.type] = {}
|
||||||
buffEntity:init(effect, unitEntity)
|
buffEntities = self.elementCountEffectEntities[effect.type]
|
||||||
self.elementCountEffectEntities[effect.type] = buffEntity
|
local originBuffEntity = BattleBuffEntity:create()
|
||||||
|
originBuffEntity:init(effect, unitEntity)
|
||||||
|
originBuffEntity:setTargetSide(targetSide)
|
||||||
|
|
||||||
|
local useBuffEntity = BattleBuffEntity:create()
|
||||||
|
useBuffEntity:init(effect, unitEntity)
|
||||||
|
useBuffEntity:setTargetSide(targetSide)
|
||||||
|
|
||||||
|
buffEntities.origin = originBuffEntity
|
||||||
|
buffEntities.use = useBuffEntity
|
||||||
else
|
else
|
||||||
local buffNum = buffEntity:getEffectNum()
|
local originBuffEntity = buffEntities.origin
|
||||||
buffEntity:init(effect, unitEntity)
|
local useBuffEntity = buffEntities.use
|
||||||
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
|
local buffNum = originBuffEntity:getEffectNum()
|
||||||
|
originBuffEntity:init(effect, unitEntity)
|
||||||
|
originBuffEntity:setEffectNum(originBuffEntity:getEffectNum() + buffNum)
|
||||||
|
originBuffEntity:setTargetSide(targetSide)
|
||||||
|
|
||||||
|
useBuffEntity:init(effect, unitEntity)
|
||||||
|
useBuffEntity:setEffectNum(originBuffEntity:getEffectNum())
|
||||||
|
useBuffEntity:setTargetSide(targetSide)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ function BattleBuffEntity:init(effectParams, owner)
|
|||||||
self.round = effectParams.round
|
self.round = effectParams.round
|
||||||
self.ratio = effectParams.ratio
|
self.ratio = effectParams.ratio
|
||||||
self.owner = owner
|
self.owner = owner
|
||||||
|
self.targetSide = nil
|
||||||
self.buffInfo = ConfigManager:getConfigWithOtherKey("buff", "name")[self.name]
|
self.buffInfo = ConfigManager:getConfigWithOtherKey("buff", "name")[self.name]
|
||||||
self.buffType = self.buffInfo.buff_type
|
self.buffType = self.buffInfo.buff_type
|
||||||
end
|
end
|
||||||
@ -57,4 +58,12 @@ function BattleBuffEntity:getBuffHitFxId()
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleBuffEntity:getTartgetSide()
|
||||||
|
return self.targetSide
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleBuffEntity:setTargetSide(side)
|
||||||
|
self.targetSide = side
|
||||||
|
end
|
||||||
|
|
||||||
return BattleBuffEntity
|
return BattleBuffEntity
|
||||||
@ -142,6 +142,10 @@ function BattleUnitEntity:changeActiveSkillId(originSkillId, tartgetSkillId)
|
|||||||
for _, skillEntity in ipairs(self.activeSkills) do
|
for _, skillEntity in ipairs(self.activeSkills) do
|
||||||
if skillEntity:getSkillid() == originSkillId then
|
if skillEntity:getSkillid() == originSkillId then
|
||||||
skillEntity:changeSkillId(tartgetSkillId)
|
skillEntity:changeSkillId(tartgetSkillId)
|
||||||
|
local extraCount = self.skillExtraUseTimes[originSkillId]
|
||||||
|
if extraCount then
|
||||||
|
self.skillExtraUseTimes[tartgetSkillId] = extraCount
|
||||||
|
end
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user