129 【战斗】战斗系统-服务端(优化战斗效率;司马懿所有技能;)
| | |
| | |
|
| | | def __init__(self, batObj):
|
| | | self._batObj = batObj
|
| | | # 被影响的技能ID: 0为所有技能
|
| | | self._objID = batObj.GetID() if batObj else 0
|
| | | |
| | | # 技能
|
| | | self._AffectSkillDict = {} # 被动技能 {(触发方式, 有效来源):{技能ID:[effID, ...], ...}, ...}
|
| | | self._affectSkillEnhanceDict = {} # 未学习的额外子技能被动效果 {skillID:{(触发方式, 有效来源):[effID, ...], ...}, ...}
|
| | | self._skillTriggerWayList = [] # 技能有的触发方式 [触发方式, ...] ,优化效率用,减少多余逻辑
|
| | | |
| | | # buff
|
| | | self._AffectBuffDict = {} # 被动buff {(触发方式, 有效来源):{buffID:[effID, ...], ...}, ...}
|
| | | self._buffSkillIDDict = {} # {buffID:skillID, ...}
|
| | | self._buffTriggerWayList = [] # buff有的触发方式 [触发方式, ...] ,优化效率用,减少多余逻辑
|
| | | return
|
| | |
|
| | | def onRelease(self):
|
| | |
| | | '''
|
| | | effList = []
|
| | |
|
| | | if not connSkillTypeID:
|
| | | if connSkill:
|
| | | connSkillTypeID = connSkill.GetSkillTypeID()
|
| | | elif connBuff:
|
| | | skillData = connBuff.GetSkillData()
|
| | | connSkillTypeID = skillData.GetSkillTypeID()
|
| | | |
| | | # SkillData 对象暂时没有 GetObjID
|
| | | if connSkill and hasattr(connSkill, "GetObjID") and self._batObj.GetID() == connSkill.GetObjID():
|
| | | # 额外子技能的一般是未学习的技能,直接加载自身的被动效果
|
| | | if connSkill and not isinstance(connSkill, IpyGameDataPY.IPY_Skill) and self._objID == connSkill.GetObjID() \
|
| | | and connSkill.GetBatType() == ChConfig.TurnBattleType_Enhance:
|
| | | skillID = connSkill.GetSkillID()
|
| | | skillManager = self._batObj.GetSkillManager()
|
| | | # 非对象身上的技能,读取本技能被动触发的效果,一般是主技能拆分的子技能
|
| | | if not skillManager.FindSkillByID(skillID):
|
| | | effIDList = []
|
| | | if skillID not in self._affectSkillEnhanceDict:
|
| | | effDict = {}
|
| | | for index in xrange(connSkill.GetEffectCount()):
|
| | | effect = connSkill.GetEffect(index)
|
| | | effectID = effect.GetEffectID()
|
| | |
| | | continue
|
| | | if tWay == ChConfig.TriggerWay_CalcEffValue:
|
| | | tWay = "%s_%s" % (tWay, effectID)
|
| | | if tWay != triggerWay:
|
| | | continue
|
| | | effIDList.append(effectID)
|
| | | if effIDList:
|
| | | effList.append(["skill", skillID, 0, effIDList])
|
| | | |
| | | key = (tWay, tSrc)
|
| | | if key not in effDict:
|
| | | effDict[key] = {}
|
| | | effList = effDict[key]
|
| | | if effectID not in effList:
|
| | | effList.append(effList)
|
| | | self._affectSkillEnhanceDict[skillID] = effDict
|
| | | |
| | | effDict = self._affectSkillEnhanceDict[skillID]
|
| | | if triggerWay in effDict:
|
| | | effList.append(["skill", skillID, 0, effDict[triggerWay]])
|
| | | |
| | | if triggerWay not in self._skillTriggerWayList and triggerWay not in self._buffTriggerWayList:
|
| | | return effList
|
| | | |
| | | if not connSkillTypeID:
|
| | | if connSkill:
|
| | | connSkillTypeID = connSkill.GetSkillTypeID()
|
| | | elif connBuff:
|
| | | connSkillTypeID = connBuff.GetSkillTypeID()
|
| | |
|
| | | # 优先取关联技能的
|
| | | if connSkillTypeID and connSkillTypeID not in [ChConfig.TriggerSrc_Skill, ChConfig.TriggerSrc_Buff, ChConfig.TriggerSrc_SkillSelf, ChConfig.TriggerSrc_BuffSelf]:
|
| | |
| | | if key in self._AffectBuffDict:
|
| | | effDict = self._AffectBuffDict[key]
|
| | | for buffID, effIDList in effDict.items():
|
| | | effList.append(["buff", self._buffSkillIDDict.get(buffID, 0), buffID, effIDList])
|
| | | skillID = self._buffSkillIDDict[buffID] if buffID in self._buffSkillIDDict else 0
|
| | | effList.append(["buff", skillID, buffID, effIDList])
|
| | |
|
| | | # 所有技能有效的
|
| | | key = (triggerWay, ChConfig.TriggerSrc_Skill)
|
| | | effDict = self._AffectSkillDict.get(key, {})
|
| | | if key in self._AffectSkillDict:
|
| | | effDict = self._AffectSkillDict[key]
|
| | | for skillID, effIDList in effDict.items():
|
| | | effList.append(["skill", skillID, 0, effIDList])
|
| | |
|
| | | # 所有buff有效的
|
| | | key = (triggerWay, ChConfig.TriggerSrc_Buff)
|
| | | effDict = self._AffectBuffDict.get(key, {})
|
| | | if key in self._AffectBuffDict:
|
| | | effDict = self._AffectBuffDict[key]
|
| | | for buffID, effIDList in effDict.items():
|
| | | effList.append(["buff", self._buffSkillIDDict.get(buffID, 0), buffID, effIDList])
|
| | | skillID = self._buffSkillIDDict[buffID] if buffID in self._buffSkillIDDict else 0
|
| | | effList.append(["buff", skillID, buffID, effIDList])
|
| | |
|
| | | return effList
|
| | |
|
| | | def RefreshSkillPassiveEffect(self):
|
| | | self._AffectSkillDict = {}
|
| | | self._skillTriggerWayList = []
|
| | |
|
| | | skillManager = self._batObj.GetSkillManager()
|
| | | for index in range(0, skillManager.GetSkillCount()):
|
| | |
| | | if skillID not in effDict:
|
| | | effDict[skillID] = []
|
| | | effDict[skillID].append(effectID)
|
| | | if triggerWay not in self._skillTriggerWayList:
|
| | | self._skillTriggerWayList.append(triggerWay)
|
| | | return
|
| | |
|
| | | def RefreshBuffPassiveEffect(self):
|
| | | self._AffectBuffDict = {}
|
| | | self._buffTriggerWayList = []
|
| | | |
| | | buffMgr = self._batObj.GetBuffManager()
|
| | | for index in range(buffMgr.GetBuffCount()):
|
| | | buff = buffMgr.GetBuffByIndex(index)
|
| | |
| | | if effectID not in effIDList:
|
| | | effIDList.append(effectID)
|
| | | self._buffSkillIDDict[buffID] = skillData.GetSkillID()
|
| | | if triggerWay not in self._buffTriggerWayList:
|
| | | self._buffTriggerWayList.append(triggerWay)
|
| | | return
|
| | |
|
| | | def DelBuffPassiveEffect(self, buffID):
|
| | |
| | | for key, effDict in self._AffectBuffDict.items():
|
| | | if buffID not in effDict:
|
| | | continue
|
| | | self._buffSkillIDDict.pop(buffID, 0)
|
| | | effDict.pop(buffID)
|
| | | if not effDict:
|
| | | self._AffectBuffDict.pop(key)
|
| | | self._buffSkillIDDict.pop(buffID, 0)
|
| | | # 检查移除存在的触发方式
|
| | | triggerWay = key[0]
|
| | | hasTrigger = False
|
| | | for k in self._AffectBuffDict.keys():
|
| | | if triggerWay == k[0]:
|
| | | hasTrigger = True
|
| | | break
|
| | | if not hasTrigger and triggerWay in self._buffTriggerWayList:
|
| | | self._buffTriggerWayList.remove(triggerWay)
|
| | | return
|
| | |
|
| | | class HurtObj():
|
| | |
| | |
|
| | | def __init__(self, ipyData):
|
| | | self._ipyData = ipyData
|
| | | self._skillID = self._ipyData.GetSkillID()
|
| | | self._skillTypeID = self._ipyData.GetSkillTypeID()
|
| | | self._effList = [] # [Effect, ...]
|
| | | self._effDict = {} # {(effID, triggerWay):Effect, ...} ,确保唯一,同个技能可能配置相同的效果ID
|
| | | for num in range(1, 1 + 3):
|
| | |
| | | ## 回收前处理,主要处理一些其他不需要释放的对象池对象,防止被连同误回收
|
| | | return
|
| | |
|
| | | def GetObjID(self): return 0 # 减少判断 hasattr 用
|
| | | def GetBatType(self): return -1 # 减少判断 hasattr 用
|
| | | def GetIpyData(self): return self._ipyData
|
| | | def GetSkillID(self): return self._ipyData.GetSkillID()
|
| | | def GetSkillTypeID(self): return self._ipyData.GetSkillTypeID()
|
| | | def GetSkillID(self): return self._skillID
|
| | | def GetSkillTypeID(self): return self._skillTypeID
|
| | | def GetSkillLV(self): return self._ipyData.GetSkillLV()
|
| | | def GetSkillMaxLV(self): return self._ipyData.GetSkillMaxLV()
|
| | | def GetSkillName(self): return self._ipyData.GetSkillName()
|
| | |
| | | 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 GetEffect(self, index): return self._effList[index]# if len(self._effList) > index else 0
|
| | | def GetEffectCount(self): return len(self._effList)
|
| | | def GetEffectByID(self, effID, triggerWay=0): return self._effDict.get((effID, triggerWay), None)
|
| | | def GetEffectByID(self, effID, triggerWay=0):
|
| | | if (effID, triggerWay) in self._effDict:
|
| | | return self._effDict[(effID, triggerWay)]
|
| | | def GetConnSkill(self): return self._ipyData.GetConnSkill()
|
| | | def GetCoolDownInit(self): return self._ipyData.GetCoolDownInit()
|
| | | def GetCoolDownTime(self): return self._ipyData.GetCoolDownTime()
|
| | |
| | |
|
| | | def __init__(self, ipyData):
|
| | | self._skillData = ObjPool.GetPoolMgr().acquire(SklllData, ipyData)
|
| | | self._skillID = self._skillData.GetSkillID()
|
| | | self._skillTypeID = self._skillData.GetSkillTypeID()
|
| | | self._addTiming = 0 # 添加该buff时间点,0-自身回合前;1-自身回合后
|
| | | self._refreshState = 0 # 添加buff后是否刷新过剩余回合,未刷新过的需要先设置为已刷新,防止添加后马上被扣除1回合的时长
|
| | | self._buffID = 0
|
| | |
| | | return
|
| | |
|
| | | def GetSkillData(self): return self._skillData
|
| | | def GetSkillID(self): return self._skillData.GetSkillID()
|
| | | def GetSkillID(self): return self._skillID
|
| | | def GetSkillTypeID(self): return self._skillTypeID
|
| | | def GetCurBuffState(self): return self._skillData.GetCurBuffState()
|
| | | def GetDispersedLimit(self): return self._skillData.GetDispersedLimit()
|
| | | def GetBuffRetain(self): return self._skillData.GetBuffRetain()
|
| | |
| | | def SetValue3(self, value): self._value3 = value
|
| | | def GetIsCopy(self): return self._isCopy
|
| | | def SetIsCopy(self, isCopy): self._isCopy = isCopy
|
| | | def GetEffectValueEx(self, effID): return self._effExDict.get(effID, 0)
|
| | | def GetEffectValueEx(self, effID):
|
| | | if effID in self._effExDict:
|
| | | return self._effExDict[effID]
|
| | | def ResetEffectValueEx(self): self._effExDict = {}
|
| | | def AddEffectValueEx(self, effID, valueEx): self._effExDict[effID] = self._effExDict.get(effID, 0) + valueEx
|
| | | def GetEffectExDict(self): return self._effExDict
|
| | |
| | |
|
| | | self._buffList.append(buff)
|
| | | self._buffIDDict[buffID] = buff
|
| | | #GameWorld.DebugLog("ObjBuff:%s, AddBuff buffID=%s, %s, %s, %s, %s, %s" % (self._batObj.GetID(), buffID, buff, len(self._buffList), len(self._buffIDDict), self._buffList, self._buffIDDict))
|
| | | #GameWorld.DebugLogEx("ObjBuff:%s, AddBuff buffID=%s, %s, %s, %s, %s, %s", self._batObj.GetID(), buffID, buff, len(self._buffList), len(self._buffIDDict), self._buffList, self._buffIDDict)
|
| | | if skillTypeID not in self._skillTypeIDBuffIDs:
|
| | | self._skillTypeIDBuffIDs[skillTypeID] = []
|
| | | buffIDs = self._skillTypeIDBuffIDs[skillTypeID]
|
| | |
| | |
|
| | | def DelBuff(self, buffID, release=True):
|
| | | if buffID not in self._buffIDDict:
|
| | | #GameWorld.DebugLog("ObjBuff:%s, DelBuff not in self._buffIDDict, buffID=%s, %s" % (self._batObj.GetID(), buffID, self._buffIDDict.keys()))
|
| | | #GameWorld.DebugLogEx("ObjBuff:%s, DelBuff not in self._buffIDDict, buffID=%s, %s", self._batObj.GetID(), buffID, self._buffIDDict.keys())
|
| | | return
|
| | | #GameWorld.DebugLog("ObjBuff:%s, DelBuff %s, buffID=%s, dict:%s, len:%s, list:%s" % (self._batObj.GetID(), release, buffID, self._buffIDDict, len(self._buffList), self._buffList))
|
| | | #GameWorld.DebugLogEx("ObjBuff:%s, DelBuff %s, buffID=%s, dict:%s, len:%s, list:%s", self._batObj.GetID(), release, buffID, self._buffIDDict, len(self._buffList), self._buffList)
|
| | | buff = self._buffIDDict.pop(buffID)
|
| | | if buff in self._buffList:
|
| | | self._buffList.remove(buff)
|
| | |
| | | if lBuff.GetBuffID() == buffID:
|
| | | self._buffList.remove(lBuff)
|
| | | GameWorld.ErrLog("删除buff异常不在列表里! buffID=%s,lBuff=%s,buff=%s" % (buffID, lBuff, buff))
|
| | | #GameWorld.DebugLog(" ObjBuff:%s, buffID=%s, dict:%s, len:%s, dictKeys:%s, list:%s" % (self._batObj.GetID(), buffID, len(self._buffIDDict), len(self._buffList), self._buffIDDict.keys(), self._buffList))
|
| | | #GameWorld.DebugLogEx(" ObjBuff:%s, buffID=%s, dict:%s, len:%s, dictKeys:%s, list:%s", self._batObj.GetID(), buffID, len(self._buffIDDict), len(self._buffList), self._buffIDDict.keys(), self._buffList)
|
| | | for skillTypeID, buffIDList in self._skillTypeIDBuffIDs.items():
|
| | | if buffID not in buffIDList:
|
| | | continue
|
| | |
| | | ObjPool.GetPoolMgr().release(buff)
|
| | | return
|
| | |
|
| | | def GetBuff(self, buffID): return self._buffIDDict.get(buffID, None)
|
| | | def GetBuff(self, buffID):
|
| | | if buffID in self._buffIDDict:
|
| | | return self._buffIDDict[buffID]
|
| | | def FindBuffListBySkillID(self, skillID):
|
| | | ## 返回该技能ID的所有buff列表
|
| | | skillData = IpyGameDataPY.GetIpyGameData("Skill", skillID)
|
| | |
| | | return
|
| | | def FindBuffByState(self, state):
|
| | | ## 查找某种buff状态的buff
|
| | | buffIDList = self._buffStateDict.get(state, [])
|
| | | if state not in self._buffStateDict:
|
| | | return
|
| | | buffIDList = self._buffStateDict[state]
|
| | | if not buffIDList:
|
| | | return
|
| | | buffID = buffIDList[0]
|
| | | return self._buffIDDict.get(buffID, None)
|
| | | if buffID in self._buffIDDict:
|
| | | return self._buffIDDict[buffID]
|
| | | def FindBuffListByState(self, state):
|
| | | ## 查找某种buff状态的buff列表
|
| | | buffIDList = self._buffStateDict.get(state, [])
|
| | | if state not in self._buffStateDict:
|
| | | return []
|
| | | buffIDList = self._buffStateDict[state]
|
| | | buffs = []
|
| | | for buffID in buffIDList:
|
| | | if buffID not in self._buffIDDict:
|
| | |
| | | buffIDList = self._buffStateDict[state]
|
| | | if buffID not in buffIDList:
|
| | | buffIDList.append(buffID)
|
| | | GameWorld.DebugLog(" AddBuffState state=%s,buffID=%s,%s" % (state, buffID, self._buffStateDict))
|
| | | GameWorld.DebugLogEx(" AddBuffState state=%s,buffID=%s,%s", state, buffID, self._buffStateDict)
|
| | | return
|
| | |
|
| | | def DelBuffState(self, state, buffID):
|
| | |
| | | buffIDList.remove(buffID)
|
| | | if not buffIDList:
|
| | | self._buffStateDict.pop(state)
|
| | | GameWorld.DebugLog(" DelBuffState state=%s,buffID=%s,%s" % (state, buffID, self._buffStateDict))
|
| | | GameWorld.DebugLogEx(" DelBuffState state=%s,buffID=%s,%s", state, buffID, self._buffStateDict)
|
| | | return
|
| | |
|
| | | def IsInBuffState(self, state): return state in self._buffStateDict ## 是否处于某种状态下
|
| | | def GetStateBuffIDList(self, state): return self._buffStateDict.get(state, []) # 获取某种状态的所有buffID列表
|
| | | def GetStateBuffIDList(self, state): # 获取某种状态的所有buffID列表
|
| | | if state in self._buffStateDict:
|
| | | return self._buffStateDict[state]
|
| | | return []
|
| | |
|
| | | class PySkill():
|
| | |
|
| | | def __init__(self, ipyData, objID):
|
| | | self._objID = objID # 该技能谁的
|
| | | self._skillData = ObjPool.GetPoolMgr().acquire(SklllData, ipyData)
|
| | | self._skillID = self._skillData.GetSkillID()
|
| | | self._skillTypeID = self._skillData.GetSkillTypeID()
|
| | | self._remainTime = 0
|
| | | self._batType = 0 # 战斗类型,普通、连击、反击、追击等
|
| | | self._tagObjList = [] # 本次技能主要目标列表 [BatObj, ...]
|
| | |
| | |
|
| | | def GetObjID(self): return self._objID
|
| | | def GetSkillData(self): return self._skillData
|
| | | def GetSkillID(self): return self._skillData.GetSkillID()
|
| | | def GetSkillTypeID(self): return self._skillData.GetSkillTypeID()
|
| | | def GetSkillID(self): return self._skillID
|
| | | def GetSkillTypeID(self): return self._skillTypeID
|
| | | def GetSkillLV(self): return self._skillData.GetSkillLV()
|
| | | def GetSkillMaxLV(self): return self._skillData.GetSkillMaxLV()
|
| | | def GetSkillName(self): return self._skillData.GetSkillName()
|
| | |
| | | ## 检查并设置开始连击相关,一般是开始使用技能时调用
|
| | | if not force:
|
| | | if self._comboState == 1:
|
| | | #GameWorld.DebugLog("连击进行中,不重置")
|
| | | #GameWorld.DebugLogEx("连击进行中,不重置")
|
| | | return
|
| | | self.__commboClear()
|
| | | self._comboState = 1 # 设置已初始化连击相关
|
| | | #GameWorld.DebugLog("连击重置")
|
| | | #GameWorld.DebugLogEx("连击重置")
|
| | | return
|
| | |
|
| | | def ComboEnable(self): return self._comboState == 1 ## 可否执行连击相关
|
| | |
| | | def GetSkillCount(self): return len(self._skillList)
|
| | | def GetSkillByIndex(self, index): return self._skillList[index]
|
| | | def GetSkillIDList(self): return sorted(self._skillDict.keys())
|
| | | def FindSkillByID(self, skillID): return self._skillDict.get(skillID, None)
|
| | | def FindSkillByID(self, skillID):
|
| | | if skillID in self._skillDict:
|
| | | return self._skillDict[skillID]
|
| | | def FindSkillByTypeID(self, skillTypeID):
|
| | | skill = None
|
| | | for s in self._skillList:
|
| | |
| | | newBatObj = ObjPool.GetPoolMgr().acquire(BatObj)
|
| | | newBatObj.objID = newObjID
|
| | | self.batObjDict[newObjID] = newBatObj
|
| | | GameWorld.DebugLog("添加战斗单位: objID=%s" % (newObjID))
|
| | | GameWorld.DebugLogEx("添加战斗单位: objID=%s", newObjID)
|
| | | if False:
|
| | | newBatObj = BatObj(None, 0)
|
| | | return newBatObj
|
| | |
| | | if not batObj:
|
| | | return
|
| | | objID = batObj.objID
|
| | | GameWorld.DebugLog("回收战斗单位: objID=%s" % (objID))
|
| | | GameWorld.DebugLogEx("回收战斗单位: objID=%s", objID)
|
| | | #前端确认不需要通知消失
|
| | | #turnFight = batObj.GetTurnFight()
|
| | | #if turnFight:
|
| | |
| | | for _, _, _, faction, num in sortList:
|
| | | self.actionSortList.append([faction, num])
|
| | |
|
| | | GameWorld.DebugLog("阵容战力排序[isPlayer, fp, sortV, f, n]: %s" % sortList)
|
| | | GameWorld.DebugLog("阵容行动顺序[f, n]: %s" % self.actionSortList)
|
| | | GameWorld.DebugLogEx("阵容战力排序[isPlayer, fp, sortV, f, n]: %s", sortList)
|
| | | GameWorld.DebugLogEx("阵容行动顺序[f, n]: %s", self.actionSortList)
|
| | | return
|
| | |
|
| | | def getBatFaction(self, faction=ChConfig.Def_FactionA):
|
| | |
| | | if self._isNeedReport:
|
| | | packBuff = clientPack.GetBuffer()
|
| | | buffLen = len(packBuff)
|
| | | #GameWorld.DebugLog("回合战斗过程封包: %s, len:%s, %s" % (headStr, buffLen, CommFunc.B2Hex(packBuff)))
|
| | | GameWorld.DebugLog("回合战斗过程封包: %s, len:%s" % (headStr, buffLen))
|
| | | #GameWorld.DebugLogEx("回合战斗过程封包: %s, len:%s, %s", headStr, buffLen, CommFunc.B2Hex(packBuff))
|
| | | GameWorld.DebugLogEx("回合战斗过程封包: %s, len:%s", headStr, buffLen)
|
| | | self.batBuffer += CommFunc.WriteWORD("", buffLen)
|
| | | self.batBuffer += packBuff
|
| | | ObjPool.GetPoolMgr().release(clientPack)
|
| | | else:
|
| | | GameWorld.DebugLog("回合战斗过程封包: %s" % (headStr))
|
| | | GameWorld.DebugLogEx("回合战斗过程封包: %s", headStr)
|
| | | # 有玩家的统一每个包单独发送,同样也支持战报统计
|
| | | if self.curPlayer:
|
| | | NetPackCommon.SendFakePack(self.curPlayer, clientPack)
|
| | |
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | | lineup = olPlayer.GetLineup(lineupID)
|
| | | if lineup.IsEmpty():
|
| | | GameWorld.DebugLog("玩家没有目标阵容默认取主阵容! lineupID=%s" % lineupID, curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLogEx("玩家没有目标阵容默认取主阵容! lineupID=%s", lineupID, curPlayer.GetPlayerID())
|
| | | lineup = olPlayer.GetLineup(ShareDefine.Lineup_Main)
|
| | | return lineup
|
| | |
|
| | |
| | |
|
| | | lineupInfo = {"NPCLineupID":lineupID, "Hero":heroDict, "BossID":bossID, "BossPosView":bossPosView}
|
| | | return lineupInfo
|
| | |
|
| | | def GMTestPVP(curPlayer, tagPlayerID=0):
|
| | | ## GM测试PVP战斗
|
| | | if not tagPlayerID:
|
| | | tagPlayerID = curPlayer.GetPlayerID()
|
| | | |
| | | guid = GameWorld.GetGUID()
|
| | | mapID, funcLineID = 0, 0
|
| | | |
| | | tagViewCache = PlayerViewCache.FindBattleViewCache(tagPlayerID)
|
| | | if not tagViewCache:
|
| | | PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
|
| | | return
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, ShareDefine.Lineup_Main)
|
| | | lineupDictA = {1:GetPlayerLineupInfo(curPlayer, ShareDefine.Lineup_Main)}
|
| | | lineupDictB = {1:defLineupInfo}
|
| | | turnFight = DoTurnFightPVP(guid, mapID, funcLineID, lineupDictA, lineupDictB)
|
| | | return turnFight.costTime if turnFight else None
|
| | |
|
| | | def GMTestFight(curPlayer, heroIDList, isAllSkill):
|
| | | ## GM测试战斗,指定武将
|
| | |
| | | random.shuffle(randSkillIDExList)
|
| | | randSkillIDExList = randSkillIDExList[:skillExCnt]
|
| | | skillIDList += randSkillIDExList
|
| | | GameWorld.DebugLog("阵容boss技能: %s, 随机附加技能: %s" % (skillIDList, randSkillIDExList))
|
| | | GameWorld.DebugLogEx("阵容boss技能: %s, 随机附加技能: %s", skillIDList, randSkillIDExList)
|
| | |
|
| | | # 成长怪属性
|
| | | batAttrDict = GetNPCStrongerAttrDict(npcID, lvIpyData, npcStronger, difficulty)
|
| | |
| | | "SkillIDList":skillIDList,
|
| | | }
|
| | |
|
| | | GameWorld.DebugLog("GetNPCBattleDict npcID=%s,strongerLV=%s,difficulty=%s,%s" % (npcID, strongerLV, difficulty, battleDict))
|
| | | GameWorld.DebugLogEx("GetNPCBattleDict npcID=%s,strongerLV=%s,difficulty=%s,%s", npcID, strongerLV, difficulty, battleDict)
|
| | | return battleDict
|
| | |
|
| | | def GetNPCHeroSkillIDList(heroID, heroIpyData, breakLV, awakeLV):
|
| | |
| | | ratio = getattr(npcStronger, "Get%sRatio" % attrName)() if hasattr(npcStronger, "Get%sRatio" % attrName) else 1 # 属性系数
|
| | | attrValue = int(reValue * ratio * difficulty)
|
| | | batAttrDict[attrID] = attrValue
|
| | | #GameWorld.DebugLog(" attrID=%s,attrValue=%s,reValue=%s,ratio=%s,difficulty=%s" % (attrID, attrValue, reValue, ratio, difficulty))
|
| | | #GameWorld.DebugLogEx(" attrID=%s,attrValue=%s,reValue=%s,ratio=%s,difficulty=%s", attrID, attrValue, reValue, ratio, difficulty)
|
| | |
|
| | | GameWorld.DebugLog("NPC成长属性: npcID=%s,lv=%s,difficulty=%s,%s" % (npcID, lv, difficulty, batAttrDict))
|
| | | GameWorld.DebugLogEx("NPC成长属性: npcID=%s,lv=%s,difficulty=%s,%s", npcID, lv, difficulty, batAttrDict)
|
| | | return batAttrDict
|
| | |
|
| | | def SummonLineupObjs(batLineup, faction, num, lineupInfo, reqPlayerID=0):
|
| | |
| | | '''
|
| | | lineupPlayerID = lineupInfo.get("PlayerID", 0) # 阵容所属玩家ID
|
| | | npcLineupID = lineupInfo.get("NPCLineupID", 0)
|
| | | GameWorld.DebugLog("SummonLineupObjs faction:%s,num:%s,npcLineupID=%s,lineupPlayerID=%s" % (faction, num, npcLineupID, lineupPlayerID), reqPlayerID)
|
| | | GameWorld.DebugLogEx("SummonLineupObjs faction:%s,num:%s,npcLineupID=%s,lineupPlayerID=%s", faction, num, npcLineupID, lineupPlayerID)
|
| | |
|
| | | turnFight = batLineup.turnFight
|
| | | tfGUID = turnFight.guid
|
| | |
| | |
|
| | | batLineup.posObjIDDict[posNum] = objID
|
| | | batLineup.heroObjIDDict[heroID] = objID
|
| | | GameWorld.DebugLog("AddBatObj %s,lv=%s,star=%s,skill=%s" % (GetObjName(batObj), lv, star, skillManager.GetSkillIDList()))
|
| | | GameWorld.DebugLogEx("AddBatObj %s,lv=%s,star=%s,skill=%s", GetObjName(batObj), lv, star, skillManager.GetSkillIDList())
|
| | | ResetObjSkill(batObj)
|
| | |
|
| | | if npcID:
|
| | | #副本指定NPC属性
|
| | | fbNPCInitAttrDict = FBLogic.GetFBNPCInitAttr(turnFight, batObj)
|
| | | if fbNPCInitAttrDict:
|
| | | GameWorld.DebugLog("副本指定NPC初始化属性: npcID=%s, %s" % (npcID, fbNPCInitAttrDict))
|
| | | GameWorld.DebugLogEx("副本指定NPC初始化属性: npcID=%s, %s", npcID, fbNPCInitAttrDict)
|
| | | attrDict = {str(k):v for k, v in fbNPCInitAttrDict.items()} # 统一格式
|
| | | #attrDict[str(ChConfig.AttrID_MaxHP)] = 10000000000
|
| | | batObj.InitBatAttr({int(k):v for k, v in attrDict.items()}, initXP)
|
| | |
|
| | | return
|
| | |
| | | batFaction = turnFight.getBatFaction(ChConfig.Def_FactionA)
|
| | | if not batFaction:
|
| | | return
|
| | | GameWorld.DebugLog("切换小队重置玩家阵容武将...")
|
| | | GameWorld.DebugLogEx("切换小队重置玩家阵容武将...")
|
| | | batLineup = batFaction.getBatlineup(1) # 只处理玩家阵容
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for objID in batLineup.posObjIDDict.values():
|
| | |
| | | continue
|
| | | objName = GetObjName(batObj)
|
| | | if not batObj.IsAlive():
|
| | | GameWorld.DebugLog(" 已被击杀不处理! %s" % (objName))
|
| | | GameWorld.DebugLogEx(" 已被击杀不处理! %s", objName)
|
| | | continue
|
| | | GameWorld.DebugLog("重置武将: %s, HP:%s/%s, XP:%s" % (objName, batObj.GetHP(), batObj.GetMaxHP(), batObj.GetXP()))
|
| | | GameWorld.DebugLogEx("重置武将: %s, HP:%s/%s, XP:%s", objName, batObj.GetHP(), batObj.GetMaxHP(), batObj.GetXP())
|
| | |
|
| | | # 清除buff
|
| | | buffMgr = batObj.GetBuffManager()
|
| | |
| | | pubCD = IpyGameDataPY.GetFuncCfg("TurnFightCD", 1)
|
| | | if pubCD:
|
| | | if tfMgr.lastRequestTick and tick - tfMgr.lastRequestTick <= pubCD:
|
| | | GameWorld.DebugLog("回合制战斗请求服务器公共CD中!")
|
| | | GameWorld.DebugLogEx("回合制战斗请求服务器公共CD中!")
|
| | | PlayerControl.NotifyCode(curPlayer, "BattleCoolDown")
|
| | | return True
|
| | |
|
| | |
| | | selfCD = IpyGameDataPY.GetFuncCfg("TurnFightCD", 2)
|
| | | lastTick = curPlayer.GetDictByKey(selfKey)
|
| | | if selfCD and lastTick and tick - lastTick <= selfCD:
|
| | | GameWorld.DebugLog("回合制战斗请求CD中: %s" % selfKey)
|
| | | GameWorld.DebugLogEx("回合制战斗请求CD中: %s", selfKey)
|
| | | PlayerControl.NotifyCode(curPlayer, "BattleCoolDown")
|
| | | return True
|
| | |
|
| | |
| | | tagID = clientData.TagID
|
| | | valueList = clientData.ValueList
|
| | |
|
| | | GameWorld.DebugLog("----- 回合制战斗请求: mapID=%s,funcLineID=%s,tagType=%s,tagID=%s,valueList=%s" |
| | | % (mapID, funcLineID, tagType, tagID, valueList), playerID)
|
| | | GameWorld.DebugLogEx("----- 回合制战斗请求: mapID=%s,funcLineID=%s,tagType=%s,tagID=%s,valueList=%s", mapID, funcLineID, tagType, tagID, valueList, playerID)
|
| | |
|
| | | reqRet = FBLogic.OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList)
|
| | | if not reqRet:
|
| | |
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, funcLineID, False)
|
| | | if fbIpyData:
|
| | | if not fbLineIpyData:
|
| | | GameWorld.DebugLog("不存在该副本功能线路! mapID=%s,funcLineID=%s" % (mapID, funcLineID))
|
| | | GameWorld.DebugLogEx("不存在该副本功能线路! mapID=%s,funcLineID=%s", mapID, funcLineID)
|
| | | return
|
| | | if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, funcLineID, fbIpyData, fbLineIpyData) != ShareDefine.EntFBAskRet_OK:
|
| | | return
|
| | |
| | |
|
| | | atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID)
|
| | | if not atkLineupInfo:
|
| | | GameWorld.DebugLog("玩家没有该阵容数据! atkLineupID=%s" % atkLineupID, playerID)
|
| | | GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s", atkLineupID, playerID)
|
| | | return
|
| | |
|
| | | # 玩家
|
| | |
| | | tagViewCache = PlayerViewCache.FindBattleViewCache(tagPlayerID)
|
| | | if not tagViewCache:
|
| | | # 跨服玩家待扩展
|
| | | GameWorld.DebugLog("目标玩家没有缓存数据! tagPlayerID=%s" % tagPlayerID, playerID)
|
| | | GameWorld.DebugLogEx("目标玩家没有缓存数据! tagPlayerID=%s", tagPlayerID, playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
|
| | | return
|
| | |
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, defLineupID)
|
| | | if not defLineupInfo:
|
| | | GameWorld.DebugLog("目标玩家没有该阵容数据! tagPlayerID=%s,defLineupID=%s" % (tagPlayerID, defLineupID), playerID)
|
| | | GameWorld.DebugLogEx("目标玩家没有该阵容数据! tagPlayerID=%s,defLineupID=%s", tagPlayerID, defLineupID, playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, "TagNoLineup")
|
| | | return
|
| | |
|
| | |
| | | fromServerID = GameWorld.GetGameWorld().GetServerID()
|
| | | reqInfo = [guid, mapID, funcLineID, lineupDictA, lineupDictB, reqPlayerID, playerServerID, npcLineupIDList, strongerLV, difficulty, reqData]
|
| | | multiMapSet = IpyGameDataPY.GetFuncCfg("TurnFightProcess", 1)
|
| | | #multiMapSet = 0
|
| | | # 多地图战斗 0-本地图处理;1-多地图处理;2-debug模式默认本地图处理,非debug默认多地图处理
|
| | | isMultiMap = False
|
| | | if multiMapSet == 1:
|
| | |
| | |
|
| | | for index, lineupID in enumerate(npcLineupIDList):
|
| | | turnFight.lineupIndex = index
|
| | | GameWorld.DebugLog("对战NPC阵容: index=%s, lineupID=%s" % (index, lineupID))
|
| | | GameWorld.DebugLogEx("对战NPC阵容: index=%s, lineupID=%s", index, lineupID)
|
| | | if index > 0:
|
| | | turnFight.nextTurnFight()
|
| | | turnFight.setFactionLineup(ChConfig.Def_FactionB, {1:GetNPCLineupInfo(lineupID, strongerLV, difficulty)})
|
| | |
| | | tfMgr.delTurnFight(guid)
|
| | | return turnFight if saveOK else None
|
| | |
|
| | | #@CommFunc.DoCProfile
|
| | | def DoTurnFightPVP(guid, mapID, funcLineID, lineupDictA, lineupDictB, reqPlayerID=0, playerServerID=0):
|
| | | '''执行PVP战斗,只处理战斗,不关心功能及curPlayer相关
|
| | | @param lineupDictA: 阵营A所有阵容{阵容编号:{阵容信息}, ...}
|
| | |
| | | __doSetFightPoint(curPlayer, reqValue)
|
| | | return
|
| | |
|
| | | GameWorld.DebugLog("------------------- 主线战斗请求: reqType=%s" % reqType, curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLogEx("------------------- 主线战斗请求: reqType=%s", reqType, curPlayer.GetPlayerID())
|
| | | mainFightMgr = GetMainFightMgr(curPlayer)
|
| | | mainFightMgr.resetMainFightExDataRec() # 请求时补重置,防止异常时重复结算逻辑
|
| | |
|
| | |
| | |
|
| | | def __doSetFightPoint(curPlayer, fightPoint):
|
| | | ## 设置消耗倍值
|
| | | GameWorld.DebugLog("设置战锤消耗倍值: %s" % fightPoint)
|
| | | GameWorld.DebugLogEx("设置战锤消耗倍值: %s", fightPoint)
|
| | | needTreeLVList = IpyGameDataPY.GetFuncEvalCfg("AutoGuaji", 1)
|
| | | if fightPoint < 1 or fightPoint > len(needTreeLVList):
|
| | | return
|
| | | needTreeLV = needTreeLVList[fightPoint - 1]
|
| | | treeLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreeLV)
|
| | | if treeLV < needTreeLV:
|
| | | GameWorld.DebugLog("祝福树等级不足: treeLV=%s < %s" % (treeLV, needTreeLV))
|
| | | GameWorld.DebugLogEx("祝福树等级不足: treeLV=%s < %s", treeLV, needTreeLV)
|
| | | return
|
| | | curPlayer.SetFightPoint(fightPoint)
|
| | | return
|
| | |
| | | # @param isRestStart: 是否从休息状态重新开始的
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | chapterID, levelNum, wave = PlayerControl.GetMainLevelNowInfo(curPlayer)
|
| | | GameWorld.DebugLog("请求关卡波战斗: chapterID=%s,levelNum=%s,wave=%s,isRestStart=%s" % (chapterID, levelNum, wave, isRestStart), playerID)
|
| | | GameWorld.DebugLogEx("请求关卡波战斗: chapterID=%s,levelNum=%s,wave=%s,isRestStart=%s", chapterID, levelNum, wave, isRestStart, playerID)
|
| | | fightPoint = max(curPlayer.GetFightPoint(), 1)
|
| | | if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_Xiantao, fightPoint):
|
| | | GameWorld.DebugLog("战锤不足,无法开始!")
|
| | | GameWorld.DebugLogEx("战锤不足,无法开始!")
|
| | | return
|
| | | chapterIpyData = IpyGameDataPY.GetIpyGameData("MainChapter", chapterID)
|
| | | if not chapterIpyData:
|
| | |
| | |
|
| | | lineupMainInfo = GetPlayerLineupInfo(curPlayer, ShareDefine.Lineup_Main)
|
| | | if not lineupMainInfo:
|
| | | GameWorld.DebugLog("没有设置主阵容!", playerID)
|
| | | GameWorld.DebugLogEx("没有设置主阵容!", playerID)
|
| | | return
|
| | |
|
| | | strongerLV = levelIpyData.GetNPCLV()
|
| | |
| | | mainFightMgr.wave = wave
|
| | | mapID, funcLineID = ChConfig.Def_FBMapID_Main, PlayerControl.ComMainLevelValue(chapterID, levelNum, wave)
|
| | | turnMax = GetTurnMax(mapID)
|
| | | GameWorld.DebugLog("设置起始关卡波: 关卡%s-%s,波=%s/%s,lineupIDList=%s,mapID=%s,funcLineID=%s,lineupID=%s,strongerLV=%s,difficulty=%s" |
| | | % (chapterID, levelNum, wave, waveMax, lineupIDList, mapID, funcLineID, lineupID, strongerLV, difficulty), playerID)
|
| | | GameWorld.DebugLogEx("设置起始关卡波: 关卡%s-%s,波=%s/%s,lineupIDList=%s,mapID=%s,funcLineID=%s,lineupID=%s,strongerLV=%s,difficulty=%s", |
| | | chapterID, levelNum, wave, waveMax, lineupIDList, mapID, funcLineID, lineupID, strongerLV, difficulty, playerID)
|
| | |
|
| | | turnFight = mainFightMgr.turnFight
|
| | | turnFight.setTurnFight(mapID, funcLineID, turnMax, False, curPlayer)
|
| | |
| | | if winFaction:
|
| | | nextLineupID = turnFight.nextLineupID()
|
| | | if nextLineupID:
|
| | | GameWorld.DebugLog("---开始进入下一小队: lineupIndex=%s,nextLineupID=%s,%s" % (turnFight.lineupIndex, nextLineupID, turnFight.lineupIDList))
|
| | | GameWorld.DebugLogEx("---开始进入下一小队: lineupIndex=%s,nextLineupID=%s,%s", turnFight.lineupIndex, nextLineupID, turnFight.lineupIDList)
|
| | |
|
| | | turnFight.nextTurnFight()
|
| | | # 切换小队时,玩家阵容不需要处理,保留状态
|
| | |
| | | # 小怪战斗,每次消耗1个战锤
|
| | | fightPoint = max(curPlayer.GetFightPoint(), 1) # 主线战斗消耗倍值,默认1
|
| | | if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_Xiantao, fightPoint):
|
| | | GameWorld.DebugLog("回合开始时战锤不足!")
|
| | | GameWorld.DebugLogEx("回合开始时战锤不足!")
|
| | | return
|
| | |
|
| | | # 以下均是处理关卡小怪分段实时战斗
|
| | |
| | |
|
| | | # 回合开始
|
| | | if turnNumStart < turnNum:
|
| | | GameWorld.DebugLog("【----- 回合制战斗轮次: %s -----】 " % (turnNum))
|
| | | GameWorld.DebugLogEx("【----- 回合制战斗轮次: %s -----】 ", turnNum)
|
| | | turnFight.turnNum = turnNum
|
| | | turnFight.turnNumStart = turnNum
|
| | | if curPlayer:
|
| | |
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | batLineup = batFaction.getBatlineup(num)
|
| | | for posNum in range(batLineup.actionNum, PosNumMax + 1):
|
| | | #GameWorld.DebugLog("武将位置: faction=%s,posNum=%s" % (faction, posNum))
|
| | | #GameWorld.DebugLogEx("武将位置: faction=%s,posNum=%s", faction, posNum)
|
| | | if posNum not in batLineup.posObjIDDict:
|
| | | batLineup.actionNum = posNum + 1
|
| | | #GameWorld.DebugLog("没有武将: faction=%s,posNum=%s" % (faction, posNum))
|
| | | #GameWorld.DebugLogEx("没有武将: faction=%s,posNum=%s", faction, posNum)
|
| | | continue
|
| | |
|
| | | objID = batLineup.posObjIDDict[posNum]
|
| | |
| | | # 玩家自己阵营,预判可否行动
|
| | | if checkBreakpoint and faction == ChConfig.Def_FactionA and batObj:
|
| | | if batObj.CanAction():
|
| | | GameWorld.DebugLog("玩家阵容下一个可行动的武将,断点: nextPosNum=%s" % (posNum))
|
| | | GameWorld.DebugLogEx("玩家阵容下一个可行动的武将,断点: nextPosNum=%s", posNum)
|
| | | return
|
| | |
|
| | | batLineup.actionNum = posNum + 1
|
| | |
| | | if turnFight.winFaction:
|
| | | break
|
| | | turnFight.turnNum = turnNum
|
| | | GameWorld.DebugLog("【----- 回合制战斗轮次: %s -----】" % turnNum)
|
| | | GameWorld.DebugLogEx("【----- 回合制战斗轮次: %s -----】", turnNum)
|
| | | if curPlayer:
|
| | | turnFight.syncState(FightState_Fighting)
|
| | |
|
| | |
| | | ## 执行进场逻辑
|
| | | if turnFight.enterLogic:
|
| | | return
|
| | | GameWorld.DebugLog("执行进场逻辑...")
|
| | | GameWorld.DebugLogEx("执行进场逻辑...")
|
| | |
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for faction, num in turnFight.actionSortList:
|
| | |
| | |
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for faction, num in turnFight.actionSortList:
|
| | | GameWorld.DebugLog("大回合开始逻辑: turnNum=%s,faction=%s,num=%s" % (turnNum, faction, num))
|
| | | GameWorld.DebugLogEx("大回合开始逻辑: turnNum=%s,faction=%s,num=%s", turnNum, faction, num)
|
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | batLineup = batFaction.getBatlineup(num)
|
| | | batLineup.actionNum = 1
|
| | |
| | |
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for faction, num in turnFight.actionSortList:
|
| | | GameWorld.DebugLog("回合结束逻辑: turnNum=%s,faction=%s, num=%s" % (turnNum, faction, num))
|
| | | GameWorld.DebugLogEx("回合结束逻辑: turnNum=%s,faction=%s, num=%s", turnNum, faction, num)
|
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | batLineup = batFaction.getBatlineup(num)
|
| | | for objID in batLineup.posObjIDDict.values():
|
| | |
| | | if not batObj.IsAlive():
|
| | | return
|
| | |
|
| | | GameWorld.DebugLog("---[武将回合开始] : curID=%s,curHP=%s/%s" % (batObj.GetID(), batObj.GetHP(), batObj.GetMaxHP()))
|
| | | GameWorld.DebugLogEx("---[武将回合开始] : curID=%s,curHP=%s/%s", batObj.GetID(), batObj.GetHP(), batObj.GetMaxHP())
|
| | | turnFight.ResetOneActionUseSkillCnt()
|
| | | RefreshObjBuffTime(turnFight, batObj)
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_HeroTurnStart)
|
| | |
| | | if not batObj.IsAlive():
|
| | | return
|
| | |
|
| | | GameWorld.DebugLog("---[武将回合结束] : curID=%s,curHP=%s/%s" % (batObj.GetID(), batObj.GetHP(), batObj.GetMaxHP()))
|
| | | GameWorld.DebugLogEx("---[武将回合结束] : curID=%s,curHP=%s/%s", batObj.GetID(), batObj.GetHP(), batObj.GetMaxHP())
|
| | | turnFight.ResetOneActionUseSkillCnt()
|
| | | RefreshObjBuffTime(turnFight, batObj)
|
| | | return
|
| | |
| | | initCD = curSkill.GetCoolDownInit()
|
| | | if initCD:
|
| | | curSkill.SetRemainTime(initCD)
|
| | | GameWorld.DebugLog("技能初始CD: curID=%s,skillID=%s,initCD=%s" % (curID, skillID, initCD))
|
| | | GameWorld.DebugLogEx("技能初始CD: curID=%s,skillID=%s,initCD=%s", curID, skillID, initCD)
|
| | | elif curSkill.GetRemainTime():
|
| | | curSkill.SetRemainTime(0)
|
| | | curSkill.SetEnergy(0)
|
| | |
| | | if remainTime <= 0:
|
| | | continue
|
| | | if preTurnUseCnt > 0:
|
| | | GameWorld.DebugLog(" 上回合有使用技能本回合不刷新CD: curID=%s,skillID=%s,remainTime=%s,preTurnUseCnt=%s" % (curID, skillID, remainTime, preTurnUseCnt))
|
| | | GameWorld.DebugLogEx(" 上回合有使用技能本回合不刷新CD: curID=%s,skillID=%s,remainTime=%s,preTurnUseCnt=%s", curID, skillID, remainTime, preTurnUseCnt)
|
| | | continue
|
| | | remainTime -= 1
|
| | | curSkill.SetRemainTime(remainTime)
|
| | | GameWorld.DebugLog(" 更新技能CD: curID=%s,skillID=%s,remainTime=%s" % (curID, skillID, remainTime))
|
| | | GameWorld.DebugLogEx(" 更新技能CD: curID=%s,skillID=%s,remainTime=%s", curID, skillID, remainTime)
|
| | | return
|
| | |
|
| | | def RefreshObjByBigTurn(turnFight, batObj):
|
| | |
| | | if skillData.GetLastTimeType() != ChConfig.BuffLastTimeType_BigTurn:
|
| | | continue
|
| | | if skillData.GetSkillType() in ChConfig.Def_LstBuff_List:
|
| | | #GameWorld.DebugLog(" 持续类buff由触发时机决定剩余时间! curID=%s,index=%s,skillID=%s,buffID=%s" % (curID, index, skillID, buffID))
|
| | | #GameWorld.DebugLogEx(" 持续类buff由触发时机决定剩余时间! curID=%s,index=%s,skillID=%s,buffID=%s", curID, index, skillID, buffID)
|
| | | continue
|
| | | if skillData.GetSkillType() == ChConfig.Def_SkillType_Halo and buff.GetOwnerID() != curID:
|
| | | GameWorld.DebugLog(" 光环buff非光源不处理! curID=%s,index=%s,skillID=%s,buffID=%s" % (curID, index, skillID, buffID))
|
| | | GameWorld.DebugLogEx(" 光环buff非光源不处理! curID=%s,index=%s,skillID=%s,buffID=%s", curID, index, skillID, buffID)
|
| | | continue
|
| | | remainTime = buff.GetRemainTime()
|
| | | if remainTime <= 0:
|
| | | continue
|
| | | remainTime -= 1
|
| | | GameWorld.DebugLog(" 更新buff回合: curID=%s,buffID=%s,skillID=%s,remainTime=%s" % (curID, buffID, skillID, remainTime))
|
| | | GameWorld.DebugLogEx(" 更新buff回合: curID=%s,buffID=%s,skillID=%s,remainTime=%s", curID, buffID, skillID, remainTime)
|
| | | TurnBuff.SetBuffRemainTime(turnFight, batObj, buff, remainTime)
|
| | | return
|
| | |
|
| | |
| | | if skillData.GetLastTimeType() != ChConfig.BuffLastTimeType_Default:
|
| | | continue
|
| | | if skillData.GetSkillType() in ChConfig.Def_LstBuff_List:
|
| | | #GameWorld.DebugLog(" 持续类buff由触发时机决定剩余时间! curID=%s,index=%s,skillID=%s,buffID=%s" % (curID, index, skillID, buffID))
|
| | | #GameWorld.DebugLogEx(" 持续类buff由触发时机决定剩余时间! curID=%s,index=%s,skillID=%s,buffID=%s", curID, index, skillID, buffID)
|
| | | continue
|
| | | if skillData.GetSkillType() == ChConfig.Def_SkillType_Halo and buff.GetOwnerID() != curID:
|
| | | GameWorld.DebugLog(" 光环buff非光源不处理! curID=%s,index=%s,skillID=%s,buffID=%s" % (curID, index, skillID, buffID))
|
| | | GameWorld.DebugLogEx(" 光环buff非光源不处理! curID=%s,index=%s,skillID=%s,buffID=%s", curID, index, skillID, buffID)
|
| | | continue
|
| | | remainTime = buff.GetRemainTime()
|
| | | if remainTime <= 0:
|
| | | # 永久buff不处理
|
| | | #GameWorld.DebugLog(" 永久buff不处理! curID=%s,index=%s,skillID=%s" % (curID, index, skillID))
|
| | | #GameWorld.DebugLogEx(" 永久buff不处理! curID=%s,index=%s,skillID=%s", curID, index, skillID)
|
| | | continue
|
| | | addTiming = buff.GetAddTiming()
|
| | | if not buff.GetRefreshState():
|
| | | GameWorld.DebugLog(" 未刷新过的buff更新为刷新过! curID=%s,index=%s,skillID=%s,buffID=%s,addTiming=%s" % (curID, index, skillID, buffID, addTiming))
|
| | | GameWorld.DebugLogEx(" 未刷新过的buff更新为刷新过! curID=%s,index=%s,skillID=%s,buffID=%s,addTiming=%s", curID, index, skillID, buffID, addTiming)
|
| | | buff.SetRefreshState(1)
|
| | | continue
|
| | | if addTiming != curTiming:
|
| | | GameWorld.DebugLog(" buff添加时机不同不处理! curID=%s,index=%s,skillID=%s,buffID=%s,addTiming=%s" % (curID, index, skillID, buffID, addTiming))
|
| | | GameWorld.DebugLogEx(" buff添加时机不同不处理! curID=%s,index=%s,skillID=%s,buffID=%s,addTiming=%s", curID, index, skillID, buffID, addTiming)
|
| | | continue
|
| | | remainTime -= 1
|
| | | GameWorld.DebugLog(" 更新buff回合: curID=%s,buffID=%s,skillID=%s,remainTime=%s,addTiming=%s" % (curID, buffID, skillID, remainTime, addTiming))
|
| | | GameWorld.DebugLogEx(" 更新buff回合: curID=%s,buffID=%s,skillID=%s,remainTime=%s,addTiming=%s", curID, buffID, skillID, remainTime, addTiming)
|
| | | TurnBuff.SetBuffRemainTime(turnFight, batObj, buff, remainTime)
|
| | | return
|
| | |
|
| | |
| | | curID = curObj.GetID()
|
| | | srcID = srcObj.GetID()
|
| | | updStatValue = srcObj.StatCureValue(cureHP)
|
| | | GameWorld.DebugLog(" 统计治疗: curID=%s,srcID=%s,skillID=%s,addValue=%s,cureHP=%s,updStatValue=%s" |
| | | % (curID, srcID, skillID, addValue, cureHP, updStatValue))
|
| | | GameWorld.DebugLogEx(" 统计治疗: curID=%s,srcID=%s,skillID=%s,addValue=%s,cureHP=%s,updStatValue=%s", |
| | | curID, srcID, skillID, addValue, cureHP, updStatValue)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | tagID = tagBatObj.GetID()
|
| | | if curID != tagID:
|
| | | updStatValue = curBatObj.StatHurtValue(hurtValue)
|
| | | GameWorld.DebugLog(" 统计输出: curID=%s,tagID=%s,skillID=%s,hurtValue=%s,lostHP=%s,updStatValue=%s,tagHP=%s,lostType=%s" |
| | | % (curID, tagID, skillID, hurtValue, lostHP, updStatValue, tagBatObj.GetHP(), lostType))
|
| | | GameWorld.DebugLogEx(" 统计输出: curID=%s,tagID=%s,skillID=%s,hurtValue=%s,lostHP=%s,updStatValue=%s,tagHP=%s,lostType=%s", |
| | | curID, tagID, skillID, hurtValue, lostHP, updStatValue, tagBatObj.GetHP(), lostType)
|
| | |
|
| | | if tagBatObj:
|
| | | updStatValue = tagBatObj.StatDefValue(hurtValue)
|
| | | GameWorld.DebugLog(" 统计承伤: curID=%s,tagID=%s,skillID=%s,hurtValue=%s,lostHP=%s,updStatValue=%s,curHP=%s,lostType=%s" |
| | | % (tagID, curID, skillID, hurtValue, lostHP, updStatValue, tagBatObj.GetHP(), lostType))
|
| | | GameWorld.DebugLogEx(" 统计承伤: curID=%s,tagID=%s,skillID=%s,hurtValue=%s,lostHP=%s,updStatValue=%s,curHP=%s,lostType=%s", |
| | | tagID, curID, skillID, hurtValue, lostHP, updStatValue, tagBatObj.GetHP(), lostType)
|
| | |
|
| | | else:
|
| | | # 如换血类技能,自残的伤害不算输出
|
| | | GameWorld.DebugLog(" 自残: curID=%s,tagID=%s,skillID=%s,hurtValue=%s,lostHP=%s,curHP=%s" |
| | | % (curID, tagID, skillID, hurtValue, lostHP, curBatObj.GetHP()))
|
| | | GameWorld.DebugLogEx(" 自残: curID=%s,tagID=%s,skillID=%s,hurtValue=%s,lostHP=%s,curHP=%s", |
| | | curID, tagID, skillID, hurtValue, lostHP, curBatObj.GetHP())
|
| | | return
|
| | |
|
| | | def OnObjAction(turnFight, curBatObj, isExtra=False):
|
| | |
| | | # 是否可行动状态判断
|
| | | canAction = curBatObj.CanAction()
|
| | | if not canAction:
|
| | | GameWorld.DebugLog("★回合%s %s 当前状态不可行动! isExtra=%s" % (turnNum, objName, isExtra))
|
| | | GameWorld.DebugLogEx("★回合%s %s 当前状态不可行动! isExtra=%s", turnNum, objName, isExtra)
|
| | | return
|
| | |
|
| | | atk = curBatObj.GetAtk()
|
| | | curXP = curBatObj.GetXP()
|
| | | GameWorld.DebugLog("★回合%s %s %s行动 : atk=%s,curHP=%s/%s,curXP=%s" % (turnNum, objName, "额外" if isExtra else "", atk, curHP, curBatObj.GetMaxHP(), curXP))
|
| | | GameWorld.DebugLogEx("★回合%s %s %s行动 : atk=%s,curHP=%s/%s,curXP=%s", turnNum, objName, "额外" if isExtra else "", atk, curHP, curBatObj.GetMaxHP(), curXP)
|
| | | turnFight.ResetOneActionUseSkillCnt()
|
| | | turnFight.syncObjAction(turnNum, objID)
|
| | |
|
| | |
| | | xpMax = IpyGameDataPY.GetFuncCfg("AngerXP", 2)
|
| | | skillManager = curBatObj.GetSkillManager()
|
| | | useSkillList = []
|
| | | #GameWorld.DebugLog('skillCount=%s' % skillManager.GetSkillCount(), npcID)
|
| | | #GameWorld.DebugLogEx('skillCount=%s', skillManager.GetSkillCount(), npcID)
|
| | | for index in range(0, skillManager.GetSkillCount()):
|
| | | useSkill = skillManager.GetSkillByIndex(index)
|
| | | if not useSkill:
|
| | |
| | | if curXP < xpMax and not useSkill.GetEffectByID(ChConfig.SkillEff_AngerSkillNoXP):
|
| | | continue
|
| | | if curBatObj.CheckInState(ChConfig.BatObjState_Sneer):
|
| | | GameWorld.DebugLog("嘲讽状态下,无法主动释放怒技! skillID=%s" % skillID) # 可被动释放怒技,如怒技追击
|
| | | GameWorld.DebugLogEx("嘲讽状态下,无法主动释放怒技! skillID=%s", skillID) # 可被动释放怒技,如怒技追击
|
| | | continue
|
| | | useCnt = -1 # xp技能优先释放
|
| | | else:
|
| | | if useSkill.GetEffectByID(ChConfig.SkillEff_ActionUseInvalid): # 配置该效果时如果被嘲讽,相当于无法行动
|
| | | GameWorld.DebugLog("行动时无法释放该技能! skillID=%s" % skillID)
|
| | | GameWorld.DebugLogEx("行动时无法释放该技能! skillID=%s", skillID)
|
| | | continue
|
| | | useCnt = curBatObj.GetSkillUseCnt(skillID)
|
| | | useSkillList.append([useCnt, skillID, useSkill])
|
| | |
|
| | | useSkillList.sort() # 按使用次数优先升序排,使用次数低的优先判断使用
|
| | | #GameWorld.DebugLog(' 技能使用顺序 = useSkillList%s' % str(useSkillList), npcID)
|
| | | #GameWorld.DebugLogEx(' 技能使用顺序 = useSkillList%s', str(useSkillList), npcID)
|
| | |
|
| | | for useInfo in useSkillList:
|
| | | useSkill = useInfo[-1]
|
| | |
| | | objID = gameObj.GetID()
|
| | | killerObjID = killer.GetID() if killer else 0
|
| | | skillID = useSkill.GetSkillID() if useSkill else 0
|
| | | GameWorld.DebugLog(" %s 回合战斗主体被击杀: curID=%s,killerObjID=%s,skillID=%s" % (GetObjName(gameObj), objID, killerObjID, skillID))
|
| | | GameWorld.DebugLogEx(" %s 回合战斗主体被击杀: curID=%s,killerObjID=%s,skillID=%s", GetObjName(gameObj), objID, killerObjID, skillID)
|
| | | gameObj.SetDead()
|
| | | TurnBuff.DoBuffByDead(turnFight, gameObj)
|
| | |
|
| | |
| | |
|
| | | def OnTurnAllOver(guid):
|
| | | ## 所有回合已经全部执行完毕
|
| | | GameWorld.DebugLog("所有回合结束")
|
| | | GameWorld.DebugLogEx("所有回合结束")
|
| | | turnFight = GetTurnFightMgr().getTurnFight(guid)
|
| | | if not turnFight:
|
| | | return
|
| | |
| | | turnFight.isWin = (winFaction == ChConfig.Def_FactionA)
|
| | | mapID = turnFight.mapID
|
| | | funcLineID = turnFight.funcLineID
|
| | | GameWorld.DebugLog("--- 战斗结束处理 ---, winFaction=%s, costTime=%ss, %s" % (winFaction, turnFight.costTime, guid))
|
| | | GameWorld.DebugLogEx("--- 战斗结束处理 ---, winFaction=%s, costTime=%ss, %s", winFaction, turnFight.costTime, guid)
|
| | | if mapID != ChConfig.Def_FBMapID_Main:
|
| | | GameWorld.Log("战斗耗时: %ss, mapID=%s,funcLineID=%s,turnNum=%s/%s" % (turnFight.costTime, mapID, funcLineID, turnFight.turnNum, turnFight.turnMax))
|
| | |
|
| | |
| | | lineupStatInfo = facStatInfo[str(num)]
|
| | | batLineup = batFaction.getBatlineup(num)
|
| | | batLineup.totalHurt = 0
|
| | | GameWorld.DebugLog("阵容明细: faction=%s,num=%s" % (faction, num))
|
| | | GameWorld.DebugLogEx("阵容明细: faction=%s,num=%s", faction, num)
|
| | | for posNum, objID in batLineup.posObjIDDict.items():
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | |
| | | batLineup.totalHurt += atkHurt
|
| | | batFaction.totalHurt += atkHurt
|
| | | dead = 0 if batObj.IsAlive() else 1
|
| | | GameWorld.DebugLog(" Pos:%s ID=%s,npcID=%s,heroID=%s,HP=%s/%s, 输出=%s,承伤=%s,治疗=%s" |
| | | % (posNum, objID, npcID, heroID, batObj.GetHP(), batObj.GetMaxHP(), atkHurt, defHurt, cureHP))
|
| | | GameWorld.DebugLogEx(" Pos:%s ID=%s,npcID=%s,heroID=%s,HP=%s/%s, 输出=%s,承伤=%s,治疗=%s", |
| | | posNum, objID, npcID, heroID, batObj.GetHP(), batObj.GetMaxHP(), atkHurt, defHurt, cureHP)
|
| | | lineupStatInfo[str(posNum)] = {"ObjID":objID, "HeroID":heroID, "NPCID":npcID, "AtkHurt":atkHurt, "DefHurt":defHurt, "CureHP":cureHP,
|
| | | "LV":batObj.GetLV(), "Star":batObj.GetStar(), "Skin":batObj.GetSkinID(), "Dead":dead}
|
| | |
|
| | |
| | | pass
|
| | |
|
| | | saveFilePath = os.path.join(ReportDir, "%s.tfr" % guid)
|
| | | GameWorld.DebugLog("战报路径=%s" % saveFilePath)
|
| | | GameWorld.DebugLogEx("战报路径=%s", saveFilePath)
|
| | |
|
| | | try:
|
| | | clientPack = ChPyNetSendPack.tagSCTurnFightReport()
|
| | |
| | | SkillTagAim_Vertical, # 竖排/纵排 4
|
| | | SkillTagAim_Self, # 自己 5
|
| | | SkillTagAim_MainSkill, # 继承主技能目标 6
|
| | | ) = range(7)
|
| | | SkillTagAim_MainSkillEx, # 继承主技能目标一次性处理 7
|
| | | ) = range(8)
|
| | |
|
| | | # 技能目标 - 细分
|
| | | (
|
| | |
| | | TriggerWay_InBattlefield, # 在场时 40
|
| | | TriggerWay_Revive, # 复活时 41
|
| | | TriggerWay_BigTurnStartByDead, # 大回合开始时(死亡后有效) 42
|
| | | ) = range(1, 1 + 42)
|
| | | TriggerWay_WhenDie, # 死亡时(自己) 43
|
| | | ) = range(1, 1 + 43)
|
| | |
|
| | | # 不加载的被动触发方式,一般用于本技能固定触发逻辑用的
|
| | | TriggerWayNoLoadList = [TriggerWay_CurSkillEff, TriggerWay_CurSkillEffLst]
|
| | | # 死亡可以触发的方式
|
| | | DeadCanTriggerWayList = [TriggerWay_BigTurnStartByDead]
|
| | | DeadCanTriggerWayList = [TriggerWay_BigTurnStartByDead, TriggerWay_WhenDie]
|
| | |
|
| | | # 被动触发有效来源
|
| | | TriggerSrc_Skill = 1 # 身上技能有效
|
| | |
| | | ) = range(1, 1 + 6)
|
| | |
|
| | | # 部分武将ID
|
| | | HeroID_Zhenfu = 510013
|
| | | HeroID_Caoren = 510015
|
| | | HeroID_Dongbai = 540009
|
| | | HeroID_Simayi = 510012 # 司马懿
|
| | | HeroID_Zhenfu = 510013 # 甄宓
|
| | | HeroID_Caoren = 510015 # 曹仁
|
| | | HeroID_Dongbai = 540009 # 董白
|
| | |
|
| | | # 部分技能ID
|
| | | SkillID_SmyFanzhao = 1012050 # 返照
|
| | |
|
| | | # 经验倍率限制类型
|
| | | (
|
| | |
| | | GameWorld.DebugAnswer(curPlayer, "位置: 1~6号位")
|
| | | GameWorld.DebugAnswer(curPlayer, "属性ID: 6-攻,7-防,8-HPMax,9-HP,12-怒")
|
| | | GameWorld.DebugAnswer(curPlayer, "测试战斗: TurnFight f 是否满技能 [武将ID ...]")
|
| | | GameWorld.DebugAnswer(curPlayer, "测试战斗: TurnFight fp [playerID]")
|
| | | return
|
| | |
|
| | | value = msgList[0]
|
| | |
| | | __printInfo(curPlayer, msgList)
|
| | | elif value == "f":
|
| | | __doFightTest(curPlayer, msgList)
|
| | | elif value == "fp":
|
| | | costTime = TurnAttack.GMTestPVP(curPlayer, msgList[1] if len(msgList) > 1 else 0)
|
| | | GameWorld.DebugAnswer(curPlayer, "GMTestPVP: %s" % costTime)
|
| | | elif value > 0 and value != ChConfig.Def_FBMapID_Main:
|
| | | __reqTurnFight(curPlayer, msgList)
|
| | | return
|
| | |
| | | LogUI.Msg('%s\t%s\tPyDebug:%s'%(par, playerID, msg))
|
| | | return
|
| | |
|
| | | def DebugLogEx(logFormat, *args):
|
| | | ## DEBUG调试输出信息,只传入日志格式跟参数,非debug下不进行日志内容格式化
|
| | | # @param logFormat: 日志内容格式,也可以直接传入完整的日志内容
|
| | | # @param args: 日志参数,最后一个参数可以多传一个参数作为playerID用
|
| | | if not __GameWorld.GetDebugLevel():
|
| | | return
|
| | | par = 0
|
| | | playerID = 0
|
| | | try:
|
| | | msg = logFormat % args
|
| | | except:
|
| | | msg = logFormat % args[:-1]
|
| | | playerID = args[-1]
|
| | | LogUI.Msg('%s\t%s\tPyDebug:%s'%(par, playerID, msg))
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##获得当前服务器跨服ID
|
| | | # @param 无
|
| | |
| | |
|
| | | def acquire(self, obj_class, *args, **kwargs):
|
| | | """获取对象并记录其所属池"""
|
| | | return obj_class(*args, **kwargs) # 关闭对象池
|
| | | if obj_class not in self._pools:
|
| | | # 如果池不存在,自动创建大小为0的无限制池
|
| | | self.create_pool(obj_class, 0)
|
| | |
| | |
|
| | | def release(self, obj):
|
| | | """释放对象并递归释放其嵌套对象池对象"""
|
| | | return # 释放对象效率有点低,暂时关闭对象池,后续优化
|
| | | obj_id = id(obj)
|
| | |
|
| | | # 检查是否正在递归释放中
|
| | |
| | | return
|
| | | effectID = curEffect.GetEffectID()
|
| | | effSkillID = effSkill.GetSkillID()
|
| | | return TurnSkill.OnUsePassiveSkill(turnFight, batObj, tagObj, passiveSkill, connSkill, effSkillID, effectID, connBuff)
|
| | | return TurnSkill.OnUsePassiveSkill(turnFight, batObj, tagObj, passiveSkill, connSkill, effSkillID, effectID, connBuff, **kwargs)
|
| | |
|
| | | def DoBuffEffectLogic(turnFight, batObj, tagObj, effBuff, curEffect, connSkill, connBuff, **kwargs):
|
| | | effSkill = effBuff.GetSkillData().GetIpyData()
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveTrigger.PassiveEff_5502
|
| | | #
|
| | | # @todo:触发释放技能(指定目标)
|
| | | # @author hxp
|
| | | # @date 2025-12-11
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 触发释放技能(指定目标)
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-12-11 14:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import TurnSkill
|
| | | import IpyGameDataPY
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
|
| | | skillID = curEffect.GetEffectValue(0) # 技能ID,为0时释放本技能
|
| | | tagSet = curEffect.GetEffectValue(1) # 指定目标[范围, 友好, 细分, 个数]
|
| | | tagObjList = TurnSkill.GetSkillTags(turnFight, batObj, None, tagSet=tagSet)
|
| | | GameWorld.DebugLogEx("被动触发技能且指定目标: curID=%s,skillID=%s,tagSet=%s", batObj.GetID(), skillID, tagSet)
|
| | | |
| | | if not skillID:
|
| | | passiveSkill = effSkill
|
| | | else:
|
| | | passiveSkill = batObj.GetSkillManager().FindSkillByID(skillID)
|
| | | if not passiveSkill:
|
| | | passiveSkill = IpyGameDataPY.GetIpyGameData("Skill", skillID)
|
| | | if not passiveSkill:
|
| | | return
|
| | | return TurnSkill.OnUseSkill(turnFight, batObj, passiveSkill, tagObjList, batType=ChConfig.TurnBattleType_Passive, bySkill=connSkill, byBuff=connBuff, **kwargs)
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveTrigger.PassiveEff_5503
|
| | | #
|
| | | # @todo:触发释放多个技能(可继承触发技能目标或重新设置目标)
|
| | | # @author hxp
|
| | | # @date 2025-12-11
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 触发释放多个技能(可继承触发技能目标或重新设置目标)
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-12-11 14:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import TurnSkill
|
| | | import IpyGameDataPY
|
| | | import GameWorld
|
| | |
|
| | | def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
|
| | | skillIDList = curEffect.GetEffectValue(0) # 技能ID列表
|
| | | GameWorld.DebugLogEx("触发释放多个技能: %s", skillIDList)
|
| | | isOK = False
|
| | | effectID = curEffect.GetEffectID()
|
| | | effSkillID = effSkill.GetSkillID()
|
| | | for skillID in skillIDList:
|
| | | if not skillID:
|
| | | continue
|
| | | passiveSkill = batObj.GetSkillManager().FindSkillByID(skillID)
|
| | | if not passiveSkill:
|
| | | passiveSkill = IpyGameDataPY.GetIpyGameData("Skill", skillID)
|
| | | if not passiveSkill:
|
| | | continue
|
| | | if TurnSkill.OnUsePassiveSkill(turnFight, batObj, tagObj, passiveSkill, connSkill, effSkillID, effectID, connBuff, **kwargs):
|
| | | isOK = True
|
| | | return isOK
|
| | |
| | | curBuff.SetValue2(tagBuff.GetValue2())
|
| | | curBuff.SetValue3(tagBuff.GetValue3())
|
| | | curBuff.SetIsCopy(1)
|
| | | GameWorld.DebugLog(" 拷贝buff: curBuffID=%s,tagBuffID=%s,Remain=%s,Layer=%s,Value=%s" |
| | | % (curBuff.GetBuffID(), tagBuff.GetBuffID(), curBuff.GetRemainTime(), curBuff.GetLayer(), |
| | | [curBuff.GetValue1(), curBuff.GetValue2(), curBuff.GetValue3()]))
|
| | | GameWorld.DebugLogEx(" 拷贝buff: curBuffID=%s,tagBuffID=%s,Remain=%s,Layer=%s,Value=%s", |
| | | curBuff.GetBuffID(), tagBuff.GetBuffID(), curBuff.GetRemainTime(), curBuff.GetLayer(), |
| | | [curBuff.GetValue1(), curBuff.GetValue2(), curBuff.GetValue3()])
|
| | | relatedSkillID = bySkill.GetSkillID() if bySkill else 0
|
| | | SyncBuffRefresh(turnFight, curBatObj, curBuff, relatedSkillID, isNewAdd)
|
| | | return
|
| | |
| | | #无敌免疫持续减益buff、控制类buff
|
| | | if skillType in [ChConfig.Def_SkillType_LstDepBuff, ChConfig.Def_SkillType_Action] \
|
| | | and batObj.CheckInState(ChConfig.BatObjState_Wudi):
|
| | | GameWorld.DebugLog("无敌状态下免疫该buff: curID=%s,skillID=%s,ownerID=%s,relatedSkillID=%s" |
| | | % (curID, skillID, ownerID, relatedSkillID))
|
| | | GameWorld.DebugLogEx("无敌状态下免疫该buff: curID=%s,skillID=%s,ownerID=%s,relatedSkillID=%s", curID, skillID, ownerID, relatedSkillID)
|
| | | return
|
| | |
|
| | | #被动触发免疫控制buff
|
| | | if skillType == ChConfig.Def_SkillType_Action:
|
| | | if TurnPassive.GetTriggerEffectValue(turnFight, batObj, buffOwner, ChConfig.PassiveEff_ImmuneControlBuff, buffSkill):
|
| | | GameWorld.DebugLog("血量低于百分x时免疫控制buff: curID=%s,skillID=%s,ownerID=%s,relatedSkillID=%s,hp:%s/%s" |
| | | % (curID, skillID, ownerID, relatedSkillID, batObj.GetHP(), batObj.GetMaxHP()))
|
| | | GameWorld.DebugLogEx("血量低于百分x时免疫控制buff: curID=%s,skillID=%s,ownerID=%s,relatedSkillID=%s,hp:%s/%s", |
| | | curID, skillID, ownerID, relatedSkillID, batObj.GetHP(), batObj.GetMaxHP())
|
| | | return
|
| | |
|
| | | #光环技能,默认施法者身上也必须有,时长与施法者身上的同步
|
| | |
| | | setLayerCnt = kwargs.get("setLayerCnt", 0)
|
| | | if setLayerCnt > 0:
|
| | | addLayerCnt = setLayerCnt
|
| | | GameWorld.DebugLog("外部直接指定添加的buff层级: setLayerCnt=%s" % setLayerCnt)
|
| | | GameWorld.DebugLogEx("外部直接指定添加的buff层级: setLayerCnt=%s", setLayerCnt)
|
| | | else:
|
| | | addLayerCnt = buffSkill.GetLayerCnt()
|
| | | addLayerEff = buffSkill.GetEffectByID(ChConfig.PassiveEff_AddBuffLayerByWeight)
|
| | |
| | | if maxLayerCnt:
|
| | | maxLayerCnt += TurnPassive.GetTriggerEffectValue(turnFight, buffOwner, batObj, ChConfig.PassiveEff_AddBuffLayerMax, buffSkill)
|
| | |
|
| | | GameWorld.DebugLog("OnAddBuff: curID=%s,skillID=%s,atkType=%s,buffValueList=%s,addLayerCnt=%s/%s,ownerID=%s,relatedSkillID=%s" |
| | | % (curID, skillID, buffSkill.GetAtkType(), buffValueList, addLayerCnt, maxLayerCnt, ownerID, relatedSkillID))
|
| | | GameWorld.DebugLogEx("OnAddBuff: curID=%s,skillID=%s,atkType=%s,buffValueList=%s,addLayerCnt=%s/%s,ownerID=%s,relatedSkillID=%s", |
| | | curID, skillID, buffSkill.GetAtkType(), buffValueList, addLayerCnt, maxLayerCnt, ownerID, relatedSkillID)
|
| | | #buff重复获得时的叠加规则
|
| | | #以下规则默认针对的是相同施法者,即相同来源的处理
|
| | | #如果有针对不同施法者的规则会说明
|
| | |
| | | if not delBuff or delBuff.GetRemainTime() < buff.GetRemainTime():
|
| | | delBuff = buff
|
| | | if delBuff:
|
| | | GameWorld.DebugLog("删除独立层级多余buff: buffID=%s,ownerID=%s,remainTime=%s" % (delBuff.GetBuffID(), ownerID, delBuff.GetRemainTime()))
|
| | | GameWorld.DebugLogEx("删除独立层级多余buff: buffID=%s,ownerID=%s,remainTime=%s", delBuff.GetBuffID(), ownerID, delBuff.GetRemainTime())
|
| | | DoBuffDel(turnFight, batObj, delBuff, bySkill, afterLogic, buffOwner)
|
| | |
|
| | | elif buffRepeat == 5: # 5 唯一,强制覆盖不同来源同状态buff,如嘲讽状态
|
| | |
| | | continue
|
| | | buffID = buff.GetBuffID()
|
| | | nowLayerCnt = buff.GetLayer()
|
| | | GameWorld.DebugLog(" 已经存在该buff: buffID=%s,skillTypeID=%s,ownerID=%s,buffRepeat=%s" % (buffID, skillTypeID, ownerID, buffRepeat))
|
| | | GameWorld.DebugLogEx(" 已经存在该buff: buffID=%s,skillTypeID=%s,ownerID=%s,buffRepeat=%s", buffID, skillTypeID, ownerID, buffRepeat)
|
| | |
|
| | | updLayerCnt = addLayerCnt
|
| | | if buffRepeat == 3: # 叠加层级
|
| | | updLayerCnt = nowLayerCnt + addLayerCnt
|
| | | if maxLayerCnt and updLayerCnt > maxLayerCnt:
|
| | | updLayerCnt = maxLayerCnt
|
| | | GameWorld.DebugLog(" 叠加层级: nowLayerCnt=%s,addLayerCnt=%s,updLayerCnt=%s,maxLayerCnt=%s" % (nowLayerCnt, addLayerCnt, updLayerCnt, maxLayerCnt))
|
| | | GameWorld.DebugLogEx(" 叠加层级: nowLayerCnt=%s,addLayerCnt=%s,updLayerCnt=%s,maxLayerCnt=%s", nowLayerCnt, addLayerCnt, updLayerCnt, maxLayerCnt)
|
| | | else:
|
| | | GameWorld.DebugLog(" 默认覆盖")
|
| | | GameWorld.DebugLogEx(" 默认覆盖")
|
| | |
|
| | | # 重置回合、CD、值等
|
| | | buff.SetAddTiming(batObj.GetTiming())
|
| | |
| | | skillID = buffSkill.GetSkillID()
|
| | | buff = buffMgr.AddBuff(skillID)
|
| | | if not buff:
|
| | | GameWorld.DebugLog(" 添加buff失败! skillID=%s" % skillID, curID)
|
| | | GameWorld.DebugLogEx(" 添加buff失败! skillID=%s", skillID, curID)
|
| | | return
|
| | | relatedSkillID = bySkill.GetSkillID() if bySkill else 0
|
| | | ownerID = buffOwner.GetID()
|
| | | buffID = buff.GetBuffID()
|
| | | timing = batObj.GetTiming()
|
| | |
|
| | | GameWorld.DebugLog(" __addNewBuff. buffID=%s,skillID=%s,ownerID=%s,relatedSkillID=%s,timing=%s" |
| | | % (buffID, skillID, ownerID, relatedSkillID, timing), curID)
|
| | | GameWorld.DebugLogEx(" __addNewBuff. buffID=%s,skillID=%s,ownerID=%s,relatedSkillID=%s,timing=%s", |
| | | buffID, skillID, ownerID, relatedSkillID, timing, curID)
|
| | | buff.SetAddTiming(timing) # 武将当前在什么时机就设置为什么时机
|
| | | buff.SetOwnerID(ownerID)
|
| | | buff.SetRemainTime(buffSkill.GetLastTime())
|
| | |
| | | if isRefreshAttr:
|
| | | RefreshBuffAttr(batObj)
|
| | |
|
| | | if refreshType in [1, 2] and skillData.GetCurBuffState() == ChConfig.BatObjState_Frozen:
|
| | | __smyRecordEnemyFrozen(turnFight, batObj, curBuff)
|
| | | return
|
| | |
|
| | | def __smyRecordEnemyFrozen(turnFight, batObj, curBuff):
|
| | | '''特殊处理司马懿记录敌方冰冻,比较特殊,使用场景比较专用,直接写,减少每次buff的触发被动遍历次数
|
| | | 潜能ID 1012050
|
| | | 司马懿存活时,记录敌方被冰冻次数,司马懿死亡后,对敌方返还攻击力100%的伤害,敌方每被冰冻一次,伤害提升100%,最多提升至1000%,本次伤害由敌方所有人均摊。(两个一起死算我方胜利)
|
| | | '''
|
| | | faction = batObj.GetFaction()
|
| | | smyFaction = ChConfig.Def_FactionA if faction == ChConfig.Def_FactionB else ChConfig.Def_FactionB
|
| | | batFaction = turnFight.getBatFaction(smyFaction)
|
| | | if not batFaction:
|
| | | return
|
| | | batLineup = batFaction.getBatlineup(1)
|
| | | if ChConfig.HeroID_Simayi not in batLineup.heroObjIDDict:
|
| | | return
|
| | | smyObjID = batLineup.heroObjIDDict[ChConfig.HeroID_Simayi]
|
| | | smyObj = BattleObj.GetBatObjMgr().getBatObj(smyObjID)
|
| | | if not smyObj or not smyObj.IsAlive():
|
| | | return
|
| | | smySkillID = ChConfig.SkillID_SmyFanzhao
|
| | | smySkill = smyObj.GetSkillManager().FindSkillByID(smySkillID)
|
| | | if not smySkill:
|
| | | GameWorld.DebugLogEx("司马懿还没有记录敌方被冰冻次数的潜能: %s" % smySkillID)
|
| | | return
|
| | | frozenCnt = smyObj.GetDictByKey("EnemyFrozen") + 1
|
| | | smyObj.SetDict("EnemyFrozen", frozenCnt)
|
| | | GameWorld.DebugLogEx("司马懿记录敌方被冰冻次数: %s" % frozenCnt)
|
| | | return
|
| | |
|
| | | def __addHaloBuffEffObjID(curID, newBuff, skillID, ownerID, haloSrcBuff):
|
| | |
| | |
|
| | | if skillType == ChConfig.Def_SkillType_Halo and ownerID == buffObjID:
|
| | | haloObjIDList = curBuff.GetHaloObjIDList()
|
| | | GameWorld.DebugLog("光环buff回合变更同步其他有效目标该光环: skillID=%s,ownerID=%s,haloObjIDList=%s" % (skillID, ownerID, haloObjIDList))
|
| | | GameWorld.DebugLogEx("光环buff回合变更同步其他有效目标该光环: skillID=%s,ownerID=%s,haloObjIDList=%s", skillID, ownerID, haloObjIDList)
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for haloObjID in haloObjIDList:
|
| | | if haloObjID == buffObjID:
|
| | |
| | |
|
| | | if skillType == ChConfig.Def_SkillType_Halo and ownerID == buffObjID:
|
| | | haloObjIDList = curBuff.GetHaloObjIDList()
|
| | | GameWorld.DebugLog("光环buff删除同步删除其他有效目标该光环: skillID=%s,ownerID=%s,haloObjIDList=%s" % (skillID, ownerID, haloObjIDList))
|
| | | GameWorld.DebugLogEx("光环buff删除同步删除其他有效目标该光环: skillID=%s,ownerID=%s,haloObjIDList=%s", skillID, ownerID, haloObjIDList)
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for haloObjID in haloObjIDList:
|
| | | if haloObjID == buffObjID:
|
| | |
| | | buffID = buff.GetBuffID()
|
| | | skillID = buff.GetSkillID()
|
| | | if buff.GetBuffRetain()&pow(2, ChConfig.BuffRetainType_Dead):
|
| | | GameWorld.DebugLog("死亡不清除的buff: objID=%s,buffID=%s,skillID=%s" % (objID, buffID, skillID))
|
| | | GameWorld.DebugLogEx("死亡不清除的buff: objID=%s,buffID=%s,skillID=%s", objID, buffID, skillID)
|
| | | continue
|
| | | if DoBuffDel(turnFight, batObj, buff, noRefreshAttr=True, isSync=False): # 可不通知,前端默认都清除,复活后重新同步
|
| | | isRefreshAttr = True
|
| | |
| | | buffID = buff.GetBuffID()
|
| | | skillID = buff.GetSkillID()
|
| | | if buff.GetBuffRetain()&pow(2, ChConfig.BuffRetainType_Revive):
|
| | | GameWorld.DebugLog("复活不清除的buff: objID=%s,buffID=%s,skillID=%s" % (objID, buffID, skillID))
|
| | | GameWorld.DebugLogEx("复活不清除的buff: objID=%s,buffID=%s,skillID=%s", objID, buffID, skillID)
|
| | | SyncBuffRefresh(turnFight, batObj, buff, isNewAdd=True) # 复活时还存在的buff通知前端视为新添加的
|
| | | continue
|
| | | if DoBuffDel(turnFight, batObj, buff, noRefreshAttr=True, isSync=False): # 复活可不通知删除的buff
|
| | |
| | | # 非光源
|
| | | continue
|
| | | haloSkillID = buff.GetSkillID()
|
| | | GameWorld.DebugLog("复活后重新添加本阵营光环: objID=%s,ownerID=%s,haloSkillID=%s" % (objID, tagObjID, haloSkillID))
|
| | | GameWorld.DebugLogEx("复活后重新添加本阵营光环: objID=%s,ownerID=%s,haloSkillID=%s", objID, tagObjID, haloSkillID)
|
| | | haloSkill = tagObj.GetSkillManager().FindSkillByID(haloSkillID)
|
| | | if not haloSkill:
|
| | | continue
|
| | |
| | |
|
| | | batAttrDict = batObj.ResetBattleEffect()
|
| | |
|
| | | GameWorld.DebugLog("RefreshBuffAttr ID:%s,atk=%s,def=%s,hp=%s/%s,batAttrDict=%s" |
| | | % (objID, batObj.GetAtk(), batObj.GetDef(), befHP, befMaxHP, batAttrDict))
|
| | | GameWorld.DebugLogEx("RefreshBuffAttr ID:%s,atk=%s,def=%s,hp=%s/%s,batAttrDict=%s", |
| | | objID, batObj.GetAtk(), batObj.GetDef(), befHP, befMaxHP, batAttrDict)
|
| | |
|
| | | skbufAttrDict = {}
|
| | |
|
| | |
| | | attrValue = -attrValue
|
| | | skillAttrDict[attrID] = skillAttrDict.get(attrID, 0) + attrValue
|
| | | skbufAttrDict[attrID] = skbufAttrDict.get(attrID, 0) + attrValue
|
| | | skillAttrDict and GameWorld.DebugLog(" skillAttrDict=%s" % skillAttrDict)
|
| | | skillAttrDict and GameWorld.DebugLogEx(" skillAttrDict=%s", skillAttrDict)
|
| | |
|
| | | # buff
|
| | | buffsAttrDict = {} # buff属性 {attrID:value, } value可能是负值
|
| | |
| | | buffsAttrDict[attrID] = buffsAttrDict.get(attrID, 0) + attrValue
|
| | | skbufAttrDict[attrID] = skbufAttrDict.get(attrID, 0) + attrValue
|
| | |
|
| | | buffsAttrDict and GameWorld.DebugLog(" buffsAttrDict=%s" % buffsAttrDict)
|
| | | GameWorld.DebugLog(" skbufAttrDict=%s" % skbufAttrDict)
|
| | | buffsAttrDict and GameWorld.DebugLogEx(" buffsAttrDict=%s", buffsAttrDict)
|
| | | GameWorld.DebugLogEx(" skbufAttrDict=%s", skbufAttrDict)
|
| | |
|
| | | objID = batObj.GetID()
|
| | | # 先计算百分比加成或降低的
|
| | |
| | | updValue = attrValue * (10000 + attrPerValue) / 10000.0
|
| | | #updValue = max(0, updValue) # 最多减到0,最大无上限
|
| | | batObj.SetBatAttrValue(attrID, updValue)
|
| | | GameWorld.DebugLog(" attrID=%s(PerID:%s),attrValue=%s(PerValue:%s),updValue=%s" % (attrID, attrPerID, attrValue, attrPerValue, updValue))
|
| | | GameWorld.DebugLogEx(" attrID=%s(PerID:%s),attrValue=%s(PerValue:%s),updValue=%s", attrID, attrPerID, attrValue, attrPerValue, updValue)
|
| | |
|
| | | # 再累加非百分比的固定值
|
| | | for attrID, addValue in skbufAttrDict.items():
|
| | |
| | | updValue = attrValue + addValue
|
| | | #updValue = max(0, attrValue + addValue) # 最多减到0,最大无上限
|
| | | batObj.SetBatAttrValue(attrID, updValue)
|
| | | GameWorld.DebugLog(" attrID=%s,attrValue=%s,addValue=%s,updValue=%s" % (attrID, attrValue, addValue, updValue))
|
| | | GameWorld.DebugLogEx(" attrID=%s,attrValue=%s,addValue=%s,updValue=%s", attrID, attrValue, addValue, updValue)
|
| | |
|
| | | aftHP = batObj.GetHP()
|
| | | aftMaxHP = batObj.GetMaxHP()
|
| | |
| | | if befHP and aftMaxHP > befMaxHP:
|
| | | aftHP += (aftMaxHP - befMaxHP)
|
| | | batObj.SetHP(aftHP, isNotify)
|
| | | GameWorld.DebugLog(" befHP=%s/%s, aftHP=%s/%s" % (befHP, befMaxHP, aftHP, aftMaxHP))
|
| | | GameWorld.DebugLog(" 最终属性 ID:%s,atk=%s,def=%s,hp=%s/%s,%s" % (objID, batObj.GetAtk(), batObj.GetDef(), aftHP, aftMaxHP, batObj.GetBatAttrDict()))
|
| | | GameWorld.DebugLogEx(" befHP=%s/%s, aftHP=%s/%s", befHP, befMaxHP, aftHP, aftMaxHP)
|
| | | GameWorld.DebugLogEx(" 最终属性 ID:%s,atk=%s,def=%s,hp=%s/%s,%s", objID, batObj.GetAtk(), batObj.GetDef(), aftHP, aftMaxHP, batObj.GetBatAttrDict())
|
| | | return
|
| | |
|
| | | def SyncBuffRefresh(turnFight, curBatObj, curBuff, relatedSkillID=0, isNewAdd=False):
|
| | |
| | | passiveEffMgr = batObj.GetPassiveEffManager()
|
| | | skillEffInfo = passiveEffMgr.RefreshSkillPassiveEffect()
|
| | | buffEffInfo = passiveEffMgr.RefreshBuffPassiveEffect()
|
| | | skillEffInfo and GameWorld.DebugLog(" 被动技能效果: %s" % skillEffInfo)
|
| | | buffEffInfo and GameWorld.DebugLog(" 被动Buff效果: %s" % buffEffInfo)
|
| | | skillEffInfo and GameWorld.DebugLogEx(" 被动技能效果: %s", skillEffInfo)
|
| | | buffEffInfo and GameWorld.DebugLogEx(" 被动Buff效果: %s", buffEffInfo)
|
| | | return
|
| | |
|
| | | def OnTriggerPassiveEffect(turnFight, batObj, triggerWay, tagObj=None, connSkill=None, connSkillTypeID=0, connBuff=None, **kwargs):
|
| | |
| | | return
|
| | | # [["skill/buff", skillID, buffID, effIDList], ...]
|
| | | tagID = tagObj.GetID() if tagObj else 0
|
| | | GameWorld.DebugLog("触发被动: triggerWay=%s,objID=%s,tagID=%s,%s" % (triggerWay, batObj.GetID(), tagID, effInfoList))
|
| | | GameWorld.DebugLogEx("触发被动: triggerWay=%s,objID=%s,tagID=%s,%s", triggerWay, batObj.GetID(), tagID, effInfoList)
|
| | | for effInfo in effInfoList:
|
| | | sign = effInfo[0]
|
| | | skillID, buffID, effIDList = effInfo[1:]
|
| | |
| | | if not effSkill:
|
| | | return
|
| | |
|
| | | kwargs["triggerWay"] = triggerWay
|
| | | for effID in effIDList:
|
| | | curEffect = effSkill.GetEffectByID(effID, triggerWay)
|
| | | if not curEffect:
|
| | |
| | | return
|
| | | skillData = effBuff.GetSkillData()
|
| | |
|
| | | kwargs["triggerWay"] = triggerWay
|
| | | for effID in effIDList:
|
| | | curEffect = skillData.GetEffectByID(effID, triggerWay)
|
| | | if not curEffect:
|
| | |
| | |
|
| | | if effID in ChConfig.PassiveEffHappenValueList:
|
| | | if value:
|
| | | GameWorld.DebugLog("统计被动效果值: calcEffID=%s,objID=%s,tagID=%s,%s,curValue=%s" % (calcEffID, atkObj.GetID(), tagID, effInfoList, value))
|
| | | GameWorld.DebugLogEx("统计被动效果值: calcEffID=%s,objID=%s,tagID=%s,%s,curValue=%s", calcEffID, atkObj.GetID(), tagID, effInfoList, value)
|
| | | return value
|
| | | elif effID in ChConfig.PassiveEffValueMaxList:
|
| | | curValue = max(curValue, value) # 取最大值
|
| | |
| | | # if curSkill.GetCoolDownTime():
|
| | | # SkillCommon.SetSkillRemainTime(curSkill, 0, tick, attacker)
|
| | |
|
| | | GameWorld.DebugLog("统计被动效果值: calcEffID=%s,objID=%s,tagID=%s,%s,curValue=%s" % (calcEffID, atkObj.GetID(), tagID, effInfoList, curValue))
|
| | | GameWorld.DebugLogEx("统计被动效果值: calcEffID=%s,objID=%s,tagID=%s,%s,curValue=%s", calcEffID, atkObj.GetID(), tagID, effInfoList, curValue)
|
| | | return curValue
|
| | |
|
| | |
| | |
|
| | | if not curBatObj.IsAlive():
|
| | | if useSkill.GetSkillType() == ChConfig.Def_SkillType_Revive and useSkill.GetTagAim() == ChConfig.SkillTagAim_Self:
|
| | | GameWorld.DebugLog("死亡时使用复活自己的技能! skillID=%s" % skillID)
|
| | | GameWorld.DebugLogEx("死亡时使用复活自己的技能! skillID=%s", skillID)
|
| | | else:
|
| | | # 其他技能死亡状态下无法释放
|
| | | triggerWay = kwargs.get("triggerWay", 0)
|
| | | if triggerWay in ChConfig.DeadCanTriggerWayList:
|
| | | GameWorld.DebugLogEx("死亡可触发的方式触发技能可释放! skillID=%s,triggerWay=%s", skillID, triggerWay)
|
| | | else:
|
| | | GameWorld.DebugLogEx("死亡状态下无法释放该技能! skillID=%s", skillID)
|
| | | return
|
| | |
|
| | | objID = curBatObj.GetID()
|
| | |
|
| | | if hasattr(useSkill, "GetRemainTime") and useSkill.GetRemainTime() > 0:
|
| | | GameWorld.DebugLog("技能CD中! skillID=%s,RemainTime=%s" % (skillID, useSkill.GetRemainTime()))
|
| | | GameWorld.DebugLogEx("技能CD中! skillID=%s,RemainTime=%s", skillID, useSkill.GetRemainTime())
|
| | | return
|
| | |
|
| | | buffStateGroups = useSkill.GetBuffStateLimit()
|
| | | if buffStateGroups:
|
| | | limitState = curBatObj.IsInBuffStateGroup(buffStateGroups)
|
| | | if limitState:
|
| | | GameWorld.DebugLog("技能使用处于buff状态限制中! skillID=%s,buffStateGroups=%s,limitState=%s" % (skillID, buffStateGroups, limitState))
|
| | | GameWorld.DebugLogEx("技能使用处于buff状态限制中! skillID=%s,buffStateGroups=%s,limitState=%s", skillID, buffStateGroups, limitState)
|
| | | return
|
| | |
|
| | | if CheckSkillUseCntLimit(curBatObj, useSkill):
|
| | |
| | | if not curBatObj.IsSkillCanHappen(skillID, rate):
|
| | | tagObjList.remove(tagObj)
|
| | | isRemove = True
|
| | | GameWorld.DebugLog(" 概率不触发,移除目标! rate=%s,skillID=%s,tagID=%s" % (rate, skillID, tagObj.GetID()))
|
| | | GameWorld.DebugLogEx(" 概率不触发,移除目标! rate=%s,skillID=%s,tagID=%s", rate, skillID, tagObj.GetID())
|
| | | if not tagObjList and isRemove:
|
| | | return
|
| | |
|
| | | if not tagObjList:
|
| | | # 可扩展其他目标选择,如复活技能没有死亡单位时则使用另外的效果
|
| | | GameWorld.DebugLog("找不到技能目标! skillID=%s,mapID=%s,funcLineID=%s" % (skillID, turnFight.mapID, turnFight.funcLineID), turnFight.getReqPlayerID())
|
| | | GameWorld.DebugLogEx("找不到技能目标! skillID=%s,mapID=%s,funcLineID=%s", skillID, turnFight.mapID, turnFight.funcLineID, turnFight.getReqPlayerID())
|
| | | if useSkill.GetSkillType() == ChConfig.Def_SkillType_Revive:
|
| | | otherEff = useSkill.GetEffectByID(ChConfig.SkillEff_ReviveNoUse)
|
| | | if otherEff:
|
| | | otherSkillID = otherEff.GetEffectValue(0)
|
| | | GameWorld.DebugLog("没有可复活的目标,释放其他技能! otherSkillID=%s" % otherSkillID)
|
| | | GameWorld.DebugLogEx("没有可复活的目标,释放其他技能! otherSkillID=%s", otherSkillID)
|
| | | otherSkill = curBatObj.GetSkillManager().FindSkillByID(otherSkillID)
|
| | | if not otherSkill:
|
| | | otherSkill = IpyGameDataPY.GetIpyGameData("Skill", otherSkillID)
|
| | |
| | | angerOverflow = curBatObj.GetAngerOverflow()
|
| | |
|
| | | bySkillID = bySkill.GetSkillID() if bySkill else 0
|
| | | GameWorld.DebugLog("◆使用技能: curID=%s,skillID=%s,tagCnt=%s,batType=%s,bySkillID=%s,HP:%s/%s,angerOverflow=%s,curXP=%s,oneActionUseCnt=%s" |
| | | % (objID, skillID, len(tagObjList), batType, bySkillID, curBatObj.GetHP(), curBatObj.GetMaxHP(), angerOverflow, curXP, oneActionUseCnt))
|
| | | GameWorld.DebugLogEx("◆使用技能: curID=%s,skillID=%s,tagCnt=%s,batType=%s,bySkillID=%s,HP:%s/%s,angerOverflow=%s,curXP=%s,oneActionUseCnt=%s", |
| | | objID, skillID, len(tagObjList), batType, bySkillID, curBatObj.GetHP(), curBatObj.GetMaxHP(), angerOverflow, curXP, oneActionUseCnt)
|
| | | # 以下为技能可以使用的处理,之后的逻辑默认技能使用成功
|
| | |
|
| | | poolMgr = ObjPool.GetPoolMgr()
|
| | |
| | | if useCntLimit:
|
| | | useCnt = batObj.GetSkillUseCnt(skillID)
|
| | | if useCnt >= useCntLimit:
|
| | | GameWorld.DebugLog("技能每场战斗使用次数受限! skillID=%s,useCnt=%s >= %s" % (skillID, useCnt, useCntLimit))
|
| | | GameWorld.DebugLogEx("技能每场战斗使用次数受限! skillID=%s,useCnt=%s >= %s", skillID, useCnt, useCntLimit)
|
| | | return True
|
| | |
|
| | | if turnUseCntLimit:
|
| | | turnUseCnt = batObj.GetSkillTurnUseCnt(skillID)
|
| | | if turnUseCnt >= turnUseCntLimit:
|
| | | GameWorld.DebugLog("技能每大回合使用次数受限! skillID=%s,turnUseCnt=%s >= %s" % (skillID, turnUseCnt, turnUseCntLimit))
|
| | | GameWorld.DebugLogEx("技能每大回合使用次数受限! skillID=%s,turnUseCnt=%s >= %s", skillID, turnUseCnt, turnUseCntLimit)
|
| | | return True
|
| | |
|
| | | return
|
| | |
| | | return True
|
| | | return False
|
| | |
|
| | | def GetSkillTags(turnFight, curBatObj, useSkill, atkBackTag=None):
|
| | | def GetSkillTags(turnFight, curBatObj, useSkill=None, atkBackTag=None, tagSet=None):
|
| | | ## 获取技能目标
|
| | | # @param tagSet: 可以外部指定检索目标 [范围, 友好, 细分, 个数]
|
| | | # @return: [主目标, 目标2, ...]
|
| | |
|
| | | lineupNumSet = None
|
| | | changeRet = None
|
| | | if tagSet and len(tagSet) == 4:
|
| | | tagAim, tagFriendly, tagAffect, tagCount = tagSet
|
| | | elif useSkill:
|
| | | tagAim = useSkill.GetTagAim()
|
| | | tagFriendly = useSkill.GetTagFriendly()
|
| | | tagAffect = useSkill.GetTagAffect()
|
| | | tagCount = useSkill.GetTagCount()
|
| | |
|
| | | lineupNumSet = None
|
| | | changeRet = CheckChangeTagEff(turnFight, curBatObj, useSkill)
|
| | | if changeRet:
|
| | | lineupNumSet, changeTagSet = changeRet
|
| | | GameWorld.DebugLog("强制修改技能目标: lineupNumSet=%s, changeTagSet=%s" % (lineupNumSet, changeTagSet))
|
| | | GameWorld.DebugLogEx("强制修改技能目标: lineupNumSet=%s, changeTagSet=%s", lineupNumSet, changeTagSet)
|
| | | tagAim, tagFriendly, tagAffect, tagCount = changeTagSet
|
| | | else:
|
| | | return []
|
| | |
|
| | | # 自己,直接返回
|
| | | if tagAim == ChConfig.SkillTagAim_Self:
|
| | | return [curBatObj]
|
| | |
|
| | | if useSkill:
|
| | | tagCount += TurnPassive.GetTriggerEffectValue(turnFight, curBatObj, None, ChConfig.PassiveEff_AddSkillTagCnt, useSkill)
|
| | | #GameWorld.DebugLog("搜索技能目标: skillID=%s,tagAim=%s,tagFriendly=%s,tagAffect=%s,tagCount=%s" % (useSkill.GetSkillID(), tagAim, tagFriendly, tagAffect, tagCount))
|
| | | #GameWorld.DebugLogEx("搜索技能目标: skillID=%s,tagAim=%s,tagFriendly=%s,tagAffect=%s,tagCount=%s", useSkill.GetSkillID(), tagAim, tagFriendly, tagAffect, tagCount)
|
| | |
|
| | | # 目标选择优先级,集火 > changeRet > 魅惑 > 混乱 > 嘲讽 > 反击 > 常规
|
| | | # 集火:直接通过效果5015指定了目标,不会走到这里,所以这里可不处理
|
| | |
| | | elif curBatObj.CheckInState(ChConfig.BatObjState_Chaos):
|
| | | inChaos = True
|
| | | tagFriendly = random.randint(0, 1) # 混乱: 随机敌友
|
| | | #GameWorld.DebugLog("inCharm=%s,inChaos=%s,tagFriendly=%s" % (inCharm, inChaos, tagFriendly))
|
| | | #GameWorld.DebugLogEx("inCharm=%s,inChaos=%s,tagFriendly=%s", inCharm, inChaos, tagFriendly)
|
| | | isNoSelf = False # 是否不包含自己
|
| | | if inCharm or inChaos:
|
| | | if SkillCommon.isAttackDirectSkill(useSkill):
|
| | | isNoSelf = True
|
| | | #GameWorld.DebugLog("特殊不包含自己")
|
| | | #GameWorld.DebugLogEx("特殊不包含自己")
|
| | |
|
| | | # 根据敌友关系确定阵营及一些敌友关系的特殊逻辑
|
| | | sneerObjFirst = True # 嘲讽目标是否优先
|
| | |
| | | sneerTagObj = curBatObj.GetSneerTagObj() # 被嘲讽的目标,对敌的强制锁定被嘲讽目标
|
| | | if sneerTagObj:
|
| | | specMainObj = sneerTagObj
|
| | | #GameWorld.DebugLog("嘲讽特殊主目标")
|
| | | #GameWorld.DebugLogEx("嘲讽特殊主目标")
|
| | | elif atkBackTag:
|
| | | specMainObj = atkBackTag
|
| | | #GameWorld.DebugLog("反击特殊主目标")
|
| | | #GameWorld.DebugLogEx("反击特殊主目标")
|
| | |
|
| | | if specMainObj:
|
| | | specObjID = specMainObj.GetID()
|
| | |
| | | colNumList.remove(specInColNum)
|
| | | colNumList.insert(0, specInColNum)
|
| | |
|
| | | GameWorld.DebugLog("纵排: colNumList=%s,specObjID-PosNum=%s-%s" % (colNumList, specObjID, specObjPosNum))
|
| | | GameWorld.DebugLogEx("纵排: colNumList=%s,specObjID-PosNum=%s-%s", colNumList, specObjID, specObjPosNum)
|
| | | for col in colNumList:
|
| | | for row in range(1, 1 + ChConfig.TurnFightRows):
|
| | | pNum = (row - 1) * ChConfig.TurnFightCols + col
|
| | | #GameWorld.DebugLog(" col=%s,row=%s,pNum=%s" % (col, row, pNum))
|
| | | #GameWorld.DebugLogEx(" col=%s,row=%s,pNum=%s", col, row, pNum)
|
| | | if pNum not in batLineup.posObjIDDict:
|
| | | continue
|
| | | tagObjID = batLineup.posObjIDDict[pNum]
|
| | |
| | | colNumList.remove(inColNum)
|
| | | colNumList.insert(0, inColNum)
|
| | |
|
| | | GameWorld.DebugLog("全部: colNumList=%s,specObjID-PosNum=%s-%s" % (colNumList, specObjID, specObjPosNum))
|
| | | GameWorld.DebugLogEx("全部: colNumList=%s,specObjID-PosNum=%s-%s", colNumList, specObjID, specObjPosNum)
|
| | | # 按前排优先原则
|
| | | for row in range(1, 1 + ChConfig.TurnFightRows):
|
| | | for col in colNumList:
|
| | | pNum = (row - 1) * ChConfig.TurnFightCols + col
|
| | | #GameWorld.DebugLog(" col=%s,row=%s,pNum=%s" % (col, row, pNum))
|
| | | #GameWorld.DebugLogEx(" col=%s,row=%s,pNum=%s", col, row, pNum)
|
| | | if pNum not in batLineup.posObjIDDict:
|
| | | continue
|
| | | tagObjID = batLineup.posObjIDDict[pNum]
|
| | |
| | | # 血量最低
|
| | | if tagAffect == ChConfig.SkillTagAffect_HPLowest:
|
| | | aimObjList.sort(key=lambda o:(o.GetHP()), reverse=False)
|
| | | #GameWorld.DebugLog("血量最低排序: %s" % [[o.GetID(), o.GetHP(), o.GetMaxHP()] for o in aimObjList])
|
| | | #GameWorld.DebugLogEx("血量最低排序: %s", [[o.GetID(), o.GetHP(), o.GetMaxHP()] for o in aimObjList])
|
| | |
|
| | | # 血量最高
|
| | | elif tagAffect == ChConfig.SkillTagAffect_HPHighest:
|
| | | aimObjList.sort(key=lambda o:(o.GetHP()), reverse=True)
|
| | | #GameWorld.DebugLog("血量最高排序: %s" % [[o.GetID(), o.GetHP(), o.GetMaxHP()] for o in aimObjList])
|
| | | #GameWorld.DebugLogEx("血量最高排序: %s", [[o.GetID(), o.GetHP(), o.GetMaxHP()] for o in aimObjList])
|
| | |
|
| | | # 攻击力最高
|
| | | elif tagAffect == ChConfig.SkillTagAffect_AtkHighest:
|
| | | aimObjList.sort(key=lambda o:(o.GetAtk()), reverse=True)
|
| | | #GameWorld.DebugLog("攻击力最高排序: %s" % [[o.GetID(), o.GetHP(), o.GetMaxHP()] for o in aimObjList])
|
| | | #GameWorld.DebugLogEx("攻击力最高排序: %s", [[o.GetID(), o.GetHP(), o.GetMaxHP()] for o in aimObjList])
|
| | |
|
| | | # 未被控制优先
|
| | | elif tagAffect == ChConfig.SkillTagAffect_UncontrolledPriority:
|
| | | sneerObjFirst = False
|
| | | aimObjList.sort(key=lambda o:(o.IsInControlled()))
|
| | | GameWorld.DebugLog("未被控制优先: %s" % [[o.GetID(), o.IsInControlled()] for o in aimObjList])
|
| | | GameWorld.DebugLogEx("未被控制优先: %s", [[o.GetID(), o.IsInControlled()] for o in aimObjList])
|
| | |
|
| | | # 灼烧/玄火目标优先
|
| | | elif tagAffect == ChConfig.SkillTagAffect_Burn:
|
| | |
| | | colNumList.remove(inColNum)
|
| | | colNumList.insert(0, inColNum)
|
| | |
|
| | | GameWorld.DebugLog("前后排: rowNumList=%s,colNumList=%s,specObjID-PosNum=%s-%s" % (rowNumList, colNumList, specObjID, specObjPosNum))
|
| | | GameWorld.DebugLogEx("前后排: rowNumList=%s,colNumList=%s,specObjID-PosNum=%s-%s", rowNumList, colNumList, specObjID, specObjPosNum)
|
| | | aimObjList = []
|
| | | for row in rowNumList:
|
| | | for col in colNumList:
|
| | | pNum = (row - 1) * ChConfig.TurnFightCols + col
|
| | | #GameWorld.DebugLog(" row=%s,col=%s,pNum=%s" % (row, col, pNum))
|
| | | #GameWorld.DebugLogEx(" row=%s,col=%s,pNum=%s", row, col, pNum)
|
| | | if pNum not in batLineup.posObjIDDict:
|
| | | continue
|
| | | tagObjID = batLineup.posObjIDDict[pNum]
|
| | |
| | | return False
|
| | | if isNoSelf:
|
| | | if tagBatObj.GetID() == curBatObj.GetID():
|
| | | #GameWorld.DebugLog("不包含自己")
|
| | | #GameWorld.DebugLogEx("不包含自己")
|
| | | return False
|
| | | #if not tagBatObj.GetCanAttack(): 策划要求不可攻击的对象也要可选中
|
| | | # return False
|
| | |
| | | if useSkill.GetSkillType() == ChConfig.Def_SkillType_Halo:
|
| | | curID = curBatObj.GetID()
|
| | | skillID = useSkill.GetSkillID()
|
| | | GameWorld.DebugLog("光环技能先给施法者添加光源buff! skillID=%s,ownerID=%s" % (skillID, curID))
|
| | | GameWorld.DebugLogEx("光环技能先给施法者添加光源buff! skillID=%s,ownerID=%s", skillID, curID)
|
| | | if TurnBuff.OnAddBuff(turnFight, curBatObj, useSkill, buffOwner=curBatObj, **kwargs):
|
| | | for tagBatObj in useSkill.GetTagObjList():
|
| | | if tagBatObj.GetID() == curBatObj.GetID():
|
| | |
| | | def __doUseSkill(turnFight, curBatObj, useSkill):
|
| | |
|
| | | atkType = useSkill.GetAtkType()
|
| | | GameWorld.DebugLog("__doUseSkill: curID=%s,skillID=%s,atkType=%s" % (curBatObj.GetID(), useSkill.GetSkillID(), atkType))
|
| | | GameWorld.DebugLogEx("__doUseSkill: curID=%s,skillID=%s,atkType=%s", curBatObj.GetID(), useSkill.GetSkillID(), atkType)
|
| | |
|
| | | __doStealBuff(turnFight, curBatObj, useSkill)
|
| | | __doHarmSelf(turnFight, curBatObj, useSkill)
|
| | |
| | | for tagBuff in tagBuffList:
|
| | | skillID = tagBuff.GetSkillID()
|
| | | buffOwner = curBatObj
|
| | | GameWorld.DebugLog("使用技能前偷取buff: tagID=%s,tagBuffID=%s,buffSkillID=%s" % (tagObj.GetID(), tagBuff.GetBuffID(), skillID))
|
| | | GameWorld.DebugLogEx("使用技能前偷取buff: tagID=%s,tagBuffID=%s,buffSkillID=%s", tagObj.GetID(), tagBuff.GetBuffID(), skillID)
|
| | | addBuff = TurnBuff.DoAddBuffBySkillID(turnFight, curBatObj, skillID, buffOwner, useSkill, isSync=False)
|
| | | if not addBuff:
|
| | | continue
|
| | |
| | |
|
| | | updHP = max(curHP - lostHP, 0)
|
| | | curBatObj.SetHP(updHP, False)
|
| | | GameWorld.DebugLog("使用技能时自残: curHP=%s/%s,harmPer=%s,harmHP=%s,lostHP=%s,updHP=%s,noEnoughDo=%s" |
| | | % (curHP, maxHP, harmPer, harmHP, lostHP, updHP, noEnoughDo))
|
| | | GameWorld.DebugLogEx("使用技能时自残: curHP=%s/%s,harmPer=%s,harmHP=%s,lostHP=%s,updHP=%s,noEnoughDo=%s", |
| | | curHP, maxHP, harmPer, harmHP, lostHP, updHP, noEnoughDo)
|
| | |
|
| | | curBatObj.SetHarmSelfHP(harmHP) # 无视实际扣血量,直接更新
|
| | |
|
| | |
| | | def SkillModule_1(turnFight, curBatObj, useSkill):
|
| | | ## 通用攻击,单攻、群攻
|
| | |
|
| | | addPer = 0
|
| | | # 司马懿特殊潜能
|
| | | if useSkill.GetSkillID() == ChConfig.SkillID_SmyFanzhao:
|
| | | frozenCnt = curBatObj.GetDictByKey("EnemyFrozen")
|
| | | curBatObj.SetDict("EnemyFrozen", 0)
|
| | | effect = useSkill.GetEffect(0)
|
| | | perFrozenAdd = effect.GetEffectValue(0) # 每个冰冻额外增加比例
|
| | | addPerMax = effect.GetEffectValue(1) # 最大增加比例
|
| | | addPer = frozenCnt * perFrozenAdd
|
| | | if addPerMax and addPer > addPerMax:
|
| | | addPer = addPerMax
|
| | | GameWorld.DebugLogEx("司马懿特殊潜能技能额外增加比例: frozenCnt=%s,addPer=%s" % (frozenCnt, addPer))
|
| | | |
| | | # 计算伤害
|
| | | calcHurtResults = []
|
| | | for tagBatObj in useSkill.GetTagObjList():
|
| | | hurtValue, hurtTypes, immuneHurt = __calcSkillHurt(turnFight, curBatObj, tagBatObj, useSkill)
|
| | | hurtValue, hurtTypes, immuneHurt = __calcSkillHurt(turnFight, curBatObj, tagBatObj, useSkill, addPer)
|
| | | calcHurtResults.append([tagBatObj, hurtValue, hurtTypes, immuneHurt])
|
| | |
|
| | | DoSkillHurtHP(turnFight, curBatObj, useSkill, calcHurtResults)
|
| | | return
|
| | |
|
| | | def __calcSkillHurt(turnFight, atkObj, defObj, curSkill):
|
| | | def __calcSkillHurt(turnFight, atkObj, defObj, curSkill, addPer=0):
|
| | | ## 计算技能伤害,只计算值,不做实际处理
|
| | | # @param addPer: 外部指定增加的比例
|
| | | # @return: hurtValue, hurtTypes, immuneHurt
|
| | | atkSkillPer = curSkill.GetSkillPer()
|
| | | atkSkillPer = curSkill.GetSkillPer() + addPer
|
| | | atkSkillValue = curSkill.GetSkillValue()
|
| | | hurtValue, hurtTypes = CalcFormatHurt(turnFight, atkObj, defObj, curSkill, atkSkillValue, atkSkillPer)
|
| | | hurtValue, hurtTypes, immuneHurt = CalcHurtWithBuff(turnFight, atkObj, defObj, hurtValue, hurtTypes)
|
| | |
| | | valueA = randEffect.GetEffectValue(0)
|
| | | valueB = max(randEffect.GetEffectValue(1), valueA)
|
| | | ricochetCnt = random.randint(valueA, valueB)
|
| | | GameWorld.DebugLog("随机弹射次数: %s,valueA=%s,valueB=%s" % (ricochetCnt, valueA, valueB))
|
| | | GameWorld.DebugLogEx("随机弹射次数: %s,valueA=%s,valueB=%s", ricochetCnt, valueA, valueB)
|
| | | ricochetCnt += TurnPassive.GetTriggerEffectValue(turnFight, curBatObj, None, ChConfig.PassiveEff_AddRicochetCnt, useSkill)
|
| | |
|
| | | # 弹射:优先弹射次数少的目标,相同目标可弹射多次
|
| | |
| | | ricochetObjList.append(tagObj)
|
| | | ricochetObjIDList.append(tagObj.GetID())
|
| | |
|
| | | GameWorld.DebugLog("弹射次数: %s, ricochetObjIDList=%s" % (ricochetCnt, ricochetObjIDList)) |
| | | GameWorld.DebugLogEx("弹射次数: %s, ricochetObjIDList=%s", ricochetCnt, ricochetObjIDList)
|
| | | return ricochetObjList
|
| | |
|
| | | def SkillModule_2(turnFight, curBatObj, useSkill):
|
| | |
| | | hurtObj.SetHurtHP(cureHP)
|
| | | hurtObj.SetLostHP(cureHP)
|
| | | hurtObj.SetCurHP(tagBatObj.GetHP())
|
| | | GameWorld.DebugLog(" 复活: dID=%s,cureHP=%s,skillPer=%s,reviveHPPer=%s,%s/%s,xp=%s,reviveXPPer=%s" |
| | | % (dID, cureHP, skillPer, reviveHPPer, tagBatObj.GetHP(), dMapHP, xp, reviveXPPer))
|
| | | GameWorld.DebugLogEx(" 复活: dID=%s,cureHP=%s,skillPer=%s,reviveHPPer=%s,%s/%s,xp=%s,reviveXPPer=%s", |
| | | dID, cureHP, skillPer, reviveHPPer, tagBatObj.GetHP(), dMapHP, xp, reviveXPPer)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | hurtObj.SetHurtHP(cureHP)
|
| | | hurtObj.SetLostHP(realCureHP)
|
| | | hurtObj.SetCurHP(tagBatObj.GetHP())
|
| | | GameWorld.DebugLog(" 治疗: dID=%s,cureHP=%s,realCureHP=%s,%s/%s" % (dID, cureHP, realCureHP, tagBatObj.GetHP(), dMapHP))
|
| | | GameWorld.DebugLogEx(" 治疗: dID=%s,cureHP=%s,realCureHP=%s,%s/%s", dID, cureHP, realCureHP, tagBatObj.GetHP(), dMapHP)
|
| | |
|
| | | TurnAttack.AddTurnObjCureHP(tagBatObj, atkObj, cureHP, realCureHP, skillID)
|
| | |
|
| | |
| | |
|
| | | dHP = defObj.GetHP()
|
| | | dMaxHP = defObj.GetMaxHP()
|
| | | GameWorld.DebugLog("结算持续治疗: atkID=%s,defID=%s,buffID=%s,skillID=%s,ownerID=%s,cureHP=%s,dHP=%s/%s" |
| | | % (atkID, defID, buffID, skillID, ownerID, cureHP, dHP, dMaxHP))
|
| | | GameWorld.DebugLogEx("结算持续治疗: atkID=%s,defID=%s,buffID=%s,skillID=%s,ownerID=%s,cureHP=%s,dHP=%s/%s", |
| | | atkID, defID, buffID, skillID, ownerID, cureHP, dHP, dMaxHP)
|
| | | layer = curBuff.GetLayer()
|
| | | if layer > 0:
|
| | | cureHP *= layer
|
| | | GameWorld.DebugLog(" 多层buff: cureHP=%s,layer=%s" % (cureHP, layer))
|
| | | GameWorld.DebugLogEx(" 多层buff: cureHP=%s,layer=%s", cureHP, layer)
|
| | | #if "FinalDamPer" in kwargs:
|
| | | # FinalDamPer = kwargs["FinalDamPer"]
|
| | | # hurtValue *= (10000 + FinalDamPer) / 10000.0
|
| | | # GameWorld.DebugLog(" 增伤: hurtValue=%s,FinalDamPer=%s" % (hurtValue, FinalDamPer))
|
| | | # GameWorld.DebugLogEx(" 增伤: hurtValue=%s,FinalDamPer=%s", hurtValue, FinalDamPer)
|
| | |
|
| | | poolMgr = ObjPool.GetPoolMgr()
|
| | | useSkill = poolMgr.acquire(BattleObj.PySkill, skillIpyData, atkID)
|
| | |
| | |
|
| | | poisonCureOwner = GetPoisonCureOwner(defObj)
|
| | | if poisonCureOwner:
|
| | | GameWorld.DebugLog("本次治疗为毒奶: cureHP=%s" % cureHP)
|
| | | GameWorld.DebugLogEx("本次治疗为毒奶: cureHP=%s", cureHP)
|
| | | hurtValue = cureHP
|
| | | hurtTypes = pow(2, ChConfig.HurtAtkType_Cure)
|
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_Hurt)
|
| | |
| | | hurtObj.SetHurtHP(cureHP)
|
| | | hurtObj.SetLostHP(realCureHP)
|
| | | hurtObj.SetCurHP(defObj.GetHP())
|
| | | GameWorld.DebugLog(" 治疗: dID=%s,cureHP=%s,realCureHP=%s,%s/%s" % (defID, cureHP, realCureHP, defObj.GetHP(), dMaxHP))
|
| | | GameWorld.DebugLogEx(" 治疗: dID=%s,cureHP=%s,realCureHP=%s,%s/%s", defID, cureHP, realCureHP, defObj.GetHP(), dMaxHP)
|
| | |
|
| | | TurnAttack.AddTurnObjCureHP(defObj, atkObj, cureHP, realCureHP, skillID)
|
| | |
|
| | |
| | | calcValue = int(xpMax * skillPer / 10000.0 + skillValue)
|
| | | attrID = ChConfig.AttrID_XP
|
| | |
|
| | | GameWorld.DebugLog("怒气%s: curID=%s,calcValue=%s,skillID=%s,skillPer=%s,skillValue=%s,relatedSkillID=%s" |
| | | % (opType, curID, calcValue, skillID, skillPer, skillValue, relatedSkillID))
|
| | | GameWorld.DebugLogEx("怒气%s: curID=%s,calcValue=%s,skillID=%s,skillPer=%s,skillValue=%s,relatedSkillID=%s",
|
| | | opType, curID, calcValue, skillID, skillPer, skillValue, relatedSkillID)
|
| | | curStealTotal = 0
|
| | | for tagBatObj in useSkill.GetTagObjList():
|
| | |
|
| | |
| | | diffValue = min(tagXP, calcValue) # 取较小值,不足时剩多少减多少
|
| | | updValue = tagXP - diffValue
|
| | | tagBatObj.SetXP(updValue, False)
|
| | | GameWorld.DebugLog(" 减怒气: tagID=%s,diffValue=%s,tagXP=%s,updXP=%s" % (tagID, diffValue, tagXP, updValue))
|
| | | GameWorld.DebugLogEx(" 减怒气: tagID=%s,diffValue=%s,tagXP=%s,updXP=%s", tagID, diffValue, tagXP, updValue)
|
| | | Sync_PropertyRefreshView(turnFight, tagBatObj, attrID, updValue, diffValue, diffType, skillID, relatedSkillID)
|
| | |
|
| | | # ͵
|
| | |
| | | diffValue = min(tagXP, calcValue) # 取较小值,不足时剩多少减多少
|
| | | updValue = tagXP - diffValue
|
| | | tagBatObj.SetXP(updValue, False)
|
| | | GameWorld.DebugLog(" 偷怒气: tagID=%s,diffValue=%s,tagXP=%s,updXP=%s" % (tagID, diffValue, tagXP, updValue))
|
| | | GameWorld.DebugLogEx(" 偷怒气: tagID=%s,diffValue=%s,tagXP=%s,updXP=%s", tagID, diffValue, tagXP, updValue)
|
| | | Sync_PropertyRefreshView(turnFight, tagBatObj, attrID, updValue, diffValue, diffType, skillID, relatedSkillID)
|
| | |
|
| | | curStealTotal += diffValue
|
| | |
| | | diffValue = GetEnhanceXP(tagBatObj, calcValue)
|
| | | updValue = tagXP + diffValue
|
| | | tagBatObj.SetXP(updValue, False)
|
| | | GameWorld.DebugLog(" 加怒气: tagID=%s,diffValue=%s,tagXP=%s,updXP=%s" % (tagID, diffValue, tagXP, updValue))
|
| | | GameWorld.DebugLogEx(" 加怒气: tagID=%s,diffValue=%s,tagXP=%s,updXP=%s", tagID, diffValue, tagXP, updValue)
|
| | | Sync_PropertyRefreshView(turnFight, tagBatObj, attrID, updValue, diffValue, diffType, skillID, relatedSkillID)
|
| | |
|
| | | if curStealTotal > 0:
|
| | |
| | | diffValue = GetEnhanceXP(tagBatObj, curStealTotal)
|
| | | updValue = curXP + diffValue
|
| | | curBatObj.SetXP(updValue, False)
|
| | | GameWorld.DebugLog(" 加总怒气: curID=%s,curStealTotal=%s,curXP=%s,diffValue=%s,updXP=%s" % (curID, curStealTotal, curXP, diffValue, updValue))
|
| | | GameWorld.DebugLogEx(" 加总怒气: curID=%s,curStealTotal=%s,curXP=%s,diffValue=%s,updXP=%s", curID, curStealTotal, curXP, diffValue, updValue)
|
| | | Sync_PropertyRefreshView(turnFight, curBatObj, attrID, updValue, diffValue, diffType, skillID, relatedSkillID)
|
| | |
|
| | | return
|
| | |
| | | atkBackSkill = __getCanAtkBackSkill(atkObj, tagObj, useSkill)
|
| | | if atkBackSkill:
|
| | | # 可以反击,打断连击
|
| | | GameWorld.DebugLog("● %s 【反击】" % TurnAttack.GetObjName(tagObj))
|
| | | GameWorld.DebugLogEx("● %s 【反击】", TurnAttack.GetObjName(tagObj))
|
| | | OnUseSkill(turnFight, tagObj, atkBackSkill, batType=ChConfig.TurnBattleType_AtkBack, atkBackTag=atkObj)
|
| | | return
|
| | |
|
| | |
| | | dComboRateDef = tagObj.GetBatAttrValue(ChConfig.AttrID_ComboRateDef)
|
| | | happenRate = eval(IpyGameDataPY.GetFuncCompileCfg("ComboCfg", 1))
|
| | | if not GameWorld.CanHappen(happenRate):
|
| | | GameWorld.DebugLog("无法连击! atkID=%s,happenRate=%s,aComboRate=%s,dComboRateDef=%s,comboNum=%s" |
| | | % (atkObj.GetID(), happenRate, aComboRate, dComboRateDef, comboNum))
|
| | | GameWorld.DebugLogEx("无法连击! atkID=%s,happenRate=%s,aComboRate=%s,dComboRateDef=%s,comboNum=%s", |
| | | atkObj.GetID(), happenRate, aComboRate, dComboRateDef, comboNum)
|
| | | return
|
| | | GameWorld.DebugLog("● %s 【连击】 happenRate=%s,aComboRate=%s,dComboRateDef=%s,comboNum=%s" |
| | | % (TurnAttack.GetObjName(atkObj), happenRate, aComboRate, dComboRateDef, comboNum))
|
| | | GameWorld.DebugLogEx("● %s 【连击】 happenRate=%s,aComboRate=%s,dComboRateDef=%s,comboNum=%s", |
| | | TurnAttack.GetObjName(atkObj), happenRate, aComboRate, dComboRateDef, comboNum)
|
| | | useSkill.SetComboNum(comboNum + 1)
|
| | |
|
| | | # 连击特长
|
| | |
| | | atkID = atkObj.GetID()
|
| | | tagID = tagObj.GetID()
|
| | | if not tagObj.CanAction():
|
| | | GameWorld.DebugLog("当前状态无法反击! tagID=%s" % (tagID))
|
| | | GameWorld.DebugLogEx("当前状态无法反击! tagID=%s", tagID)
|
| | | return
|
| | |
|
| | | if atkObj.GetFaction() == tagObj.GetFaction():
|
| | | #GameWorld.DebugLog("同阵营不触发反击!") # 魅惑可能导致打自己人
|
| | | #GameWorld.DebugLogEx("同阵营不触发反击!") # 魅惑可能导致打自己人
|
| | | return
|
| | |
|
| | | canAtkbackDictTypeList = IpyGameDataPY.GetFuncEvalCfg("ParryCfg", 2)
|
| | | if atkObj.GetAtkDistType() not in canAtkbackDictTypeList:
|
| | | heroID = atkObj.GetHeroID()
|
| | | GameWorld.DebugLog("攻击方远近类型武将不可反击! atkID=%s,heroID=%s,AtkDistType=%s not in %s" % (atkID, heroID, atkObj.GetAtkDistType(), canAtkbackDictTypeList))
|
| | | GameWorld.DebugLogEx("攻击方远近类型武将不可反击! atkID=%s,heroID=%s,AtkDistType=%s not in %s", atkID, heroID, atkObj.GetAtkDistType(), canAtkbackDictTypeList)
|
| | | return
|
| | |
|
| | | canAtkBack = False
|
| | |
| | | break
|
| | |
|
| | | if not canAtkBack:
|
| | | GameWorld.DebugLog("没有格挡不可反击! tagID=%s" % tagID)
|
| | | GameWorld.DebugLogEx("没有格挡不可反击! tagID=%s", tagID)
|
| | | return
|
| | |
|
| | | # 大回合单武将反击次数限制
|
| | |
| | | if bigTurnAtkbackCntMax:
|
| | | atkbackCnt = tagObj.GetBigTurnAtkbackCnt()
|
| | | if atkbackCnt >= bigTurnAtkbackCntMax:
|
| | | GameWorld.DebugLog("本大回合累计反击次数达上限! atkbackCnt=%s >= %s" % (atkbackCnt, bigTurnAtkbackCntMax))
|
| | | GameWorld.DebugLogEx("本大回合累计反击次数达上限! atkbackCnt=%s >= %s", atkbackCnt, bigTurnAtkbackCntMax)
|
| | | return
|
| | |
|
| | | skillManager = tagObj.GetSkillManager()
|
| | |
| | | if not useSkill:
|
| | | continue
|
| | | if useSkill.GetFuncType() == ChConfig.Def_SkillFuncType_TurnNormaSkill: # 使用普攻反击
|
| | | GameWorld.DebugLog("可以反击! tagID=%s" % tagID)
|
| | | GameWorld.DebugLogEx("可以反击! tagID=%s", tagID)
|
| | | return useSkill
|
| | | return
|
| | |
|
| | |
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_KillTagObj, tagObj, connSkill=useSkill)
|
| | |
|
| | | if dieObjList:
|
| | | for dieObj in dieObjList:
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, dieObj, ChConfig.TriggerWay_WhenDie, curObj, connSkill=useSkill)
|
| | | |
| | | for faction in [ChConfig.Def_FactionA, ChConfig.Def_FactionB]:
|
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | for lineupNum in batFaction.lineupDict.keys():
|
| | |
| | | def AddFightXP(gameObj, addXP, reason=""):
|
| | | ## 回合战斗增加XP
|
| | | if addXP <= 0 or not addXP:
|
| | | #GameWorld.DebugLog(" 没有增加XP! curID=%s" % (gameObj.GetID()))
|
| | | #GameWorld.DebugLogEx(" 没有增加XP! curID=%s", gameObj.GetID())
|
| | | return
|
| | | posNum = gameObj.GetPosNum()
|
| | | if posNum <= 0:
|
| | |
| | | curXP = gameObj.GetXP()
|
| | | updXP = curXP + addXP
|
| | | gameObj.SetXP(updXP)
|
| | | GameWorld.DebugLog(" 更新XP: curID=%s,curXP=%s,addXP=%s,updXP=%s,reason=%s" % (gameObj.GetID(), curXP, addXP, updXP, reason))
|
| | | GameWorld.DebugLogEx(" 更新XP: curID=%s,curXP=%s,addXP=%s,updXP=%s,reason=%s", gameObj.GetID(), curXP, addXP, updXP, reason)
|
| | | return
|
| | |
|
| | | def DoHeroSpecialty(turnFight, gameObj, specialty, relatedSkillID=0):
|
| | |
| | | curXP = gameObj.GetXP()
|
| | | updXP = curXP + addXP
|
| | | gameObj.SetXP(updXP, False)
|
| | | GameWorld.DebugLog(" 特长加XP: curID=%s,curXP=%s,addXP=%s,updXP=%s,特性=%s" % (gameObj.GetID(), curXP, addXP, updXP, specialty))
|
| | | GameWorld.DebugLogEx(" 特长加XP: curID=%s,curXP=%s,addXP=%s,updXP=%s,特性=%s", gameObj.GetID(), curXP, addXP, updXP, specialty)
|
| | | Sync_PropertyRefreshView(turnFight, gameObj, ChConfig.AttrID_XP, updXP, addXP, diffType=1, relatedSkillID=relatedSkillID)
|
| | | return
|
| | |
|
| | |
| | | return addXP
|
| | | objID = gameObj.GetID()
|
| | | updAddXP = int(addXP * max(10000 + addPer, 0) / 10000.0)
|
| | | GameWorld.DebugLog("怒气恢复提升: objID=%s,addXP=%s,addPer=%s,updAddXP=%s" % (objID, addXP, addPer, updAddXP))
|
| | | GameWorld.DebugLogEx("怒气恢复提升: objID=%s,addXP=%s,addPer=%s,updAddXP=%s", objID, addXP, addPer, updAddXP)
|
| | | return updAddXP
|
| | |
|
| | | def __DoCurSkillEff(turnFight, curObj, useSkill, effIgnoreObjIDList, isUseSkill):
|
| | |
| | | continue
|
| | |
|
| | | effID = curEffect.GetEffectID()
|
| | | GameWorld.DebugLog("●执行额外技能效果: skillID=%s,effID=%s, triggerWay=%s,effIgnoreObjIDList=%s" % (useSkill.GetSkillID(), effID, triggerWay, effIgnoreObjIDList))
|
| | | GameWorld.DebugLogEx("●执行额外技能效果: skillID=%s,effID=%s, triggerWay=%s,effIgnoreObjIDList=%s", useSkill.GetSkillID(), effID, triggerWay, effIgnoreObjIDList)
|
| | | if effID == 5010:
|
| | | # 额外技能效果
|
| | | __doUseEnhanceSkill(turnFight, curObj, useSkill, curEffect, effIgnoreObjIDList)
|
| | |
| | | def __doUseEnhanceSkill(turnFight, curBatObj, useSkill, curEffect, effIgnoreObjIDList):
|
| | | ## 执行主技能的额外技能效果
|
| | | #if useSkill.GetBatType() == ChConfig.TurnBattleType_Enhance:
|
| | | # #GameWorld.DebugLog("自身为额外触发的技能不再触发额外技能! skillID=%s" % useSkill.GetSkillID())
|
| | | # #GameWorld.DebugLogEx("自身为额外触发的技能不再触发额外技能! skillID=%s", useSkill.GetSkillID())
|
| | | # return
|
| | | enhanceSkillID = curEffect.GetEffectValue(0)
|
| | | checkInStateList = curEffect.GetEffectValue(1)
|
| | | checkHeroJob = curEffect.GetEffectValue(2)
|
| | | checkHeroSex = curEffect.GetEffectValue(3)
|
| | | GameWorld.DebugLog("额外触发的技能: enhanceSkillID=%s,checkInStateList=%s,checkHeroJob=%s,checkHeroSex=%s" % (enhanceSkillID, checkInStateList, checkHeroJob, checkHeroSex))
|
| | | GameWorld.DebugLogEx("额外触发的技能: enhanceSkillID=%s,checkInStateList=%s,checkHeroJob=%s,checkHeroSex=%s", enhanceSkillID, checkInStateList, checkHeroJob, checkHeroSex)
|
| | | tagObjList = useSkill.GetTagObjList()
|
| | |
|
| | | enhanceSkillData = IpyGameDataPY.GetIpyGameData("Skill", enhanceSkillID)
|
| | |
| | | invalidSkillID = TurnPassive.GetTriggerEffectValue(turnFight, curBatObj, None, ChConfig.PassiveEff_SkillInvalid, useSkill,
|
| | | triggerWay=ChConfig.TriggerWay_KillOneObj)
|
| | | if invalidSkillID and invalidSkillID == enhanceSkillID:
|
| | | GameWorld.DebugLog("有击杀目标时该技能无效! enhanceSkillID=%s" % enhanceSkillID)
|
| | | GameWorld.DebugLogEx("有击杀目标时该技能无效! enhanceSkillID=%s", enhanceSkillID)
|
| | | return
|
| | |
|
| | | # 继承主技能目标
|
| | | if enhanceSkillData.GetTagAim() == ChConfig.SkillTagAim_MainSkill:
|
| | | GameWorld.DebugLog("继承主技能目标! enhanceSkillID=%s" % enhanceSkillID)
|
| | | GameWorld.DebugLogEx("继承主技能目标! enhanceSkillID=%s", enhanceSkillID)
|
| | | # 额外触发的技能直接在外层检查概率,如果都没有触发则不需要再处理
|
| | | enhanceRate = enhanceSkillData.GetHappenRate()
|
| | | if enhanceRate:
|
| | |
| | | for tagObj in tagObjList:
|
| | | tagID = tagObj.GetID()
|
| | | if not tagObj.IsAlive():
|
| | | GameWorld.DebugLog(" 已被击杀不触发: tagID=%s" % (tagID))
|
| | | GameWorld.DebugLogEx(" 已被击杀不触发: tagID=%s", tagID)
|
| | | continue
|
| | | if tagID in effIgnoreObjIDList:
|
| | | GameWorld.DebugLog(" 闪避或免疫的不触发: tagID=%s" % (tagID))
|
| | | GameWorld.DebugLogEx(" 闪避或免疫的不触发: tagID=%s", tagID)
|
| | | continue
|
| | | if checkInStateList:
|
| | | if not tagObj.CheckInState(checkInStateList):
|
| | | GameWorld.DebugLog(" 不在状态下不触发: tagID=%s not in state:%s" % (tagID, checkInStateList))
|
| | | GameWorld.DebugLogEx(" 不在状态下不触发: tagID=%s not in state:%s", tagID, checkInStateList)
|
| | | continue
|
| | | if checkHeroJob and checkHeroJob != tagObj.GetJob():
|
| | | GameWorld.DebugLog(" 非目标职业不触发: tagID=%s,job=%s != %s" % (tagID, tagObj.GetJob(), checkHeroJob))
|
| | | GameWorld.DebugLogEx(" 非目标职业不触发: tagID=%s,job=%s != %s", tagID, tagObj.GetJob(), checkHeroJob)
|
| | | continue
|
| | | if checkHeroSex and checkHeroSex != tagObj.GetSex():
|
| | | GameWorld.DebugLog(" 非目标性别不触发: tagID=%s,sex=%s != %s" % (tagID, tagObj.GetSex(), checkHeroSex))
|
| | | GameWorld.DebugLogEx(" 非目标性别不触发: tagID=%s,sex=%s != %s", tagID, tagObj.GetSex(), checkHeroSex)
|
| | | continue
|
| | | if not curBatObj.IsSkillCanHappen(enhanceSkillID, enhanceRate):
|
| | | GameWorld.DebugLog(" 概率不触发: tagID=%s,enhanceRate=%s" % (tagID, enhanceRate))
|
| | | GameWorld.DebugLogEx(" 概率不触发: tagID=%s,enhanceRate=%s", tagID, enhanceRate)
|
| | | continue
|
| | |
|
| | | enchanceTagObjList.append(tagObj)
|
| | |
| | | return
|
| | |
|
| | | # 只执行一次,防止群攻时额外触发多次
|
| | | GameWorld.DebugLog("重新锁定目标! enhanceSkillID=%s" % enhanceSkillID)
|
| | | GameWorld.DebugLogEx("重新锁定目标! enhanceSkillID=%s", enhanceSkillID)
|
| | | if checkInStateList or checkHeroJob or checkHeroSex:
|
| | | inState, haveJob, haveSex = False, False, False
|
| | | for tagObj in tagObjList:
|
| | |
| | | if not haveSex and checkHeroSex and checkHeroSex == tagObj.GetSex():
|
| | | haveSex = True
|
| | | if checkInStateList and not inState:
|
| | | GameWorld.DebugLog(" 没有命中目标在状态下不触发: tagObj not in state:%s" % str(checkInStateList))
|
| | | GameWorld.DebugLogEx(" 没有命中目标在状态下不触发: tagObj not in state:%s", str(checkInStateList))
|
| | | return
|
| | | if checkHeroJob and not haveJob:
|
| | | GameWorld.DebugLog(" 没有命中目标为目标职业不触发: checkHeroJob=%s" % checkHeroJob)
|
| | | GameWorld.DebugLogEx(" 没有命中目标为目标职业不触发: checkHeroJob=%s", checkHeroJob)
|
| | | return
|
| | | if checkHeroSex and not haveSex:
|
| | | GameWorld.DebugLog(" 没有命中目标为目标性别不触发: checkHeroSex=%s" % checkHeroSex)
|
| | | GameWorld.DebugLogEx(" 没有命中目标为目标性别不触发: checkHeroSex=%s", checkHeroSex)
|
| | | return
|
| | | OnUseSkill(turnFight, curBatObj, enhanceSkillData, batType=ChConfig.TurnBattleType_Enhance, bySkill=useSkill)
|
| | | return
|
| | |
| | | bySkillID = connBuff.GetSkillID()
|
| | | passiveSkillID = passiveSkill.GetSkillID()
|
| | | if passiveSkillID == bySkillID:
|
| | | #GameWorld.DebugLog("###被动触发技能不触发自身,防止死循环! effSkillID=%s,effectID=%s,passiveSkillID=%s" % (effSkillID, effectID, passiveSkillID))
|
| | | #GameWorld.DebugLogEx("###被动触发技能不触发自身,防止死循环! effSkillID=%s,effectID=%s,passiveSkillID=%s", effSkillID, effectID, passiveSkillID)
|
| | | return
|
| | |
|
| | | if hasattr(passiveSkill, "GetRemainTime") and passiveSkill.GetRemainTime() > 0:
|
| | | #GameWorld.DebugLog("被动触发技能CD中! skillID=%s,RemainTime=%s" % (passiveSkillID, passiveSkill.GetRemainTime()))
|
| | | #GameWorld.DebugLogEx("被动触发技能CD中! skillID=%s,RemainTime=%s", passiveSkillID, passiveSkill.GetRemainTime())
|
| | | return
|
| | |
|
| | | isOK = False
|
| | | # 继承主技能目标
|
| | | if passiveSkill.GetTagAim() == ChConfig.SkillTagAim_MainSkill:
|
| | | tagAim = passiveSkill.GetTagAim()
|
| | | if tagAim == ChConfig.SkillTagAim_MainSkill:
|
| | | if not tagObj:
|
| | | return
|
| | | happenRate = passiveSkill.GetHappenRate()
|
| | | if happenRate:
|
| | | happenRate += TurnPassive.GetTriggerEffectValue(turnFight, batObj, None, ChConfig.PassiveEff_AddSkillRate, passiveSkill)
|
| | | GameWorld.DebugLog("被动触发技能,继承主技能目标! effSkillID=%s,effectID=%s,passiveSkillID=%s,happenRate=%s,bySkillID=%s" % (effSkillID, effectID, passiveSkillID, happenRate, bySkillID))
|
| | | GameWorld.DebugLogEx("被动触发技能,继承主技能目标! effSkillID=%s,effectID=%s,passiveSkillID=%s,happenRate=%s,bySkillID=%s", effSkillID, effectID, passiveSkillID, happenRate, bySkillID)
|
| | | tagID = tagObj.GetID()
|
| | | if not tagObj.IsAlive() and passiveSkill.GetSkillType() != ChConfig.Def_SkillType_Revive:
|
| | | GameWorld.DebugLog(" 已被击杀不触发: tagID=%s" % (tagID))
|
| | | GameWorld.DebugLogEx(" 已被击杀不触发: tagID=%s", tagID)
|
| | | return
|
| | | if not batObj.IsSkillCanHappen(passiveSkillID, happenRate):
|
| | | GameWorld.DebugLog(" 概率不触发: tagID=%s,happenRate=%s" % (tagID, happenRate))
|
| | | GameWorld.DebugLogEx(" 概率不触发: tagID=%s,happenRate=%s", tagID, happenRate)
|
| | | return
|
| | | passiveTagObjList = [tagObj]
|
| | | isOK = OnUseSkill(turnFight, batObj, passiveSkill, passiveTagObjList, batType=ChConfig.TurnBattleType_Passive, bySkill=connSkill, byBuff=connBuff, **kwargs)
|
| | | elif tagAim == ChConfig.SkillTagAim_MainSkillEx:
|
| | | if not connSkill:
|
| | | return
|
| | | passiveTagObjList = connSkill.GetTagObjList()
|
| | | isOK = OnUseSkill(turnFight, batObj, passiveSkill, passiveTagObjList, batType=ChConfig.TurnBattleType_Passive, bySkill=connSkill, byBuff=connBuff, **kwargs)
|
| | | else:
|
| | | GameWorld.DebugLog("被动触发技能,重新锁定目标! effSkillID=%s,effectID=%s,passiveSkillID=%s,bySkillID=%s" % (effSkillID, effectID, passiveSkillID, bySkillID))
|
| | | GameWorld.DebugLogEx("被动触发技能,重新锁定目标! effSkillID=%s,effectID=%s,passiveSkillID=%s,bySkillID=%s", effSkillID, effectID, passiveSkillID, bySkillID)
|
| | | isOK = OnUseSkill(turnFight, batObj, passiveSkill, batType=ChConfig.TurnBattleType_Passive, bySkill=connSkill, byBuff=connBuff, **kwargs)
|
| | |
|
| | | return isOK
|
| | |
| | | changeHurtType = TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_ChangeHurtType, curSkill)
|
| | | if changeHurtType == 1:
|
| | | ignoreDef = True
|
| | | GameWorld.DebugLog("强制变更本次伤害为无视防御! skillID=%s" % skillID)
|
| | | GameWorld.DebugLogEx("强制变更本次伤害为无视防御! skillID=%s", skillID)
|
| | |
|
| | | atkID = atkObj.GetID()
|
| | | defID = defObj.GetID()
|
| | |
| | | angerOverflow = atkObj.GetAngerOverflow() # 怒气溢出值
|
| | | if isAngerSkill:
|
| | | curXP = atkObj.GetXP()
|
| | | GameWorld.DebugLog("怒技攻击! curXP=%s,angerOverflow=%s" % (curXP, angerOverflow))
|
| | | GameWorld.DebugLogEx("怒技攻击! curXP=%s,angerOverflow=%s", curXP, angerOverflow)
|
| | |
|
| | | #命中公式 攻击方类型不同,公式不同
|
| | | if not mustHit and not curSkill.GetEffectByID(ChConfig.SkillEff_MustHit) and not defObj.IsInControlledHard():
|
| | |
| | | missNum = curSkill.GetTagMissNum(defID)
|
| | | missRate = eval(IpyGameDataPY.GetFuncCompileCfg("MissCfg", 1))
|
| | | if GameWorld.CanHappen(missRate):
|
| | | GameWorld.DebugLog("闪避了! missRate=%s,dMissRate=%s,aMissRateDef=%s,missNum=%s" % (missRate, dMissRate, aMissRateDef, missNum))
|
| | | GameWorld.DebugLogEx("闪避了! missRate=%s,dMissRate=%s,aMissRateDef=%s,missNum=%s", missRate, dMissRate, aMissRateDef, missNum)
|
| | | curSkill.SetTagMissNum(defID, missRate + 1)
|
| | | return 0, pow(2, ChConfig.HurtAtkType_Miss)
|
| | |
|
| | |
| | | aSuperDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_SuperDamPer, curSkill)
|
| | |
|
| | | dSuperDamPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_SuperDamPerDef)
|
| | | GameWorld.DebugLog("aSuperDamPer=%s,dSuperDamPerDef=%s" % (aSuperDamPer, dSuperDamPerDef))
|
| | | GameWorld.DebugLogEx("aSuperDamPer=%s,dSuperDamPerDef=%s", aSuperDamPer, dSuperDamPerDef)
|
| | |
|
| | | if isParry:
|
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_Parry)
|
| | |
|
| | | if ignoreDef:
|
| | | GameWorld.DebugLog("无视防御/真实伤害!")
|
| | | GameWorld.DebugLogEx("无视防御/真实伤害!")
|
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_IgnoreDef)
|
| | |
|
| | | if isStun:
|
| | |
| | | if isDot:
|
| | | aDOTPer = atkObj.GetBatAttrValue(ChConfig.AttrID_DOTPer)
|
| | | dDOTPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_DOTPerDef)
|
| | | GameWorld.DebugLog("aDOTPer=%s,dDOTPerDef=%s" % (aDOTPer, dDOTPerDef))
|
| | | GameWorld.DebugLogEx("aDOTPer=%s,dDOTPerDef=%s", aDOTPer, dDOTPerDef)
|
| | |
|
| | | #aAddSkillPer = 0 # 技能增伤
|
| | | aBatDamPer, dBatDamPerDef = 0, 0 # 战斗增减伤
|
| | |
| | | if turnFight.isPVP() > 0:
|
| | | aPVPDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_PVPDamPer)
|
| | | dPVPDamPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_PVPDamPerDef)
|
| | | GameWorld.DebugLog("PVP aPVPDamPer=%s,dPVPDamPerDef=%s" % (aPVPDamPer, dPVPDamPerDef))
|
| | | GameWorld.DebugLogEx("PVP aPVPDamPer=%s,dPVPDamPerDef=%s", aPVPDamPer, dPVPDamPerDef)
|
| | |
|
| | | # 所有万分率参数统一除10000.0
|
| | | atkSkillPer /= 10000.0
|
| | |
| | |
|
| | | if calcType != ChConfig.Def_Calc_Attack:
|
| | | aAtk = GetCalcBaseValue(calcType, atkObj, defObj, curSkill)
|
| | | GameWorld.DebugLog("伤血计算: atkID=%s,defID=%s,skillID=%s,atkSkillPer=%s,calcType=%s,aAtk=%s,dDef=%s,dHP=%s/%s,hurtTypes=%s,aBatDamPer=%s,aFinalDamPer=%s" |
| | | % (atkID, defID, skillID, atkSkillPer, calcType, aAtk, dDef, dHP, dMaxHP, hurtTypes, aBatDamPer, aFinalDamPer))
|
| | | GameWorld.DebugLog("aCountry=%s,dCountry=%s,aCountryDamPer=%s,dCountryDamPerDef=%s" % (aCountry, dCountry, aCountryDamPer, dCountryDamPerDef))
|
| | | GameWorld.DebugLogEx("伤血计算: atkID=%s,defID=%s,skillID=%s,atkSkillPer=%s,calcType=%s,aAtk=%s,dDef=%s,dHP=%s/%s,hurtTypes=%s,aBatDamPer=%s,aFinalDamPer=%s", |
| | | atkID, defID, skillID, atkSkillPer, calcType, aAtk, dDef, dHP, dMaxHP, hurtTypes, aBatDamPer, aFinalDamPer)
|
| | | #GameWorld.DebugLogEx("aCountry=%s,dCountry=%s,aCountryDamPer=%s,dCountryDamPerDef=%s", aCountry, dCountry, aCountryDamPer, dCountryDamPerDef)
|
| | |
|
| | | if isTurnNormalSkill:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 1))
|
| | | GameWorld.DebugLog(" 普攻技能伤害=%s,aNormalSkillPer=%s,dNormalSkillPerDef=%s" % (hurtValue, aNormalSkillPer, dNormalSkillPerDef))
|
| | | GameWorld.DebugLogEx(" 普攻技能伤害=%s,aNormalSkillPer=%s,dNormalSkillPerDef=%s", hurtValue, aNormalSkillPer, dNormalSkillPerDef)
|
| | | elif isAngerSkill:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 2))
|
| | | GameWorld.DebugLog(" 怒气技能伤害=%s,aAngerSkillPer=%s,dAngerSkillPerDef=%s" % (hurtValue, aAngerSkillPer, dAngerSkillPerDef))
|
| | | GameWorld.DebugLogEx(" 怒气技能伤害=%s,aAngerSkillPer=%s,dAngerSkillPerDef=%s", hurtValue, aAngerSkillPer, dAngerSkillPerDef)
|
| | | elif isDot:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("DOTFormula", 1))
|
| | | GameWorld.DebugLog(" 持续技能伤害=%s" % (hurtValue))
|
| | | GameWorld.DebugLogEx(" 持续技能伤害=%s" % (hurtValue))
|
| | | elif calcType == ChConfig.Def_Calc_ByBuffValue:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("CalcTypeFormula", 2))
|
| | | GameWorld.DebugLog(" 按最后一次buff值计算伤害=%s,calcType=%s,LastHurt=%s" % (hurtValue, calcType, aAtk))
|
| | | GameWorld.DebugLogEx(" 按最后一次buff值计算伤害=%s,calcType=%s,LastHurt=%s", hurtValue, calcType, aAtk)
|
| | | elif calcType != ChConfig.Def_Calc_Attack:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("CalcTypeFormula", 1))
|
| | | GameWorld.DebugLog(" 非按攻击力伤害=%s,calcType=%s,aAtk=%s" % (hurtValue, calcType, aAtk))
|
| | | GameWorld.DebugLogEx(" 非按攻击力伤害=%s,calcType=%s,aAtk=%s", hurtValue, calcType, aAtk)
|
| | | else:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 3))
|
| | | GameWorld.DebugLog(" 其他伤害=%s" % (hurtValue))
|
| | | GameWorld.DebugLogEx(" 其他伤害=%s", hurtValue)
|
| | |
|
| | | if isParry:
|
| | | parryReduceRatio = IpyGameDataPY.GetFuncCfg("ParryCfg", 3)
|
| | | hurtValue = hurtValue * (1 - parryReduceRatio)
|
| | | GameWorld.DebugLog(" 格挡后伤害=%s,parryReduceRatio=%s" % (hurtValue, parryReduceRatio))
|
| | | GameWorld.DebugLogEx(" 格挡后伤害=%s,parryReduceRatio=%s", hurtValue, parryReduceRatio)
|
| | |
|
| | | multiValue = TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_ChangeHurtMulti, curSkill)
|
| | | if multiValue and multiValue != 1:
|
| | | hurtValue = int(hurtValue * multiValue)
|
| | | GameWorld.DebugLog(" 伤害倍值: hurtValue=%s,multiValue=%s" % (hurtValue, multiValue))
|
| | | GameWorld.DebugLogEx(" 伤害倍值: hurtValue=%s,multiValue=%s", hurtValue, multiValue)
|
| | |
|
| | | hurtAtkPerMax = curSkill.GetHurtAtkPerMax() # 最大万分比,限制最终伤害不超过攻击力万分率
|
| | | if hurtAtkPerMax:
|
| | | aAtk = atkObj.GetAtk()
|
| | | hurtValueMax = aAtk * hurtAtkPerMax / 10000.0
|
| | | hurtValue = min(hurtValue, hurtValueMax)
|
| | | GameWorld.DebugLog(" 伤害最高限制: hurtValue=%s,hurtAtkPerMax=%s,aAtk=%s" % (hurtValue, hurtAtkPerMax, aAtk))
|
| | | GameWorld.DebugLogEx(" 伤害最高限制: hurtValue=%s,hurtAtkPerMax=%s,aAtk=%s", hurtValue, hurtAtkPerMax, aAtk)
|
| | |
|
| | | # 均摊
|
| | | hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
|
| | | if hurtShareEff:
|
| | | tagCnt = max(1, len(curSkill.GetTagObjList()))
|
| | | hurtValue = hurtValue / tagCnt
|
| | | GameWorld.DebugLog(" 目标均摊伤害: hurtValue=%s,tagCnt=%s" % (hurtValue, tagCnt))
|
| | | GameWorld.DebugLogEx(" 目标均摊伤害: hurtValue=%s,tagCnt=%s", hurtValue, tagCnt)
|
| | |
|
| | | hurtValue = max(1, int(hurtValue)) # 负值、保底防范,放最后
|
| | | return hurtValue, hurtTypes
|
| | |
| | |
|
| | | def CanSuperHit(turnFight, atkObj, defObj, curSkill):
|
| | | if TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_MustSuperHit, curSkill):
|
| | | GameWorld.DebugLog("目标血量低于百分x时必定暴击: defID=%s,hp:%s/%s" % (defObj.GetID(), defObj.GetHP(), defObj.GetMaxHP()))
|
| | | GameWorld.DebugLogEx("目标血量低于百分x时必定暴击: defID=%s,hp:%s/%s", defObj.GetID(), defObj.GetHP(), defObj.GetMaxHP())
|
| | | return True
|
| | |
|
| | | aSuperHitRate = atkObj.GetBatAttrValue(ChConfig.AttrID_SuperHitRate)
|
| | |
| | | dSuperHitRateDef = defObj.GetBatAttrValue(ChConfig.AttrID_SuperHitRateDef)
|
| | | happenRate = eval(IpyGameDataPY.GetFuncCompileCfg("SuperHitCfg", 1))
|
| | | if GameWorld.CanHappen(happenRate):
|
| | | GameWorld.DebugLog("暴击了: happenRate=%s,aSuperHitRate=%s,dSuperHitRateDef=%s" % (happenRate, aSuperHitRate, dSuperHitRateDef))
|
| | | GameWorld.DebugLogEx("暴击了: happenRate=%s,aSuperHitRate=%s,dSuperHitRateDef=%s", happenRate, aSuperHitRate, dSuperHitRateDef)
|
| | | return True
|
| | | return False
|
| | |
|
| | |
| | | return False
|
| | | stunSkillID = IpyGameDataPY.GetFuncCfg("StunCfg", 2)
|
| | | if TurnBuff.DoAddBuffBySkillID(turnFight, defObj, stunSkillID, atkObj, curSkill, afterLogic=True):
|
| | | GameWorld.DebugLog("击晕了: happenRate=%s,aStunRate=%s,dStunRateDef=%s" % (happenRate, aStunRate, dStunRateDef))
|
| | | GameWorld.DebugLogEx("击晕了: happenRate=%s,aStunRate=%s,dStunRateDef=%s", happenRate, aStunRate, dStunRateDef)
|
| | | return True
|
| | | return False
|
| | |
|
| | |
| | | buffMgr = defObj.GetBuffManager()
|
| | | parryYJBuff = buffMgr.FindBuffByState(ChConfig.BatObjState_ParryYJ)
|
| | | if parryYJBuff and parryYJBuff.GetLayer():
|
| | | GameWorld.DebugLog("格挡印记格挡了: buffID=%s,buffLayer=%s" % (parryYJBuff.GetBuffID(), parryYJBuff.GetLayer()))
|
| | | GameWorld.DebugLogEx("格挡印记格挡了: buffID=%s,buffLayer=%s", parryYJBuff.GetBuffID(), parryYJBuff.GetLayer())
|
| | | TurnBuff.DoBuffLayerChange(turnFight, defObj, parryYJBuff, parryYJBuff.GetLayer() - 1, curSkill)
|
| | | return True
|
| | |
|
| | |
| | | parryNum = curSkill.GetTagParryNum(defID)
|
| | | happenRate = eval(IpyGameDataPY.GetFuncCompileCfg("ParryCfg", 1))
|
| | | if GameWorld.CanHappen(happenRate):
|
| | | GameWorld.DebugLog("格挡了: happenRate=%s,aParryRateDef=%s,dParryRate=%s,parryNum=%s" % (happenRate, aParryRateDef, dParryRate, parryNum))
|
| | | GameWorld.DebugLogEx("格挡了: happenRate=%s,aParryRateDef=%s,dParryRate=%s,parryNum=%s", happenRate, aParryRateDef, dParryRate, parryNum)
|
| | | curSkill.SetTagParryNum(defID, parryNum + 1)
|
| | | return True
|
| | | return False
|
| | |
| | |
|
| | | isAve, caorenProtectID, otherFactionHurtDict = __calcFactionAverageHurt(turnFight, tagFaction, tagLineupNum, hurtValueDict, immuneHurtDict, caorenProtectObj)
|
| | | if not isAve:
|
| | | #GameWorld.DebugLog("没有分摊伤害原值返回")
|
| | | #GameWorld.DebugLogEx("没有分摊伤害原值返回")
|
| | | return calcHurtResults
|
| | | GameWorld.DebugLog("本阵营分摊伤害结果: %s,免疫伤害=%s,给敌阵营=%s,caorenProtectID=%s" |
| | | % (hurtValueDict, immuneHurtDict, otherFactionHurtDict, caorenProtectID))
|
| | | GameWorld.DebugLogEx("本阵营分摊伤害结果: %s,免疫伤害=%s,给敌阵营=%s,caorenProtectID=%s", |
| | | hurtValueDict, immuneHurtDict, otherFactionHurtDict, caorenProtectID)
|
| | |
|
| | | # 均摊给其他阵营的算非直接伤害,即曹仁无效
|
| | | for key, otherHurtDict in otherFactionHurtDict.items():
|
| | |
| | | # 其他阵营分摊后的最终伤害累加到实际最终伤害
|
| | | for objID, aveHurt in otherHurtDict.items():
|
| | | hurtValueDict[objID] = hurtValueDict.get(objID, 0) + aveHurt
|
| | | GameWorld.DebugLog("其他阵营分摊后的最终伤害: isAveEx=%s,%s,免疫伤害=%s,给敌阵营=%s" |
| | | % (isAveEx, hurtValueDict, immuneHurtDict, otherFactionHurtDictEx))
|
| | | GameWorld.DebugLogEx("其他阵营分摊后的最终伤害: isAveEx=%s,%s,免疫伤害=%s,给敌阵营=%s", |
| | | isAveEx, hurtValueDict, immuneHurtDict, otherFactionHurtDictEx)
|
| | |
|
| | | # 其他阵营再次分摊给其他阵营的,董白效果引起
|
| | | # 董白暂时只能再次摊给源头一次伤害,在多V多场景下暂不做支持 A董白 摊 B董白 摊 C董白,目前只做 A->B->A
|
| | |
| | |
|
| | | for objID, aveHurt in otherHurtDictEx.items():
|
| | | hurtValueDict[objID] = hurtValueDict.get(objID, 0) + aveHurt
|
| | | GameWorld.DebugLog("其他阵营再分摊给源阵营的伤害: %s,最终伤害=%s,免疫伤害=%s" |
| | | % (otherHurtDictEx, hurtValueDict, immuneHurtDict))
|
| | | GameWorld.DebugLogEx("其他阵营再分摊给源阵营的伤害: %s,最终伤害=%s,免疫伤害=%s", |
| | | otherHurtDictEx, hurtValueDict, immuneHurtDict)
|
| | |
|
| | | finalHurtTotal = 0
|
| | | finalHurtResults = []
|
| | |
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_CaorenProtect) # 标记受到曹仁防护,前端表现需要
|
| | | finalHurtResults.append([tagObj, finalHurt, hurtTypes, immuneHurt])
|
| | | finalHurtTotal = finalHurtTotal + finalHurt + immuneHurt
|
| | | GameWorld.DebugLog("得出主要目标分摊后的最终伤害: tagID=%s,finalHurt=%s,hurtTypes=%s,immuneHurt=%s,finalHurtTotal=%s" % (tagID, finalHurt, hurtTypes, immuneHurt, finalHurtTotal))
|
| | | GameWorld.DebugLogEx("得出主要目标分摊后的最终伤害: tagID=%s,finalHurt=%s,hurtTypes=%s,immuneHurt=%s,finalHurtTotal=%s", tagID, finalHurt, hurtTypes, immuneHurt, finalHurtTotal)
|
| | |
|
| | | # 剩下伤害则默认为额外目标伤害,放主要目标后面
|
| | | isEx = 1
|
| | |
| | | if immuneHurt > 0:
|
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_Immune) # 添加免疫
|
| | | finalHurtTotal = finalHurtTotal + finalHurt + immuneHurt
|
| | | GameWorld.DebugLog("得出额外目标分摊后的最终伤害: tagID=%s,finalHurt=%s,hurtTypes=%s,immuneHurt=%s,finalHurtTotal=%s" % (tagID, finalHurt, hurtTypes, immuneHurt, finalHurtTotal))
|
| | | GameWorld.DebugLogEx("得出额外目标分摊后的最终伤害: tagID=%s,finalHurt=%s,hurtTypes=%s,immuneHurt=%s,finalHurtTotal=%s", tagID, finalHurt, hurtTypes, immuneHurt, finalHurtTotal)
|
| | | if finalHurt > 0 or immuneHurt > 0: # 额外目标有受伤或免疫才算
|
| | | finalHurtResults.append([tagObj, finalHurt, hurtTypes, immuneHurt, isEx])
|
| | |
|
| | | if finalHurtTotal != srcHurtTotal:
|
| | | GameWorld.DebugLog("[分摊伤害后误差值]=%s,srcHurtTotal=%s,finalHurtTotal=%s" % (srcHurtTotal - finalHurtTotal, srcHurtTotal, finalHurtTotal))
|
| | | GameWorld.DebugLogEx("[分摊伤害后误差值]=%s,srcHurtTotal=%s,finalHurtTotal=%s", srcHurtTotal - finalHurtTotal, srcHurtTotal, finalHurtTotal)
|
| | | return finalHurtResults
|
| | |
|
| | | def __calcFactionAverageHurt(turnFight, faction, lineupNum, hurtValueDict, immuneHurtDict, caorenProtectObj=None):
|
| | |
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | batLineup = batFaction.getBatlineup(lineupNum)
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | GameWorld.DebugLog("----开始计算阵营分摊伤害: faction=%s,lineupNum=%s,hurtValueDict=%s,免疫伤害=%s" |
| | | % (faction, lineupNum, hurtValueDict, immuneHurtDict))
|
| | | GameWorld.DebugLogEx("----开始计算阵营分摊伤害: faction=%s,lineupNum=%s,hurtValueDict=%s,免疫伤害=%s", |
| | | faction, lineupNum, hurtValueDict, immuneHurtDict)
|
| | | # 按优先级顺序处理拥有分摊效果的武将
|
| | | for effHeroID in effHeroIDList:
|
| | | if effHeroID not in batLineup.heroObjIDDict:
|
| | |
| | | aveObjList = [] # 可均摊伤害的对象列表
|
| | | if effHeroID == ChConfig.HeroID_Caoren:
|
| | | if not caorenProtectObj:
|
| | | GameWorld.DebugLog("没有曹仁可防护的对象")
|
| | | GameWorld.DebugLogEx("没有曹仁可防护的对象")
|
| | | continue
|
| | | hpLowestID = caorenProtectObj.GetID()
|
| | | if hpLowestID == objID:
|
| | | GameWorld.DebugLog("曹仁不防护自己")
|
| | | GameWorld.DebugLogEx("曹仁不防护自己")
|
| | | continue
|
| | | if not inHurt and hpLowestID not in hurtValueDict:
|
| | | GameWorld.DebugLog("曹仁及防护对象都不在受伤列表里不处理! hpLowestID=%s" % hpLowestID)
|
| | | GameWorld.DebugLogEx("曹仁及防护对象都不在受伤列表里不处理! hpLowestID=%s", hpLowestID)
|
| | | continue
|
| | | if batObj.IsInControlledHard():
|
| | | GameWorld.DebugLog("曹仁被硬控中不防护")
|
| | | GameWorld.DebugLogEx("曹仁被硬控中不防护")
|
| | | continue
|
| | | caoRenSkill = batObj.GetSkillManager().FindSkillByID(caorenSkillID)
|
| | | if not caoRenSkill:
|
| | | GameWorld.DebugLog("曹仁还未学习分担伤害技能! caorenSkillID=%s" % caorenSkillID)
|
| | | GameWorld.DebugLogEx("曹仁还未学习分担伤害技能! caorenSkillID=%s", caorenSkillID)
|
| | | continue
|
| | | if not GameWorld.CanHappen(caoRenSkill.GetHappenRate()):
|
| | | GameWorld.DebugLog("曹仁概率未触发防护")
|
| | | GameWorld.DebugLogEx("曹仁概率未触发防护")
|
| | | continue
|
| | | inHurt = True
|
| | | aveObjList = [batObj, caorenProtectObj]
|
| | | GameWorld.DebugLog("曹仁触发防护! hpLowestID=%s" % hpLowestID)
|
| | | GameWorld.DebugLogEx("曹仁触发防护! hpLowestID=%s", hpLowestID)
|
| | |
|
| | | elif effHeroID == ChConfig.HeroID_Zhenfu:
|
| | | aveBuff = buffMgr.FindBuffByState(ChConfig.BatObjState_Zhiming)
|
| | |
| | |
|
| | | if not aveObjList: # 没有指定均摊伤害的,根据均摊光环buff找
|
| | | if not aveBuff:
|
| | | GameWorld.DebugLog("没有分摊伤害光环! effHeroID=%s" % (effHeroID))
|
| | | GameWorld.DebugLogEx("没有分摊伤害光环! effHeroID=%s", effHeroID)
|
| | | continue
|
| | | haloObjIDList = aveBuff.GetHaloObjIDList()
|
| | | GameWorld.DebugLog("[分摊光环buff] effHeroID=%s,skillID=%s,objID=%s,haloObjIDList=%s" % (effHeroID, aveBuff.GetSkillID(), objID, haloObjIDList))
|
| | | GameWorld.DebugLogEx("[分摊光环buff] effHeroID=%s,skillID=%s,objID=%s,haloObjIDList=%s", effHeroID, aveBuff.GetSkillID(), objID, haloObjIDList)
|
| | | for haloObjID in haloObjIDList:
|
| | | haloObj = batObjMgr.getBatObj(haloObjID)
|
| | | if not haloObj or not haloObj.IsAlive():
|
| | |
| | | inHurt = True
|
| | |
|
| | | if not inHurt:
|
| | | GameWorld.DebugLog("相关人员没有受伤,不处理分摊伤害! effHeroID=%s" % effHeroID)
|
| | | GameWorld.DebugLogEx("相关人员没有受伤,不处理分摊伤害! effHeroID=%s", effHeroID)
|
| | | continue
|
| | |
|
| | | aveObjCnt = len(aveObjList)
|
| | | if aveObjCnt < 2:
|
| | | GameWorld.DebugLog("相关人员少于2个时自行承担所有伤害! effHeroID=%s,aveObjCnt=%s" % (effHeroID, aveObjCnt))
|
| | | GameWorld.DebugLogEx("相关人员少于2个时自行承担所有伤害! effHeroID=%s,aveObjCnt=%s", effHeroID, aveObjCnt)
|
| | | continue
|
| | |
|
| | | if not isAve:
|
| | |
| | |
|
| | | if effHeroID == ChConfig.HeroID_Caoren and caorenProtectObj:
|
| | | caorenProtectID = caorenProtectObj.GetID()
|
| | | GameWorld.DebugLog("[曹仁防护目标] caorenProtectID=%s,caorenObjID=%s" % (caorenProtectID, objID))
|
| | | GameWorld.DebugLogEx("[曹仁防护目标] caorenProtectID=%s,caorenObjID=%s", caorenProtectID, objID)
|
| | |
|
| | | aveHurtTotal = 0
|
| | | for aveObj in aveObjList:
|
| | | aveObjID = aveObj.GetID()
|
| | | if effHeroID == ChConfig.HeroID_Caoren and aveObjID == objID:
|
| | | GameWorld.DebugLog(" 曹仁的效果不平摊曹仁自身的伤害,只是曹仁帮别人摊! aveObjID=%s" % aveObjID)
|
| | | GameWorld.DebugLogEx(" 曹仁的效果不平摊曹仁自身的伤害,只是曹仁帮别人摊! aveObjID=%s", aveObjID)
|
| | | continue
|
| | | if aveObjID not in hurtValueDict:
|
| | | continue
|
| | | hurtValue = hurtValueDict.pop(aveObjID, 0) # 被分摊的伤害要移除
|
| | | if hurtValue <= 0:
|
| | | GameWorld.DebugLog(" 无伤害的不处理:可能是非主要目标或自身已经无敌免疫了伤害! aveObjID=%s" % aveObjID)
|
| | | GameWorld.DebugLogEx(" 无伤害的不处理:可能是非主要目标或自身已经无敌免疫了伤害! aveObjID=%s", aveObjID)
|
| | | continue
|
| | | aveHurtTotal += hurtValue
|
| | | GameWorld.DebugLog(" 累计待分摊伤害! effHeroID=%s,aveObjID=%s,hurtValue=%s,aveHurtTotal=%s" % (effHeroID, aveObjID, hurtValue, aveHurtTotal))
|
| | | GameWorld.DebugLogEx(" 累计待分摊伤害! effHeroID=%s,aveObjID=%s,hurtValue=%s,aveHurtTotal=%s", effHeroID, aveObjID, hurtValue, aveHurtTotal)
|
| | |
|
| | | # 大家分摊
|
| | | aveHurtDict = {} # 本阵营该分摊效果分摊伤害记录
|
| | | aveHurt = round(aveHurtTotal / float(aveObjCnt), 2)
|
| | | GameWorld.DebugLog("计算分摊伤害! effHeroID=%s,aveHurtTotal=%s,aveObjCnt=%s,aveHurt=%s" % (effHeroID, aveHurtTotal, aveObjCnt, aveHurt))
|
| | | GameWorld.DebugLogEx("计算分摊伤害! effHeroID=%s,aveHurtTotal=%s,aveObjCnt=%s,aveHurt=%s", effHeroID, aveHurtTotal, aveObjCnt, aveHurt)
|
| | | for aveObj in aveObjList:
|
| | | aveObjID = aveObj.GetID()
|
| | | aveFaction = aveObj.GetFaction()
|
| | |
| | |
|
| | | if immuneHurt >= 0:
|
| | | immuneHurtDict[aveObjID] = immuneHurt + aveHurt
|
| | | GameWorld.DebugLog(" 累加免疫分摊伤害! aveObjID=%s,免疫伤害=%s" % (aveObjID, immuneHurtDict))
|
| | | GameWorld.DebugLogEx(" 累加免疫分摊伤害! aveObjID=%s,免疫伤害=%s", aveObjID, immuneHurtDict)
|
| | | continue
|
| | |
|
| | | if aveFaction == faction:
|
| | | aveHurtDict[aveObjID] = aveHurtDict.get(aveObjID, 0) + aveHurt
|
| | | GameWorld.DebugLog(" 累加本效果本阵营分摊伤害! aveObjID=%s,aveHurtDict=%s" % (aveObjID, aveHurtDict))
|
| | | GameWorld.DebugLogEx(" 累加本效果本阵营分摊伤害! aveObjID=%s,aveHurtDict=%s", aveObjID, aveHurtDict)
|
| | | else:
|
| | | aveLineupNum = aveObj.GetLineupNum()
|
| | | key = (aveFaction, aveLineupNum)
|
| | |
| | | otherFactionHurtDict[key] = {}
|
| | | otherHurtDict = otherFactionHurtDict[key]
|
| | | otherHurtDict[aveObjID] = otherHurtDict.get(aveObjID, 0) + aveHurt
|
| | | GameWorld.DebugLog(" 累加本效果敌阵营分摊伤害! aveObjID=%s,factionKey=%s,otherHurtDict=%s" % (aveObjID, key, otherHurtDict))
|
| | | GameWorld.DebugLogEx(" 累加本效果敌阵营分摊伤害! aveObjID=%s,factionKey=%s,otherHurtDict=%s", aveObjID, key, otherHurtDict)
|
| | |
|
| | | # 汇总最新伤害
|
| | | for aveObjID, aveHurt in aveHurtDict.items():
|
| | | hurtValueDict[aveObjID] = hurtValueDict.get(aveObjID, 0) + aveHurt
|
| | | GameWorld.DebugLog(" 更新本效果分摊后的伤害! %s,免疫伤害=%s,给敌阵营=%s" % (hurtValueDict, immuneHurtDict, otherFactionHurtDict))
|
| | | GameWorld.DebugLogEx(" 更新本效果分摊后的伤害! %s,免疫伤害=%s,给敌阵营=%s", hurtValueDict, immuneHurtDict, otherFactionHurtDict)
|
| | |
|
| | | return isAve, caorenProtectID, otherFactionHurtDict
|
| | |
|
| | |
| | | updBuffValue = buffValue + immuneHurt
|
| | | buff.SetValue1(updBuffValue % ChConfig.Def_PerPointValue)
|
| | | buff.SetValue2(updBuffValue / ChConfig.Def_PerPointValue)
|
| | | GameWorld.DebugLog(" 无敌盾累计免疫伤害: defID=%s,buffID=%s,buffSkillID=%s,buffValue=%s,immuneHurt=%s,updBuffValue=%s,lostType=%s" |
| | | % (defObj.GetID(), buff.GetBuffID(), buffSkillID, buffValue, immuneHurt, updBuffValue, lostType))
|
| | | GameWorld.DebugLogEx(" 无敌盾累计免疫伤害: defID=%s,buffID=%s,buffSkillID=%s,buffValue=%s,immuneHurt=%s,updBuffValue=%s,lostType=%s", |
| | | defObj.GetID(), buff.GetBuffID(), buffSkillID, buffValue, immuneHurt, updBuffValue, lostType)
|
| | |
|
| | | if hurtValue <= 0:
|
| | | return 0
|
| | |
| | | shieldHurtPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddShieldHurtPer, curSkill)
|
| | | shieldHurtPer /= 10000.0
|
| | | shieldHurtValue = int(hurtValue * shieldHurtPer) # 对护盾伤害
|
| | | GameWorld.DebugLog(" 对护盾总伤害: shieldHurtValue=%s,shieldHurtPer=%s,hurtValue=%s" % (shieldHurtValue, shieldHurtPer, hurtValue))
|
| | | GameWorld.DebugLogEx(" 对护盾总伤害: shieldHurtValue=%s,shieldHurtPer=%s,hurtValue=%s", shieldHurtValue, shieldHurtPer, hurtValue)
|
| | | shieldBuffList.sort()
|
| | | for _, buffValue, buff in shieldBuffList:
|
| | | if shieldHurtValue <= 0:
|
| | |
| | | decShieldValue = shieldHurtValue
|
| | | else:
|
| | | decShieldValue = buffValue
|
| | | GameWorld.DebugLog(" 承伤盾抵扣: buffID=%s,skillID=%s,buffValue=%s,剩余盾伤=%s,扣除盾值=%s" % (buffID, buffSkillID, buffValue, shieldHurtValue, decShieldValue))
|
| | | GameWorld.DebugLogEx(" 承伤盾抵扣: buffID=%s,skillID=%s,buffValue=%s,剩余盾伤=%s,扣除盾值=%s", buffID, buffSkillID, buffValue, shieldHurtValue, decShieldValue)
|
| | | shieldHurtValue -= decShieldValue # 承伤值
|
| | | if decShieldValue >= buffValue:
|
| | | GameWorld.DebugLog(" 删除盾: buffID=%s,剩余盾伤=%s" % (buffID, shieldHurtValue))
|
| | | GameWorld.DebugLogEx(" 删除盾: buffID=%s,剩余盾伤=%s", buffID, shieldHurtValue)
|
| | | TurnBuff.DoBuffDel(turnFight, defObj, buff, relatedSkill=curSkill, afterLogic=True, tagObj=atkObj)
|
| | | else:
|
| | | updShieldValue = buffValue - decShieldValue
|
| | | GameWorld.DebugLog(" 更新盾: updShieldValue=%s,剩余盾伤=%s" % (updShieldValue, shieldHurtValue))
|
| | | GameWorld.DebugLogEx(" 更新盾: updShieldValue=%s,剩余盾伤=%s", updShieldValue, shieldHurtValue)
|
| | | buff.SetValue1(updShieldValue % ChConfig.Def_PerPointValue)
|
| | | buff.SetValue2(updShieldValue / ChConfig.Def_PerPointValue)
|
| | | curSkill.AddAfterLogic(ChConfig.AfterLogic_SyncBuff, [defObj, buff, atkObj, "ReduceShieldValue"])
|
| | |
|
| | | lostHP = int(shieldHurtValue / shieldHurtPer)
|
| | | GameWorld.DebugLog(" 承伤后剩余伤血: lostHP=%s" % (lostHP))
|
| | | GameWorld.DebugLogEx(" 承伤后剩余伤血: lostHP=%s", lostHP)
|
| | |
|
| | | dHP = defObj.GetHP()
|
| | | remainHP = dHP - lostHP # 剩余血量
|
| | |
| | | lostHP = dHP - remainHP # 实际掉血量
|
| | | defObj.SetHP(remainHP)
|
| | |
|
| | | GameWorld.DebugLog(" 扣血: atkID=%s,defID=%s,hurtValue=%s,lostType=%s,lostHP=%s,dHP=%s,updHP=%s/%s" |
| | | % (atkID, defID, hurtValue, lostType, lostHP, dHP, defObj.GetHP(), defObj.GetMaxHP()))
|
| | | GameWorld.DebugLogEx(" 扣血: atkID=%s,defID=%s,hurtValue=%s,lostType=%s,lostHP=%s,dHP=%s,updHP=%s/%s", |
| | | atkID, defID, hurtValue, lostType, lostHP, dHP, defObj.GetHP(), defObj.GetMaxHP())
|
| | | TurnAttack.AddTurnObjHurtValue(atkObj, defObj, hurtValue, lostHP, skillID, lostType)
|
| | | return lostHP
|
| | |
|
| | |
| | | if bounceHP <= 0:
|
| | | return
|
| | |
|
| | | GameWorld.DebugLog(" 反弹伤害=%s,%s/%s, damBackPer=%s" % (bounceHP, atkObj.GetHP(), atkObj.GetMaxHP(), damBackPer))
|
| | | GameWorld.DebugLogEx(" 反弹伤害=%s,%s/%s, damBackPer=%s", bounceHP, atkObj.GetHP(), atkObj.GetMaxHP(), damBackPer)
|
| | | bounceHP, _, immuneHurt = CalcHurtWithBuff(turnFight, atkObj, defObj, bounceHP)
|
| | | if bounceHP <= 0:
|
| | | GameWorld.DebugLog(" bounceHP=%s" % (bounceHP))
|
| | | GameWorld.DebugLogEx(" bounceHP=%s", bounceHP)
|
| | | return
|
| | | hurtObj.SetBounceHP(bounceHP)
|
| | | DoLostHP(turnFight, atkObj, defObj, bounceHP, curSkill, "Bounce", hpCanNegative=True, immuneHurt=immuneHurt) # 反弹后生命允许负值
|
| | |
| | | atkObj, defObj = poisonCureOwner, atkObj
|
| | | hurtValue = suckHP
|
| | | hurtValue, _, immuneHurt = CalcHurtWithBuff(turnFight, atkObj, defObj, hurtValue)
|
| | | GameWorld.DebugLog(" 本次吸血为毒奶: suckHP=%s,hurtValue=%s" % (suckHP, hurtValue))
|
| | | GameWorld.DebugLogEx(" 本次吸血为毒奶: suckHP=%s,hurtValue=%s", suckHP, hurtValue)
|
| | | DoLostHP(turnFight, atkObj, defObj, hurtValue, curSkill, "PoisonSuckBlood", hpCanNegative=True, immuneHurt=immuneHurt) # 吸血毒奶生命允许负值
|
| | |
|
| | | hurtObj.AddHurtType(ChConfig.HurtAtkType_PoisonCureSuck)
|
| | |
| | |
|
| | | hurtObj.SetSuckHP(suckHP)
|
| | | atkObj.SetHP(remainHP)
|
| | | GameWorld.DebugLog(" 吸血=%s,remainHP=%s/%s,aSuckHPPer=%s,dSuckHPPerDef=%s,aCurePer=%s,dCureDefPer=%s" |
| | | % (suckHP, remainHP, maxHP, aSuckHPPer, dSuckHPPerDef, aCurePer, dCureDefPer))
|
| | | GameWorld.DebugLogEx(" 吸血=%s,remainHP=%s/%s,aSuckHPPer=%s,dSuckHPPerDef=%s,aCurePer=%s,dCureDefPer=%s", |
| | | suckHP, remainHP, maxHP, aSuckHPPer, dSuckHPPerDef, aCurePer, dCureDefPer)
|
| | |
|
| | | # 吸血暂定算治疗
|
| | | TurnAttack.AddTurnObjCureHP(atkObj, atkObj, suckHP, cureHP)
|
| | |
| | | baseValue = GetCalcBaseValue(cureType, userObj, tagObj, curSkill)
|
| | |
|
| | | cureHP = eval(IpyGameDataPY.GetFuncCompileCfg("CureFormula", 1))
|
| | | GameWorld.DebugLog("计算治疗值(%s):skillID=%s,cureType=%s,baseValue=%s,skillPer=%s,aCurePer=%s,dCureDefPer=%s,angerOverflow=%s" |
| | | % (cureHP, skillID, cureType, baseValue, skillPer, aCurePer, dCureDefPer, angerOverflow))
|
| | | GameWorld.DebugLogEx("计算治疗值(%s):skillID=%s,cureType=%s,baseValue=%s,skillPer=%s,aCurePer=%s,dCureDefPer=%s,angerOverflow=%s", |
| | | cureHP, skillID, cureType, baseValue, skillPer, aCurePer, dCureDefPer, angerOverflow)
|
| | |
|
| | | # 额外治疗值
|
| | | cureWayExEff = curSkill.GetEffectByID(ChConfig.SkillEff_CureWayEx)
|
| | |
| | | baseValue = GetCalcBaseValue(cureType, userObj, tagObj, curSkill)
|
| | | cureHPEx = eval(IpyGameDataPY.GetFuncCompileCfg("CureFormula", 1))
|
| | | cureHP += cureHPEx
|
| | | GameWorld.DebugLog(" 额外治疗值(%s): cureType=%s,baseValue=%s,skillPer=%s,cureHP=%s" % (cureHPEx, cureType, baseValue, skillPer, cureHP))
|
| | | GameWorld.DebugLogEx(" 额外治疗值(%s): cureType=%s,baseValue=%s,skillPer=%s,cureHP=%s", cureHPEx, cureType, baseValue, skillPer, cureHP)
|
| | |
|
| | | hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
|
| | | if hurtShareEff:
|
| | | tagCnt = max(1, len(curSkill.GetTagObjList()))
|
| | | cureHP = cureHP / tagCnt
|
| | | GameWorld.DebugLog(" 目标均摊治疗: cureHP=%s,tagCnt=%s" % (cureHP, tagCnt))
|
| | | GameWorld.DebugLogEx(" 目标均摊治疗: cureHP=%s,tagCnt=%s", cureHP, tagCnt)
|
| | |
|
| | | if cureHP < 1:
|
| | | cureHP = 1
|
| | | GameWorld.DebugLog(" 保底治疗值: cureHP=%s" % (cureHP))
|
| | | GameWorld.DebugLogEx(" 保底治疗值: cureHP=%s", cureHP)
|
| | | return int(cureHP)
|
| | |
|
| | | def GetCalcBaseValue(calcType, curObj, tagObj, curSkill):
|
| | |
| | | byBuff = curSkill.GetByBuff()
|
| | | if byBuff:
|
| | | baseValue = byBuff.GetValue1() + byBuff.GetValue2() * ChConfig.Def_PerPointValue
|
| | | GameWorld.DebugLog("根据buff值: %s" % baseValue)
|
| | | GameWorld.DebugLogEx("根据buff值: %s", baseValue)
|
| | | elif calcType == ChConfig.Def_Calc_HarmSelfHP:
|
| | | baseValue = curObj.GetHarmSelfHP()
|
| | | GameWorld.DebugLog("根据自残值: %s" % baseValue)
|
| | | GameWorld.DebugLogEx("根据自残值: %s", baseValue)
|
| | | elif calcType == ChConfig.Def_Calc_AtkedSkillHurtHP:
|
| | | bySkill = curSkill.GetBySkill()
|
| | | bySkillID = 0
|
| | |
| | | for hurtObj in bySkill.GetHurtObjListAll():
|
| | | if curID == hurtObj.GetObjID():
|
| | | baseValue += hurtObj.GetHurtHP()
|
| | | GameWorld.DebugLog("根据最后受击技能伤害: %s,bySkillID=%s" % (baseValue, bySkillID))
|
| | | GameWorld.DebugLogEx("根据最后受击技能伤害: %s,bySkillID=%s", baseValue, bySkillID)
|
| | |
|
| | | return max(0, baseValue)
|
| | |
|
| | |
| | |
|
| | | dHP = defObj.GetHP()
|
| | | dMaxHP = defObj.GetMaxHP()
|
| | | GameWorld.DebugLog("结算dot: atkID=%s,defID=%s,buffID=%s,skillID=%s,ownerID=%s,hurtValue=%s,hurtTypes=%s,dHP=%s/%s" |
| | | % (atkID, defID, buffID, skillID, ownerID, hurtValue, hurtTypes, dHP, dMaxHP))
|
| | | GameWorld.DebugLogEx("结算dot: atkID=%s,defID=%s,buffID=%s,skillID=%s,ownerID=%s,hurtValue=%s,hurtTypes=%s,dHP=%s/%s", |
| | | atkID, defID, buffID, skillID, ownerID, hurtValue, hurtTypes, dHP, dMaxHP)
|
| | | costLayer = kwargs.get("costLayer")
|
| | | layer = curBuff.GetLayer()
|
| | | if costLayer > 0:
|
| | | hurtValue *= min(costLayer, max(1, layer))
|
| | | GameWorld.DebugLog(" 消耗buff层伤害: hurtValue=%s,costLayer=%s,layer=%s" % (hurtValue, costLayer, layer))
|
| | | GameWorld.DebugLogEx(" 消耗buff层伤害: hurtValue=%s,costLayer=%s,layer=%s", hurtValue, costLayer, layer)
|
| | | else:
|
| | | if layer > 0:
|
| | | hurtValue *= layer
|
| | | GameWorld.DebugLog(" 多层buff伤害: hurtValue=%s,layer=%s" % (hurtValue, layer))
|
| | | GameWorld.DebugLogEx(" 多层buff伤害: hurtValue=%s,layer=%s", hurtValue, layer)
|
| | | if "FinalDamPer" in kwargs:
|
| | | FinalDamPer = kwargs["FinalDamPer"]
|
| | | hurtValue *= (10000 + FinalDamPer) / 10000.0
|
| | | GameWorld.DebugLog(" 增伤: hurtValue=%s,FinalDamPer=%s" % (hurtValue, FinalDamPer))
|
| | | GameWorld.DebugLogEx(" 增伤: hurtValue=%s,FinalDamPer=%s", hurtValue, FinalDamPer)
|
| | |
|
| | | poolMgr = ObjPool.GetPoolMgr()
|
| | | useSkill = poolMgr.acquire(BattleObj.PySkill, skillIpyData, atkID)
|