【战斗】=======变身卡技能提交
parent
836d216309
commit
33d25289b3
|
@ -2814,6 +2814,59 @@ local effectList = {
|
|||
BattleUtil.FinalTreat(caster,target,treat,1,skill)
|
||||
end)
|
||||
end,
|
||||
--对目标造成神佑状态,造成目标[a]属性[b]%的治疗,持续[c]回合,溢出的治疗量转化为御甲
|
||||
--a[int],b[float],c[int]
|
||||
[144] = function(caster, target, args, interval, skill)
|
||||
local p1 = args[1]
|
||||
local v1 = args[2]
|
||||
local round = args[3]
|
||||
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
local damage=floor(target:GetRoleData(p1)*v1)
|
||||
local buff=Buff.Create(caster,BuffName.HOT,round,1,damage)
|
||||
buff.hotType=2
|
||||
target:AddBuff(buff)
|
||||
end)
|
||||
end,
|
||||
--为我方添加反伤盾,护盾类型为[a],护盾值为[b]%,持续[c]回合
|
||||
--a[int],b[float],c[int]
|
||||
[145] = function(caster, target, args, interval, skill)
|
||||
local type = args[1]
|
||||
local v1 = args[2]
|
||||
local r1 = args[3]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
|
||||
target:AddBuff(Buff.Create(caster, BuffName.Shield,r1,type,v1))
|
||||
end)
|
||||
end,
|
||||
--对目标造成自身[a]*[b]%的伤害,目标每减少[c]个伤害增加[d]%,
|
||||
--a[int],b[int],c[int],d[float]
|
||||
[146] = function(caster, target, args, interval, skill)
|
||||
local pro = args[1]
|
||||
local v1 = args[2]
|
||||
local i1 = args[3]
|
||||
local v2 = args[4]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
|
||||
local isBoss=BattleUtil.CheckIsBoss(target)
|
||||
if isBoss then
|
||||
return
|
||||
end
|
||||
-- 改变值 = 技能最大目标数 - 当前目标数
|
||||
local maxNum = skill:GetMaxTargetNum()
|
||||
local curNum = #skill:GetDirectTargets()
|
||||
local lessNum = max(maxNum - curNum, 0)
|
||||
local level = math.floor(lessNum/i1)
|
||||
local extra = BattleUtil.ErrorCorrection(level * v2)
|
||||
local damage=floor(target:GetRoleData(pro)*(v1+extra))
|
||||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||||
end)
|
||||
end,
|
||||
[147]=function(caster, target, args, interval, skill)
|
||||
target.isRealDead=true
|
||||
target:SetRelive(1, caster)
|
||||
end,
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3241,16 +3241,16 @@ local passivityList = {
|
|||
if not type then
|
||||
type=0
|
||||
end
|
||||
local onBeSkillCastEnd = function(skill)
|
||||
if type==0 and skill.type~=BattleSkillType.Normal then
|
||||
local onBeSkillCastEnd = function(atkRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
if type==0 and (skill.type~=BattleSkillType.Normal and skill.type~=BattleSkillType.ChaosNormal) then
|
||||
return
|
||||
end
|
||||
if type==1 and skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then
|
||||
return
|
||||
end
|
||||
BattleUtil.CalRage(role, skill.owner, i1, CountTypeName.Sub)
|
||||
BattleUtil.CalRage(role, atkRole, i1, CountTypeName.Sub)
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.BeSkillCastEnd, onBeSkillCastEnd,nil,nil,role)
|
||||
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeSkillCastEnd,nil,nil,role)
|
||||
end,
|
||||
|
||||
|
||||
|
@ -10259,27 +10259,40 @@ local passivityList = {
|
|||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillEnd,nil,nil,role)
|
||||
end,
|
||||
--敌方处于[a]类型[b]状态的单位死亡,自身立即获得全场[c]状态[d]类型buff层数*[e]的怒气
|
||||
--a[int],b[int],c[int],d[int],e[float]
|
||||
--敌方处于[a]类型[b]状态的单位死亡,自身立即获得全场[c]状态[d]类型buff层数*[e]的怒气,每回合触发[f]次
|
||||
--a[int],b[int],c[int],d[int],e[float],f[int]
|
||||
[405]=function(role,args,id,judge)
|
||||
local t1=args[1]
|
||||
local t2=args[2]
|
||||
local t3=args[3]
|
||||
local t4=args[4]
|
||||
local v1=args[5]
|
||||
local time=args[6]
|
||||
if args[6]==nil then
|
||||
time=1
|
||||
end
|
||||
local triggerTime=0
|
||||
local onRoleDead=function(defRole, atkRole)
|
||||
|
||||
if defRole and defRole.camp==role.camp then
|
||||
return
|
||||
end
|
||||
if BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.damageType == t2 end ) then
|
||||
if triggerTime>=time then
|
||||
return
|
||||
end
|
||||
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t1 and buff.damageType==t2 end)
|
||||
local len=BattleUtil.LengthOfTable(list)
|
||||
local num= floor(v1*len)
|
||||
BattleUtil.CalRage(role,role,num,CountTypeName.Add)
|
||||
triggerTime=triggerTime+1
|
||||
end
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead,onRoleDead,nil,nil,role)
|
||||
local onRoundChange=function()
|
||||
triggerTime=0
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange,onRoundChange,nil,nil,role)
|
||||
end,
|
||||
--第[a]回合必定命中
|
||||
--a[int]
|
||||
|
@ -10452,7 +10465,7 @@ local passivityList = {
|
|||
end)
|
||||
if #list>0 then
|
||||
for i = 1, #list do
|
||||
local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 end)
|
||||
local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 and buff.target==list[i] end)
|
||||
local len=BattleUtil.LengthOfTable(list2)
|
||||
if len<num then
|
||||
local buff=Buff.Create(role,t2,0,t3)
|
||||
|
|
|
@ -18,6 +18,20 @@ function Shield:SetData(...)
|
|||
self.sort = 4
|
||||
end
|
||||
|
||||
|
||||
local onRoleBeHit=function(atkRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
--damagetype为3 是 舍身济世分摊伤害
|
||||
if damageType==3 then
|
||||
return
|
||||
end
|
||||
if skill then --技能造成的直接伤害
|
||||
local rDamage = math.floor(damage*self.shieldValue)
|
||||
if rDamage ~= 0 then
|
||||
BattleUtil.ApplyDamage(nil,self.target,atkRole, rDamage)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--初始化后调用一次
|
||||
function Shield:OnStart()
|
||||
|
||||
|
@ -28,6 +42,8 @@ function Shield:OnStart()
|
|||
BattleLogic.BuffMgr:ClearBuff(self.target, function (buff)
|
||||
return buff.type == BuffName.Control or buff.type == BuffName.DOT
|
||||
end)
|
||||
elseif self.shieldType == ShieldTypeName.ThornsReduce then
|
||||
self.target.Event:AddEvent(BattleEventName.RoleBeHit,onRoleBeHit,nil,nil,self.target)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -179,6 +195,16 @@ function Shield:OnEnd()
|
|||
break
|
||||
end
|
||||
end
|
||||
elseif self.shieldType == ShieldTypeName.ThornsReduce then
|
||||
|
||||
self.target.Event:RemoveEvent(BattleEventName.RoleBeHit,onRoleBeHit,nil,nil,self.target)
|
||||
|
||||
for i = 1, self.target.shield.size do
|
||||
if self.target.shield.buffer[i] == self then
|
||||
self.target.shield:Remove(i)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.ShieldBuffEnd, self)
|
||||
end
|
||||
|
|
|
@ -332,6 +332,7 @@ ShieldTypeName = {
|
|||
NormalReduce = 1, -- 固定值减伤
|
||||
RateReduce = 2, -- 百分比减伤
|
||||
AllReduce = 3, -- 无敌护盾
|
||||
ThornsReduce = 4, --反伤盾
|
||||
}
|
||||
|
||||
--额外释放技能
|
||||
|
|
|
@ -441,8 +441,15 @@ function BattleUtil.ChooseTarget(role, chooseId)
|
|||
if list and #list>0 then
|
||||
arr=RoleManager.GetNeighbor(list[1], chooseType)
|
||||
end
|
||||
elseif chooseWeight ==15 then --敌方
|
||||
-- body
|
||||
elseif chooseWeight ==15 then --我方阵亡
|
||||
|
||||
local aaa=RoleManager.GetDeadRole(role.camp)
|
||||
if aaa~=nil then
|
||||
--LogError(aaa.position)
|
||||
end
|
||||
aaa.isRealDead=false
|
||||
table.insert(arr,aaa)
|
||||
-- return aaa
|
||||
end
|
||||
local finalArr = {}
|
||||
if num == 0 then
|
||||
|
@ -617,6 +624,9 @@ end
|
|||
|
||||
-- 计算真实伤害
|
||||
function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect)
|
||||
if defRole==nil then
|
||||
return
|
||||
end
|
||||
-- 灵兽无效
|
||||
if defRole.type == BattleUnitType.Monster or defRole.type == BattleUnitType.Player then
|
||||
return
|
||||
|
@ -1092,6 +1102,9 @@ end
|
|||
--没有暴击得治疗
|
||||
function BattleUtil.CalTreatNoCrit(castRole, targetRole, value, baseFactor,skill)
|
||||
-- 灵兽无效
|
||||
if targetRole==nil then
|
||||
return
|
||||
end
|
||||
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
|
||||
return
|
||||
end
|
||||
|
|
|
@ -7,6 +7,10 @@ local _DeadRoleList = {}
|
|||
local _ReliveRoleList = {}
|
||||
-- 所有角色
|
||||
local PosList = {}
|
||||
|
||||
|
||||
local RealDeadList={}
|
||||
|
||||
-- 删除节点
|
||||
local removeObjList = BattleList.New()
|
||||
-- 角色对象池
|
||||
|
@ -83,6 +87,16 @@ end
|
|||
function this.AddDeadRole(role)
|
||||
_DeadRoleList[role.position + role.camp * 6] = role
|
||||
end
|
||||
function this.GetDeadRole(type)
|
||||
if RealDeadList and #RealDeadList>0 then
|
||||
for i = 1, #RealDeadList do
|
||||
if RealDeadList[i].camp==type then
|
||||
return RealDeadList[i]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function this.RemoveDeadRole(role)
|
||||
if _DeadRoleList[role.position + role.camp * 6] then
|
||||
|
@ -101,8 +115,10 @@ function this.CheckDead()
|
|||
end
|
||||
end
|
||||
for _, pos in ipairs(removePos) do
|
||||
table.insert(RealDeadList,_DeadRoleList[pos])
|
||||
_DeadRoleList[pos] = nil
|
||||
end
|
||||
|
||||
return isDeadFrame
|
||||
end
|
||||
|
||||
|
@ -411,6 +427,7 @@ function this.Clear()
|
|||
|
||||
_DeadRoleList = {}
|
||||
_ReliveRoleList = {}
|
||||
RealDeadList = {}
|
||||
end
|
||||
|
||||
-- 多波
|
||||
|
|
Loading…
Reference in New Issue