| | |
| | | import IpyGameDataPY
|
| | | import BattleObj
|
| | | import ChConfig
|
| | | import TurnSkill
|
| | |
|
| | | GameWorld.ImportAll("Script\\Skill\\", "PassiveTrigger")
|
| | |
|
| | |
| | | if not effSkill:
|
| | | return
|
| | |
|
| | | if effSkill.GetCoolDownTime():
|
| | | if hasattr(effSkill, "GetRemainTime") and effSkill.GetRemainTime() > 0:
|
| | | GameWorld.DebugLogEx("被动效果技能CD中! effSkillID=%s,RemainTime=%s", skillID, effSkill.GetRemainTime())
|
| | | return
|
| | | kwargs["byEffSkill"] = effSkill # 目前用于触发被动技能时,该效果技能提前先设置CD,防止嵌套触发时CD后置才设置,如关羽的怒技追击
|
| | | |
| | | # 没有类型的,纯配被动效果,有类型的技能在 OnUseSkill 统一处理回合次数,这里只处理纯被动效果的
|
| | | useCntLimit = None
|
| | | if not effSkill.GetSkillType(): |
| | | useCntLimit = TurnSkill.CheckSkillUseCntLimit(batObj, effSkill)
|
| | | if useCntLimit:
|
| | | return
|
| | | |
| | | isOK = False
|
| | | kwargs["byTriggerWay"] = triggerWay
|
| | | for effID in effIDList:
|
| | | curEffect = effSkill.GetEffectByID(effID, triggerWay)
|
| | | if not curEffect:
|
| | | continue
|
| | | DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs)
|
| | | if DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
|
| | | isOK = True # 有效果触发就算
|
| | |
|
| | | return
|
| | | if isOK:
|
| | | if useCntLimit != None:
|
| | | #GameWorld.DebugLogEx("增加被动效果回合触发次数! skillID=%s", effSkill.GetSkillID())
|
| | | batObj.AddSkillUseCnt(effSkill.GetSkillID())
|
| | | |
| | | return isOK
|
| | |
|
| | | def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff=None, **kwargs):
|
| | | effID = curEffect.GetEffectID()
|
| | |
| | | callFunc = GameWorld.GetExecFunc(PassiveTrigger, "%s.%s" % (pyName, "DoSkillEffectLogic"))
|
| | | if not callFunc:
|
| | | return
|
| | | callFunc(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs)
|
| | | return
|
| | | isOK = callFunc(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs)
|
| | | if not isOK:
|
| | | return
|
| | | |
| | | cdTime = effSkill.GetCoolDownTime()
|
| | | if cdTime:
|
| | | # 非触发技能的在后面设置CD即可
|
| | | if hasattr(effSkill, "GetRemainTime"):
|
| | | effSkill.SetRemainTime(cdTime)
|
| | | |
| | | return True
|
| | |
|
| | | def __doTriggerPassiveEffectByBuff(turnFight, batObj, tagObj, triggerWay, buffID, effIDList, connSkill=None, connBuff=None, **kwargs):
|
| | | buffMgr = batObj.GetBuffManager()
|