| | |
| | | GameWorld.ErrLog("设置对象属性失败, Index = %s" % (effIndex))
|
| | | return
|
| | |
|
| | | effectValue = min(effectValue, ChConfig.Def_UpperLimit_DWord)
|
| | | if effIndex not in ChConfig.TYPE_BIGVALUE_ATTR:
|
| | | effectValue = min(effectValue, ChConfig.Def_UpperLimit_DWord)
|
| | | return ObjProperty_AttrByIndex[effIndex - 1][1](curObj, effectValue)
|
| | |
|
| | |
|
| | |
| | | def CopyPlayerFuncAttr(curPlayer):
|
| | | for i in xrange(len(ObjProperty_AttrByIndex)):
|
| | | # Get
|
| | | if i+1 in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | effIndex = i + 1
|
| | | if effIndex in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | continue
|
| | | value = ObjProperty_AttrByIndex[i][0](curPlayer)
|
| | | if value == 0 and curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr%i) == 0:
|
| | | if value == 0 and GetCopyFuncAttrValue(curPlayer, effIndex) == 0:
|
| | | continue
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttr%i, ObjProperty_AttrByIndex[i][0](curPlayer))
|
| | | SetCopyFuncAttrValue(curPlayer, effIndex, value)
|
| | | return
|
| | |
|
| | | # 恢复缓存功能属性的刷新结果,用于BUFF属性单独刷新
|
| | | def RestorePlayerFuncAttr(curPlayer):
|
| | | for i in xrange(len(ObjProperty_AttrByIndex)):
|
| | | if i+1 in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | effIndex = i + 1
|
| | | if effIndex in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | continue
|
| | | ObjProperty_AttrByIndex[i][1](curPlayer, |
| | | curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr%i))
|
| | | ObjProperty_AttrByIndex[i][1](curPlayer, GetCopyFuncAttrValue(curPlayer, effIndex))
|
| | | return
|
| | | |
| | | |
| | |
|
| | | def GetCopyFuncAttrValue(curPlayer, effIndex):
|
| | | value = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr % effIndex)
|
| | | valueEx = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttrEx % effIndex)
|
| | | return valueEx * ShareDefine.Def_PerPointValue + value
|
| | |
|
| | | def SetCopyFuncAttrValue(curPlayer, effIndex, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttr % effIndex, value % ShareDefine.Def_PerPointValue)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttrEx % effIndex, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | |