| | |
| | | GameWorld.ImportAll("Script\\Skill\\", "TurnBuffs")
|
| | |
|
| | | def GetAddBuffValue(turnFight, attacker, defender, curSkill):
|
| | | if not curSkill.GetAtkType():
|
| | | return []
|
| | | callFunc = GameWorld.GetExecFunc(TurnBuffs, "BuffAtkType_%d.%s" % (curSkill.GetAtkType(), "CalcBuffValue"))
|
| | | if not callFunc:
|
| | | return []
|
| | | return callFunc(turnFight, attacker, defender, curSkill)
|
| | | ret = callFunc(turnFight, attacker, defender, curSkill)
|
| | | if ret == None:
|
| | | return []
|
| | | return ret
|
| | |
|
| | | def CopyBuff(turnFight, curBatObj, curBuff, tagBuff, bySkill=None, isNewAdd=False):
|
| | | def CopyBuff(turnFight, curBatObj, curBuff, tagBuff, bySkill=None, isNewAdd=False, refreshTimeLayer=True):
|
| | | '''拷贝buff数据,不含目标buffID、归属,并刷新时间
|
| | | @param refreshTimeLayer: 刷新剩余时间、层级
|
| | | '''
|
| | | skillData = curBuff.GetSkillData()
|
| | | curBuff.SetCalcTime(turnFight.getTimeline())
|
| | | curBuff.SetRemainTime(max(tagBuff.GetRemainTime(), skillData.GetLastTime()))
|
| | | curBuff.SetLayer(max(tagBuff.GetLayer(), skillData.GetLayerMax()))
|
| | | if refreshTimeLayer:
|
| | | curBuff.SetRemainTime(max(tagBuff.GetRemainTime(), skillData.GetLastTime()))
|
| | | curBuff.SetLayer(max(tagBuff.GetLayer(), skillData.GetLayerMax()))
|
| | | else:
|
| | | curBuff.SetRemainTime(tagBuff.GetRemainTime())
|
| | | curBuff.SetLayer(tagBuff.GetLayer())
|
| | | curBuff.SetValue1(tagBuff.GetValue1())
|
| | | curBuff.SetValue2(tagBuff.GetValue2())
|
| | | curBuff.SetValue3(tagBuff.GetValue3())
|
| | | curBuff.SetIsCopy(1)
|
| | | GameWorld.DebugLog(" 拷贝buff: curBuffID=%s,tagBuffID=%s,Remain=%s,Layer=%s,Value=%s"
|
| | | % (curBuff.GetBuffID(), tagBuff.GetBuffID(), curBuff.GetRemainTime(), curBuff.GetLayer(),
|
| | | [curBuff.GetValue1(), curBuff.GetValue2(), curBuff.GetValue3()]))
|
| | |
| | | ObjPool.GetPoolMgr().release(curBuff)
|
| | | return
|
| | |
|
| | | def DoBuffProcess(turnFight, batObj, curBuff):
|
| | | def DoBuffProcess(turnFight, batObj, curBuff, **kwargs):
|
| | | skillData = curBuff.GetSkillData()
|
| | | if not skillData.GetAtkType():
|
| | | return
|
| | | callFunc = GameWorld.GetExecFunc(TurnBuffs, "BuffAtkType_%d.%s" % (skillData.GetAtkType(), "DoBuffProcess"))
|
| | | if callFunc:
|
| | | callFunc(turnFight, batObj, curBuff)
|
| | | callFunc(turnFight, batObj, curBuff, **kwargs)
|
| | | return
|
| | |
|
| | | def RefreshBuffAttr(batObj):
|
| | |
| | | buff = buffMgr.GetBuffByIndex(index)
|
| | | layer = max(1, buff.GetLayer())
|
| | | skillData = buff.GetSkillData()
|
| | | atkType = skillData.GetAtkType()
|
| | | if atkType:
|
| | | callFunc = GameWorld.GetExecFunc(TurnBuffs, "BuffAtkType_%d.%s" % (atkType, "CalcBuffAttrEx"))
|
| | | if callFunc:
|
| | | callFunc(batObj, buff, skillData, layer, buffAttrDict)
|
| | | |
| | | for eIndex in range(skillData.GetEffectCount()):
|
| | | effect = skillData.GetEffect(eIndex)
|
| | | effID = effect.GetEffectID()
|