| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | 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:
|