| | |
| | | effList = []
|
| | |
|
| | | # 优先取关联技能的
|
| | | if connSkillTypeID and connSkillTypeID not in [ChConfig.TriggerSrc_Skill, ChConfig.TriggerSrc_Buff]:
|
| | | if connSkillTypeID and connSkillTypeID not in [ChConfig.TriggerSrc_Skill, ChConfig.TriggerSrc_Buff, ChConfig.TriggerSrc_SkillSelf, ChConfig.TriggerSrc_BuffSelf]:
|
| | | # 技能
|
| | | key = (triggerWay, connSkillTypeID)
|
| | | if key in self._AffectSkillDict:
|
| | |
| | | return
|
| | | if triggerWay == ChConfig.TriggerWay_CurSkillEff:
|
| | | return
|
| | | if triggerSrc == ChConfig.TriggerSrc_Buff:
|
| | | if triggerSrc in [ChConfig.TriggerSrc_Buff, ChConfig.TriggerSrc_BuffSelf]:
|
| | | # buff有效的不加进来
|
| | | return
|
| | |
|
| | | skillID = curSkill.GetSkillID()
|
| | | effectID = effect.GetEffectID()
|
| | |
|
| | | if triggerWay == ChConfig.TriggerWay_CalcEffValue:
|
| | | triggerWay = "%s_%s" % (triggerWay, effectID)
|
| | | |
| | | if triggerSrc == ChConfig.TriggerSrc_SkillSelf:
|
| | | triggerSrc = curSkill.GetSkillTypeID()
|
| | | |
| | | key = (triggerWay, triggerSrc)
|
| | | if key not in self._AffectSkillDict:
|
| | | self._AffectSkillDict[key] = {}
|
| | |
| | | return
|
| | | if triggerWay == ChConfig.TriggerWay_CurSkillEff:
|
| | | return
|
| | | if triggerSrc == ChConfig.TriggerSrc_Skill:
|
| | | if triggerSrc in [ChConfig.TriggerSrc_Skill, ChConfig.TriggerSrc_SkillSelf]:
|
| | | # 技能有效的不加进来
|
| | | return
|
| | |
|
| | | buffID = buff.GetBuffID()
|
| | | effectID = effect.GetEffectID()
|
| | |
|
| | | if triggerWay == ChConfig.TriggerWay_CalcEffValue:
|
| | | triggerWay = "%s_%s" % (triggerWay, effectID)
|
| | | |
| | | if triggerSrc == ChConfig.TriggerSrc_BuffSelf:
|
| | | triggerSrc = skillData.GetSkillTypeID()
|
| | | |
| | | key = (triggerWay, triggerSrc)
|
| | | if key not in self._AffectBuffDict:
|
| | | self._AffectBuffDict[key] = {}
|
| | |
| | | def GetCalcType(self): return self._ipyData.GetCalcType()
|
| | | def GetSkillPer(self): return self._ipyData.GetSkillPer()
|
| | | def GetSkillValue(self): return self._ipyData.GetSkillValue()
|
| | | def GetHurtAtkPerMax(self): return self._ipyData.GetHurtAtkPerMax()
|
| | | def GetHappenRate(self): return self._ipyData.GetHappenRate() # 触发概率
|
| | | def GetEffect(self, index): return self._effList[index] if len(self._effList) > index else 0
|
| | | def GetEffectCount(self): return len(self._effList)
|
| | |
| | | def GetCalcType(self): return self._skillData.GetCalcType()
|
| | | def GetSkillPer(self): return self._skillData.GetSkillPer()
|
| | | def GetSkillValue(self): return self._skillData.GetSkillValue()
|
| | | def GetHurtAtkPerMax(self): return self._skillData.GetHurtAtkPerMax()
|
| | | def GetHappenRate(self): return self._skillData.GetHappenRate() # 触发概率
|
| | | def GetEffect(self, index): return self._skillData.GetEffect(index)
|
| | | def GetEffectCount(self): return self._skillData.GetEffectCount()
|
| | |
| | | self._xp = 0 # 当前怒气值
|
| | | self._isAlive = True # 是否活着
|
| | | self._initAttrDict = {} # 初始化时的属性,固定不变,初始化时已经算好的属性 {attrID:value, ...}
|
| | | self._batAttrDict = {} # 实际战斗属性,包含buff层级的实际属性
|
| | | self._skillTempAttrDict = {} # 某次技能释放中临时的属性增减 {attrID:+-value, ...}
|
| | | self._batAttrDict = {} # 实际战斗属性,包含buff层级的实际属性 {attrID:+-value, ...} value可能是负值
|
| | | self._skillTempAttrDict = {} # 某次技能释放中临时的属性增减 {attrID:+-value, ...} value可能是负值
|
| | | self._kvDict = {} # 自定义kv字典
|
| | | self._skillUseCntDict = {} # 技能累计使用次数 {skillID:useCnt, ...}
|
| | | self._skillTurnUseCntDict = {} # 技能单回合累计使用次数 {skillID:useCnt, ...}
|
| | | self._skillMgr = ObjPool.GetPoolMgr().acquire(SkillManager)
|
| | | self._buffMgr = ObjPool.GetPoolMgr().acquire(BuffManager, self)
|
| | | self._passiveEffMgr = ObjPool.GetPoolMgr().acquire(PassiveEffManager, self)
|
| | | self._lastHurtValue = 0
|
| | |
|
| | | # 统计
|
| | | self.hurtStat = 0 # 输出统计
|
| | |
| | | # return False
|
| | | return True
|
| | |
|
| | | def IsInState(self, state):
|
| | | def CheckInState(self, checkInState):
|
| | | ## 是否处于某种状态下
|
| | | if isinstance(checkInState, int):
|
| | | checkInStateList = [checkInState]
|
| | | elif isinstance(checkInState, list) or isinstance(checkInState, tuple):
|
| | | checkInStateList = checkInState
|
| | | else:
|
| | | return False
|
| | | for state in checkInStateList:
|
| | | if self._buffMgr.IsInBuffState(state):
|
| | | return True
|
| | | return False
|
| | | def IsInState(self, state):
|
| | | ## 是否处于指定状态下
|
| | | return self._buffMgr.IsInBuffState(state)
|
| | |
|
| | | def IsInControlled(self):
|
| | |
| | | def GetAtk(self): return self.GetBatAttrValue(ChConfig.AttrID_Atk)
|
| | | def GetDef(self): return self.GetBatAttrValue(ChConfig.AttrID_Def)
|
| | |
|
| | | def GetBatAttrDict(self): return self._batAttrDict
|
| | | def GetBatAttrValue(self, attrID, includeTemp=True):
|
| | | #ChConfig.AttrID_HP ChConfig.AttrID_XP
|
| | | value = self._batAttrDict.get(attrID, 0)
|
| | | if includeTemp and attrID in self._skillTempAttrDict:
|
| | | value += self._skillTempAttrDict[attrID] # 支持正负值
|
| | | value = max(1, value)
|
| | | #value = max(1, value)
|
| | | return value
|
| | | def SetBatAttrValue(self, attrID, value): self._batAttrDict[attrID] = value
|
| | | def AddSkillTempAttr(self, attrID, value):
|
| | |
| | | self._skillUseCntDict[skillID] = self._skillUseCntDict.get(skillID, 0) + 1
|
| | | self._skillTurnUseCntDict[skillID] = self._skillTurnUseCntDict.get(skillID, 0) + 1
|
| | |
|
| | | def GetLastHurtValue(self): return self._lastHurtValue
|
| | | def SetLastHurtValue(self, lastHurtValue): self._lastHurtValue = lastHurtValue
|
| | | |
| | | def StatHurtValue(self, hurtValue):
|
| | | ## 统计输出
|
| | | self.hurtStat += hurtValue
|