64 lines
2.0 KiB
Lua
64 lines
2.0 KiB
Lua
|
|
|
|
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
|
|
|
Condition_Prop_Type = {
|
|
LV_100 = 1, -- 100级生效的属性
|
|
ELE_TEAM_ADD = 2, -- 元素属性
|
|
TEAM_ELE_NUM = 3,
|
|
}
|
|
|
|
|
|
Condition_Prop_Func = {
|
|
[Condition_Prop_Type.LV_100] = function(ower, target, propList, args)
|
|
|
|
local list = {}
|
|
if ower.tId == target.tId then -- 只对自己生效
|
|
local forNum = target.lv - 100
|
|
if forNum > 0 then
|
|
for propId, value in pairs(propList) do
|
|
list[propId] = value * forNum
|
|
end
|
|
end
|
|
end
|
|
return list
|
|
end,
|
|
|
|
[Condition_Prop_Type.ELE_TEAM_ADD] = function(ower, target, propList, args)
|
|
--
|
|
local config = heroConfig[target.tId]
|
|
-- 判断元素是否符合条件
|
|
--LogError("zhenyingid=="..target.zhenYingId)
|
|
-- LogError("target.did=="..target.dId)
|
|
local heroId=target.dId
|
|
local isTrue=HeroTempPropManager.IsTempHeroID(heroId)
|
|
if isTrue then
|
|
heroId=HeroTempPropManager.GetDynamicIdByTempId(heroId)
|
|
end
|
|
local heroData=HeroManager.GetSingleHeroData(heroId)
|
|
if config and args and heroData.changeProId == tonumber(args[1]) then
|
|
return propList
|
|
end
|
|
end,
|
|
[Condition_Prop_Type.TEAM_ELE_NUM] = function(ower, target, propList, args,teamInfo)
|
|
if teamInfo and teamInfo.teamHeroInfos and #teamInfo.teamHeroInfos > 0 then
|
|
local num=0
|
|
for _, hero in ipairs(teamInfo.teamHeroInfos) do
|
|
local heroData=HeroManager.GetSingleHeroData(hero.heroId)
|
|
if heroData and heroData.changeProId==args[1] then
|
|
-- LogError("")
|
|
num=num+1
|
|
end
|
|
end
|
|
local newProList={}
|
|
LogError("num=="..num)
|
|
for key, value in pairs(propList) do
|
|
newProList[key]=value*num
|
|
end
|
|
return newProList
|
|
end
|
|
|
|
end,
|
|
|
|
|
|
} |