129 【战斗】战斗系统-服务端(曹操所有技能;增加触发方式50-敌方受控时(硬控);)
| | |
| | | TriggerWay_ImmuneHurt, # 免疫伤害时 55
|
| | | TriggerWay_BeSuckHP, # 被吸血时 56
|
| | | TriggerWay_SuckHPOne, # 吸血时(多目标仅触发一次) 57
|
| | | ) = range(1, 1 + 57)
|
| | | TriggerWay_EnemyBeControlledHard, # 敌方受控时(硬控) 58
|
| | | ) = range(1, 1 + 58)
|
| | |
|
| | | # 不加载的被动触发方式,一般用于本技能固定触发逻辑用的
|
| | | TriggerWayNoLoadList = [TriggerWay_CurSkillEff, TriggerWay_CurSkillEffLst]
|
| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import TurnBuff
|
| | |
|
| | | def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
|
| | |
|
| | |
| | | GameWorld.DebugLog("按自身已损失生命百分比增加属性: attrID=%s,attrValue=%s,curHP=%s/%s,lostPer=%s"
|
| | | % (attrID, attrValue, curHP, maxHP, lostPer))
|
| | |
|
| | | # 12-根据自己buff层级增加
|
| | | elif calcType == 12:
|
| | | if "turnFight" not in skillkwargs:
|
| | | return
|
| | | turnFight = skillkwargs["turnFight"]
|
| | | buffState = curEffect.GetEffectValue(2) # 自己身上buff状态
|
| | | isDelBuff = curEffect.GetEffectValue(3) # 触发效果后是否扣除buff
|
| | | layerTotal = 0
|
| | | buffMgr = attacker.GetBuffManager()
|
| | | for buff in buffMgr.FindBuffListByState(buffState):
|
| | | layerTotal += buff.GetLayer()
|
| | | if isDelBuff:
|
| | | TurnBuff.DoBuffDel(turnFight, attacker, buff, connSkill)
|
| | | attrValue *= layerTotal
|
| | | GameWorld.DebugLogEx("按自己buff层级增加属性: attrID=%s,attrValue=%s,buffState=%s,layerTotal=%s", attrID, attrValue, buffState, layerTotal)
|
| | | |
| | | # 13-根据对方buff状态种数
|
| | | elif calcType == 13:
|
| | | buffStateList = curEffect.GetEffectValue(2) # 对方处于xx状态 [状态1, 状态2, ...]
|
| | | isMulti = curEffect.GetEffectValue(3) # 存在多种状态时是否叠加属性
|
| | | stateCount = 0
|
| | | buffMgr = defender.GetBuffManager()
|
| | | for buffState in buffStateList:
|
| | | if buffMgr.IsInBuffState(buffState):
|
| | | stateCount += 1
|
| | | if not stateCount:
|
| | | return
|
| | | if isMulti and stateCount > 1:
|
| | | attrValue *= stateCount
|
| | | GameWorld.DebugLogEx("按目标buff状态种数增加属性: attrID=%s,attrValue=%s,buffStateList=%s,stateCount=%s,isMulti=%s", |
| | | attrID, attrValue, buffStateList, stateCount, isMulti)
|
| | | |
| | | else:
|
| | | checkInStateList = curEffect.GetEffectValue(2)
|
| | | if checkInStateList:
|
| | |
| | | #受控时
|
| | | if curBuffState and IsControlledHardState(curBuffState):
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_BeControlledHard, tagObj=buffOwner, connSkill=buffSkill, connBuff=buff)
|
| | | |
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | ownerBatLineup = buffOwner.GetBatLineup()
|
| | | for lineupObjID in ownerBatLineup.posObjIDDict.values():
|
| | | lineupObj = batObjMgr.getBatObj(lineupObjID)
|
| | | if not lineupObj.IsAlive():
|
| | | continue
|
| | | # 敌方被控时
|
| | | if lineupObj.GetFaction() != batObj.GetFaction():
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, lineupObj, ChConfig.TriggerWay_EnemyBeControlledHard, batObj, connSkill=buffSkill)
|
| | | |
| | | return buff
|
| | |
|
| | | def IsControlledHardState(state):
|
| | |
| | | effID = effect.GetEffectID()
|
| | | if effID not in ChConfig.AttrIDList:
|
| | | continue
|
| | | if effect.GetTriggerWay():
|
| | | # 有需要触发才生效的属性在buff中不生效,由触发规则决定
|
| | | continue
|
| | | if not (not effect.GetTriggerSrc() or effect.GetTriggerBuffEnable()):
|
| | | # buff时,不配默认有效,或仅buff有效
|
| | | continue
|
| | |
| | | # 掉血时
|
| | | if tagID in beHurtObjIDList:
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, tagObj, ChConfig.TriggerWay_BeHurt, curObj, connSkill=useSkill)
|
| | | #TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_HurtTag, tagObj, connSkill=useSkill) 暂时用不到先屏蔽
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_HurtTag, tagObj, connSkill=useSkill)
|
| | |
|
| | | # 受到任意效果时(除直接攻击外的任意效果,如buff、dot、治疗、额外怒技)
|
| | | if not isAttackDirect:
|