| | |
| | | import IpyGameDataPY
|
| | | import FormulaControl
|
| | | import PlayerPrestigeSys
|
| | | import PlayerBeauty
|
| | | import PlayerFamily
|
| | | import PlayerHorse
|
| | | import PlayerGubao
|
| | |
| | | self.curPlayer = None
|
| | |
|
| | | # 属性、阵容
|
| | | self.calcAttrDict = {} # 非武将功能点属性统计 {calcIndex:{attrID:value, ...}, ...}
|
| | | self.lineupDict = {} # 上阵阵容 {lineupID:Lineup, ...}
|
| | | self._calcAttrDict = {} # 非武将功能点属性统计 {calcIndex:{attrID:value, ...}, ...}
|
| | | self._lineupDict = {} # 上阵阵容 {lineupID:Lineup, ...}
|
| | | self._effectiveCardDict = {} # 加成属性生效的武将卡牌信息 {heroID:[cardAddPer, itemIndex, inMain], ...}
|
| | |
|
| | | # 主线战斗
|
| | | self.mainFight = TurnAttack.MainFight(playerID)
|
| | |
| | | def GetLineup(self, lineupID, checkAttr=True):
|
| | | # @param checkAttr: 检查刷新到最新阵容属性
|
| | | lineup = None
|
| | | if lineupID in self.lineupDict:
|
| | | lineup = self.lineupDict[lineupID]
|
| | | if lineupID in self._lineupDict:
|
| | | lineup = self._lineupDict[lineupID]
|
| | | else:
|
| | | lineup = Lineup(self.playerID, lineupID)
|
| | | self.lineupDict[lineupID] = lineup
|
| | | self._lineupDict[lineupID] = lineup
|
| | | lineup.olPlayer = self
|
| | | if checkAttr:
|
| | | lineup.CheckRefreshLineupAttr()
|
| | | return lineup
|
| | |
|
| | | def GetCalcAttr(self, calcIndex): return self.calcAttrDict.get(calcIndex, {})
|
| | | def GetHeroEffectiveCard(self, heroID): return self._effectiveCardDict.get(heroID, [-1, -1, False])
|
| | | def SetHeroEffectiveCard(self, heroID, cardAddPer, itemIndex, inMain):
|
| | | ## 更新某个武将生效的卡牌信息
|
| | | self._effectiveCardDict[heroID] = [cardAddPer, itemIndex, inMain]
|
| | | self.RefreshRoleAttr()
|
| | | |
| | | def SetEffectiveCardDict(self, effectiveCardDict): self._effectiveCardDict = effectiveCardDict
|
| | | def GetEffectiveCardDict(self): return self._effectiveCardDict
|
| | | |
| | | def GetCalcAttr(self, calcIndex): return self._calcAttrDict.get(calcIndex, {})
|
| | | def SetCalcAttr(self, calcIndex, attrDict):
|
| | | ## 设置某个功能点计算的属性
|
| | | self.calcAttrDict[calcIndex] = attrDict
|
| | | self._calcAttrDict[calcIndex] = attrDict
|
| | | return
|
| | |
|
| | | def ReCalcAllAttr(self):
|
| | |
| | | curPlayer = self.curPlayer
|
| | | GameWorld.DebugLog("ReCalcAllAttr...", self.playerID)
|
| | |
|
| | | self.calcAttrDict = {}
|
| | | self.lineupDict = {}
|
| | | self._calcAttrDict = {}
|
| | | self._lineupDict = {}
|
| | | self._effectiveCardDict = {}
|
| | |
|
| | | doCalcAllAttr(curPlayer)
|
| | | doReloadLineup(curPlayer, self)
|
| | | reloadEffHeroCard(curPlayer, self)
|
| | |
|
| | | self.RefreshRoleAttr()
|
| | | return
|
| | |
| | | '''
|
| | | GameWorld.DebugLog("请求刷属性: refreshForce=%s" % (refreshForce), self.playerID)
|
| | | # 主公属性刷新时,所有阵容都要同步刷新
|
| | | for lineup in self.lineupDict.values():
|
| | | for lineup in self._lineupDict.values():
|
| | | lineup.SetNeedRefreshState()
|
| | |
|
| | | if refreshForce:
|
| | |
| | |
|
| | | isRefresh = False
|
| | | # 同步执行阵容属性刷新
|
| | | for lineupID, lineup in self.lineupDict.items():
|
| | | for lineupID, lineup in self._lineupDict.items():
|
| | | if not isAllLineup and lineupID != ShareDefine.Lineup_Main:
|
| | | continue
|
| | | if lineup.CheckRefreshLineupAttr():
|
| | |
| | |
|
| | | return isRefresh
|
| | |
|
| | | def OnHeroItemUpate(self, itemIndexList):
|
| | | '''武将物品养成更新
|
| | | @param itemIndexList: 变化武将物品所在武将背包格子索引列表
|
| | | def OnHeroItemUpate(self, heroItem):
|
| | | '''武将物品变化时需要处理的逻辑
|
| | | @param heroItem: 变化武将物品
|
| | | @param return: 影响的阵容ID列表
|
| | | '''
|
| | | effLineupIDList = []
|
| | |
|
| | | for lineupID, lineup in self.lineupDict.items():
|
| | | for itemIndex in itemIndexList:
|
| | | if lineup.CheckHeroItemUpdate(itemIndex):
|
| | | if lineupID not in effLineupIDList:
|
| | | effLineupIDList.append(lineupID)
|
| | | |
| | | GameWorld.DebugLog("武将物品养成更新索引: %s, 影响阵容:%s" % (itemIndexList, effLineupIDList), self.playerID)
|
| | | checkUpdEffHeroCard(self, heroItem) # 检查更新生效的卡牌
|
| | | |
| | | itemIndex = heroItem.GetItemPlaceIndex()
|
| | | for lineupID, lineup in self._lineupDict.items():
|
| | | if lineup.CheckHeroItemUpdate(itemIndex):
|
| | | if lineupID not in effLineupIDList:
|
| | | effLineupIDList.append(lineupID)
|
| | | |
| | | GameWorld.DebugLog("武将物品变化: itemIndex=%s, 影响阵容:%s" % (itemIndex, effLineupIDList), self.playerID)
|
| | | return effLineupIDList
|
| | |
|
| | | def GetLastBatBuffer(self): return self._lastBatBufferInfo
|
| | |
| | | GetOnlinePlayer(curPlayer).SetCalcAttr(ChConfig.Def_CalcAttr_LV, lvAttrDict)
|
| | | return
|
| | |
|
| | | def checkUpdEffHeroCard(olPlayer, heroItem, isNotify=True):
|
| | | ## 玩家武将背包卡牌变更时调用
|
| | | # @return: 加成是否变更 |
| | | if not hasattr(heroItem, "GetItemPlaceIndex"):
|
| | | return
|
| | | curPlayer = olPlayer.curPlayer
|
| | | if not curPlayer:
|
| | | return
|
| | | itemIndex = heroItem.GetItemPlaceIndex()
|
| | | heroID = heroItem.GetItemTypeID()
|
| | | curAddPer = getHeroCardAddPer(heroItem)
|
| | | effAddPer, effItemIndex, inMain = olPlayer.GetHeroEffectiveCard(heroID)
|
| | | if itemIndex == effItemIndex:
|
| | | if curAddPer == effAddPer:
|
| | | GameWorld.DebugLog("生效的卡牌不变且加成也不变,不用处理! heroID=%s,itemIndex=%s,inMain=%s,effAddPer=%s,curAddPer=%s" % (heroID, itemIndex, inMain, effAddPer, curAddPer))
|
| | | return
|
| | | olPlayer.SetHeroEffectiveCard(heroID, curAddPer, itemIndex, inMain)
|
| | | if curAddPer > effAddPer:
|
| | | GameWorld.DebugLog("生效的卡牌不变且加成提升了! heroID=%s,itemIndex=%s,inMain=%s,effAddPer=%s,curAddPer=%s" % (heroID, itemIndex, inMain, effAddPer, curAddPer))
|
| | | return
|
| | | if inMain:
|
| | | GameWorld.DebugLog("生效的卡牌效果加成降低了,但在主阵容中依旧保持生效! heroID=%s,itemIndex=%s,inMain=%s,effAddPer=%s,curAddPer=%s" % (heroID, itemIndex, inMain, effAddPer, curAddPer))
|
| | | return
|
| | | GameWorld.DebugLog("生效的卡牌效果加成降低了,未在主阵容中重新检索是否有加成更高的! heroID=%s,itemIndex=%s,inMain=%s,effAddPer=%s,curAddPer=%s" |
| | | % (heroID, itemIndex, inMain, effAddPer, curAddPer))
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptHero)
|
| | | for index in range(curPack.GetCount()):
|
| | | if index == itemIndex:
|
| | | continue
|
| | | packItem = curPack.GetAt(index)
|
| | | if not packItem or packItem.IsEmpty():
|
| | | continue
|
| | | if heroID != packItem.GetItemTypeID():
|
| | | continue
|
| | | packCardPer = getHeroCardAddPer(packItem)
|
| | | if packCardPer <= curAddPer:
|
| | | continue
|
| | | GameWorld.DebugLog("有更高加成的同名武将! heroID=%s,index=%s,packCardPer=%s > curAddPer=%s" % (heroID, index, packCardPer, curAddPer))
|
| | | checkUpdEffHeroCard(olPlayer, packItem, isNotify)
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("没有更高加成的同名武将,保留本卡生效! heroID=%s,itemIndex=%s,curAddPer=%s" % (heroID, itemIndex, curAddPer))
|
| | | return
|
| | | |
| | | if inMain:
|
| | | GameWorld.DebugLog("没有在主阵容中且当前生效的卡牌在主阵容中不处理! heroID=%s,effItemIndex=%s,itemIndex=%s" % (heroID, effItemIndex, itemIndex))
|
| | | return
|
| | | |
| | | if curAddPer <= effAddPer:
|
| | | GameWorld.DebugLog("都没有在主阵容中且不高于当前生效卡牌加成不处理! heroID=%s,itemIndex=%s,curAddPer=%s <= %s,effItemIndex=%s" |
| | | % (heroID, itemIndex, curAddPer, effAddPer, effItemIndex))
|
| | | return
|
| | | GameWorld.DebugLog("都没有在主阵容中且高于当前生效卡牌加成替换生效卡牌! heroID=%s,itemIndex=%s,curAddPer=%s > %s,effItemIndex=%s" |
| | | % (heroID, itemIndex, curAddPer, effAddPer, effItemIndex))
|
| | | olPlayer.SetHeroEffectiveCard(heroID, curAddPer, itemIndex, inMain)
|
| | | |
| | | item = heroItem.GetItem()
|
| | | item.SetUserAttr(ShareDefine.Def_IudetHeroCardEffective, 1)
|
| | | isNotify and heroItem.Sync_Item()
|
| | | |
| | | if effItemIndex >= 0:
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptHero)
|
| | | hisEffItem = curPack.GetAt(effItemIndex) if curPack.GetCount() > effItemIndex else None
|
| | | if hisEffItem and not hisEffItem.IsEmpty():
|
| | | item = hisEffItem.GetItem()
|
| | | item.SetUserAttr(ShareDefine.Def_IudetHeroCardEffective, 0)
|
| | | isNotify and hisEffItem.Sync_Item()
|
| | | |
| | | return
|
| | |
|
| | | def reloadEffHeroCard(curPlayer, olPlayer):
|
| | | ## 重新检查载入生效的卡牌,一般用于比较复杂的情况,直接重新遍历一遍,如登录时、重新保存主阵容时
|
| | | hisEffCardIndexList = [] # 历史生效的卡牌 [index, ...]
|
| | | updEffectiveCardDict = {} # 更新生效的卡牌 {heroID:[cardAddPer, itemIndex, inMain], ...}
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptHero)
|
| | | for index in range(curPack.GetCount()):
|
| | | heroItem = curPack.GetAt(index)
|
| | | if not heroItem or heroItem.IsEmpty():
|
| | | continue
|
| | | |
| | | heroID = heroItem.GetItemTypeID()
|
| | | inMain = PlayerHero.InMainLineup(heroItem)
|
| | | cardAddPer = getHeroCardAddPer(heroItem)
|
| | | # 历史生效的
|
| | | if heroItem.GetUserAttr(ShareDefine.Def_IudetHeroCardEffective): # 是否生效的
|
| | | hisEffCardIndexList.append(index)
|
| | | |
| | | # 最新生效的: 主阵容中的优先生效,非主阵容中的最高加成的生效
|
| | | if inMain:
|
| | | updEffectiveCardDict[heroID] = [cardAddPer, index, inMain]
|
| | | else:
|
| | | addPer = updEffectiveCardDict.get(heroID, [-1, -1, False])[0]
|
| | | if cardAddPer > addPer:
|
| | | updEffectiveCardDict[heroID] = [cardAddPer, index, inMain]
|
| | | |
| | | # 更新生效变更的卡牌
|
| | | syncItemDict = {} # 需要同步的异常物品 {index:heroItem, ...}
|
| | | GameWorld.DebugLog("历史生效的卡牌索引: %s" % hisEffCardIndexList)
|
| | | GameWorld.DebugLog("最新生效的卡牌信息: %s" % updEffectiveCardDict)
|
| | | cardPerTotal = 0
|
| | | olPlayer.SetEffectiveCardDict(updEffectiveCardDict)
|
| | | for heroID, effInfo in updEffectiveCardDict.items():
|
| | | cardAddPer, itemIndex, inMain = effInfo
|
| | | cardPerTotal += cardAddPer
|
| | | if itemIndex in hisEffCardIndexList:
|
| | | hisEffCardIndexList.remove(itemIndex) # 不变的直接移除,剩余未移除的就是失效的
|
| | | GameWorld.DebugLog("生效的卡牌不变的: heroID=%s,itemIndex=%s,inMain=%s,cardAddPer=%s,cardPerTotal=%s" % (heroID, itemIndex, inMain, cardAddPer, cardPerTotal))
|
| | | else:
|
| | | GameWorld.DebugLog("生效的卡牌变化的: heroID=%s,itemIndex=%s,inMain=%s,cardAddPer=%s,cardPerTotal=%s" % (heroID, itemIndex, inMain, cardAddPer, cardPerTotal))
|
| | | heroItem = curPack.GetAt(itemIndex)
|
| | | item = heroItem.GetItem()
|
| | | item.SetUserAttr(ShareDefine.Def_IudetHeroCardEffective, 1)
|
| | | syncItemDict[itemIndex] = heroItem
|
| | | |
| | | # 移除历史失效的卡牌
|
| | | GameWorld.DebugLog("移除失效的卡牌索引: %s" % hisEffCardIndexList)
|
| | | for itemIndex in hisEffCardIndexList:
|
| | | heroItem = curPack.GetAt(itemIndex)
|
| | | item = heroItem.GetItem()
|
| | | item.SetUserAttr(ShareDefine.Def_IudetHeroCardEffective, 0)
|
| | | syncItemDict[itemIndex] = heroItem
|
| | | |
| | | # 同步变更的物品
|
| | | for syncItem in syncItemDict.values():
|
| | | syncItem.Sync_Item()
|
| | | |
| | | return
|
| | |
|
| | | def getHeroCardAddPer(heroItem):
|
| | | ## 获取该武将卡的卡牌加成
|
| | | heroID = heroItem.GetItemTypeID()
|
| | | heroIpyData = IpyGameDataPY.GetIpyGameData("Hero", heroID)
|
| | | if not heroIpyData:
|
| | | return 0
|
| | | quality = heroIpyData.GetQuality()
|
| | | qualityIpyData = IpyGameDataPY.GetIpyGameData("HeroQuality", quality)
|
| | | if not qualityIpyData:
|
| | | return 0
|
| | | |
| | | heroLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroLV)
|
| | | star = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroStar)
|
| | | breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
|
| | | |
| | | starMax = PlayerHero.GetHeroStarMax(heroItem)
|
| | | addPer = qualityIpyData.GetInitAddPer()
|
| | | addPer += qualityIpyData.GetLVAddPer() * max(0, heroLV - 1)
|
| | | addPer += qualityIpyData.GetBreakLVAddPer() * breakLV
|
| | | addPer += qualityIpyData.GetStarAddPer() * min(star, starMax)
|
| | | return addPer
|
| | |
|
| | | def doReloadLineup(curPlayer, olPlayer):
|
| | | ## 重新载入阵容
|
| | | loadLineupIDList = ShareDefine.LineupList
|
| | |
| | | heroItem = curPack.GetAt(index)
|
| | | if not heroItem or heroItem.IsEmpty():
|
| | | continue
|
| | | |
| | | lineupCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroLineup)
|
| | | if not lineupCount:
|
| | | continue
|
| | |
| | | item.DelUserAttr(ShareDefine.Def_IudetHeroLineup, lineupValue)
|
| | | syncItemDict[index] = heroItem
|
| | |
|
| | | # 同步变更的物品
|
| | | for syncItem in syncItemDict.values():
|
| | | syncItem.Sync_Item()
|
| | |
|
| | |
| | | PlayerGubao.CalcGubaoAttr(curPlayer)
|
| | | PlayerHJG.CalcHJGAttr(curPlayer)
|
| | | PlayerHorse.CalcHorseAttr(curPlayer)
|
| | | PlayerBeauty.CalcBeautyAttr(curPlayer)
|
| | | return
|
| | |
|
| | | def doRefreshLineupAttr(curPlayer, olPlayer, lineup):
|
| | |
| | | countryHeroInfo = {} # 国家武将统计 {country:[heroID, ...], ...}
|
| | | fetterHeroInfo = {} # 阵容羁绊武将统计信息 {fetterID:[heroID, ...], ...}
|
| | | heroSelfAttrInfo = {} # 武将自身属性 {heroID:{attrID:value, ...}, ...}
|
| | | heroLVAttrInfo = {} # 武将等级属性 {heroID:{attrID:value, ...}, ...}
|
| | | heroStarTalentInfo = {} # 武将星级天赋属性 {heroID:{attrID:value, ...}, ...}
|
| | | heroBreakAttrInfo = {} # 武将突破潜能属性 {heroID:{attrID:value, ...}, ...}
|
| | | heroAwakeTalentInfo = {} # 武将觉醒天赋属性 {heroID:{attrID:value, ...}, ...}
|
| | | |
| | | # 上阵卡牌【初始加成+升级加成+突破加成+吞噬加成】
|
| | | InitAddPer, LVAddPer, BreakLVAddPer, StarAddPer = 0, 0, 0, 0
|
| | |
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptHero)
|
| | | for itemIndex, posNum in lineup.heroItemDict.items():
|
| | |
| | | continue
|
| | |
|
| | | heroLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroLV)
|
| | | star = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroStar)
|
| | | #star = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroStar)
|
| | | breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
|
| | | awakeLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroAwakeLV)
|
| | | skinIndex = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroSkin)
|
| | |
| | | elif skinIDList:
|
| | | skinID = skinIDList[0]
|
| | |
|
| | | starMax = PlayerHero.GetHeroStarMax(heroItem)
|
| | | InitAddPer += qualityIpyData.GetInitAddPer()
|
| | | LVAddPer += qualityIpyData.GetLVAddPer() * max(0, heroLV - 1)
|
| | | BreakLVAddPer += qualityIpyData.GetBreakLVAddPer() * breakLV
|
| | | StarAddPer += qualityIpyData.GetStarAddPer() * min(star, starMax)
|
| | | |
| | | lineupHero = lineup.GetLineupHero(posNum)
|
| | | #if False:
|
| | | # lineupHero = LineupHero()
|
| | |
| | | for k, v in heroIpyData.GetBatAttrDict().items():
|
| | | selfAttrDict[int(k)] = v
|
| | | heroSelfAttrInfo[heroID] = selfAttrDict
|
| | | |
| | | # 等级属性
|
| | | heroLVAttrDict = {}
|
| | | heroLVIpyData = IpyGameDataPY.GetIpyGameData("HeroQualityLV", quality, heroLV)
|
| | | if heroLVIpyData:
|
| | | attrIDList = heroLVIpyData.GetAttrIDList()
|
| | | attrValueList = heroLVIpyData.GetAttrValueList()
|
| | | for aIndex in range(min(len(attrIDList), len(attrValueList))):
|
| | | attrID = attrIDList[aIndex]
|
| | | attrValue = attrValueList[aIndex]
|
| | | heroLVAttrDict[attrID] = heroLVAttrDict.get(attrID, 0) + attrValue
|
| | | heroLVAttrInfo[heroID] = heroLVAttrDict
|
| | |
|
| | | # 突破潜能
|
| | | breakAttrDict = {}
|
| | |
| | |
|
| | | lvAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_LV)
|
| | | equipAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_MainEquip)
|
| | | bookAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_HeroBook)
|
| | | fatesAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_HeroFates)
|
| | | realmAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Realm)
|
| | | gubaoAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Gubao)
|
| | | hjgAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_HJG)
|
| | | horseAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Horse)
|
| | | beautyAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Beauty)
|
| | |
|
| | | GameWorld.DebugLog(" 国家武将统计=%s" % countryHeroInfo, playerID)
|
| | | GameWorld.DebugLog(" 羁绊武将统计=%s" % fetterHeroInfo, playerID)
|
| | | GameWorld.DebugLog(" 武将自身属性=%s" % heroSelfAttrInfo, playerID)
|
| | | GameWorld.DebugLog(" 武将等级属性=%s" % heroLVAttrInfo, playerID)
|
| | | GameWorld.DebugLog(" 武将吞噬属性=%s" % heroStarTalentInfo, playerID)
|
| | | GameWorld.DebugLog(" 武将突破潜能=%s" % heroBreakAttrInfo, playerID)
|
| | | GameWorld.DebugLog(" 武将觉醒天赋=%s" % heroAwakeTalentInfo, playerID)
|
| | | GameWorld.DebugLog(" 武将羁绊属性=%s" % heroFetterAttrInfo, playerID)
|
| | | GameWorld.DebugLog(" 阵容光环属性=%s" % lineupHaloAttrInfo, playerID)
|
| | | GameWorld.DebugLog(" 阵容上阵加成=InitAddPer=%s,LVAddPer=%s,BreakLVAddPer=%s,StarAddPer=%s" % (InitAddPer, LVAddPer, BreakLVAddPer, StarAddPer), playerID)
|
| | |
|
| | | GameWorld.DebugLog(" 主公等级属性=%s" % lvAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公装备属性=%s" % equipAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公图鉴属性=%s" % bookAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公宿缘属性=%s" % fatesAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公官职属性=%s" % realmAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公古宝属性=%s" % gubaoAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主幻境阁属性=%s" % hjgAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公坐骑属性=%s" % horseAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公红颜属性=%s" % beautyAttrDict, playerID)
|
| | | |
| | | effCardAddPer = 0
|
| | | for effInfo in olPlayer.GetEffectiveCardDict().values():
|
| | | effCardAddPer += effInfo[0]
|
| | | effCardAddPer /= 10000.0
|
| | | GameWorld.DebugLog(" 主公卡牌加成=%s" % effCardAddPer, playerID)
|
| | |
|
| | | PlayerLV = curPlayer.GetLV()
|
| | | OfficialLV = curPlayer.GetOfficialRank()
|
| | |
| | | fpRatioIpyData = IpyGameDataPY.GetIpyGameData("FightPowerRatio", OfficialLV)
|
| | |
|
| | | lineupFightPower = 0 # 阵容总战力
|
| | | InitAddPer, LVAddPer, BreakLVAddPer, StarAddPer = InitAddPer / 10000.0, LVAddPer / 10000.0, BreakLVAddPer / 10000.0, StarAddPer / 10000.0
|
| | | for heroID, selfAttrDict in heroSelfAttrInfo.items():
|
| | | lineupHero = lineup.GetLineupHeroByID(heroID)
|
| | | if not lineupHero:
|
| | |
| | | lineupHero.heroBatAttrDict = {}
|
| | | lineupHero.fightPower = 0
|
| | |
|
| | | heroLVAttrDict = heroLVAttrInfo.get(heroID, {})
|
| | | starTalentAttrDict = heroStarTalentInfo.get(heroID, {})
|
| | | breakAttrDict = heroBreakAttrInfo.get(heroID, {})
|
| | | awakeTalentAttrDict = heroAwakeTalentInfo.get(heroID, {})
|
| | |
| | |
|
| | | lvValue = lvAttrDict.get(attrID, 0)
|
| | | equipValue = equipAttrDict.get(attrID, 0)
|
| | | bookValue = bookAttrDict.get(attrID, 0)
|
| | | bookPer = bookAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | | |
| | | cardPer = 0 # 卡牌加成,仅对基础三维有用
|
| | | if attrID in ChConfig.BaseAttrIDList:
|
| | | cardPer = effCardAddPer
|
| | | |
| | | fatesValue = fatesAttrDict.get(attrID, 0)
|
| | | fatesPer = fatesAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | |
|
| | | realmValue = realmAttrDict.get(attrID, 0)
|
| | | realmPer = realmAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | |
| | | horseValue = horseAttrDict.get(attrID, 0)
|
| | | horsePer = horseAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | |
|
| | | lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = 0, 0, 0, 0
|
| | | if attrID in ChConfig.BaseAttrIDList:
|
| | | lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = InitAddPer, LVAddPer, BreakLVAddPer, StarAddPer
|
| | | beautyValue = beautyAttrDict.get(attrID, 0)
|
| | | beautyPer = beautyAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | |
|
| | | heroSelfValue, heroSelfPer = selfAttrDict.get(attrID, 0), 0 # 武将自身基值
|
| | | inheritPer = 1 # 继承比例,默认100%
|
| | |
| | |
|
| | | lineupHaloValue, lineupHaloPer = lineupHaloAttrInfo.get(attrID, 0), 0
|
| | | fetterValue, fetterPer = fetterAttrDict.get(attrID, 0), 0
|
| | | heroLVValue, heroLVPer = heroLVAttrDict.get(attrID, 0), 0
|
| | | starTalentValue, starTalentPer = starTalentAttrDict.get(attrID, 0), 0
|
| | | breakLVValue, breakLVPer = breakAttrDict.get(attrID, 0), 0
|
| | | awakeTalentValue, awakeTalentPer = awakeTalentAttrDict.get(attrID, 0), 0
|
| | |
| | | heroSelfPer = selfAttrDict.get(attrPerID, 0) / 10000.0
|
| | | lineupHaloPer = lineupHaloAttrInfo.get(attrPerID, 0) / 10000.0
|
| | | fetterPer = fetterAttrDict.get(attrPerID, 0) / 10000.0
|
| | | heroLVPer = heroLVAttrDict.get(attrPerID, 0) / 10000.0
|
| | | starTalentPer = starTalentAttrDict.get(attrPerID, 0) / 10000.0
|
| | | breakLVPer = breakAttrDict.get(attrPerID, 0) / 10000.0
|
| | | awakeTalentPer = awakeTalentAttrDict.get(attrPerID, 0) / 10000.0
|
| | |
|
| | | # 计算
|
| | | attrParamDict = {"lvValue":lvValue, "equipValue":equipValue, "bookValue":bookValue, "bookPer":bookPer, "realmValue":realmValue, "realmPer":realmPer, |
| | | "gubaoValue":gubaoValue, "gubaoPer":gubaoPer, "hjgValue":hjgValue, "hjgPer":hjgPer, "horseValue":horseValue, "horsePer":horsePer,
|
| | | "lineupInitAddPer":lineupInitAddPer, "lineupLVAddPer":lineupLVAddPer, "lineupBreakLVAddPer":lineupBreakLVAddPer, "lineupStarAddPer":lineupStarAddPer,
|
| | | "heroSelfValue":heroSelfValue, "heroSelfPer":heroSelfPer, "inheritPer":inheritPer,
|
| | | attrParamDict = {"lvValue":lvValue, "equipValue":equipValue, "realmValue":realmValue, "realmPer":realmPer, "cardPer":cardPer,
|
| | | "gubaoValue":gubaoValue, "gubaoPer":gubaoPer, "hjgValue":hjgValue, "hjgPer":hjgPer, "horseValue":horseValue, "horsePer":horsePer, |
| | | "beautyValue":beautyValue, "beautyPer":beautyPer, "fatesValue":fatesValue, "fatesPer":fatesPer,
|
| | | "heroSelfValue":heroSelfValue, "heroSelfPer":heroSelfPer, "inheritPer":inheritPer, "heroLVValue":heroLVValue, "heroLVPer":heroLVPer,
|
| | | "lineupHaloValue":lineupHaloValue, "lineupHaloPer":lineupHaloPer, "fetterValue":fetterValue, "fetterPer":fetterPer,
|
| | | "starTalentValue":starTalentValue, "starTalentPer":starTalentPer, "breakLVValue":breakLVValue, "breakLVPer":breakLVPer,
|
| | | "awakeTalentValue":awakeTalentValue, "awakeTalentPer":awakeTalentPer,
|