| | |
| | | self._initAttrDict = initAttrDict
|
| | | self._batAttrDict = {}
|
| | | self._batAttrDict.update(initAttrDict)
|
| | | self.__onUpdBatAttr()
|
| | | self._skillTempAttrDict = {}
|
| | | self._xp = initXP
|
| | | self._hp = initAttrDict.get(ChConfig.AttrID_MaxHP, 1)
|
| | | self.SetXP(initXP, False)
|
| | | self.SetHPFull(False)
|
| | | TurnBuff.RefreshBuffAttr(self)
|
| | | TurnPassive.RefreshPassive(self)
|
| | | return
|
| | |
| | | def ResetBattleEffect(self):
|
| | | self._batAttrDict = {}
|
| | | self._batAttrDict.update(self._initAttrDict)
|
| | | self.__onUpdBatAttr()
|
| | | return self._batAttrDict
|
| | |
|
| | | def GetTFGUID(self): return self.tfGUID # 所属的某场战斗
|
| | |
| | | def SetDead(self):
|
| | | self._isAlive = False
|
| | | self._hp = 0
|
| | | def GetMaxHP(self): return self._batAttrDict.get(ChConfig.AttrID_MaxHP, 0)
|
| | | def GetMaxHP(self): return int(self._batAttrDict.get(ChConfig.AttrID_MaxHP, 0))
|
| | | def SetMaxHP(self, maxHP, isNotify=False):
|
| | | maxHP = int(maxHP)
|
| | | self._batAttrDict[ChConfig.AttrID_MaxHP] = maxHP
|
| | | if isNotify:
|
| | | NotifyObjInfoRefresh(self, ChConfig.AttrID_MaxHP, maxHP)
|
| | | return
|
| | | def GetHP(self): return self._hp
|
| | | def SetHP(self, hp, isNotify=False):
|
| | | hp = int(hp)
|
| | | self._hp = hp
|
| | | if isNotify:
|
| | | NotifyObjInfoRefresh(self, ChConfig.AttrID_HP, hp)
|
| | |
| | | def SetHPFull(self, isNotify=True): self.SetHP(self.GetMaxHP(), isNotify)
|
| | | def GetXP(self): return self._xp
|
| | | def SetXP(self, xp, isNotify=True):
|
| | | xp = int(xp)
|
| | | self._xp = xp
|
| | | if isNotify:
|
| | | NotifyObjInfoRefresh(self, ChConfig.AttrID_XP, xp)
|
| | |
| | | value += self._skillTempAttrDict[attrID] # 支持正负值
|
| | | #value = max(1, value)
|
| | | return value
|
| | | def SetBatAttrValue(self, attrID, value): self._batAttrDict[attrID] = value
|
| | | def SetBatAttrValue(self, attrID, value):
|
| | | self._batAttrDict[attrID] = value
|
| | | self.__onUpdBatAttr()
|
| | | return
|
| | | def __onUpdBatAttr(self):
|
| | | for attrID in [ChConfig.AttrID_MaxHP]:
|
| | | self._batAttrDict[attrID] = int(self._batAttrDict.get(attrID, 0))
|
| | | return
|
| | | def AddSkillTempAttr(self, attrID, value):
|
| | | ## 增加技能临时属性,支持正负值
|
| | | # @param value: 正值-加属性;负值-减属性
|