[战斗]====添加5, 6 condition 判断条件 添加buff类型 麒麟印加 放逐
parent
63448b9f1a
commit
8ce40e8099
|
@ -52,7 +52,71 @@ local _ConditionConfig = {
|
|||
local comValue = condition[3]
|
||||
-- 当前释放技能的单位的职业
|
||||
local professionId = skill.owner.professionId
|
||||
return professionId == comValue
|
||||
local skillCastEnd=function(skill2)
|
||||
if skill2.owner.camp==skill.owner.camp then
|
||||
local list=skill2:GetDirectTargetsNoMiss()
|
||||
if not list then
|
||||
return false
|
||||
end
|
||||
local num=0
|
||||
for key, value in pairs(list) do
|
||||
local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.DOT, function(buff) return buff.damageType == 1 and buff.caster==skill2.owner and buff.startRound == BattleLogic.GetCurRound() end)
|
||||
if isHave then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.SkillCastEnd,skillCastEnd)
|
||||
return skillCastEnd
|
||||
end,
|
||||
[5] = function(skill, condition) --5:敌方上场神将数量 且概率(万分比)
|
||||
local conId = condition[1]
|
||||
local comType = condition[2]
|
||||
local comValue = condition[3]
|
||||
local rand = condition[4]
|
||||
local roleList = RoleManager.Query(function(role)
|
||||
return role.camp ~= skill.owner.camp
|
||||
end)
|
||||
local isEnough=BattleUtil.CompareValue(#roleList, comValue, comType)
|
||||
local r = Random.Range01()
|
||||
-- 判断概率
|
||||
if isEnough then
|
||||
return r>rand/10000
|
||||
end
|
||||
return false
|
||||
end,
|
||||
[6] = function(skill, condition) --6:敌方任意神将生命百分比 【比较类型】 N(万分比)
|
||||
local conId = condition[1]
|
||||
local comType = condition[2]
|
||||
local comValue = condition[3]
|
||||
local round = condition[4]
|
||||
-- 获取该技能相同阵营人物
|
||||
local roleList = RoleManager.Query(function(role)
|
||||
return role.camp ~= skill.owner.camp
|
||||
end)
|
||||
-- 判断
|
||||
local r = Random.Range01()
|
||||
for _, role in ipairs(roleList) do
|
||||
local hpf = role:GetRoleData(RoleDataName.Hp) / role:GetRoleData(RoleDataName.MaxHp)
|
||||
if BattleUtil.CompareValue(hpf, comValue/10000, comType) then
|
||||
return round/10000>r
|
||||
end
|
||||
end
|
||||
return false
|
||||
end,
|
||||
[7] = function(skill, condition) --7:检测是否有可以放逐的目标
|
||||
local list=skill.owner.exileTargets
|
||||
if list then
|
||||
local roleList = RoleManager.Query(function(role)
|
||||
return role.camp ~= skill.owner.camp and not BattleUtil.ChecklistIsContainValue(list,role)
|
||||
end)
|
||||
if roleList and #roleList>0 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end,
|
||||
}
|
||||
|
||||
|
@ -61,6 +125,7 @@ function MCondition.CheckCondition(skill, condition)
|
|||
if not condition then
|
||||
return true
|
||||
end
|
||||
LogError("skill"..skill.id)
|
||||
local conId = condition[1]
|
||||
local comType = condition[2]
|
||||
local comValue = condition[3]
|
||||
|
|
|
@ -8,6 +8,8 @@ local BuffTypeToConfigType = {
|
|||
[BuffName.Shield] = 5,
|
||||
[BuffName.Immune] = 6,
|
||||
[BuffName.Curse] = 7,
|
||||
[BuffName.KylinMark] = 8,
|
||||
[BuffName.Exile] = 9,
|
||||
}
|
||||
local function _GetPropChangeBuffCType(pName)
|
||||
for cType, pn in ipairs(BattlePropList) do
|
||||
|
@ -39,6 +41,10 @@ local function _GetBuffEffectConfig(buff)
|
|||
cType = buff.immuneType
|
||||
elseif bType == BuffName.Curse then
|
||||
cType = buff.curseType
|
||||
elseif bType== BuffName.KylinMark then
|
||||
cType = 1
|
||||
elseif bType== BuffName.Exile then
|
||||
cType = 1
|
||||
end
|
||||
|
||||
local type = BuffTypeToConfigType[bType]
|
||||
|
|
Loading…
Reference in New Issue