| | |
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import FormulaControl
|
| | | import PlayerPrestigeSys
|
| | | import PlayerHero
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
| | |
|
| | | # 主线战斗
|
| | | self.mainFight = TurnAttack.MainFight(playerID)
|
| | | |
| | | self._lastBatBufferInfo = [] # 最后一场战斗临时回放 ["guid", "buffer"]
|
| | | return
|
| | |
|
| | | def OnClear(self):
|
| | |
| | |
|
| | | GameWorld.DebugLog("武将物品养成更新索引: %s, 影响阵容:%s" % (itemIndexList, effLineupIDList), self.playerID)
|
| | | return effLineupIDList
|
| | | |
| | | def GetLastBatBuffer(self): return self._lastBatBufferInfo
|
| | | def SetLastBatBuffer(self, guid, batBuffer):
|
| | | self._lastBatBufferInfo = [guid, batBuffer]
|
| | | return
|
| | |
|
| | | class OnlineMgr():
|
| | | ## 准在线玩家管理
|
| | |
| | | CalcRoleBase(curPlayer)
|
| | | ChEquip.CalcRoleEquipAttr(curPlayer)
|
| | | PlayerHero.CalcHeroAddAttr(curPlayer)
|
| | | PlayerPrestigeSys.CalcOfficialRankAttr(curPlayer)
|
| | | return
|
| | |
|
| | | def doRefreshLineupAttr(curPlayer, olPlayer, lineup):
|
| | |
| | | elif skinIDList:
|
| | | skinID = skinIDList[0]
|
| | |
|
| | | starMax = PlayerHero.GetHeroStarMax(heroItem)
|
| | | InitAddPer += qualityIpyData.GetInitAddPer()
|
| | | LVAddPer += qualityIpyData.GetLVAddPer() * heroLV
|
| | | LVAddPer += qualityIpyData.GetLVAddPer() * max(0, heroLV - 1)
|
| | | BreakLVAddPer += qualityIpyData.GetBreakLVAddPer() * breakLV
|
| | | StarAddPer += qualityIpyData.GetStarAddPer() * star
|
| | | StarAddPer += qualityIpyData.GetStarAddPer() * min(star, starMax)
|
| | |
|
| | | lineupHero = lineup.GetLineupHero(posNum)
|
| | | #if False:
|
| | |
| | | selfAttrDict[int(k)] = v
|
| | | heroSelfAttrInfo[heroID] = selfAttrDict
|
| | |
|
| | | # 星级天赋
|
| | | starTalentAttrDict = {}
|
| | | idCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentID)
|
| | | lvCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentIDLV)
|
| | | for aIndex in range(min(idCount, lvCount)):
|
| | | talentID = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentID, aIndex)
|
| | | talentLV = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentIDLV, aIndex)
|
| | | stIpyData = IpyGameDataPY.GetIpyGameData("HeroTalent", talentID)
|
| | | if not stIpyData:
|
| | | continue
|
| | | attrID = stIpyData.GetAttrID()
|
| | | attrValue = stIpyData.GetAttrValue() * talentLV
|
| | | starTalentAttrDict[attrID] = starTalentAttrDict.get(attrID, 0) + attrValue
|
| | | heroStarTalentInfo[heroID] = starTalentAttrDict
|
| | | |
| | | # 突破潜能
|
| | | breakAttrDict = {}
|
| | | breakIpyDataList = IpyGameDataPY.GetIpyGameDataList("HeroBreak", heroID)
|
| | |
| | | heroBreakAttrInfo[heroID] = breakAttrDict
|
| | |
|
| | | # 觉醒天赋
|
| | | maxUnlockSlot = IpyGameDataPY.GetFuncCfg("HeroStarTalent", 1) # 常规天赋槽个数
|
| | | awakeTalentAttrDict = {}
|
| | | awakeIpyDataList = IpyGameDataPY.GetIpyGameDataList("HeroAwake", heroID)
|
| | | awakeIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog("HeroAwake", heroID)
|
| | | if awakeIpyDataList:
|
| | | for awakeIpyData in awakeIpyDataList:
|
| | | if awakeIpyData.GetAwakeLV() > awakeLV:
|
| | | break
|
| | | unlockTalentSlot = awakeIpyData.GetUnlockTalentSlot()
|
| | | maxUnlockSlot = max(maxUnlockSlot, unlockTalentSlot)
|
| | | attrIDList = awakeIpyData.GetAttrIDList()
|
| | | attrValueList = awakeIpyData.GetAttrValueList()
|
| | | for aIndex in range(min(len(attrIDList), len(attrValueList))):
|
| | |
| | | if skillID:
|
| | | lineupHero.heroSkillIDList.append(skillID)
|
| | | heroAwakeTalentInfo[heroID] = awakeTalentAttrDict
|
| | | |
| | | # 星级天赋
|
| | | starTalentAttrDict = {}
|
| | | idCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentID)
|
| | | lvCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentIDLV)
|
| | | for aIndex in range(min(idCount, lvCount, maxUnlockSlot)): # 重生导致已觉醒槽位失效时属性也无效
|
| | | talentID = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentID, aIndex)
|
| | | talentLV = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentIDLV, aIndex)
|
| | | stIpyData = IpyGameDataPY.GetIpyGameData("HeroTalent", talentID)
|
| | | if not stIpyData:
|
| | | continue
|
| | | attrID = stIpyData.GetAttrID()
|
| | | attrValue = stIpyData.GetAttrValue() * talentLV
|
| | | starTalentAttrDict[attrID] = starTalentAttrDict.get(attrID, 0) + attrValue
|
| | | heroStarTalentInfo[heroID] = starTalentAttrDict
|
| | |
|
| | | # 羁绊统计
|
| | | for fetterID in heroIpyData.GetFetterIDList():
|
| | |
| | | lvAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_LV)
|
| | | equipAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_MainEquip)
|
| | | bookAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_HeroBook)
|
| | | realmAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Realm)
|
| | |
|
| | | GameWorld.DebugLog(" 国家武将统计=%s" % countryHeroInfo, playerID)
|
| | | GameWorld.DebugLog(" 羁绊武将统计=%s" % fetterHeroInfo, playerID)
|
| | |
| | | GameWorld.DebugLog(" 主公等级属性=%s" % lvAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公装备属性=%s" % equipAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公图鉴属性=%s" % bookAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公官职属性=%s" % realmAttrDict, playerID)
|
| | |
|
| | | PlayerLV = curPlayer.GetLV()
|
| | | OfficialLV = curPlayer.GetOfficialRank()
|
| | |
| | | bookValue = bookAttrDict.get(attrID, 0)
|
| | | bookPer = bookAttrDict.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
|
| | | |
| | | lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = 0, 0, 0, 0
|
| | | if attrID in ChConfig.BaseAttrIDList:
|
| | | lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = InitAddPer, LVAddPer, BreakLVAddPer, StarAddPer
|
| | |
| | | awakeTalentPer = awakeTalentAttrDict.get(attrPerID, 0) / 10000.0
|
| | |
|
| | | # 计算
|
| | | attrParamDict = {"lvValue":lvValue, "equipValue":equipValue, "bookValue":bookValue, "bookPer":bookPer, |
| | | attrParamDict = {"lvValue":lvValue, "equipValue":equipValue, "bookValue":bookValue, "bookPer":bookPer, "realmValue":realmValue, "realmPer":realmPer, |
| | | "lineupInitAddPer":lineupInitAddPer, "lineupLVAddPer":lineupLVAddPer, "lineupBreakLVAddPer":lineupBreakLVAddPer, "lineupStarAddPer":lineupStarAddPer,
|
| | | "heroSelfValue":heroSelfValue, "heroSelfPer":heroSelfPer, "inheritPer":inheritPer,
|
| | | "lineupHaloValue":lineupHaloValue, "lineupHaloPer":lineupHaloPer, "fetterValue":fetterValue, "fetterPer":fetterPer,
|
| | |
| | | GameWorld.DebugLog("主阵容变化,重新开始战斗", playerID)
|
| | | if mainTurnFight.mapID == ChConfig.Def_FBMapID_Main:
|
| | | TurnAttack.__doMainLevelWave(curPlayer, True)
|
| | | elif mainTurnFight.mapID == ChConfig.Def_FBMapID_MainBoss:
|
| | | TurnAttack.__doMainBossStart(curPlayer)
|
| | |
|
| | | # 否则只重新设置战斗属性
|
| | | else:
|