|
|
@@ -393,11 +393,79 @@ function CMD.hp(obj,skillConfig,skillTargets)
|
|
|
limit = args[6] * CombatObj.getHpMax(obj) / 10000
|
|
|
end
|
|
|
|
|
|
+ local hpAddRate = CombatObj.getValue(obj,RoleDefine.ZAOCHENG_HP_ADD_RATE) / 10000
|
|
|
+ for _,target in ipairs(targets) do
|
|
|
+ if not target.bufferCmd["noHp"] then
|
|
|
+ hp = calcHp(obj,target,calcType,rate,limit,true)
|
|
|
+ hp = hp * (1 + hpAddRate)
|
|
|
+ hp = hp < 0 and 1 or hp
|
|
|
+
|
|
|
+ if hp > 0 and obj.isAllCalcHp == true then
|
|
|
+ if target.side == CombatDefine.DEFEND_SIDE then
|
|
|
+ hp = CombatImpl.commonArgs.hpLimit or hp
|
|
|
+ end
|
|
|
+ local d = CombatObj.updateHp(target,hp,nil,true,obj.pos,CombatObj.EXTRA_HP_TYPE)
|
|
|
+ local showHp = hp
|
|
|
+ if hp > 0 and d < 0 then
|
|
|
+ showHp = hp * (-1)
|
|
|
+ end
|
|
|
+ CombatImpl.setExtraHit(target, showHp, CMD2ID["hp"])
|
|
|
+ CombatObj.onHpCB(target,d, obj.pos)
|
|
|
+ end
|
|
|
+
|
|
|
+ if hp < 0 then
|
|
|
+ if target.side == CombatDefine.DEFEND_SIDE then
|
|
|
+ hp = CombatImpl.commonArgs.hpLimit or hp
|
|
|
+ end
|
|
|
+ local d = CombatObj.updateHp(target,hp,nil,true,obj.pos,CombatObj.EXTRA_HP_TYPE)
|
|
|
+ if hp > 0 and d < 0 then
|
|
|
+ hp = hp * (-1)
|
|
|
+ end
|
|
|
+ CombatImpl.setExtraHit(target, hp, CMD2ID["hp"])
|
|
|
+ CombatObj.onHpCB(target,d, obj.pos)
|
|
|
+ end
|
|
|
+ ret[#ret+1] = target
|
|
|
+ end
|
|
|
+ end
|
|
|
+ return ret
|
|
|
+end
|
|
|
|
|
|
|
|
|
+function CMD.shixueHP(obj,skillConfig,skillTargets, hitObj)
|
|
|
+ local ret = {}
|
|
|
+ local args = obj.isPet and obj.args or skillConfig.args
|
|
|
+ local r = math.random(0,10000)
|
|
|
+ if args[4] and r > args[4] then
|
|
|
+ return
|
|
|
+ end
|
|
|
+ local calcType = args[1]
|
|
|
+ local rate = args[2]
|
|
|
+ local targets = TargetMode.getTargets(obj, args[3], skillTargets)
|
|
|
+ local hp
|
|
|
+ local limit
|
|
|
+ if args[5] and args[5] > 0 then
|
|
|
+ limit = args[5] * CombatObj.getValue(obj,RoleDefine.ATK_COMBAT_NOW) / 10000
|
|
|
+ end
|
|
|
+ if not obj.isPet and args[6] and args[6] > 0 then
|
|
|
+ limit = args[6] * CombatObj.getHpMax(obj) / 10000
|
|
|
+ end
|
|
|
+
|
|
|
+ local targetBuffInfo
|
|
|
+ local res, _, buffIdx = CombatBuff.isStatus(obj, {"noShixue"})
|
|
|
+
|
|
|
+ local bl = true
|
|
|
+ if res and buffIdx then
|
|
|
+ local objBuffList = CombatBuff.getBuffer(obj)
|
|
|
+ targetBuffInfo = objBuffList[buffIdx]
|
|
|
+
|
|
|
+ if hitObj and targetBuffInfo and targetBuffInfo.attackPos == hitObj.pos then
|
|
|
+ bl = false
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
local hpAddRate = CombatObj.getValue(obj,RoleDefine.ZAOCHENG_HP_ADD_RATE) / 10000
|
|
|
for _,target in ipairs(targets) do
|
|
|
- if not target.bufferCmd["noHp"] then
|
|
|
+ if not target.bufferCmd["noHp"] and bl then
|
|
|
hp = calcHp(obj,target,calcType,rate,limit,true)
|
|
|
hp = hp * (1 + hpAddRate)
|
|
|
hp = hp < 0 and 1 or hp
|
|
|
@@ -963,22 +1031,14 @@ function CMD.randcmd(obj,skillConfig,skillTargets)
|
|
|
return {}
|
|
|
end
|
|
|
|
|
|
-function CMD.qusan(obj,skillConfig,skillTargets, isAddFrame)
|
|
|
+function CMD.qusan(obj,skillConfig,skillTargets)
|
|
|
if obj.isPet then return {} end
|
|
|
- print("================qusan0000==============")
|
|
|
local args = skillConfig.args
|
|
|
local r = math.random(0,10000)
|
|
|
if r > args[3] then
|
|
|
- print("================qusan==============", r, args[3])
|
|
|
return
|
|
|
end
|
|
|
|
|
|
- -- 只有能驱散时才增加技能帧
|
|
|
- if isAddFrame then
|
|
|
- CombatImpl.addFrame()
|
|
|
- CombatImpl.setSkillID(obj, skillConfig.id)
|
|
|
- end
|
|
|
-
|
|
|
local qusanType = args[1]
|
|
|
local calcType = args[5] and args[5][1]
|
|
|
local rate = args[5] and args[5][2]
|