| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929 |
- local Util = require("common.Util")
- local CombatBuff = require("combat.CombatBuff")
- local CombatDefine = require("combat.CombatDefine")
- local CombatImpl = require("combat.CombatImpl")
- local Skill = require("combat.Skill")
- local CombatObj = require("combat.CombatObj")
- local RoleAttr = require("role.RoleAttr")
- local RoleDefine = require("role.RoleDefine")
- local HeroExcel = require("excel.hero").hero
- local SkillExcel = require("excel.skill").skill
- local BufferExcel = require("excel.buffer").buffer
- local FuwenExcel = require("excel.fuwen")
- local SkinSkillExcel = require("excel.skin").skill
- local BingshuLogic = require("fuwen.BingshuLogic")
- local ProjectLogic = require("platform.ProjectLogic")
- local HeroDefine = require("hero.HeroDefine")
- local tbFuwenSkillGroupID = {}
- local posSortBySpeed = posSortBySpeed or {}
- function initBeSkill(obj)
- obj.beSkillList = {}
- obj.beSkillListTemp = {}
- end
- function setBeSkillID(obj, skillID, isFuWenSkill)
- if obj.beSkillListTemp[skillID] then return end
- local skillConfig = SkillExcel[skillID]
- if skillConfig.need > obj.quality then return end
- if skillConfig.beSkillType == 0 then return end
- if skillConfig.beSkillType == BESKILL_TYPE24 then
- obj.beSkillListTemp[BESKILL_TYPE24] = obj.beSkillListTemp[BESKILL_TYPE24] or {}
- obj.beSkillListTemp[BESKILL_TYPE24][#obj.beSkillListTemp[BESKILL_TYPE24] + 1] = {
- skillID,
- skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,
- skillConfig.cd[2] or 0,
- isFuWenSkill or 0}
- for _,skillID in ipairs(skillConfig.args) do
- local skillConfig = SkillExcel[skillID]
- if not obj.beSkillListTemp[skillID] and skillConfig.need <= obj.quality then
- obj.beSkillList[skillConfig.beSkillType] = obj.beSkillList[skillConfig.beSkillType] or {}
- obj.beSkillList[skillConfig.beSkillType][#obj.beSkillList[skillConfig.beSkillType] + 1] = {
- skillID,
- skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,
- skillConfig.cd[2] or 0,
- isFuWenSkill or 0}
- obj.beSkillListTemp[skillID] = 1
- end
- end
- else
- obj.beSkillList[skillConfig.beSkillType] = obj.beSkillList[skillConfig.beSkillType] or {}
- obj.beSkillList[skillConfig.beSkillType][#obj.beSkillList[skillConfig.beSkillType] + 1] = {
- skillID,
- skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,
- skillConfig.cd[2] or 0,
- isFuWenSkill or 0}
- obj.beSkillListTemp[skillID] = 1
- end
- end
- function setBeSkill(obj, config, skinConf, monsterOutConfig)
- local temp = {}
- local confBeskillID = skinConf and skinConf.beSkillList or config.beSkillList
- for _,skillID in ipairs(confBeskillID) do
- setBeSkillID(obj,skillID)
- end
- -- 加载 赋能技能 这个策划说放到最后
- if config.bePvPSkillList and CombatImpl.isPVP == 1 then
- for _,skillID in ipairs(config.bePvPSkillList) do
- setBeSkillID(obj, skillID)
- end
- end
- -- 怪物组附加的被动技能
- if monsterOutConfig then
- for _, skillID in ipairs(monsterOutConfig) do
- setBeSkillID(obj,skillID)
- end
- end
-
- -- 符文被动技能
- -- 符文技能效果这里 如果有多个同类型的技能 效果不叠加 只取最高等级的那个技能的效果
- if obj.fuwen or obj.bingshu then
- local hasFuwenBeSkill = nil
- Util.initTable(tbFuwenSkillGroupID)
- if obj.fuwen then
- for i = 1, 2 do
- local fuwenGrid = obj.fuwen[i]
- if fuwenGrid and fuwenGrid.skill then
- for j = 1, #fuwenGrid.skill do
- local fuwenSkillID = fuwenGrid.skill[j]
- local fuwenSkillConfig = FuwenExcel.skill[fuwenSkillID]
- local fuwenGroupID = fuwenSkillConfig.groupID
- if fuwenSkillConfig.fuwenBeSkill ~= 0 then
- hasFuwenBeSkill = true
- if tbFuwenSkillGroupID[fuwenGroupID] then
- if tbFuwenSkillGroupID[fuwenGroupID] < fuwenSkillID then
- tbFuwenSkillGroupID[fuwenGroupID] = fuwenSkillID
- end
- else
- tbFuwenSkillGroupID[fuwenGroupID] = fuwenSkillID
- end
- end
- end
- end
- end
- end
- if obj.bingshu then
- for i = 1, BingshuLogic.BINGSHU_MAXCNT do
- local bingshuGrid = obj.bingshu[i]
- if bingshuGrid then
- local skillID = bingshuGrid.skillID
- local skillConfig = FuwenExcel.skill[skillID]
- local groupID = skillConfig.groupID
- hasFuwenBeSkill = true
- if (tbFuwenSkillGroupID[groupID] or 0) < skillID then
- tbFuwenSkillGroupID[groupID] = skillID
- end
- end
- end
- end
- if hasFuwenBeSkill == true then
- for groupID, skillIDTemp in pairs(tbFuwenSkillGroupID) do
- local fuwenSkillConfig = FuwenExcel.skill[skillIDTemp]
- local fuwenBeSkillID = fuwenSkillConfig.fuwenBeSkill
- setBeSkillID(obj,fuwenBeSkillID, 1)
- end
- end
- end
- end
- function setPetBeSkill(obj)
- --if obj
- local skillConfig = SkillExcel[1999]
- if skillConfig then
- obj.beSkillList = obj.beSkillList or {}
- obj.beSkillList[skillConfig.beSkillType] = obj.beSkillList[skillConfig.beSkillType] or {}
- obj.beSkillList[skillConfig.beSkillType][#obj.beSkillList[skillConfig.beSkillType] + 1] = {1999,skillConfig.beSkillLimit > 0 and skillConfig.beSkillLimit,skillConfig.cd[1] or 0,skillConfig.cd[2] or 0}
- end
- end
- --被动技能类型
- BESKILL_TYPE1 = 1 --普攻附带
- BESKILL_TYPE2 = 2 --被击触发
- BESKILL_TYPE3 = 3 --自身生命低于参数
- BESKILL_TYPE4 = 4 --自己暴击触发
- BESKILL_TYPE5 = 5 --受到技能伤害
- BESKILL_TYPE6 = 6 --自己攻击被格挡
- BESKILL_TYPE7 = 7 --受到暴击触发
- BESKILL_TYPE8 = 8 --自己格挡触发(其他单位对自己发动攻击,自己触发格挡)
- BESKILL_TYPE9 = 9 --敌方英雄触发格挡
- BESKILL_TYPE10 = 10 --自己受持续状态伤害
- BESKILL_TYPE11 = 11 --自己受控制类状态
- BESKILL_TYPE12 = 12 --场上有英雄被添加燃烧状态
- BESKILL_TYPE13 = 13 -- 我方英雄施放主动技能
- BESKILL_TYPE14 = 14 -- 我方英雄暴击
- BESKILL_TYPE15 = 15 -- 自己死亡
- BESKILL_TYPE16 = 16 --我方英雄死亡
- BESKILL_TYPE17 = 17 --敌方英雄死亡
- BESKILL_TYPE18 = 18 --有英雄死亡
- BESKILL_TYPE19 = 19 --回合开始
- BESKILL_TYPE20 = 20 --回合结束
- BESKILL_TYPE23 = 23 --激活就生效(计入面板属性)
- BESKILL_TYPE24 = 24 --技能包
- BESKILL_TYPE25 = 25 --替换初始普攻
- BESKILL_TYPE26 = 26 --激活就生效(进入战斗前算。不计入面板属性)
- BESKILL_TYPE27 = 27 --魔兽回能量被动
- BESKILL_TYPE28 = 28 --自身触发格挡次数
- BESKILL_TYPE29 = 29 --有人受到缠绕时
- BESKILL_TYPE30 = 30 --使生命低于x时
- BESKILL_TYPE31 = 31 --任意英雄释放主动技能
- BESKILL_TYPE32 = 32 --战斗开始时触发
- BESKILL_TYPE33 = 33 --复活时触发
- BESKILL_TYPE34 = 34 --使用主动技能时
- BESKILL_TYPE35 = 35 --自身击杀敌人时
- BESKILL_TYPE36 = 36 --攻击回合结束时触发
- BESKILL_TYPE37 = 37 --物攻后触发
- BESKILL_TYPE38 = 38 --法攻后触发
- BESKILL_TYPE39 = 39 --攻击附带 (普攻 主动 都算)
- BESKILL_TYPE40 = 40 --攻击前根据条件判断是否触发(小战斗回合,针对每个对象单独判断)
- BESKILL_TYPE41 = 41 --实际扣血前触发
- BESKILL_TYPE42 = 42 --由其他英雄的buff触发
- BESKILL_TYPE43 = 43 --被某个技能打死
- BESKILL_TYPE44 = 44 --自己暴击+反击触发
- BESKILL_TYPE45 = 45 --计算伤害时触发
- BESKILL_TYPE46 = 46 --攻击附带 (普攻 主动 连击 反击都算)
- BESKILL_TYPE47 = 47 --每回合叠加属性
- BESKILL_TYPE48 = 48 --死亡英雄伤害率
- BESKILL_TYPE49 = 49 --加血变成减血
- BESKILL_TYPE50 = 50 --每回合触发 降低对方首次攻击目标伤害率
- BESKILL_TYPE51 = 51 --场上有英雄被添加诅咒状态
- BESKILL_TYPE52 = 52 --场上有英雄被攻击
- BESKILL_TYPE53 = 53 --场上有英雄有特定被动技能 友军普攻触发
- BESKILL_TYPE54 = 54 --场上有英雄特定buff 伤害加成
- BESKILL_TYPE55 = 55 --场上有英雄指定buff层数 额外伤害加成
- BESKILL_TYPE56 = 56 --场上有英雄特定bufer且概率产生
- BESKILL_TYPE57 = 57 --特定buff被引爆消除时 触发的效果
- BESKILL_TYPE58 = 58 --指定技能暴击
- BESKILL_TYPE59 = 59 --没有暴击触发一个效果
- BESKILL_TYPE60 = 60 --暴击加成
- BESKILL_TYPE61 = 61 --技能未击杀目标时触发
- BESKILL_TYPE62 = 62 --回合开始生命值触发
- BESKILL_TYPE63 = 63 --回合开始生命值触发
- BESKILL_TYPE64 = 64 --冰冻buffer被击碎
- BESKILL_TYPE65 = 65 --场上有英雄有特定被动技能 友军普攻暴击触发
- BESKILL_TYPE66 = 66 --敌方死亡特定buff触发
- BESKILL_TYPE67 = 67 --血量低于多少跟受控制触发
- BESKILL_TYPE68 = 68 --血族英雄特殊处理
- BESKILL_TYPE69 = 69 --血族英雄特殊处理
- BESKILL_TYPE70 = 70 --增加的属性激活就生效(计入面板属性)并且概率连击
- NO_CHECK_FANJI_LIST = {
- [BESKILL_TYPE3] = 1,
- [BESKILL_TYPE15] = 1,
- [BESKILL_TYPE16] = 1,
- [BESKILL_TYPE17] = 1,
- [BESKILL_TYPE18] = 1,
- [BESKILL_TYPE35] = 1,
- [BESKILL_TYPE36] = 1,
- [BESKILL_TYPE37] = 1,
- [BESKILL_TYPE38] = 1,
- [BESKILL_TYPE44] = 1,
- [BESKILL_TYPE46] = 1,
- }
- NO_CHECK_COMBO_LIST = {
- [BESKILL_TYPE1] = 1,
- [BESKILL_TYPE3] = 1,
- [BESKILL_TYPE14] = 1,
- [BESKILL_TYPE16] = 1,
- [BESKILL_TYPE17] = 1,
- [BESKILL_TYPE18] = 1,
- [BESKILL_TYPE35] = 1,
- [BESKILL_TYPE34] = 1,
- [BESKILL_TYPE25] = 1,
- [BESKILL_TYPE46] = 1,
- [BESKILL_TYPE37] = 1,
- }
- local function checkLimit(data)
- if data[2] and data[2] <= 0 then
- return
- end
-
- if data[4] > 0 and data[3] > CombatImpl.round then
- return
- end
- return true
- end
- local function canUse(obj,data)
- if obj.isPet then
- return true
- end
- --被动技能次数限制判断
- if not checkLimit(data) then
- return
- end
-
- local skillConfig = SkillExcel[data[1]]
- if not NO_CHECK_FANJI_LIST[skillConfig.beSkillType] and CombatImpl.isFanji then
- return
- end
-
- if not NO_CHECK_COMBO_LIST[skillConfig.beSkillType] and CombatImpl.comboType > 0 then
- return
- end
- local bNotFeng = nil
- -- boss 被动不能被封印
- -- 世界boss模式下 boss不受feng状态影响
- if CombatImpl.fightMode[1] == CombatDefine.FIGHT_MODE3 then
- if obj.type == CombatDefine.COMBAT_OBJ_TYPE3 then
- bNotFeng = true
- end
- end
- if not bNotFeng and CombatBuff.isStatus(obj,{"banBeSkill","feng"}) then
- return
- end
- data[3] = data[3] + data[4]
- local beSkillArgs = skillConfig.beSkillArgs
- local ret = true
- --被动技能触发条件判断
- if beSkillArgs[1] then
- if beSkillArgs[1] == "hp" then
- local hp = obj.hp
- local hpMax = CombatObj.getHpMax(obj)
- if hp > hpMax * beSkillArgs[2]/10000 then
- ret = false
- end
- elseif beSkillArgs[1] == "hpOrControl" then
- ret = false
- local hp = obj.hp
- local hpMax = CombatObj.getHpMax(obj)
- if hp <= hpMax * beSkillArgs[2]/10000 then
- ret = true
- end
- if CombatBuff.isAtControl(obj) then
- ret = true
- end
- elseif beSkillArgs[1] == "fanji" then
- local r = math.random(0,10000)
- if r > beSkillArgs[2] then
- return
- end
- elseif beSkillArgs[1] == "pos" then
- local pos = obj.pos
- ret = false
- if beSkillArgs[2] then
- for i = 1,#beSkillArgs[2] do
- if pos == beSkillArgs[2][i] then
- ret = true
- break
- end
- end
- end
- elseif beSkillArgs[1] == "noBuffCmd" then
- return not CombatBuff.isStatus(obj,beSkillArgs[2])
- elseif beSkillArgs[1] == "attackerBuffCmd" then
- local isStatus,cmd = CombatBuff.isStatus(obj,beSkillArgs[2])
- return isStatus
- elseif beSkillArgs[1] == "myjob" then
- ret = false
- for k,v in ipairs(beSkillArgs[2]) do
- if v == obj.job then
- ret = true
- break
- end
- end
- elseif beSkillArgs[1] == "sideLimit" then
- for k,v in ipairs(beSkillArgs[2]) do
- local useCnt = CombatImpl.getBeSkillSideUse(obj.pos,v[1])
- if useCnt >= v[2] then
- return
- end
- end
- elseif beSkillArgs[1] == "firstAttackOrder" then
- local side = obj.side
- if side then
- local isFirstAttack = CombatImpl.firstAttack[side]
- if beSkillArgs[2] == 1 then
- return isFirstAttack
- else
- return not isFirstAttack
- end
- end
- end
- end
- if ret and data[2] then
- data[2] = data[2] - 1
- end
-
- if skillConfig.cmd == "hp" then
- local hp = obj.hp
- local targetMode = skillConfig.args[3]
- --英雄血量为0时不能加血
- if (hp <= 0 or CombatBuff.isStatus(obj,{"revive"})) and targetMode and targetMode[1] == 10 then
- ret = false
- end
- end
- return ret
- end
- --被攻击触发,需要判断攻击者状态的被动技能
- local function canUseOnHit(obj,data)
- if not obj then
- return true
- end
- local skillConfig = SkillExcel[data[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- local condCmd = beSkillArgs[1]
- if condCmd == "job" then
- for _,job in ipairs(beSkillArgs[2]) do
- if obj.job == job then
- return true
- end
- end
- return false
- elseif condCmd == "buffCmd" then
- return CombatBuff.isStatus(obj,beSkillArgs[2])
- elseif condCmd == "targetHp" then
- local hp = obj.hp
- local checkHp = CombatObj.getHpMax(obj) * beSkillArgs[3] / 10000
- if beSkillArgs[2] == 1 and hp > checkHp then
- return true
- elseif beSkillArgs[2] == 2 and hp < checkHp then
- return true
- end
- else
- return true
- end
- end
- local function isCanRevive(obj, attacker , data)
- local skillConfig = SkillExcel[data[1]]
- if skillConfig.cmd == "shengling" or
- skillConfig.cmd == "revive" then
- if skillConfig.cmd == "shengling" and CombatImpl.checkSideResult(obj.pos) == true then -- 如果是队伍最后一个死亡的不释放 圣灵复活
- return false
- end
- if CombatBuff.canRevive(obj) ~= true then
- return false
- end
- if skillConfig.cmd == "shengling" then
- if CombatBuff.isStatus(obj,{"revive"}) then
- return false
- end
- end
- if attacker and attacker.beSkillList then
- for k,skillList in pairs(attacker.beSkillList) do
- for j,v in pairs(skillList) do
- local config = SkillExcel[v[1]]
-
- if config and skillConfig.cmd == "shengling" and config.cmd == "noShengling" then --击杀方有 不准圣灵复活被动
- return false
- elseif config and config.cmd == "noRevive" then -- 击杀方 有不准复活的
- if #config.args > 0 then
- local canNum = config.args[1]
- local random = math.random(1, 10000)
- if random > canNum then -- noRevive 概率不生效
- return true
- else
- return false
- end
- end
- return true
- end
- end
- end
-
- end
- end
- return true
- end
- function onSkillID(obj,skillID)
- local skillConfig = SkillExcel[skillID]
- if skillConfig.type == CombatDefine.SKILL_TYPE1 and obj.beSkillList[BESKILL_TYPE25] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE25]) do
- if canUse(obj,v) then
- local conf = SkillExcel[v[1]]
- return conf.args[1]
- end
- end
- end
- return skillID
- end
- local function use(attacker,targets,data,newFrame, packBuff)
- if canUse(attacker,data) and canUseOnHit(targets and targets[1],data) then
- --print("beskill realuse:",attacker.pos,data[1])
- local skillConfig = SkillExcel[data[1]]
- local ret
- -- 二次元连击触发帧不新加帧
- if ProjectLogic.isSsecy() and skillConfig.cmd == "combo" then
- newFrame = false
- end
- if packBuff then
- CombatImpl.afterBuff()
- end
- if Skill.CMD[skillConfig.cmd] then
- if newFrame or CombatImpl.isSkillFrameEmpty() then
- --进入战斗时,未加入任何战斗帧触发被动技能时,先添加被动技能的战斗帧,可以在这个战斗帧上挂被动技能引发的额外作用
- CombatImpl.addFrame()
- CombatImpl.setSkillID(attacker, data[1])
- end
- ret = Skill.CMD[skillConfig.cmd](attacker,skillConfig,targets)
- end
- local isAddSkillFrame = CombatBuff.onUseBeSkill(attacker,skillConfig,targets,ret)
- --判断是否加喊话
- if skillConfig.contentType > 0 then
- if isAddSkillFrame then
- CombatImpl.addSaySkill(attacker,skillConfig)
- elseif ret or skillConfig.beSkillType == BESKILL_TYPE26 or
- skillConfig.beSkillType == BESKILL_TYPE23 or
- skillConfig.beSkillType == BESKILL_TYPE4 or
- skillConfig.beSkillType == BESKILL_TYPE44 then
- if CombatImpl.isSkillFrameEmpty() then
- CombatImpl.addFrame()
- CombatImpl.setSkillID(attacker, data[1])
- end
- CombatImpl.setSaySkill(attacker.pos,skillConfig.id,skillConfig.contentType)
- end
- end
- CombatImpl.addBeSkillPosUse(attacker.pos,data[1])
- end
- end
- function onHit(attacker,targets,skillID)
- if attacker.isPet then
- return
- end
- local useSkillConfig = SkillExcel[skillID]
- if useSkillConfig.type == CombatDefine.SKILL_TYPE2 then
- --[[for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE13] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE13]) do
- use(obj,targets,v)
- end
- end
- end]]
- if attacker.beSkillList[BESKILL_TYPE34] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE34]) do
- local skillConfig = SkillExcel[v[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- if beSkillArgs[1] == "attackerBuffCmd" and beSkillArgs[2][1] == "shayi" then
- local shayiCnt = CombatBuff.getBuffCnt(attacker,"shayi")
- if shayiCnt > 0 then
- for i = 1,shayiCnt do
- use(attacker,targets,v,true)
- CombatImpl.instantFrameBuffer(attacker,v[1])
- end
- end
- CombatBuff.delShayi(attacker)
- elseif beSkillArgs[1] == "qusanNeedCmd" then
- local canUse = false
- for h,need in ipairs(beSkillArgs[2]) do
- if need == useSkillConfig.cmd then
- canUse = true
- break
- end
- end
- if canUse == true then
- use(attacker,targets,v,true)
- end
- elseif beSkillArgs[1] == "jiekongNeedCmd" then
- local canUse = false
- for h,need in ipairs(beSkillArgs[2]) do
- if need == useSkillConfig.cmd then
- canUse = true
- break
- end
- end
- if canUse == true then
- use(attacker,targets,v,true)
- end
- elseif beSkillArgs[1] == "skillID" then
- local canUse = false
- for _,v in ipairs(beSkillArgs[2]) do
- if skillID == v then
- canUse = true
- break
- end
- end
- if canUse == true then
- use(attacker,targets,v,true)
- end
- else
- use(attacker,targets,v)
- end
- end
- end
- end
- --非攻击性主动技能不处理被击被动技能
- if CombatObj.getValue(attacker,RoleDefine.HURT_COMBAT_NOW) <= 0 then
- if (useSkillConfig.type == CombatDefine.SKILL_TYPE1 or useSkillConfig.type == CombatDefine.SKILL_TYPE2) then
- if attacker.beSkillList[BESKILL_TYPE39] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE39]) do
- use(attacker,targets,v)
- end
- end
- if attacker.beSkillList[BESKILL_TYPE70] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE70]) do
- use(attacker,targets,v)
- end
- end
- end
- return
- end
- if useSkillConfig.type == CombatDefine.SKILL_TYPE1 and attacker.beSkillList[BESKILL_TYPE1] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE1]) do
- use(attacker,targets,v)
- end
- end
- if useSkillConfig.type == CombatDefine.SKILL_TYPE2 and attacker.beSkillList[BESKILL_TYPE61] then
- local canUseSkill = true
- for index = 1, #targets do
- local target = targets[index]
- if target.hp <=0 then
- canUseSkill = false
- end
- end
- if canUseSkill then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE61]) do
- local skillConfig = SkillExcel[v[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- if beSkillArgs[1] == "skillID" then
- local canUse = false
- for _,v in ipairs(beSkillArgs[2]) do
- if skillID == v then
- canUse = true
- break
- end
- end
- if canUse then
- use(attacker,{},v)
- end
- end
- end
- end
- end
-
- if (useSkillConfig.type == CombatDefine.SKILL_TYPE1 or useSkillConfig.type == CombatDefine.SKILL_TYPE2 or useSkillConfig.type == CombatDefine.SKILL_TYPE3) then
- if attacker.beSkillList[BESKILL_TYPE39] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE39]) do
- use(attacker,targets,v)
- end
- end
- if attacker.beSkillList[BESKILL_TYPE46] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE46]) do
- use(attacker,targets,v)
- end
- end
- if attacker.beSkillList[BESKILL_TYPE70] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE70]) do
- use(attacker,targets,v)
- end
- end
- end
- local isDefendSideGedang = false
- local baojiDefender = {}
-
- for _,target in ipairs(targets) do
- if target.beSkillList[BESKILL_TYPE2] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE2]) do
- use(target,{attacker},v)
- end
- end
- -- 友军受击
- for _,pos in ipairs(CombatDefine.SIDE2POS[target.side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.pos ~= target.pos and obj.beSkillList[BESKILL_TYPE52] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE52]) do
- use(target,{attacker},v)
- end
- end
- end
-
- if useSkillConfig.type == CombatDefine.SKILL_TYPE2 and target.beSkillList[BESKILL_TYPE5] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE5]) do
- use(target,{attacker},v)
- end
- end
-
- if target.isGedang then
- isDefendSideGedang = true
- if target.beSkillList[BESKILL_TYPE8] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE8]) do
- use(target,{attacker},v)
- end
- end
-
- if attacker.beSkillList[BESKILL_TYPE6] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE6]) do
- use(attacker,{target},v)
- end
- end
-
- --目标触发格挡次数
- if target.beSkillList[BESKILL_TYPE28] then
- for _, v in ipairs(target.beSkillList[BESKILL_TYPE28]) do
- local skillConfig = SkillExcel[v[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- if beSkillArgs[1] == "gedang" then
- target.isGedangCnt = target.isGedangCnt or 0
- local geDangLimit = beSkillArgs[2]
- if target.isGedangCnt >= geDangLimit then
- target.isGedangCnt = 0
- use(target,{attacker},v)
- end
- end
- end
- end
- end
-
- local chanRao = CombatBuff.isChanRao(target)
- if chanRao then
- if target.beSkillList[BESKILL_TYPE29] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE29]) do
- use(target,{attacker},v)
- end
- end
- end
-
- if target.isBaoji then
- if target.beSkillList[BESKILL_TYPE7] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE7]) do
- use(target,{attacker},v)
- end
- end
- baojiDefender[#baojiDefender+1] = target
- end
-
- end
- local side = attacker.side
- local defendSide = side == CombatDefine.ATTACK_SIDE and CombatDefine.DEFEND_SIDE or CombatDefine.ATTACK_SIDE
-
- --普通技能触发
- if useSkillConfig.type == CombatDefine.SKILL_TYPE1 then
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE53] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE53]) do
- use(attacker,targets,v)
- end
- end
- end
- end
- --主动技能触发
- if useSkillConfig.type == CombatDefine.SKILL_TYPE2 then
- for _,pos in ipairs(CombatDefine.SIDE2POS[0]) do
- local obj = CombatImpl.objList[pos]
- local objSide = pos <= 6 and CombatDefine.ATTACK_SIDE or CombatDefine.DEFEND_SIDE
- --触发自己这方的
- if side == objSide then
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE13] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE13]) do
- use(obj,targets,v)
- end
- end
- end
-
- --触发任意一方
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE31] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE31]) do
- use(obj,targets,v)
- end
- end
- end
- end
- if not attacker.isBaoji then
- --指定技能没有暴击
- if attacker.beSkillList[BESKILL_TYPE59] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE59]) do
- local skillConfig = SkillExcel[v[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- if beSkillArgs[1] == "skillID" then
- local canUse = false
- for _,v in ipairs(beSkillArgs[2]) do
- if skillID == v then
- canUse = true
- break
- end
- end
- if canUse then
- use(attacker,{},v)
- end
- end
- end
- end
- end
- if attacker.isBaoji then
- --普通暴击技能触发
- if useSkillConfig.type == CombatDefine.SKILL_TYPE1 then
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE65] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE65]) do
- use(attacker,targets,v)
- end
- end
- end
- end
- if attacker.beSkillList[BESKILL_TYPE4] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE4]) do
- use(attacker,baojiDefender,v)
- end
- end
- if attacker.beSkillList[BESKILL_TYPE44] and CombatImpl.isFanji then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE44]) do
- use(attacker,baojiDefender,v)
- end
- end
- --指定技能暴击
- if attacker.beSkillList[BESKILL_TYPE58] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE58]) do
- local skillConfig = SkillExcel[v[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- if beSkillArgs[1] == "skillID" then
- local canUse = false
- for _,v in ipairs(beSkillArgs[2]) do
- if skillID == v then
- canUse = true
- break
- end
- end
- if canUse then
- use(attacker,baojiDefender,v)
- end
- end
- end
- end
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE14] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE14]) do
- use(obj,targets,v)
- end
- end
- end
- end
- if isDefendSideGedang then
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE9] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE9]) do
- use(obj,targets,v)
- end
- end
- end
- end
- end
- function onHp(obj, hurt, attackPos)
- if obj.beSkillList[BESKILL_TYPE3] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE3]) do
- use(obj,{},v)
- end
- end
- if obj.beSkillList[BESKILL_TYPE67] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE67]) do
- use(obj,{},v)
- end
- end
- local attacker = CombatImpl.objList[attackPos]
- if attacker and attacker.beSkillList[BESKILL_TYPE30] and obj.pos ~= attackPos then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE30]) do
- local skillConfig = SkillExcel[v[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- obj.paramData.isbeSkillByHp = obj.paramData.isbeSkillByHp or 0
- if beSkillArgs[1] then
- if beSkillArgs[1] == "tohp" then
- local hp = obj.hp
- local hpMax = CombatObj.getHpMax(obj)
- if hp > hpMax * beSkillArgs[2]/10000 then
- obj.paramData.isbeSkillByHp = 0 --恢复到上限
- else
- if obj.isbeSkillByHp == 0 then
- obj.paramData.isbeSkillByHp = 1 --达到下限
- end
- end
- elseif beSkillArgs[1] == "hurthpper" then
- local hpMax = CombatObj.getHpMax(obj)
- local percent = -hurt/hpMax
- if percent > beSkillArgs[2]/10000 then -- 伤害超过目标生命值上限X%时
- use(attacker,{obj},v)
- end
- elseif beSkillArgs[1] == "speed" then
- local atkSpeed = CombatImpl.getValue(attacker,RoleDefine.SPEED)
- local defSpeed = CombatImpl.getValue(obj,RoleDefine.SPEED)
- if atkSpeed > defSpeed then
- use(attacker,{obj},v)
- end
- end
- end
-
- --使用技能
- if obj.paramData.isbeSkillByHp == 1 then
- use(attacker,{obj},v)
- obj.paramData.isbeSkillByHp = 2
- end
- end
- end
- end
- -- 选择合适的复活技能
- function selectReviceSkill(obj, attacker)
- local reviveSkillList = {}
- local len = 0
- for k, v in ipairs(obj.beSkillList[BESKILL_TYPE15]) do
- local skillID = v[1]
- local isFuwenSkill = v[5]
- local skillConfig = SkillExcel[skillID]
- if skillConfig.cmd == "revive" then
- --有可使用的主动复活技能
- local state = isCanRevive(obj, attacker, v)
- if state and isFuwenSkill == 0 then
- if checkLimit(v) then
- len = len + 1
- reviveSkillList[k] = 1
- break
- end
- end
- end
- end
- -- 没有再取符文技能的复活
- if len == 0 then
- for k, v in ipairs(obj.beSkillList[BESKILL_TYPE15]) do
- local skillID = v[1]
- local isFuwenSkill = v[5]
- local skillConfig = SkillExcel[skillID]
- if skillConfig.cmd == "revive" then
- local state = isCanRevive(obj, attacker, v)
- if state and isFuwenSkill == 1 then
- --被动技能次数限制判断
- if checkLimit(v) then
- reviveSkillList[k] = 1
- break
- end
- end
- end
- end
- end
- return reviveSkillList
- end
- function onDie(obj, hurt, attackPos)
- if obj.hp > 0 then
- return
- end
- local side = obj.side
- local attacker = CombatImpl.objList[attackPos]
- if obj.attackSkillID then
- if attacker and attacker.beSkillList[BESKILL_TYPE43] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE43]) do
- local skillConfig = SkillExcel[v[1]]
- for _,v1 in ipairs(skillConfig.beSkillArgs) do
- if v1 == obj.attackSkillID then
- use(attacker,{obj},v)
- break
- end
- end
- end
- end
- end
-
- local defendSide = side == CombatDefine.ATTACK_SIDE and CombatDefine.DEFEND_SIDE or CombatDefine.ATTACK_SIDE
- for _,posData in ipairs(posSortBySpeed[side]) do
- local pos = posData[1]
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 then
- if target.beSkillList[BESKILL_TYPE16] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE16]) do
- use(target,{obj},v)
- end
- end
- if target.beSkillList[BESKILL_TYPE18] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE18]) do
- use(target,{obj},v)
- end
- end
- end
- end
- for _,posData in ipairs(posSortBySpeed[defendSide]) do
- local pos = posData[1]
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 then
- if target.beSkillList[BESKILL_TYPE17] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE17]) do
- use(target,{obj},v)
- end
- end
- if target.beSkillList[BESKILL_TYPE18] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE18]) do
- use(target,{obj},v)
- end
- end
- end
- end
-
- if attacker and attacker.beSkillList and attacker.beSkillList[BESKILL_TYPE30] and obj.pos ~= attackPos then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE30]) do
- if obj.isbeSkillByHp == nil or
- obj.isbeSkillByHp == 0 then
- use(attacker,{},v)
- end
- end
- end
- if attacker and attacker.beSkillList and attacker.beSkillList[BESKILL_TYPE35] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE35]) do
- use(attacker,{obj},v)
- end
- end
- if obj.beSkillList[BESKILL_TYPE15] then
- -- 选择其中一个使用
- local reviceSkillList = selectReviceSkill(obj, attacker)
- for k, v in ipairs(obj.beSkillList[BESKILL_TYPE15]) do
- local skillID = v[1]
- local skillConfig = SkillExcel[skillID]
- if skillConfig.cmd == "revive" then
- if reviceSkillList[k] then
- use(obj,{},v)
- break
- end
- else
- use(obj,{},v)
- end
- end
- end
-
-
- for _,pos in ipairs(CombatDefine.SIDE2POS[defendSide]) do
- local defendobj = CombatImpl.objList[pos]
- if defendobj and defendobj.hp > 0 and defendobj.beSkillList[BESKILL_TYPE66] then
- for _,v in ipairs(defendobj.beSkillList[BESKILL_TYPE66]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig and skillConfig.otherArgs.tdBuffCmd then
- if obj.bufferCmd[skillConfig.otherArgs.tdBuffCmd] then
- use(defendobj,{},v)
- end
- end
- end
- end
- end
- end
- function onAddBuffer(obj,buffer)
- local conf = BufferExcel[buffer.id]
- local attacker = CombatImpl.objList[buffer.attackPos]
- local cmd = conf.cmd
- if cmd == "hurt" or cmd == "liuxue"or cmd == "liuxue2" or cmd == "zhongdu" or cmd == "ranshao" then
- if obj.beSkillList[BESKILL_TYPE10] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE10]) do
- use(obj,{attacker},v)
- end
- end
- end
- if cmd == "bingdong" or cmd == "jiansu" then
- for _,pos in ipairs(CombatDefine.SIDE2POS[attacker.side]) do
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE63] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE63]) do
- use(target,{obj},v)
- end
- end
- end
- end
-
- if CombatBuff.isControlCmd(cmd) then
- if obj.beSkillList[BESKILL_TYPE11] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE11]) do
- use(obj,{attacker},v)
- end
- end
-
- if obj.beSkillList[BESKILL_TYPE67] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE67]) do
- use(obj,{attacker},v, true, true)
- end
- end
- end
-
- if cmd == "ranshao" then
- for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE12] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE12]) do
- local beSkillUseCnt = CombatImpl.getBeSkillUse(target,obj.pos,v[1])--特殊条件特殊处理:同一英雄在同一时间被施加多次燃烧状态时只触发一次
- if beSkillUseCnt == 0 then
- use(target,{obj},v)
- CombatImpl.addBeSkillUse(target,obj.pos,v[1])
- end
- end
- end
- end
- end
- if cmd == "zuzhou" then
- for _,pos in ipairs(CombatDefine.SIDE2POS[attacker.side]) do
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE51] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE51]) do
- use(target,{obj},v)
- end
- end
- end
- end
- if cmd == "revive" then
- if obj.beSkillList[BESKILL_TYPE33] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE33]) do
- use(obj,{attacker},v)
- end
- end
- end
- end
- function onDelBingDongBuffer(obj, buffer)
- local conf = BufferExcel[buffer.id]
- local attacker = CombatImpl.objList[buffer.attackPos]
- if conf.cmd == "bingdong" then
- for _, pos in ipairs(CombatDefine.SIDE2POS[attacker.side]) do
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE64] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE64]) do
- use(target,{obj},v)
- end
- end
- end
- end
- end
- --援军上阵触发
- function onBackupBegin(obj)
- if not obj then return end
- if CombatDefine.isBackup(obj) ~= CombatDefine.BACKUP_TYPE2 then return end
- -- 备份的被动技能上阵
- if obj.backUpSkillList then
- obj.beSkillList = obj.backUpSkillList
- obj.backUpSkillList = nil
- end
- -- 出站计算属性
- if obj.beSkillList[BESKILL_TYPE26] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE26]) do
- if canUse(obj,v) then
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.cmd == "attr" then
- for _,v1 in ipairs(skillConfig.args) do
- obj.sysAttr[v1[1]] = obj.sysAttr[v1[1]] +v1[2]
- end
- obj.isSysAttrChange = true
- elseif skillConfig.cmd == "normalTarget" then
- use(obj,{},v)
- end
- end
- end
- end
- table.sort(posSortBySpeed[CombatDefine.ATTACK_SIDE],posSpeedCmp)
- table.sort(posSortBySpeed[CombatDefine.DEFEND_SIDE],posSpeedCmp)
- --援军出战触发
- if obj and obj.beSkillList[BESKILL_TYPE32] then
- for k,v in ipairs(obj.beSkillList[BESKILL_TYPE32]) do
- use(obj,{},v)
- end
- end
- --上场技能
- CombatDefine.BACKUP_BUFF_SKILL[2] = 1
- use(obj,{}, CombatDefine.BACKUP_BUFF_SKILL)
- end
- function onRoundBegin(round)
- for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE19] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE19]) do
- use(target,{},v)
- end
- end
-
- -- 生命值触发
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE62] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE62]) do
- local skillConfig = SkillExcel[v[1]]
- local beSkillArgs = skillConfig.beSkillArgs
- if beSkillArgs[1] == 1 then
- local hpMax = CombatObj.getHpMax(target)
- local percent = target.hp/hpMax
- if percent > beSkillArgs[2]/10000 then
- use(target,{},v)
- end
- end
- if beSkillArgs[1] == 2 then
- local hpMax = CombatObj.getHpMax(target)
- local percent = target.hp/hpMax
- if percent < beSkillArgs[2]/10000 then
- use(target,{},v)
- end
- end
- end
- end
- end
-
- for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE47] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE47]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.cmd == "attr" then
- for _,v1 in ipairs(skillConfig.args) do
- target.sysAttr[v1[1]] = target.sysAttr[v1[1]] +v1[2]
- end
- CombatObj.calcAttr(target)
- CombatImpl.addFrame()
- CombatImpl.setSkillID(target, v[1])
- CombatImpl.setSaySkill(target.pos,skillConfig.id,skillConfig.contentType)
- end
- end
- end
- end
-
- if round and round == 1 then
- for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
- local obj = CombatImpl.objList[pos]
- if obj and obj.beSkillList[BESKILL_TYPE32] then
- for k,v in ipairs(obj.beSkillList[BESKILL_TYPE32]) do
- use(obj,{},v)
- end
- end
- end
- end
- end
- function beforeFanji(obj)
- if not obj or obj.isPet then
- return
- end
- if obj and obj.hurtType == CombatDefine.PHY_HURT_TYPE then
- if obj and obj.beSkillList and obj.beSkillList[BESKILL_TYPE37] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE37]) do
- use(obj,{},v)
- end
- end
- else
- if obj and obj.beSkillList and obj.beSkillList[BESKILL_TYPE38] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE38]) do
- use(obj,{},v)
- end
- end
- end
- end
- function onRoundEnd(isRoundEnd)
- for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
- local obj = CombatImpl.objList[pos]
- if obj and obj.beSkillList[BESKILL_TYPE36] then
- if pos == 1 then
- end
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE36]) do
- use(obj,{},v)
- end
- end
- end
- if isRoundEnd then
- for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
- local target = CombatImpl.objList[pos]
- if target and target.hp > 0 and target.beSkillList[BESKILL_TYPE20] then
- for _,v in ipairs(target.beSkillList[BESKILL_TYPE20]) do
- use(target,{},v)
- end
- end
- end
- end
- end
- function posSpeedCmp(a,b)
- if a[2] > b[2] then
- return true
- elseif a[2] < b[2] then
- return false
- else
- return a[1] < b[1]
- end
- end
- function onFightBegin()
- posSortBySpeed[CombatDefine.ATTACK_SIDE] = {}
- posSortBySpeed[CombatDefine.DEFEND_SIDE] = {}
- for pos = 1,CombatDefine.COMBAT_HERO_ALL_CNT do
- local obj = CombatImpl.objList[pos]
- if obj then
- if obj.beSkillList[BESKILL_TYPE26] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE26]) do
- if canUse(obj,v) then
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.cmd == "attr" then
- for _,v1 in ipairs(skillConfig.args) do
- obj.sysAttr[v1[1]] = obj.sysAttr[v1[1]] +v1[2]
- end
- obj.isSysAttrChange = true
- elseif skillConfig.cmd == "normalTarget" then
- use(obj,{},v)
- end
- end
- end
- end
- if pos <= CombatDefine.COMBAT_HERO_CNT then
- posSortBySpeed[CombatDefine.ATTACK_SIDE][#posSortBySpeed[CombatDefine.ATTACK_SIDE]+1] = {pos,obj.attr and obj.attr[RoleDefine.SPEED] or 0}
- elseif pos <= CombatDefine.COMBAT_HERO_CNT * 2 then
- posSortBySpeed[CombatDefine.DEFEND_SIDE][#posSortBySpeed[CombatDefine.DEFEND_SIDE]+1] = {pos,obj.attr and obj.attr[RoleDefine.SPEED] or 0}
- end
- end
- end
- table.sort(posSortBySpeed[CombatDefine.ATTACK_SIDE],posSpeedCmp)
- table.sort(posSortBySpeed[CombatDefine.DEFEND_SIDE],posSpeedCmp)
- end
- function onCombatPetBe(round)
- if round <= 1 then
- return
- end
- for side = 1,CombatDefine.DEFEND_SIDE do
- local pet = CombatImpl.petList[side]
- if pet and pet.petID and pet.beSkillList[BESKILL_TYPE27] then
- for _,v in ipairs(pet.beSkillList[BESKILL_TYPE27]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.cmd == "mp" then
- use(pet,{},v)
- end
- end
- end
- end
- end
- -- 计算被动技能属性
- local beSkillIDList = {}
- function doCalcHero(obj, attrs, skinSkillID, heroConf)
- for i = 1, #beSkillIDList do
- beSkillIDList[i] = nil
- end
- heroConf = heroConf or HeroDefine.getAttrConfig(obj.id, obj.star)
- local beSkillIDs = heroConf.beSkillList
- local skinSkillConf = skinSkillID and SkinSkillExcel[skinSkillID]
- if skinSkillConf then
- beSkillIDs = skinSkillConf.beSkillList
- end
- for _, skillID in ipairs(beSkillIDs) do
- local skillConfig = SkillExcel[skillID]
- if skillConfig.beSkillType == BESKILL_TYPE24 and
- ((not obj) or (obj.quality >= skillConfig.need)) then
- for _,v in ipairs(skillConfig.args) do
- beSkillIDList[#beSkillIDList + 1] = v
- end
- else
- beSkillIDList[#beSkillIDList + 1] = skillID
- end
- end
- for _, skillID in ipairs(beSkillIDList) do
- local skillConfig = SkillExcel[skillID]
- if skillConfig and skillConfig.cmd == "attr" and
- skillConfig.beSkillType == BESKILL_TYPE23 and
- ((not obj) or (obj.quality >= skillConfig.need)) then
- for _, v in ipairs(skillConfig.args) do
- RoleAttr.updateValue(v[1], v[2], attrs)
- end
- elseif skillConfig and skillConfig.cmd == "attrcomboAgain" and
- skillConfig.beSkillType == BESKILL_TYPE70 and
- ((not obj) or (obj.quality >= skillConfig.need)) then
- for i, v in ipairs(skillConfig.args) do
- if v[1] == 1 then
- RoleAttr.updateValue(v[2], v[3], attrs)
- end
- end
- end
- end
- end
- function beforeHit(attacker,defender)
- attacker.beforeHitCheck = false
- if attacker.beSkillList[BESKILL_TYPE40] then
- local hpMax = CombatObj.getHpMax(defender)
- local hp = defender.hp
- local defendHpRate = hp*10000/hpMax
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE40]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.cmd == "lowerLimit" then
- local args = skillConfig.args
- if defendHpRate < args[1] then
- attacker.beforeHitCheck = true
- attacker.beskill40 = attacker.beskill40 or {}
- attacker.beskill40[defender.pos] = 1
- end
- end
- end
- end
- end
- function afterHit(attacker,target, isEnd)
- if attacker.beforeHitCheck then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE40]) do
- use(attacker,{target},v)
- end
- end
- beforeFanji(attacker, isEnd)
- end
- function getOutAtkRate(attacker, defender)
- local outAtkRate = 0
- -- 首次攻击
- local isFirstAttack = CombatImpl.firstAttack[attacker.side]
- if isFirstAttack then
- for _,pos in ipairs(CombatDefine.SIDE2POS[defender.side]) do
- local objM = CombatImpl.objList[pos]
- if objM and objM.beSkillList[BESKILL_TYPE50] then
- for _,v in ipairs(objM.beSkillList[BESKILL_TYPE50]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig and skillConfig.otherArgs.outAtkRate then
- if skillConfig.otherArgs.outAtkRate >= outAtkRate then
- outAtkRate = skillConfig.otherArgs.outAtkRate
- end
- end
- end
- end
- end
- end
- return outAtkRate
- end
- function getExtraHurtRate(attacker,defender,skillConfig)
- if not attacker or attacker.isPet then
- return 0
- end
- local zhanyiRet = 0
- local bodongHurtRet = 0
- local zhenduiHurtRate = 0
- local zhenduiLen = 0
- local zhenduiList = {}
- local bezhenduiList = {}
- local hpHurtRate = 0
- local extraSpeedHurt = 0
- local firstHurt = 0
- local sexHurt = 0
- local campHurt = 0
- local reJobHurt = 0
- for k,skillList in pairs(attacker.beSkillList) do
- for j,v in pairs(skillList) do
- local config = SkillExcel[v[1]]
- if config.cmd == "zhanyi" then --战意 伤害加成
- local nowHp = attacker.hp
- local hpMax = CombatObj.getHpMax(attacker)
- local percent = math.floor( (hpMax - nowHp )/hpMax * 100)
- if percent >= 1 then
- zhanyiRet = zhanyiRet + (percent * config.args[2])
- end
- elseif config.cmd == "fuwenAKH" then
- for i = 1,#config.otherArgs do
- zhenduiLen = zhenduiLen + 1
- zhenduiList[config.otherArgs[i][1]] = zhenduiList[config.otherArgs[i][1]] or 0
- zhenduiList[config.otherArgs[i][1]] = zhenduiList[config.otherArgs[i][1]] + config.otherArgs[i][2]
- end
- elseif config.cmd == "hurtBodong" then
- if canUse(attacker, v) then
- local minRet = config.args[1]
- local maxRet = config.args[2]
- local randomRet = math.random(minRet, maxRet)
- bodongHurtRet = bodongHurtRet + randomRet - 10000
- end
- elseif config.cmd == "hpExtraHurt" then
- local hp = defender.hp
- local beSkillArgs = config.beSkillArgs
- local checkHp = CombatObj.getHpMax(defender) * beSkillArgs[3] / 10000
- if beSkillArgs[2] == 1 and hp > checkHp then
- hpHurtRate = beSkillArgs[4]
- elseif beSkillArgs[2] == 2 and hp < checkHp then
- hpHurtRate = beSkillArgs[4]
- end
- elseif config.cmd == "extraSpeedHurt" then
- extraSpeedHurt = config.args[1]
- elseif config.cmd == "firstAttackHurt" then
- if canUse(attacker, v) then
- firstHurt = config.args[1]
- end
- end
- end
- end
- for k,skillList in pairs(defender.beSkillList) do
- for j,v in pairs(skillList) do
- local conf = SkillExcel[v[1]]
- if conf then
- if conf.cmd == "befuwenAKH" then
- for i = 1,#conf.otherArgs do
- zhenduiLen = zhenduiLen + 1
- bezhenduiList[conf.otherArgs[i][1]] = bezhenduiList[conf.otherArgs[i][1]] or 0
- bezhenduiList[conf.otherArgs[i][1]] = bezhenduiList[conf.otherArgs[i][1]] + conf.otherArgs[i][2]
- end
- -- 受性别增伤
- elseif conf.cmd == "sexHurt" then
- if attacker.sex == conf.args[1] then
- sexHurt = sexHurt + conf.args[2]
- end
- -- 受阵营增伤
- elseif conf.cmd == "campHurt" then
- if attacker.camp == conf.args[1] then
- campHurt = campHurt + conf.args[2]
- end
- -- 受职业增伤
- elseif conf.cmd == "reJobHurt" then
- if attacker.job == conf.args[1] then
- reJobHurt = reJobHurt + conf.args[2]
- end
- end
- end
- end
- end
- if zhenduiLen > 0 then
- local bAdd = 0
- for k,skillList in pairs(defender.beSkillList) do
- for j,v in pairs(skillList) do
- local conf = SkillExcel[v[1]]
- local isFuWenSkill = v[5]
- if conf.cmd and conf.cmd ~= "" and zhenduiList[conf.cmd] then
- -- 符文技能只生效一个
- if isFuWenSkill == 1 then
- if bAdd == 0 then
- zhenduiHurtRate = zhenduiHurtRate + zhenduiList[conf.cmd]
- bAdd = 1
- end
- else
- zhenduiHurtRate = zhenduiHurtRate + zhenduiList[conf.cmd]
- end
- end
- end
- end
- bAdd = 0
- for k,skillList in pairs(attacker.beSkillList) do
- for j,v in pairs(skillList) do
- local conf = SkillExcel[v[1]]
- local isFuWenSkill = v[5]
- if conf.cmd and conf.cmd ~= "" and bezhenduiList[conf.cmd] then
- if isFuWenSkill == 1 then
- if bAdd == 0 then
- zhenduiHurtRate = zhenduiHurtRate + bezhenduiList[conf.cmd]
- bAdd = 1
- end
- else
- zhenduiHurtRate = zhenduiHurtRate + bezhenduiList[conf.cmd]
- end
- end
- end
- end
- end
-
- --特殊buff 对血族的加成
- local campHurtRate = 0
- local campRate = nil
- local buffCmd = nil
- local camp = nil
- for _,pos in ipairs(CombatDefine.SIDE2POS[attacker.side]) do
- obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 then
- if obj.beSkillList[BESKILL_TYPE68] then
- local beSkillList = obj.beSkillList[BESKILL_TYPE68][1]
- local skillConfig = SkillExcel[beSkillList[1]]
- if skillConfig then
- camp = skillConfig.otherArgs.calcCamp[1]
- buffCmd = skillConfig.otherArgs.calcCamp[2]
- campRate = skillConfig.otherArgs.calcCamp[3]
- break
- end
- end
- end
- end
-
- if buffCmd and campRate and attacker.camp == camp then
- local campHurtCnt = 0
- for _,pos in ipairs(CombatDefine.SIDE2POS[defender.side]) do
- obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 then
- local isStatus1, cmd1, ind1 = CombatBuff.isStatus(obj, buffCmd)
- if isStatus1 then
- campHurtCnt = campHurtCnt + 1
- end
- end
- end
- if campHurtCnt > 0 then
- campHurtRate = campHurtCnt * campRate
- end
- end
- local extraHurtRate = zhanyiRet + zhenduiHurtRate + bodongHurtRet + hpHurtRate + extraSpeedHurt + firstHurt + sexHurt + campHurt + reJobHurt + campHurtRate
- if attacker.beSkillList[BESKILL_TYPE40] and attacker.beforeHitCheck then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE40]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.cmd == "extraHurt" then
- local args = skillConfig.args
- extraHurtRate = extraHurtRate + args[1]
- end
- end
- end
- return extraHurtRate
- end
- --
- function getExtraHurt(attacker, target, tUseskillConfig)
- local extraHurt = 0
- if attacker.beSkillList[BESKILL_TYPE55] then
- local beSkillList = attacker.beSkillList[BESKILL_TYPE55][1]
- local skillConfig = SkillExcel[beSkillList[1]]
- local buffCmd = target.bufferCmd[skillConfig.otherArgs.buffCmdHurtRate[1]]
- local rate = skillConfig.otherArgs.buffCmdHurtRate[2] / 10000
- if buffCmd then
- local buffCnt = #buffCmd
- local buffIndex = buffCmd[buffCnt]
- local buffer = target.buffer[buffIndex]
- local conf = BufferExcel[buffer.id]
- local hurt = buffer.arg[1]
- extraHurt = extraHurt + hurt * rate * buffCnt
- end
- end
- return extraHurt
- end
- --
- function getRandomBuffCmd(attacker, target, cmd)
- local side = attacker.side
- local mathRandom = math.random
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE56] then
- local beSkillList = obj.beSkillList[BESKILL_TYPE56][1]
- local skillConfig = SkillExcel[beSkillList[1]]
- local buffCmdRand = skillConfig.otherArgs.buffCmdRand
- if buffCmdRand and cmd == buffCmdRand[1] then
- local random = mathRandom(1, 10000)
- if random <= buffCmdRand[2] then
- return true
- end
- end
- end
- end
- end
- function getHurtPercentRate(attacker, defender, hurt, tUseskillConfig)
- local rate = 0
- for k,skillList in pairs(defender.beSkillList) do
- for j,v in pairs(skillList) do
- local conf = SkillExcel[v[1]]
-
- if conf and conf.cmd == "behurtRet" then
- local canUse = true
- if conf.beSkillArgs and #conf.beSkillArgs > 0 then
- if conf.beSkillArgs[1] == "hurthpper" then
- local hpMax = CombatObj.getHpMax(defender)
- local percent = hurt/hpMax
- if percent < conf.beSkillArgs[2]/10000 then -- 伤害超过目标生命值上限X%时
- canUse = false
- end
- end
- end
- if canUse == true then
- local random = math.random(1, 10000)
- if random <= conf.args[2] then
- rate = rate + conf.args[1]
- end
- end
- end
- end
- end
- if tUseskillConfig.type == CombatDefine.SKILL_TYPE1 then
- if attacker.beSkillList[BESKILL_TYPE1] then
- for _, v in pairs(attacker.beSkillList[BESKILL_TYPE1]) do
- local nSkillID = v[1]
- local skillConfig = SkillExcel[nSkillID]
- if skillConfig and skillConfig.hurtRate and skillConfig.hurtRate[1] then
- local fRate = skillConfig.hurtRate[1]
- rate = rate + fRate
- --print("[getExtraHurt] 获取到的普工伤害加成概率 fRate = "..fRate.." 总加成 rate = "..rate)
- end
- end
- end
- end
-
- return rate
- end
- function getBufferExtraHurt(attacker,bufferID,cmd)
- local rate = 0
- for _,skillList in pairs(attacker.beSkillList) do
- for k,v in pairs(skillList) do
- local conf = SkillExcel[v[1]]
- local otherArgs = conf.otherArgs
- if bufferID and otherArgs.bufferExtraHurt then
- for k1,v1 in ipairs(otherArgs.bufferExtraHurt[1]) do
- if bufferID == v1 then
- rate = rate + otherArgs.bufferExtraHurt[2]
- end
- end
- end
- if cmd and otherArgs.bufferCmdExtraHurt then
- for k1,v1 in ipairs(otherArgs.bufferCmdExtraHurt[1]) do
- if cmd == v1 then
- rate = rate + otherArgs.bufferCmdExtraHurt[2]
- end
- end
- end
- end
- end
- return rate
- end
- function getExtraHurtRateEx(attacker, defender)
- local rate = 0
- -- 死亡数伤害率
- if attacker.beSkillList[BESKILL_TYPE48] then
- for _,v in ipairs(attacker.beSkillList[BESKILL_TYPE48]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig and skillConfig.otherArgs.deathHurt then
- local side = defender.side
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp <=0 then
- if rate == 0 then
- rate = skillConfig.otherArgs.deathHurt
- else
- rate = rate + 10000
- end
- end
- end
- end
- end
- end
- return rate
- end
- --
- function getBuffChixuHurt(attacker, cmd)
- if not attacker then return 0 end
- local hurt = 0
- local side = attacker.side
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local objM = CombatImpl.objList[pos]
- if objM and objM.hp > 0 and objM.beSkillList[BESKILL_TYPE54] then
- for _,v in ipairs(objM.beSkillList[BESKILL_TYPE54]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig and skillConfig.otherArgs[cmd] then
- hurt = hurt + skillConfig.otherArgs[cmd]
- end
- end
- end
- end
- return hurt / 10000
- end
- --
- function handlerBuff(attacker, target, arg, cmd)
- if not attacker then return end
- for _,pos in ipairs(CombatDefine.SIDE2POS[attacker.side]) do
- local obj = CombatImpl.objList[pos]
- if obj and obj.hp > 0 and obj.beSkillList[BESKILL_TYPE57] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE57]) do
- attacker.args = arg
- use(attacker, {target}, v, false)
- end
- end
- end
- end
- function beforeMinusHp(obj, value)
- if value <= 0 then return end
- --敌对阵营 有对象有 49号被动技能 加血变成减血
- local side = obj.side == CombatDefine.ATTACK_SIDE and CombatDefine.DEFEND_SIDE or CombatDefine.ATTACK_SIDE
- for _,pos in ipairs(CombatDefine.SIDE2POS[side]) do
- local objM = CombatImpl.objList[pos]
- if objM and objM.hp > 0 and objM.beSkillList[BESKILL_TYPE49] then
- value = value * (-1)
- break
- end
- end
- return value
- end
- function beforeUpdateHp(obj,sum)
- if sum <= 0 and obj.beSkillList[BESKILL_TYPE41] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE41]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.cmd == "miansi" and canUse(obj,v) then
- use(obj,{},v)
- return true
- end
- end
- end
- end
- function onCheckBuffer(obj,attacker,value)
- local ret = value
- if obj.beSkillList[BESKILL_TYPE42] then
- for _,v in ipairs(obj.beSkillList[BESKILL_TYPE42]) do
- local skillConfig = SkillExcel[v[1]]
- if canUse(obj,v) then
- local newFrame = true
- if skillConfig.cmd == "baohu" then
- obj.baohuHurt = value * skillConfig.args[1] / 10000
- if obj.hp < -obj.baohuHurt then
- obj.baohuHurt = -obj.hp
- end
- ret = value - obj.baohuHurt
- newFrame = false
- end
- use(obj,{attacker},v, newFrame)
- break
- end
- end
- end
- return ret
- end
- function getStatusBaoji(attacker, defender)
- local baoji = 0
- local firstBaoji = 0
- for k, skillList in pairs(attacker.beSkillList) do
- for j, v in pairs(skillList) do
- local config = SkillExcel[v[1]]
- if config.cmd == "firstAttackHurt" then
- if canUse(attacker, v) then
- firstBaoji = config.args[2] or 0
- end
- end
- end
- end
- if attacker.beSkillList[BESKILL_TYPE60] then
- for _, v in ipairs(attacker.beSkillList[BESKILL_TYPE60]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig and skillConfig.otherArgs.addStatusBaoji then
- local status = CombatBuff.getStatus(defender)
- local isStatus = false
- for k, v in ipairs(skillConfig.otherArgs.addStatusBaoji[1]) do
- if status[v] then
- isStatus = true
- break
- end
- end
- if isStatus then
- baoji = baoji + skillConfig.otherArgs.addStatusBaoji[2]
- end
- end
- end
- end
- if attacker.beSkillList[BESKILL_TYPE69] and attacker.notBaoJi then
- for _, v in ipairs(attacker.beSkillList[BESKILL_TYPE69]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig and skillConfig.otherArgs.addNotBaoji then
- baoji = baoji + skillConfig.otherArgs.addNotBaoji
- end
- end
- end
- return baoji + firstBaoji
- end
- function getStatusPojia(attacker, defender)
- local poJia = 0
- -- 对指定状态破甲加成 走的技能状态属性
- if attacker.beSkillList[BESKILL_TYPE60] then
- for _, v in ipairs(attacker.beSkillList[BESKILL_TYPE60]) do
- local skillConfig = SkillExcel[v[1]]
- if skillConfig.otherArgs.addStatusPoJia then
- local status = CombatBuff.getStatus(defender)
- local isStatus = false
- for k, v in ipairs(skillConfig.otherArgs.addStatusPoJia[1]) do
- if status[v] then
- isStatus = true
- break
- end
- end
- if isStatus then
- poJia = poJia + skillConfig.otherArgs.addStatusPoJia[2]
- end
- end
- end
- end
- return poJia
- end
|