#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#---------------------------------------------------------------------
|
#
|
#---------------------------------------------------------------------
|
##@package CalcLineEffect.
|
# @todo:
|
#
|
# @author: panwei
|
# @date 2011-03-22
|
# @version 1.1
|
#
|
# @change: "2013-04-17 20:35" Alee ¸ü¸Ä¼ÆË㷽ʽ
|
#------------------------------------------------------------------------------
|
"""Version = 2013-04-17 20:35"""
|
#---------------------------------------------------------------------
|
import EffGetSet
|
import GameWorld
|
import ChConfig
|
#---------------------------------------------------------------------
|
## ¸øÍæ¼ÒÌí¼ÓÏßÐÔBuffЧ¹û
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param effectDict Ч¹û×Öµä
|
# @return None
|
def ChangePlayerAttrInLineEffectList(curPlayer, effectDict, isBuffAttr=False):
|
return __CalcAttrInLineEffectList(curPlayer, effectDict, isBuffAttr)
|
|
#---------------------------------------------------------------------
|
## ¸øNPCÌí¼ÓÏßÐÔBuffЧ¹û
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param effectDict Ч¹û×Öµä
|
# @return None
|
# @remarks
|
def ChangeNPCAttrInLineEffectList(curNPC, effectDict):
|
return __CalcAttrInLineEffectList(curNPC, effectDict, False)
|
|
#---------------------------------------------------------------------
|
##Ìí¼ÓÏßÐÔBuff
|
# @param curObj ¶ÔÏóʵÀý
|
# @param effectList Ч¹ûÁбíTYPE_Max_Attr
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks
|
def __CalcAttrInLineEffectList(curObj, effectDict, isBuffAttr):
|
for key, value in effectDict.items():
|
if value == 0:
|
continue
|
|
# buff¶ÔÒÆ¶¯ËٶȵÄÓ°Ïì²»ÔÚÕâÀï¼ÆËã, µ¥¶ÀÌá³öÀ´¶ÀÁ¢¼ÆËã
|
if isBuffAttr and key == ChConfig.TYPE_Calc_AttrSpeed:
|
continue
|
|
curValue = EffGetSet.GetValueByEffIndex(curObj, key)
|
|
if curValue == None:
|
GameWorld.Log("µ÷ÓÃÏßÐÔÊôÐÔÌõ¼þʧ°Ü, curObjType = %s, index = %s"%(curObj.GetGameObjType(), key))
|
continue
|
|
EffGetSet.SetValueByEffIndex(curObj, key, curValue + value)
|
|
return
|
|