#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#---------------------------------------------------------------------
|
#
|
#---------------------------------------------------------------------
|
##@package CalcNoLineEffect
|
# ¼ÆËã·ÇÏßÐÔBuff
|
#
|
# @author eggxp
|
# @date 2010-4-22
|
# @version 1.5
|
#
|
# @change: "2013-05-17 15:35" Alee ¸ü¸Ä¼ÆË㷽ʽ
|
# @change: "2013-09-06 20:00" hxp ÐÞ¸ÄÕ½¶·Á¦¼ÆËãÂß¼
|
# @change: "2013-10-15 11:40" hxp ÐÞ¸Ä×Öµä»ñȡֵÅжÏ
|
# @change: "2013-11-13 21:00" Alee ÒÆ¶¯ËٶȶÀÁ¢´¦Àí
|
# @change: "2015-07-29 17:30" hxp É˺¦¼õÃâ¸ÄΪÏßÐÔ
|
#---------------------------------------------------------------------
|
#"""Version = 2015-07-29 17:30"""
|
#---------------------------------------------------------------------
|
import ChConfig
|
import EffGetSet
|
import GameWorld
|
import FBCommon
|
#---------------------------------------------------------------------
|
|
def AddPlayerMapAttrNolineEffect(curPlayer, effectDict):
|
## ¸ù¾ÝÍæ¼Òµ±Ç°ÊôÐÔ¸øÍæ¼ÒÌí¼Ó·ÇÏßÐÔЧ¹û¼Ó³É - ijЩµØÍ¼²ÅÉúЧµÄ
|
mapID = FBCommon.GetRecordMapID(curPlayer.GetMapID())
|
mapAttrNolineInfo = ChConfig.MapAttrInfoDict_Noline.get(mapID, {})
|
for attrIndex, effAttrIndexList in mapAttrNolineInfo.items():
|
curValue = EffGetSet.GetValueByEffIndex(curPlayer, attrIndex)
|
if not curValue:
|
#GameWorld.DebugLog(" ûÓиÃÀàÊôÐÔ: attrIndex=%s" % attrIndex)
|
continue
|
for effAttrIndex in effAttrIndexList:
|
effectDict[effAttrIndex] = effectDict.get(effAttrIndex, 0) + curValue
|
return
|
|
## ¸øÍæ¼ÒÌí¼Ó·ÇÏßÐÔBuffЧ¹û
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param effectDict Ч¹ûÁбí
|
# @return None
|
def ChangePlayerAttrInNoLineEffectList(curPlayer, effectDict, isBuffAttr=False):
|
for key, value in effectDict.items():
|
if value == 0:
|
continue
|
|
# ¹¦Äܽ»²æÏßÐÔÌáÉýµÄ²»ÔÚÕâÀï´¦Àí£¬ÕâÀïÖ»´¦ÀíÍæ¼Òµ±Ç°ÊôÐԵķÇÏßÐÔÌáÉý
|
if key in ChConfig.FuncNoLinearAttrDict:
|
continue
|
|
curValue = EffGetSet.GetValueByEffIndex(curPlayer, key)
|
if curValue == None :
|
GameWorld.Log("µ÷ÓÃplayer·ÇÏßÐÔÊôÐÔÌõ¼þʧ°Ü,index = %s" % (key) , curPlayer.GetPlayerID())
|
continue
|
|
# buff¶ÔÒÆ¶¯ËٶȵÄÓ°Ïì²»ÔÚÕâÀï¼ÆËã, µ¥¶ÀÌá³öÀ´¶ÀÁ¢¼ÆËã
|
if isBuffAttr and key == ChConfig.TYPE_Calc_AttrSpeed:
|
continue
|
|
# if key == ChConfig.TYPE_Calc_AttrSpeed:
|
# # ÒÆ¶¯ËÙ¶ÈÔÝû×öÕ½¶·Á¦Í³¼Æ£¬Èç¹ûÐèÒª£¬¿É²ÎÕÕÉ˺¦ÎüÊÕÖ±½Ó¼ÓÉÏÊýÖµ£¬²»×öÌØÊâ´¦Àí
|
# # ËÙ¶ÈÌØÊâ´¦Àí, ¶ÀÁ¢´¦Àí ²»Ë¢ÊôÐÔ
|
# #EffGetSet.SetValueByEffIndex(curPlayer, key, curValue * ChConfig.Def_MaxRateValue / max(100, ChConfig.Def_MaxRateValue + value))
|
# continue
|
## elif key == ChConfig.TYPE_Calc_AttrDamReduce:
|
## if mfpObjAttrDict:
|
## for mfpObj, attrDict in mfpObjAttrDict.items():
|
## #if not attrDict.has_key(key): # Èç¹û¸ÃÄ£¿éûÓÐÔö¼Ó¸ÃÊôÐÔ£¬ÔòÌø¹ý
|
## if key not in attrDict: # Èç¹û¸ÃÄ£¿éûÓÐÔö¼Ó¸ÃÊôÐÔ£¬ÔòÌø¹ý
|
## continue
|
## curMValue = attrDict[key]
|
## # ¸ø¶ÔӦģ¿éÀÛ¼ÓÉÏ·ÇÏßÐÔÔö¼ÓµÄÕ½¶·ÊôÐÔÖµ£¬¼ÆËãÕ½¶·Á¦Ê±¿ÉÖ±½ÓÓþßÌåÊýÖµ£¬²»×öË¥¼õ´¦Àí
|
## mfpObj.AddCalcMFPAttr(key, curMValue)
|
##
|
## tmpValue = curValue + value - curValue * value / ChConfig.Def_MaxRateValue
|
## # Ë¥¼õËã·¨
|
## EffGetSet.SetValueByEffIndex(curPlayer, key, tmpValue)
|
# else:
|
EffGetSet.SetValueByEffIndex(curPlayer, key, curValue * (ChConfig.Def_MaxRateValue + value) / ChConfig.Def_MaxRateValue)
|
|
return
|
|
|
## ¸øNPCÌí¼Ó·ÇÏßÐÔBuffЧ¹û
|
# @param curNPC µ±Ç°NPC
|
# @param effectDict Ч¹ûÁбí
|
# @return None
|
def ChangeNPCAttrInNoLineEffectList(curNPC, effectDict):
|
for key, value in effectDict.items():
|
if value == 0:
|
continue
|
|
curValue = EffGetSet.GetValueByEffIndex(curNPC, key)
|
if curValue == None :
|
GameWorld.Log("µ÷ÓÃNPC·ÇÏßÐÔÊôÐÔÌõ¼þʧ°Ü,index = %s" % (key))
|
continue
|
|
EffGetSet.SetValueByEffIndex(curNPC, key, curValue * (ChConfig.Def_MaxRateValue + value) / ChConfig.Def_MaxRateValue)
|
|
return
|
|