|
|
@@ -326,6 +326,21 @@ local function isPos(obj,posList)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+local function isLianjie1(obj)
|
|
|
+ if obj.bufferCmd["lianjie1"] then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+
|
|
|
+ return false
|
|
|
+end
|
|
|
+
|
|
|
+local function isLianjie2(obj)
|
|
|
+ if obj.bufferCmd["lianjie2"] then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+
|
|
|
+ return false
|
|
|
+end
|
|
|
|
|
|
function getBuffer(obj)
|
|
|
return obj.buffer
|
|
|
@@ -1110,6 +1125,15 @@ function onHit(attacker, skillTargets, skillConfig, cmdTargets, otherArgs)
|
|
|
end
|
|
|
end
|
|
|
end
|
|
|
+
|
|
|
+ if true == isLianjie1(v) then
|
|
|
+ local LianJieBufferInd = v.bufferCmd["lianjie1"] and v.bufferCmd["lianjie1"][1]
|
|
|
+ local LianJieBBuffer = v.buffer[LianJieBufferInd]
|
|
|
+ if LianJieBBuffer then
|
|
|
+ local conf = GetBuffConfig(LianJieBBuffer.id)
|
|
|
+ handler[conf.cmd](v, LianJieBBuffer, conf, attacker)
|
|
|
+ end
|
|
|
+ end
|
|
|
end
|
|
|
|
|
|
local buffers = getSkillBuffers(skillConfig)
|
|
|
@@ -1840,9 +1864,80 @@ function handler.zuzhou(target,buffer,conf)
|
|
|
BeSkill.handlerBuff(attacker, target, hurt, conf.cmd)
|
|
|
end
|
|
|
|
|
|
--- 潜行
|
|
|
-function handler.qianxing()
|
|
|
-
|
|
|
+function handler.lianjie1(target, buffer1, conf1, attacker)
|
|
|
+ if not attacker then
|
|
|
+ return
|
|
|
+ end
|
|
|
+ local nHurt = CombatObj.getValue(attacker, RoleDefine.HURT_COMBAT_NOW)
|
|
|
+ if 0 >= nHurt or not target then
|
|
|
+ print("[handler.lianjie1] 不正确的目标和伤害值")
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ if not target.bufferCmd or not target.bufferCmd["lianjie1"] then
|
|
|
+ print("[handler.lianjie1] 不存在对应buff")
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ local nTargetPos, nTargetSide = target.pos, target.side
|
|
|
+ print("[handler.lianjie1] nTargetPos = "..nTargetPos.." nTargetSide = "..nTargetSide.." id = "..target.id)
|
|
|
+ for i = #target.bufferCmd["lianjie1"],1,-1 do
|
|
|
+ local ind = target.bufferCmd["lianjie1"][i]
|
|
|
+ local buffer = target.buffer[ind]
|
|
|
+ -- 自己身上有链接
|
|
|
+ local conf = GetBuffConfig(buffer.id)
|
|
|
+ local arg = conf.args[1]
|
|
|
+ local nDelHurt = nHurt * arg / 10000
|
|
|
+ print("[handler.lianjie1] 计算出来的值 nDelHurt = "..nDelHurt.." arg = "..arg.." nHurt = "..nHurt)
|
|
|
+ local nGetSide = nTargetSide == CombatDefine.ATTACK_SIDE and CombatDefine.DEFEND_SIDE or CombatDefine.ATTACK_SIDE
|
|
|
+ for _,pos in ipairs(CombatDefine.SIDE2POS[nGetSide]) do
|
|
|
+ local objM = CombatImpl.objList[pos]
|
|
|
+ if objM and objM.hp > 0 and isLianjie2(objM) then
|
|
|
+ local bHave = false
|
|
|
+ for j = #objM.bufferCmd["lianjie2"], 1, -1 do
|
|
|
+ local index = objM.bufferCmd["lianjie2"][i]
|
|
|
+ local tBuffData = objM.buffer[ind]
|
|
|
+ if tBuffData and tBuffData.attackPos == nTargetPos then
|
|
|
+ bHave = true
|
|
|
+ break
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ if bHave == true then
|
|
|
+ print("[handler.lianjie1] 对目标英雄 进行扣血操作 id = "..objM.id .." nDelHurt = "..nDelHurt)
|
|
|
+ local d = CombatObj.updateHp(objM, -nDelHurt, nil, true, objM.pos,CombatObj.BUFFER_HP_TYPE)
|
|
|
+ CombatImpl.setExtraHit(objM, d)
|
|
|
+ CombatObj.onHpCB(objM, d, objM.pos)
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+function handler.lianjie3(obj, buffer1, conf1, nAddNum)
|
|
|
+ if not obj.bufferCmd or not obj.bufferCmd["lianjie3"] or not nAddNum then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ if 0 >= nAddNum then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ for i = #obj.bufferCmd["lianjie3"], 1, -1 do
|
|
|
+ local ind = obj.bufferCmd["lianjie3"][i]
|
|
|
+ local buffer = obj.buffer[ind]
|
|
|
+ local nAttackPos = buffer.attackPos
|
|
|
+ local conf = GetBuffConfig(buffer.id)
|
|
|
+ local arg = conf.args[1]
|
|
|
+ local nSum = nAddNum * arg / 10000
|
|
|
+ local tAttacker = CombatImpl.objList[nAttackPos]
|
|
|
+ if tAttacker and tAttacker.hp > 0 then
|
|
|
+ -- print("[handler.lianjie3] 进行加血操作 nAddNum = "..nAddNum.." nSum = "..nSum.." arg = "..arg)
|
|
|
+ local d = CombatObj.updateHp(tAttacker, nSum, nil, true, tAttacker.pos,CombatObj.BUFFER_HP_TYPE)
|
|
|
+ CombatImpl.setExtraHit(tAttacker, d)
|
|
|
+ CombatObj.onHpCB(tAttacker, d, tAttacker.pos)
|
|
|
+ end
|
|
|
+ end
|
|
|
end
|
|
|
|
|
|
function yinbaoZuzhou(obj, skillTargets, skillConfig)
|
|
|
@@ -2141,27 +2236,36 @@ function qusanAddBuff(attacker, targets, bufferID)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
-function beforeUpdateHp(obj,sum)
|
|
|
- local isStatus,cmd,ind = isStatus(obj,{"miansi","waitMiansi"})
|
|
|
- if not isStatus then
|
|
|
- return
|
|
|
- end
|
|
|
- --免死逻辑
|
|
|
- if cmd == "miansi" then
|
|
|
- return true
|
|
|
+function beforeUpdateHp(obj,sum, nAddNum)
|
|
|
+ local isLianjie, Lianjie2Cmd, index = isStatus(obj,{"lianjie3"})
|
|
|
+ if isLianjie then
|
|
|
+ local buffer = obj.buffer[index]
|
|
|
+ local conf = GetBuffConfig(buffer.id)
|
|
|
+ if handler[conf.cmd] then
|
|
|
+ handler[conf.cmd](obj, nil, nil, nAddNum)
|
|
|
end
|
|
|
- if sum == 0 and cmd == "waitMiansi" then
|
|
|
- local buffer = obj.buffer[ind]
|
|
|
- local bufferCnt = delBuffer(obj, ind)
|
|
|
- CombatImpl.addFrameBuffer(obj,buffer,CombatDefine.BUFFER_OP_DEL)
|
|
|
- --local conf = BufferExcel.buffer[buffer.id]
|
|
|
- local conf = GetBuffConfig(buffer.id)
|
|
|
- local bufferID = conf.args[1]
|
|
|
- if canAdd(obj,bufferID) then
|
|
|
- addBuffer(obj.pos,obj, bufferID)
|
|
|
- end
|
|
|
- return true
|
|
|
+ end
|
|
|
+
|
|
|
+ local isStatus,cmd,ind = isStatus(obj,{"miansi","waitMiansi"})
|
|
|
+ if not isStatus then
|
|
|
+ return
|
|
|
+ end
|
|
|
+ --免死逻辑
|
|
|
+ if cmd == "miansi" then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+ if sum == 0 and cmd == "waitMiansi" then
|
|
|
+ local buffer = obj.buffer[ind]
|
|
|
+ local bufferCnt = delBuffer(obj, ind)
|
|
|
+ CombatImpl.addFrameBuffer(obj,buffer,CombatDefine.BUFFER_OP_DEL)
|
|
|
+ --local conf = BufferExcel.buffer[buffer.id]
|
|
|
+ local conf = GetBuffConfig(buffer.id)
|
|
|
+ local bufferID = conf.args[1]
|
|
|
+ if canAdd(obj,bufferID) then
|
|
|
+ addBuffer(obj.pos,obj, bufferID)
|
|
|
end
|
|
|
+ return true
|
|
|
+ end
|
|
|
end
|
|
|
|
|
|
function checkBaohu(obj,value)
|