【战斗】==========被动107 被动321 修改

dev_chengFeng
wangzhenxing 2021-05-14 17:48:57 +08:00
parent 5292b1441b
commit bcc175ea8f
4 changed files with 99 additions and 22 deletions

View File

@ -1917,17 +1917,23 @@ local passivityList = {
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeHit,nil,nil,role)
end,
-- 释放技能后自身回[a]点怒气
-- a[int]
-- 释放技能后自身回[a]点怒气,回怒概率[b]%(不填为100%)
-- a[int],b[float]
[107] = function(role, args,id,judge)
local i1 = args[1]
local p1 = args[2]
if not p1 then
p1=1
end
-- 释放技能后
local onSkillEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type == BattleSkillType.Special then
BattleUtil.RandomAction(p1, function ()
BattleUtil.CalRage(role, role, i1, CountTypeName.Add)
end)
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd,nil,nil,role)
@ -7008,24 +7014,25 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.RoleRageGrow, OnRageGrow,nil,nil,role)
end,
--[a]%概率受到的直接伤害变成[b],每回合最多触发[c]次
--a[float],b[int],c[int]
--[a]%概率受到的直接伤害变成[b],每回合最多触发[c]次,同一回合内每失败一次概率增加[d]%
--a[float],b[int],c[int],d[float]
[321] = function(role, args,id,judge)
local p1 = args[1]
local damage1=args[2]
local v1 =args[3]
local p2 = args[4]
local curRound=1
local time=0
local curDamage = 0
local function onRoundChange(round)
if round==curRound+1 then
p1=args[1]
time=0
end
curRound=round
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange,nil,nil,role)
local function onFinalBeDamage(damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType,isDirect)
-- 非直接伤害不免除
if not skill and not isDirect then
@ -7037,13 +7044,15 @@ local passivityList = {
if time>=v1 then
return
end
BattleUtil.RandomAction(p1, function ()
local isTrigger=BattleUtil.RandomAction(p1, function ()
curDamage=floor(damage-damage1)
if damagingFunc then damagingFunc(curDamage) end
time=time+1
p1=args[1]
end)
if not isTrigger then
p1=p1+p2
end
end
role.Event:AddEvent(BattleEventName.FinalBeDamageEnd, onFinalBeDamage,nil,nil,role)
end,

View File

@ -450,7 +450,6 @@ function BattleLogic.BattleEnd(result)
BattleLogic.IsEnd = true
BattleLogic.Result = result
BattleLogic.Event:DispatchEvent(BattleEventName.BattleEnd, result)
LogError("/////////////")
if hardStageId and hardStageId~=0 then
--获取精英副本 星级信息
local hardStageConfig=ConfigManager.GetConfigData(ConfigName.HardStage,hardStageId)
@ -463,9 +462,6 @@ function BattleLogic.BattleEnd(result)
table.insert(levelStarRecord,v1)
end
end
for i = 1, #levelStarRecord do
LogError("星级记录"..levelStarRecord[i])
end
end
end

View File

@ -4,7 +4,6 @@ local this = HardStageCondition
local _ConditionConfig = {
--通过关卡
[1]=function(condition)
LogError("aaaaaaaaaaaaaaaaaaa")
if BattleLogic.Result==1 then
return 1
end
@ -14,7 +13,6 @@ local _ConditionConfig = {
[2]=function(condition)
local v1 = condition[1]
local round,maxRound=BattleLogic.GetCurRound()
LogError(" "..v1.." "..round)
if round<=v1 then
return 1
end
@ -36,9 +34,7 @@ local _ConditionConfig = {
local record=HardStageEventManager.GetRoundDamageRecord()
if record then
for key, value in pairs(record) do
LogError(" round=="..value[1].." value=="..value[2])
if key<=v1 and value[2]>=v2 then
LogError("伤害达标!!!!")
return 1
end
end
@ -77,7 +73,6 @@ local _ConditionConfig = {
[8]=function(condition)
local v1 = condition[1]
local list = RoleManager.Query(function(v) return v.camp == 0 and v.element==v1 end)
LogError(" 8 len== "..BattleUtil.LengthOfTable(list))
if BattleUtil.LengthOfTable(list)==0 then
return 1
end
@ -93,7 +88,6 @@ local _ConditionConfig = {
for i = 1, #list do
local isHave=list[i]:CheckHavePassive(v1)
if isHave then
LogError("有改魂印")
return 1
end
end
@ -104,7 +98,6 @@ local _ConditionConfig = {
local v1 = condition[1]
local data=BattleLogic.GetPlayerMonsterData()
if data and BattleUtil.LengthOfTable(data)>v1 then
LogError("灵兽数量不符合")
return 0
end
return 1
@ -113,13 +106,33 @@ local _ConditionConfig = {
[11]=function(condition)
local v1 = condition[1]
local list = RoleManager.Query(function(v) return v.camp == 0 and v.professionId~=v1 end)
LogError(" 11 len== "..BattleUtil.LengthOfTable(list))
if BattleUtil.LengthOfTable(list)==0 then
LogError("阵容符合")
return 1
end
return 0
end,
--达成[a]次斩杀
[12]=function(condition)
local v1 = condition[1]
local num=HardStageEventManager.GetSeckKillNum()
if v1 and num>=v1 then
return 1
end
return 0
end,
--控制[a]类型 [b]次
[13]=function(condition)
local v1 = condition[1]
local v2 = condition[2]
local list=HardStageEventManager.GetCtrlNumList()
if list and list[v1] then
if list[v1]>=v2 then
return 1
end
end
return 0
end,
}

View File

@ -6,16 +6,76 @@ local recordRound=1
local roundDamage=0
--记录的回合伤害
local recordRoundDamage
--记录追击击杀单位
local recordAddKill
--斩杀次数
local seckKillNum=0
--控制次数集合
local ctrlNumList
function this.Init()
recordRound=1
roundDamage=0
seckKillNum=0
CurRound=0
recordRoundDamage={}
recordAddKill={}
ctrlNumList={}
BattleLogic.Event:AddEvent(BattleEventName.RecordDamage,this.OnRecordDamage)
BattleLogic.Event:AddEvent(BattleEventName.Seckill,this.OnSeckill)
BattleLogic.Event:AddEvent(BattleEventName.BuffRoundChange,this.OnRoundChange)
BattleLogic.Event:AddEvent(BattleEventName.RecordBuff,this.OnBuffAdd)
end
function this.ClearEvent()
BattleLogic.Event:RemoveEvent(BattleEventName.RecordDamage,this.OnRecordDamage)
BattleLogic.Event:RemoveEvent(BattleEventName.Seckill,this.OnSeckill)
BattleLogic.Event:RemoveEvent(BattleEventName.BuffRoundChange,this.OnRoundChange)
BattleLogic.Event:RemoveEvent(BattleEventName.RecordBuff,this.OnBuffAdd)
end
--buff添加成功
function this.OnBuffAdd(caster,target,buff)
if caster and target and buff then
if caster.camp==0 and buff.type==BuffName.Control then
local type=buff.ctrlType
LogError("ctrltype=="..type)
if ctrlNumList[type] then
ctrlNumList[type]=ctrlNumList[type]+1
else
table.insert(ctrlNumList,type)
ctrlNumList[type]=1
end
end
end
end
--获取控制集合
function this.GetCtrlNumList()
return ctrlNumList
end
--回合数据改变
function this.OnRoundChange(round)
CurRound=round
end
function this.OnSeckill(atkRole,defRole)
if not atkRole and not defRole then
if atkRole.camp==0 and defRole.camp==1 and not BattleUtil.CheckIsNoDead(defRole) then
seckKillNum=seckKillNum+1
end
end
end
--获取斩杀次数
function this.GetSeckKillNum()
return seckKillNum
end
--记录伤害
function this.OnRecordDamage(atkRole,defRole,damage)
if not atkRole or atkRole.camp==1 then
@ -23,7 +83,6 @@ function this.OnRecordDamage(atkRole,defRole,damage)
end
local curRound,maxRound=BattleLogic.GetCurRound()
CurRound=curRound
LogError("damage=="..damage)
--如果进入下一回合,记录上一回合的伤害
if CurRound==recordRound+1 then
table.insert(recordRoundDamage,{recordRound,roundDamage})