Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-04-18 18:59:39 +08:00
commit 2ff99edc4e
16 changed files with 292 additions and 111 deletions

View File

@ -7,51 +7,61 @@ local buff = {
[2]={
["name"]="hurt_red",
["buff_type"]=3,
["position"]=1,
["formula"]=1
},
[3]={
["name"]="hurt_yellow",
["buff_type"]=3,
["position"]=2,
["formula"]=1
},
[4]={
["name"]="hurt_green",
["buff_type"]=3,
["position"]=3,
["formula"]=1
},
[5]={
["name"]="hurt_blue",
["buff_type"]=3,
["position"]=4,
["formula"]=1
},
[6]={
["name"]="hurt_purple",
["buff_type"]=3,
["position"]=5,
["formula"]=1
},
[7]={
["name"]="dec_dmg_red_add",
["buff_type"]=1,
["position"]=1,
["icon"]="dec_dmg_red_add"
},
[8]={
["name"]="dec_dmg_yellow_add",
["buff_type"]=1,
["position"]=2,
["icon"]="dec_dmg_yellow_add"
},
[9]={
["name"]="dec_dmg_green_add",
["buff_type"]=1,
["position"]=3,
["icon"]="dec_dmg_green_add"
},
[10]={
["name"]="dec_dmg_blue_add",
["buff_type"]=1,
["position"]=4,
["icon"]="dec_dmg_blue_add"
},
[11]={
["name"]="dec_dmg_purple_add",
["buff_type"]=1,
["position"]=5,
["icon"]="dec_dmg_purple_add"
},
[12]={
@ -62,26 +72,31 @@ local buff = {
[13]={
["name"]="weakness_red_add",
["buff_type"]=1,
["position"]=1,
["icon"]="weakness_red_add"
},
[14]={
["name"]="weakness_yellow_add",
["buff_type"]=1,
["position"]=2,
["icon"]="weakness_yellow_add"
},
[15]={
["name"]="weakness_green_add",
["buff_type"]=1,
["position"]=3,
["icon"]="weakness_green_add"
},
[16]={
["name"]="weakness_blue_add",
["buff_type"]=1,
["position"]=4,
["icon"]="weakness_blue_add"
},
[17]={
["name"]="weakness_purple_add",
["buff_type"]=1,
["position"]=5,
["icon"]="weakness_purple_add"
},
[18]={
@ -92,26 +107,31 @@ local buff = {
[19]={
["name"]="dmg_addition_red_add",
["buff_type"]=1,
["position"]=1,
["icon"]="dmg_addition_red_add"
},
[20]={
["name"]="dmg_addition_yellow_add",
["buff_type"]=1,
["position"]=2,
["icon"]="dmg_addition_yellow_add"
},
[21]={
["name"]="dmg_addition_green_add",
["buff_type"]=1,
["position"]=3,
["icon"]="dmg_addition_green_add"
},
[22]={
["name"]="dmg_addition_blue_add",
["buff_type"]=1,
["position"]=4,
["icon"]="dmg_addition_blue_add"
},
[23]={
["name"]="dmg_addition_purple_add",
["buff_type"]=1,
["position"]=5,
["icon"]="dmg_addition_purple_add"
},
[24]={
@ -125,23 +145,28 @@ local buff = {
},
[26]={
["name"]="atkp_red_add",
["buff_type"]=1
["buff_type"]=1,
["position"]=1
},
[27]={
["name"]="atkp_yellow_add",
["buff_type"]=1
["buff_type"]=1,
["position"]=2
},
[28]={
["name"]="atkp_green_add",
["buff_type"]=1
["buff_type"]=1,
["position"]=3
},
[29]={
["name"]="atkp_blue_add",
["buff_type"]=1
["buff_type"]=1,
["position"]=4
},
[30]={
["name"]="atkp_purple_add",
["buff_type"]=1
["buff_type"]=1,
["position"]=5
},
[31]={
["name"]="wavehealp",
@ -216,6 +241,10 @@ local buff = {
[44]={
["name"]="add_skill",
["buff_type"]=7
},
[45]={
["name"]="skill_fire_times",
["buff_type"]=7
}
}
local keys = {
@ -263,12 +292,13 @@ local keys = {
["crit_time_add"]=buff[41],
["exp_time_add"]=buff[42],
["cured_add"]=buff[43],
["add_skill"]=buff[44]
["add_skill"]=buff[44],
["skill_fire_times"]=buff[45]
}
}
local config = {
data=buff,
keys=keys,
count=44
count=45
}
return config

View File

@ -4,7 +4,6 @@ BattleConst.ROW_COUNT = 7
BattleConst.COLUMN_COUNT = 7
BattleConst.HALF_ROW_COUNT = 4 -- 计算偏移 math.ceil(ROW_COUNT / 2)
BattleConst.HALF_COLUMN_COUNT = 4 -- 计算偏移 math.ceil(COLUMN_COUNT / 2)
BattleConst.ELIMINATION_MIN_COUNT = 2
BattleConst.GRID_STEP_H = 94
BattleConst.ROW_STEP = 10
BattleConst.ONE_STEP_TIME = 0.2
@ -95,6 +94,16 @@ BattleConst.MATCH_WEAKNESS_NAME = {
[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 = {
IDLE = "idle",
ATTACK = "attack01",
@ -484,12 +493,4 @@ BattleConst.INSTRUCTION_NAME = {
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

View File

@ -261,6 +261,11 @@ function BattleManager:getPosRC(posId)
return BattleConst.POS_ID_2_RC[posId]
end
function BattleManager:getBuffElementType(buffName)
local cfg = ConfigManager:getConfigWithOtherKey("buff", "name")[buffName]
return cfg and cfg.position
end
----------------------- end 一些公共相关的方法 -----------------------------
function BattleManager:bindBattleUnitAttribute(hashCode, side)

View File

@ -583,6 +583,7 @@ function BattleUnitComp:updateSkillAttack(dt)
end
return
else
self.currActiveSkill:startUse()
self:doNextSkillAttack()
end
else -- 继续普攻
@ -590,7 +591,8 @@ function BattleUnitComp:updateSkillAttack(dt)
end
else
local currActiveSkill = nil
if self.currActiveSkill:getSkillCanUseTimes() > 0 then -- 当前技能可以多次使用
local skillCanUseTimes = self.currActiveSkill:getSkillCanUseTimes()
if skillCanUseTimes and skillCanUseTimes > 0 then -- 当前技能可以多次使用
currActiveSkill = self.currActiveSkill
elseif self.activeSkillIndex then
self.activeSkillIndex = self.activeSkillIndex + 1
@ -765,7 +767,7 @@ end
function BattleUnitComp:onSkillTakeEffect(skill)
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)
end
local effectList = skill:getEffectList()

View File

@ -53,6 +53,13 @@ function BattleController:getMaxWave()
return 1
end
function BattleController:getMinEliminationCount()
if not self.minEliminationCount then
self.minEliminationCount = GFunc.getConstIntValue("element_combo")
end
return self.minEliminationCount
end
function BattleController:initDefUnits(callback)
callback()
end
@ -366,7 +373,12 @@ function BattleController:enterRoundEnd()
end
self.atkTeam:onRoundEnd()
self.defTeam:onRoundEnd()
if self.battleData:useAddlvCount() then
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
else
self:enterRoundBegin()
end
end
---- end回合步骤
@ -376,7 +388,7 @@ function BattleController:onTouchEvent(eventType, posId)
return
end
local entity = self.battleData:getGridEntity(posId)
if not entity:canLink() then
if not entity or not entity:canLink() then
return
end
@ -477,7 +489,7 @@ function BattleController:onTouchEvent(eventType, posId)
self.battleUI:showBoardMask(nil)
local sequence = self.battleData:getGridSequence()
local count = #sequence
if count < BattleConst.ELIMINATION_MIN_COUNT then
if count < self:getMinEliminationCount() then
if count <= 0 then
self.battleData:clearGridSequence()
self:onLinkChange()
@ -506,7 +518,7 @@ end
function BattleController:onLinkOver()
local sequence = self.battleData:getGridSequence()
local count = #sequence
if count < BattleConst.ELIMINATION_MIN_COUNT then
if count < self:getMinEliminationCount() then
return
end
@ -521,6 +533,7 @@ function BattleController:onLinkOver()
local elementTypeMap = {}
local eliminationPosIds = {}
local boomGridIds = {}
local lineCount = 0
for _, info in ipairs(sequence) do
if not eliminationPosIds[info.posId] then
@ -529,6 +542,7 @@ function BattleController:onLinkOver()
local elementType = entity:getElementType()
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
linkElementType = elementType
lineCount = lineCount + 1
end
local outline = BattleConst.GRID_OUT_LINE_POS_ID[info.posId]
@ -588,7 +602,7 @@ function BattleController:onLinkOver()
self.battleUI:disableUITouch()
self.battleUI:eliminationAni(sequence, function()
self:generateInstructions(skillEntity, linkElementType, influenceElementType, elementTypeMap)
self:generateInstructions(skillEntity, linkElementType, lineCount, influenceElementType, elementTypeMap)
self:enterAtkStep()
end)
end
@ -641,10 +655,6 @@ function BattleController:fillBoard()
self.battleUI:fallGrid(pathMap, function()
self:onFillBoardOver()
self.battleUI:enableUITouch()
if self.battleData:useAddlvCount() then
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
end
end)
end
@ -655,38 +665,7 @@ function BattleController:onFillBoardOver()
end)
end
function BattleController:generateInstructions(skillEntity, elementType, influenceElementType, 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
function BattleController:generateInstructions(skillEntity, elementType, lineCount, influenceElementTypeMap, elementTypeMap)
local elementTypeCount = 0
local assistingList = nil
---- 援助
@ -729,11 +708,76 @@ function BattleController:generateInstructions(skillEntity, elementType, influen
assistingList = assistingList,
})
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
function BattleController:exeInstructions(callback)
Logger.logHighlight("--------exeInstructions----------")
Logger.printTable(self.instructions)
if not self.instructions or #self.instructions <= 0 then
callback()
return
@ -1085,7 +1129,7 @@ function BattleController:getRandomSkillList(getCount)
getCount = getCount - 1
end
for skillId, info in ipairs(cfg) do
for skillId, info in pairs(cfg) do
if not self:getNotInvolvedSkills()[skillId] then
if info.universal 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
ModuleManager.BattleManager:showSelectSkillUI(self:getRandomSkillList())
else
self:enterRoundBegin()
end
if self.battleUI then
self.battleUI:refreshBoard()
end
end
@ -1141,6 +1191,7 @@ end
function BattleController:addHeroAttr(attrName, value)
Logger.logHighlight("------addHeroAttr------ " .. attrName .. " " .. value)
Logger.logHighlight(self.battleData.atkTeam == nil)
if not self.battleData or not self.battleData.atkTeam then
return
end
@ -1202,6 +1253,9 @@ function BattleController:_tick(dt)
end
function BattleController:battleEnd()
if self.battleUI then
self.battleUI:enableUITouch()
end
self:controllBattleEnd()
end
@ -1230,6 +1284,20 @@ function BattleController:showEffectNumber(num, x, y)
end
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()
end

View File

@ -142,7 +142,7 @@ local function _removeEffectAttr(buffSender, target, buff, buffEffect)
local buffName = buff:getName()
local attr = BUFF_NAME_TO_ATTR[buffName]
if attr then
target.unitEntity:addAttr(attr[1], -buffEffect.effectResult, false)
target.unitEntity:addAttr(attr[1], -buffEffect.result, false)
else
local func = BattleBuffHandle.addAttribute[buffName]
if func then

View File

@ -96,8 +96,7 @@ function BattleHelper:getBuffEffect()
if #self.buffEffectPool > 0 then
return table.remove(self.buffEffectPool)
end
local sid = self.buffSid + 1
return {sid = sid}
return {}
end
function BattleHelper:recycleBuffEffect(buffEffect)

View File

@ -40,7 +40,7 @@ local function _takeChangeAround(posId, skillEntity, gridEntities, sequenceEntit
for _, info in ipairs(posIdInfos) do
local entity = gridEntities[info.posId]
if entity then
entity:setElementType(skillEntity:getSkillTypeParameter())
entity:setElementType(skillEntity:getSkillTypeParameter()[1])
end
end
end

View File

@ -68,7 +68,7 @@ local _addLinkAtkp = function(skillInfo, battleData, battleController)
for _, effect in ipairs(skillInfo.effect) do
local entity = battleData:getSkillEntityByElement(elementType)
if entity then
entity:addLinkEffect(effect, unitEntity)
entity:addLinkEffect(effect, unitEntity, skillInfo.obj)
end
end
end
@ -107,7 +107,16 @@ local _addSkillReleaseCount = function(skillInfo, battleData, battleController)
return
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
local _addSkillEffectParams = function(skillInfo, battleData, battleController)
@ -142,7 +151,7 @@ local _addSkillEffectParams = function(skillInfo, battleData, battleController)
return
end
if battleData.atkTeam:getAllMembers()[elementType] then
battleData.atkTeam:getAllMembers()[elementType]:addSkillEffectParams(skillId, effect)
battleData.atkTeam:getAllMembers()[elementType]:addActiveSkillParams(skillId, effect)
end
end
end
@ -217,7 +226,7 @@ local _addSkillInInfluenceAtkp = function(skillInfo, battleData, battleControlle
local entity = battleData:getSkillEntityByElement(elementType)
for _, effect in ipairs(skillInfo.effect) do
entity:addInInfluenceEffect(effect, unitEntity)
entity:addInInfluenceEffect(effect, unitEntity, skillInfo.obj)
end
end
@ -239,7 +248,7 @@ local _addSkillGeneralAttackEffect = function(skillInfo, battleData, battleContr
local entity = battleData:getSkillEntityByElement(elementType)
if entity then
for _, effect in ipairs(skillInfo.effect) do
entity:addGeneralAttackEffect(effect, unitEntity)
entity:addGeneralAttackEffect(effect, unitEntity, skillInfo.obj)
end
end
end
@ -262,7 +271,7 @@ local _addSkillElementCountEffect = function(skillInfo, battleData, battleContro
local entity = battleData:getSkillEntityByElement(elementType)
if entity then
for _, effect in ipairs(skillInfo.effect) do
entity:addElementCountEffect(effect, unitEntity)
entity:addElementCountEffect(effect, unitEntity, skillInfo.obj)
end
end
end
@ -280,7 +289,7 @@ BattleRogueSkillHandle._effectOn = {
[10] = _changeElementType, -- 将场上随机几个元素变为某元素
[11] = _addSkillInInfluenceAtkp, -- 技能消除的增加伤害
[12] = _addSkillGeneralAttackEffect, -- 技能链接中的每一个元素,都触发的技能效果
[11] = _addSkillElementCountEffect, -- 技能链接中每一个元素累加的技能效果
[13] = _addSkillElementCountEffect, -- 技能链接中每一个元素累加的技能效果
}
function BattleRogueSkillHandle.takeEffect(skillId, battleData, battleController)

View File

@ -124,15 +124,15 @@ function BattleTeam:handleShield(reduceShield, unit)
local shieldNum = 0
local currShieldBuff = self.shieldBuffList[1]
while currShieldBuff do
reduceShield = reduceShield + currShieldBuff.effectResult
reduceShield = reduceShield + currShieldBuff.result
if reduceShield > 0 then
shieldNum = shieldNum + reduceShield - currShieldBuff.effectResult
currShieldBuff.effectResult = reduceShield
shieldNum = shieldNum + reduceShield - currShieldBuff.result
currShieldBuff.result = reduceShield
reduceShield = 0
break
else
shieldNum = shieldNum - currShieldBuff.effectResult
currShieldBuff.effectResult = 0
shieldNum = shieldNum - currShieldBuff.result
currShieldBuff.result = 0
for k, v in ipairs(self.buffList) do
if v == currShieldBuff then
self:updateBuffState(currShieldBuff.buff, -1)

View File

@ -73,9 +73,8 @@ function BattleSkillSelectUI:refreshRogueSkill()
end
function BattleSkillSelectUI:onClickSkill(skillId)
Logger.logHighlight(skillId)
ModuleManager.BattleManager:onSelectSkill(skillId)
self:closeUI()
ModuleManager.BattleManager:onSelectSkill(skillId)
end
return BattleSkillSelectUI

View File

@ -191,6 +191,10 @@ function BattleUI:showBoardMask(elementType)
end
self.curElementType = elementType
self:refreshBoard()
end
function BattleUI:refreshBoard()
local entities = DataManager.BattleData:getGridEnties()
for posId, entity in pairs(entities) do
if entity and entity:getCell() then

View File

@ -37,7 +37,11 @@ function HeroListCell:refresh(index, heroList, stageFormation, allHeroCount, act
end
local heroStartIndex = (index-1)*4 + 1
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
local heroIndex = heroStartIndex
for i = 1, 4 do

View File

@ -5,8 +5,8 @@ function BattleBoardSkillEnity:ctor(skillId)
self:refreshSkillId(skillId)
self.curEnergy = 0
self.addRange = {}
self.linkEffectEntities = 0
self.inInfluenceEntities = 0
self.linkEffectEntities = {}
self.inInfluenceEntities = {}
self.generalAttackEffectEntities = {}
self.elementCountEffectEntities = {}
self.cacheBuffEntities = {}
@ -159,37 +159,67 @@ function BattleBoardSkillEnity:getLinkEffects()
return self.linkEffectEntities
end
function BattleBoardSkillEnity:addLinkEffect(effect, unitEntity)
local buffEntity = self.linkEffectEntities[effect.type]
if not buffEntity then
buffEntity = BattleBuffEntity:create()
function BattleBoardSkillEnity:addLinkEffect(effect, unitEntity, targetSide)
effect = GFunc.getTable(effect)
local buffEntities = self.linkEffectEntities[effect.type]
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)
self.linkEffectEntities[effect.type] = buffEntity
buffEntity:setTargetSide(targetSide)
buffEntities[elementType] = buffEntity
end
else
for elementType, buffEntity in pairs(buffEntities) do
local buffNum = buffEntity:getEffectNum()
buffEntity:init(effect, unitEntity)
buffEntity:setOwner(unitEntity)
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
buffEntity:setTargetSide(targetSide)
end
end
end
function BattleBoardSkillEnity:getInInfluenceAtkp()
function BattleBoardSkillEnity:getInInfluenceEffects()
return self.inInfluenceEntities
end
function BattleBoardSkillEnity:addInInfluenceEffect(effect, unitEntity)
local buffEntity = self.inInfluenceEntities[effect.type]
if not buffEntity then
buffEntity = BattleBuffEntity:create()
function BattleBoardSkillEnity:addInInfluenceEffect(effect, unitEntity, targetSide)
effect = GFunc.getTable(effect)
local buffEntities = self.inInfluenceEntities[effect.type]
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)
self.inInfluenceEntities[effect.type] = buffEntity
buffEntity:setTargetSide(targetSide)
buffEntities[elementType] = buffEntity
end
else
for elementType, buffEntity in pairs(buffEntities) do
local buffNum = buffEntity:getEffectNum()
buffEntity:init(effect, unitEntity)
buffEntity:setOwner(unitEntity)
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
buffEntity:setTargetSide(targetSide)
end
end
end
function BattleBoardSkillEnity:addGeneralAttackEffect(effect, unitEntity)
function BattleBoardSkillEnity:addGeneralAttackEffect(effect, unitEntity, targetSide)
local buffEntity = self.generalAttackEffectEntities[effect.type]
if not buffEntity then
buffEntity = BattleBuffEntity:create()
@ -200,22 +230,39 @@ function BattleBoardSkillEnity:addGeneralAttackEffect(effect, unitEntity)
buffEntity:init(effect, unitEntity)
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
end
buffEntity:setTargetSide(targetSide)
end
function BattleBoardSkillEnity:getGeneralAttackEffect()
return self.generalAttackEffectEntities
end
function BattleBoardSkillEnity:addElementCountEffect(effect, unitEntity)
local buffEntity = self.elementCountEffectEntities[effect.type]
if not buffEntity then
buffEntity = BattleBuffEntity:create()
buffEntity:init(effect, unitEntity)
self.elementCountEffectEntities[effect.type] = buffEntity
function BattleBoardSkillEnity:addElementCountEffect(effect, unitEntity, targetSide)
local buffEntities = self.elementCountEffectEntities[effect.type]
if not buffEntities then
self.elementCountEffectEntities[effect.type] = {}
buffEntities = self.elementCountEffectEntities[effect.type]
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
local buffNum = buffEntity:getEffectNum()
buffEntity:init(effect, unitEntity)
buffEntity:setEffectNum(buffEntity:getEffectNum() + buffNum)
local originBuffEntity = buffEntities.origin
local useBuffEntity = buffEntities.use
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

View File

@ -9,6 +9,7 @@ function BattleBuffEntity:init(effectParams, owner)
self.round = effectParams.round
self.ratio = effectParams.ratio
self.owner = owner
self.targetSide = nil
self.buffInfo = ConfigManager:getConfigWithOtherKey("buff", "name")[self.name]
self.buffType = self.buffInfo.buff_type
end
@ -57,4 +58,12 @@ function BattleBuffEntity:getBuffHitFxId()
return nil
end
function BattleBuffEntity:getTartgetSide()
return self.targetSide
end
function BattleBuffEntity:setTargetSide(side)
self.targetSide = side
end
return BattleBuffEntity

View File

@ -142,6 +142,10 @@ function BattleUnitEntity:changeActiveSkillId(originSkillId, tartgetSkillId)
for _, skillEntity in ipairs(self.activeSkills) do
if skillEntity:getSkillid() == originSkillId then
skillEntity:changeSkillId(tartgetSkillId)
local extraCount = self.skillExtraUseTimes[originSkillId]
if extraCount then
self.skillExtraUseTimes[tartgetSkillId] = extraCount
end
break
end
end