129 【战斗】战斗系统-服务端(命格buff改为只给命格自身添加;命格buff基础属性加成支持计算到武将身上;命格战斗属性支持计算到武将战斗中;)
| | |
| | | mgObj = batLineup.getMinggeObj()
|
| | | if mgObj:
|
| | | objName = "命格 ID:%s" % mgObj.GetID()
|
| | | GameWorld.DebugAnswer(curPlayer, "--- %s" % objName)
|
| | | skillMgr = mgObj.GetSkillManager()
|
| | | skillIDList = skillMgr.GetSkillIDList()
|
| | | GameWorld.DebugAnswer(curPlayer, "技能: %s,%s" % (len(skillIDList), skillIDList))
|
| | | buffMgr = mgObj.GetBuffManager()
|
| | | GameWorld.DebugAnswer(curPlayer, "Buff: %s" % buffMgr.GetBuffCount())
|
| | | for index in range(buffMgr.GetBuffCount()):
|
| | | buff = buffMgr.GetBuffByIndex(index)
|
| | | buffName = GameWorld.CodeToGbk(buff.GetSkillData().GetSkillName())
|
| | | GameWorld.DebugAnswer(curPlayer, "ID:%s,%s(%s),回合:%s,层:%s,V:%s,来源:%s,光环:%s" |
| | | % (buff.GetBuffID(), buffName, buff.GetSkillID(), buff.GetRemainTime(), buff.GetLayer(), |
| | | [buff.GetValue1(), buff.GetValue2(), buff.GetValue3()], buff.GetOwnerID(), buff.GetHaloObjIDList()
|
| | | ))
|
| | | |
| | | __printObj(curPlayer, mgObj, objName)
|
| | | |
| | | posObjIDDict = batLineup.getPosObjIDDict()
|
| | | for posNum in posNumList:
|
| | | objID = posObjIDDict.get(posNum)
|
| | |
| | | continue
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | objName = TurnAttack.GetObjName(batObj)
|
| | | GameWorld.DebugAnswer(curPlayer, "--- %s%s" % (objName, "" if batObj.IsAlive() else " [被击杀]"))
|
| | | GameWorld.DebugAnswer(curPlayer, "HP:%s/%s" % (batObj.GetHP(), batObj.GetMaxHP()))
|
| | | GameWorld.DebugAnswer(curPlayer, "攻:%s,防:%s,怒:%s" % (batObj.GetAtk(), batObj.GetDef(), batObj.GetXP()))
|
| | | attrStr = ""
|
| | | attrDict = batObj.GetBatAttrDict()
|
| | | attrIDList = attrDict.keys()
|
| | | attrIDList.sort()
|
| | | for attrID in attrIDList:
|
| | | attrValue = attrDict[attrID]
|
| | | if attrValue:
|
| | | attrStr += "%s=%s;" % (attrID, attrValue)
|
| | | GameWorld.DebugAnswer(curPlayer, "属性:%s" % attrStr)
|
| | | skillMgr = batObj.GetSkillManager()
|
| | | skillIDList = skillMgr.GetSkillIDList()
|
| | | GameWorld.DebugAnswer(curPlayer, "技能: %s,%s" % (len(skillIDList), skillIDList))
|
| | | buffMgr = batObj.GetBuffManager()
|
| | | GameWorld.DebugAnswer(curPlayer, "Buff: %s" % buffMgr.GetBuffCount())
|
| | | for index in range(buffMgr.GetBuffCount()):
|
| | | buff = buffMgr.GetBuffByIndex(index)
|
| | | buffName = GameWorld.CodeToGbk(buff.GetSkillData().GetSkillName())
|
| | | GameWorld.DebugAnswer(curPlayer, "ID:%s,%s(%s),回合:%s,层:%s,V:%s,来源:%s,光环:%s" |
| | | % (buff.GetBuffID(), buffName, buff.GetSkillID(), buff.GetRemainTime(), buff.GetLayer(), |
| | | [buff.GetValue1(), buff.GetValue2(), buff.GetValue3()], buff.GetOwnerID(), buff.GetHaloObjIDList()
|
| | | ))
|
| | | |
| | | __printObj(curPlayer, batObj, objName)
|
| | | |
| | | return
|
| | |
|
| | | def __printObj(curPlayer, batObj, objName):
|
| | | GameWorld.DebugAnswer(curPlayer, "--- %s%s" % (objName, "" if batObj.IsAlive() else " [被击杀]"))
|
| | | GameWorld.DebugAnswer(curPlayer, "HP:%s/%s" % (batObj.GetHP(), batObj.GetMaxHP()))
|
| | | GameWorld.DebugAnswer(curPlayer, "攻:%s,防:%s,怒:%s" % (batObj.GetAtk(), batObj.GetDef(), batObj.GetXP()))
|
| | | attrStr = ""
|
| | | attrDict = batObj.GetBatAttrDict()
|
| | | attrIDList = attrDict.keys()
|
| | | attrIDList.sort()
|
| | | for attrID in attrIDList:
|
| | | attrValue = attrDict[attrID]
|
| | | if attrValue:
|
| | | attrStr += "%s=%s;" % (attrID, attrValue)
|
| | | GameWorld.DebugAnswer(curPlayer, "属性:%s" % attrStr)
|
| | | skillMgr = batObj.GetSkillManager()
|
| | | skillIDList = skillMgr.GetSkillIDList()
|
| | | GameWorld.DebugAnswer(curPlayer, "技能: %s,%s" % (len(skillIDList), skillIDList))
|
| | | buffMgr = batObj.GetBuffManager()
|
| | | GameWorld.DebugAnswer(curPlayer, "Buff: %s" % buffMgr.GetBuffCount())
|
| | | for index in range(buffMgr.GetBuffCount()):
|
| | | buff = buffMgr.GetBuffByIndex(index)
|
| | | buffName = GameWorld.CodeToGbk(buff.GetSkillData().GetSkillName())
|
| | | GameWorld.DebugAnswer(curPlayer, "ID:%s,%s(%s),回合:%s,层:%s,V:%s,来源:%s,光环:%s" |
| | | % (buff.GetBuffID(), buffName, buff.GetSkillID(), buff.GetRemainTime(), buff.GetLayer(), |
| | | [buff.GetValue1(), buff.GetValue2(), buff.GetValue3()], buff.GetOwnerID(), buff.GetHaloObjIDList()
|
| | | ))
|
| | | return
|
| | |
|
| | | def __doFightTest(curPlayer, msgList):
|
| | |
| | | if calcType == 2: # 减少,其他默认增加
|
| | | attrValue = -attrValue
|
| | |
|
| | | if effBuff:
|
| | | attrValue *= max(1, effBuff.GetLayer())
|
| | | |
| | | return attrValue
|
| | |
| | | continue
|
| | | buffID = buff.GetBuffID()
|
| | | nowLayerCnt = buff.GetLayer()
|
| | | GameWorld.DebugLogEx(" 已经存在该buff: buffID=%s,skillTypeID=%s,ownerID=%s,buffRepeat=%s", buffID, skillTypeID, ownerID, buffRepeat)
|
| | | GameWorld.DebugLogEx(" 已经存在该buff: buffID=%s,skillTypeID=%s,ownerID=%s,buffRepeat=%s,nowLayerCnt=%s/%s", buffID, skillTypeID, ownerID, buffRepeat, nowLayerCnt, maxLayerCnt)
|
| | |
|
| | | resetAddTiming = False # 一般只有覆盖的才重新计算回合,视为重新添加
|
| | | remainTime = buffSkill.GetLastTime()
|
| | | updLayerCnt = addLayerCnt
|
| | | if buffRepeat == 3: # 叠加层级
|
| | | if maxLayerCnt and nowLayerCnt >= maxLayerCnt:
|
| | | GameWorld.DebugLogEx(" 已达最大层数: nowLayerCnt=%s/%s", nowLayerCnt, maxLayerCnt)
|
| | | return
|
| | | updLayerCnt = nowLayerCnt + addLayerCnt
|
| | | if maxLayerCnt and updLayerCnt > maxLayerCnt:
|
| | | updLayerCnt = maxLayerCnt
|
| | |
| | | befHP = batObj.GetHP()
|
| | | befMaxHP = batObj.GetMaxHP()
|
| | |
|
| | | isMingge = batObj.GetPosNum() == ChConfig.TFPosNum_Mingge
|
| | | mgObj = None
|
| | | if not isMingge:
|
| | | mgObj = batObj.GetTFBatLineup().getMinggeObj()
|
| | | mgObjID = mgObj.GetID() if mgObj else 0
|
| | | batAttrDict = batObj.ResetBattleEffect()
|
| | | GameWorld.DebugLogEx("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,isMingge=%s(%s),batAttrDict=%s", |
| | | objID, batObj.GetAtk(), batObj.GetDef(), befHP, befMaxHP, isMingge, mgObjID, batAttrDict)
|
| | |
|
| | | skbufAttrDict = {}
|
| | |
|
| | |
| | |
|
| | | objID = batObj.GetID()
|
| | | # 先计算百分比加成或降低的
|
| | | mgHaveAttrPer = False # 命格加成对友军有效
|
| | | perIDList = ChConfig.AttrPerDict.values()
|
| | | for attrID, attrPerID in ChConfig.AttrPerDict.items():
|
| | | if attrPerID not in skbufAttrDict:
|
| | | attrPerValue = 0
|
| | | if attrPerID in skbufAttrDict:
|
| | | attrPerValue += skbufAttrDict[attrPerID] # 可能是负值
|
| | | if mgObj:
|
| | | attrPerValue += mgObj.GetBatAttrValue(attrPerID)
|
| | | if attrPerValue:
|
| | | GameWorld.DebugLogEx(" 命格额外加成: attrID=%s,attrPerID=%s,attrPerValue=%s", attrID, attrPerID, attrPerValue)
|
| | | elif isMingge and attrPerValue:
|
| | | mgHaveAttrPer = True
|
| | | batObj.SetBatAttrValue(attrPerID, attrPerValue)
|
| | | GameWorld.DebugLogEx(" 命格保存加成: attrID=%s,attrPerID=%s,attrPerValue=%s", attrID, attrPerID, attrPerValue) |
| | | if not attrPerValue:
|
| | | continue
|
| | | attrPerValue = skbufAttrDict[attrPerID] # 可能是负值
|
| | | attrValue = batObj.GetBatAttrValue(attrID, False)
|
| | | if attrValue <= 0:
|
| | | continue
|
| | |
| | | batObj.SetHP(aftHP, isNotify)
|
| | | 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())
|
| | | |
| | | # 命格刷属性
|
| | | if mgHaveAttrPer and isMingge and not isInit:
|
| | | batLineup = batObj.GetTFBatLineup()
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | heroObjIDList = batLineup.getBatHeroObjIDList()
|
| | | GameWorld.DebugLogEx("命格有加成属性同步刷新本阵容武将属性: heroObjIDList=%s", heroObjIDList)
|
| | | for heroObjID in heroObjIDList:
|
| | | heroObj = batObjMgr.getBatObj(heroObjID)
|
| | | if not heroObj:
|
| | | continue
|
| | | if not heroObj.IsAlive():
|
| | | continue
|
| | | RefreshBuffAttr(heroObj)
|
| | | |
| | | return
|
| | |
|
| | | def SyncBuffRefresh(turnFight, curBatObj, curBuff, relatedSkillID=0, isNewAdd=False):
|
| | |
| | | pmType = GetPMType(atkObj, curSkill)
|
| | | ignoreDef = IsIgnoreDef(curSkill)
|
| | | batType = curSkill.GetBatType()
|
| | | atkMGObj = atkObj.GetTFBatLineup().getMinggeObj()
|
| | | defMGObj = defObj.GetTFBatLineup().getMinggeObj()
|
| | |
|
| | | changeHurtType = TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_ChangeHurtType, curSkill)
|
| | | if not changeHurtType:
|
| | |
| | | if not isDot:
|
| | | aMissRateDef = atkObj.GetBatAttrValue(ChConfig.AttrID_AbsoluteMissRateDef)
|
| | | dMissRate = defObj.GetBatAttrValue(ChConfig.AttrID_AbsoluteMissRate)
|
| | | if defMGObj:
|
| | | dMissRate += defMGObj.GetBatAttrValue(ChConfig.AttrID_AbsoluteMissRate)
|
| | | missNum = curSkill.GetTagMissNum(defID)
|
| | | if dMissRate > 0:
|
| | | missRate = eval(IpyGameDataPY.GetFuncCompileCfg("MissCfg", 1))
|
| | |
| | | aSuperDamPer = IpyGameDataPY.GetFuncCfg("SuperHitCfg", 2) * 10000
|
| | | aSuperDamPer += atkObj.GetBatAttrValue(ChConfig.AttrID_SuperDamPer)
|
| | | aSuperDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_SuperDamPer, curSkill)
|
| | | |
| | | if atkMGObj:
|
| | | aSuperDamPer += atkMGObj.GetBatAttrValue(ChConfig.AttrID_SuperDamPer)
|
| | | dSuperDamPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_SuperDamPerDef)
|
| | |
|
| | | if isParry:
|
| | |
| | | aFinalDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddFinalDamPer, curSkill)
|
| | | aFinalDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_FinalDamPer, curSkill)
|
| | |
|
| | | if defMGObj:
|
| | | dFinalDamPerDef += defMGObj.GetBatAttrValue(ChConfig.AttrID_FinalDamPerDef)
|
| | | |
| | | #招架 - 无视攻击方最终增伤百分比
|
| | | dZhaojia = defObj.GetBatAttrValue(ChConfig.AttrID_Zhaojia)
|
| | | aZhaojiaDef = atkObj.GetBatAttrValue(ChConfig.AttrID_ZhaojiaDef)
|
| | |
| | | aDOTPer += atkObj.GetBatAttrValue(ChConfig.AttrID_DOTBurnPer)
|
| | | dDOTPerDef += defObj.GetBatAttrValue(ChConfig.AttrID_DOTBurnPerDef)
|
| | | GameWorld.DebugLogEx("是灼烧: aDOTPer=%s,dDOTPerDef=%s", aDOTPer, dDOTPerDef)
|
| | | if atkMGObj:
|
| | | aDOTPer += atkMGObj.GetBatAttrValue(ChConfig.AttrID_DOTPer)
|
| | |
|
| | | #aAddSkillPer = 0 # 技能增伤
|
| | | dBatDamPerDef = 0 # 战斗增减伤
|
| | |
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_BatDamPer, curSkill)
|
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddBatDamPerByTagLostHP, curSkill)
|
| | | aBatDamPer += addBatDamPer
|
| | | |
| | | if atkMGObj:
|
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkMGObj, defObj, ChConfig.AttrID_BatDamPer, curSkill)
|
| | | |
| | | # 物法增减伤
|
| | | if pmType == IPY_GameWorld.ghtMag: # 法伤
|
| | | aPMDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_MagDamPer)
|
| | |
| | | if batType == ChConfig.TurnBattleType_Combo:
|
| | | aComboDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_ComboDamPer)
|
| | | dComboDamPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_ComboDamPerDef)
|
| | | |
| | | if atkMGObj:
|
| | | aComboDamPer += atkMGObj.GetBatAttrValue(ChConfig.AttrID_ComboDamPer)
|
| | | aPursueDamPer, dPursueDamPerDef = 0, 0 # 追击增伤
|
| | | if batType == ChConfig.TurnBattleType_Pursue:
|
| | | aPursueDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_PursueDamPer)
|
| | | dPursueDamPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_PursueDamPerDef)
|
| | | |
| | | if atkMGObj:
|
| | | aPursueDamPer += atkMGObj.GetBatAttrValue(ChConfig.AttrID_PursueDamPer)
|
| | | |
| | | aPVPDamPer, dPVPDamPerDef = 0, 0 # PVP
|
| | | if turnFight.isPVP() > 0:
|
| | | aPVPDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_PVPDamPer)
|
| | |
| | | connSkillTypeID = buff.GetSkillTypeID()
|
| | | damBackPer += TurnPassive.GetTriggerEffectValue(turnFight, defObj, atkObj, ChConfig.PassiveEff_AddDamBackPerByBuffLayer, connSkillTypeID=connSkillTypeID)
|
| | |
|
| | | defMGObj = defObj.GetTFBatLineup().getMinggeObj()
|
| | | if defMGObj:
|
| | | mgBuffMgr = defMGObj.GetBuffManager()
|
| | | for buff in mgBuffMgr.FindBuffListByState(ChConfig.BatObjState_DamBackShield):
|
| | | damBackPer += buff.GetValue1() * max(1, buff.GetLayer())
|
| | | |
| | | if damBackPer <= 0:
|
| | | return
|
| | |
|
| | |
| | | # dot施法者已死亡不再吸血
|
| | | return
|
| | |
|
| | | atkMGObj = atkObj.GetTFBatLineup().getMinggeObj()
|
| | | aSuckHPPer = atkObj.GetBatAttrValue(ChConfig.AttrID_SuckHPPer)
|
| | | if atkMGObj:
|
| | | aSuckHPPer += atkMGObj.GetBatAttrValue(ChConfig.AttrID_SuckHPPer)
|
| | | aCurePer = atkObj.GetBatAttrValue(ChConfig.AttrID_CurePer)
|
| | |
|
| | | dSuckHPPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_SuckHPPerDef)
|