战斗逻辑

back_recharge
lvxinran 2020-02-25 20:09:26 +08:00
parent a3716c257f
commit d70ce6c1f2
2 changed files with 54 additions and 1 deletions

View File

@ -1434,5 +1434,58 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.RoleBeDamaged, OnBeDamaged)
end,
--战斗中,若自己是[a],[d]改变[b]属性[c]。
--a[职业],b[属性],c[float],d[改变类型]
[76] = function(role, args)
local i1 = args[1]
local pro = args[2]
local f1 = args[3]
local ct = args[4]
if role.roleData.professionId == i1 then
if ct == 1 then --加算
role.data:AddValue(propertyList[pro], f1)
elseif ct == 2 then --乘加算(百分比属性加算)
role.data:AddPencentValue(propertyList[pro], f1)
elseif ct == 3 then --减算
role.data:SubValue(propertyList[pro], f1)
elseif ct == 4 then --乘减算(百分比属性减算)
role.data:SubPencentValue(propertyList[pro], f1)
end
end
end,
--战斗开始时,为自身施加[a]*[b]的护盾,持续[c]秒0为无限
--a[属性],b[float],c[int]
[77] = function(role, args)
local pro1 = args[1]
local f1 = args[2]
local f2 = args[3]
local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(propertyList[pro1])))
role:AddBuff(Buff.Create(role, BuffName.Shield, f2, val, 0))
end,
--战斗开始时,为自身回复[a]*[b]的血量。
--a[属性],b[float]
[78] = function(role, args)
local pro = args[1]
local f1 = args[2]
local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(propertyList[pro])))
BattleUtil.CalTreat(role, role, val)
end,
--战斗结束时,为自身回复[a]*[b]的血量。
--a[属性],b[float]
[79] = function(role, args)
local pro = args[1]
local f1 = args[2]
local OnEnd = function(order)
if order == BattleLogic.TotalOrder then
local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(propertyList[pro])))
BattleUtil.CalTreat(role, role, val)
end
end
BattleLogic.Event:AddEvent(BattleEventName.BattleOrderEnd, OnEnd)
end,
}
return passivityList

View File

@ -439,7 +439,7 @@ function BattleLogic.Update()
end
end
end
if bEnemyAllDead and BattleLogic.CurOrder < BattleLogic.TotalOrder then
if bEnemyAllDead then
BattleLogic.Event:DispatchEvent(BattleEventName.BattleOrderEnd, BattleLogic.CurOrder)
end
end