412 【挑战】定军阁-服务端(定军阁功能专享属性支持;优化主阵容属性支持专有功能属性,不影响通用主阵容属性、战力,专享阵容与主阵容相同,只是属性、战力可能不一样;)
| | |
| | | lineupInfo = lineupDict.get("%s" % ShareDefine.Lineup_Main, {})
|
| | | return lineupInfo
|
| | |
|
| | | def GetPlayerLineupFightPower(curPlayer, lineupID):
|
| | | def GetPlayerLineupFightPower(curPlayer, lineupID=ShareDefine.Lineup_Main):
|
| | | ## 获取玩家阵容战力,一般用于直接获取阵容战力记录用
|
| | | return GetPlayerLineup(curPlayer, lineupID).fightPower
|
| | | def GetPlayerLineup(curPlayer, lineupID):
|
| | | def GetPlayerLineup(curPlayer, lineupID=ShareDefine.Lineup_Main, exclusiveMapID=0):
|
| | | ## 获取玩家阵容
|
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | | lineup = olPlayer.GetLineup(lineupID)
|
| | | lineup = olPlayer.GetLineup(lineupID, exclusiveMapID=exclusiveMapID)
|
| | | if lineup.IsEmpty():
|
| | | GameWorld.DebugLogEx("玩家没有目标阵容默认取主阵容! lineupID=%s", lineupID, curPlayer.GetPlayerID())
|
| | | lineup = olPlayer.GetLineup(ShareDefine.Lineup_Main)
|
| | | return lineup
|
| | |
|
| | | def GetPlayerLineupInfo(curPlayer, lineupID):
|
| | | def GetPlayerLineupInfo(curPlayer, lineupID, exclusiveMapID=0):
|
| | | ## 获取玩家阵容信息,可用于战斗或查看缓存,因为可能取玩家的缓存进行对战,所以统一使用json格式,前端通用
|
| | | # @param lineupID: 阵容ID
|
| | | # @param exclusiveMapID: 专享阵容的地图ID,如定军阁
|
| | | # @return: 阵容全部信息json字典,前端通用格式
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | lineup = GetPlayerLineup(curPlayer, lineupID)
|
| | | lineup = GetPlayerLineup(curPlayer, lineupID, exclusiveMapID)
|
| | | if lineup.IsEmpty():
|
| | | return {}
|
| | |
|
| | |
| | | if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, funcLineID, fbIpyData, fbLineIpyData) != ShareDefine.EntFBAskRet_OK:
|
| | | return
|
| | |
|
| | | # 攻防方所使用的阵容ID
|
| | | atkLineupID, defLineupID = FBLogic.GetFBPlayerLineupID(curPlayer, mapID, funcLineID)
|
| | | if atkLineupID not in ShareDefine.LineupList or defLineupID not in ShareDefine.LineupList:
|
| | | return
|
| | | |
| | | if CheckFightCD(curPlayer, tick, "TurnFightReqTick"):
|
| | | return
|
| | |
|
| | |
| | | playerServerID = GameWorld.GetPlayerServerID(curPlayer)
|
| | | guid = GameWorld.GetGUID()
|
| | |
|
| | | atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID)
|
| | | atkLineupID = ShareDefine.Lineup_Main # 进攻方默认使用主阵容
|
| | | atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID, mapID)
|
| | | if not atkLineupInfo:
|
| | | GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s", atkLineupID, playerID)
|
| | | GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s,mapID=%s", atkLineupID, mapID, playerID)
|
| | | return
|
| | |
|
| | | # 玩家
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
|
| | | return
|
| | |
|
| | | defLineupID = ChConfig.MapLineIDDict.get(mapID, ShareDefine.Lineup_Main)
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, defLineupID)
|
| | | if not defLineupInfo:
|
| | | GameWorld.DebugLogEx("目标玩家没有该阵容数据! tagPlayerID=%s,defLineupID=%s", tagPlayerID, defLineupID, playerID)
|
| | |
| | | Def_CalcAttr_HJG, # 幻境阁 5
|
| | | Def_CalcAttr_Horse, # 坐骑 6
|
| | | Def_CalcAttr_Beauty, # 红颜 7
|
| | | ) = range(8)
|
| | | Def_CalcAttr_Dingjunge, # 定军阁 8
|
| | | ) = range(9)
|
| | |
|
| | | CalcAttrName = {
|
| | | Def_CalcAttr_LV:"主公等级",
|
| | |
| | | Def_CalcAttr_HJG:"幻境阁",
|
| | | Def_CalcAttr_Horse:"坐骑",
|
| | | Def_CalcAttr_Beauty:"红颜",
|
| | | Def_CalcAttr_Dingjunge:"定军阁",
|
| | | }
|
| | |
|
| | | ##-----------------------------------------------------------------------------------------------
|
| | |
| | | PlayerWinMapIDList = [Def_FBMapID_Tianzi]
|
| | | #需要汇报中心副本过关进度的地图
|
| | | ReportCenterMapIDList = [Def_FBMapID_Zhanchui, Def_FBMapID_Dingjunge]
|
| | | #需要阵容战斗属性单独专用的地图 - 一般是有地图专有属性的,仅该功能战斗有效,用的是专项的主线阵容,战力独立计算,不影响通用主线阵容战力
|
| | | ExclusiveBatAttrMapIDList = [Def_FBMapID_Dingjunge]
|
| | | #地图专用阵容,注:这里只针对非主动进攻时使用的阵容,不一定是防守,如系统PK的双方阵容也可以
|
| | | MapLineIDDict = {Def_FBMapID_ArenaBattle:ShareDefine.Lineup_ArenaDef}
|
| | |
|
| | | #注册上传跨服服务器数据后直接进入跨服服务器的地图
|
| | | RegisterEnter_CrossServerMapIDList = []
|
| | |
| | |
|
| | | if not paramList:
|
| | | GameWorld.DebugAnswer(curPlayer, "定军阁进度: Dingjunge 今日关卡ID 历史关卡ID")
|
| | | GameWorld.DebugAnswer(curPlayer, "增加效果数: Dingjunge e 增加效果次数")
|
| | | GameWorld.DebugAnswer(curPlayer, "增加效果数: Dingjunge e 加效果数 [自动选择]")
|
| | | GameWorld.DebugAnswer(curPlayer, "待选择效果: Dingjunge s 效果ID [效果ID ...]")
|
| | | return
|
| | | mapID = ChConfig.Def_FBMapID_Dingjunge
|
| | |
| | |
|
| | | if value1 == "e":
|
| | | addEffCnt = paramList[1] if len(paramList) > 1 else 1
|
| | | autoSelect = paramList[2] if len(paramList) > 2 else 0
|
| | | if autoSelect and not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DJGEffAuto):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DJGEffAuto, 1)
|
| | | GameLogic_Dingjunge.GivePassLayerEff(curPlayer, addEffCnt)
|
| | | elif value1 == "s":
|
| | | setEffIDList = paramList[1:]
|
| | |
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | |
|
| | | if not msgList:
|
| | | GameWorld.DebugAnswer(curPlayer, "PrintFightPower [阵容ID]")
|
| | | GameWorld.DebugAnswer(curPlayer, "PrintFightPower [阵容ID 专享属性地图ID]")
|
| | | GameWorld.DebugAnswer(curPlayer, "主公战力: %s" % PlayerControl.GetFightPower(curPlayer))
|
| | | for lineupID in ShareDefine.LineupList:
|
| | | lineup = olPlayer.GetLineup(lineupID)
|
| | | GameWorld.DebugAnswer(curPlayer, "阵容(%s)总战力: %s" % (lineupID, lineup.fightPower))
|
| | | if lineupID == ShareDefine.Lineup_Main:
|
| | | for exclusiveMapID in ChConfig.ExclusiveBatAttrMapIDList:
|
| | | exclusiveLineup = olPlayer.GetLineup(lineupID, exclusiveMapID=exclusiveMapID)
|
| | | GameWorld.DebugAnswer(curPlayer, "阵容(%s-%s)总战力: %s" % (lineupID, exclusiveLineup.exclusiveMapID, exclusiveLineup.fightPower))
|
| | | return
|
| | |
|
| | | lineupID = msgList[0]
|
| | | exclusiveMapID = msgList[1] if len(msgList) > 1 else 0
|
| | | if lineupID not in ShareDefine.LineupList:
|
| | | GameWorld.DebugAnswer(curPlayer, "阵容(%s)不存在.")
|
| | | return
|
| | | |
| | | if exclusiveMapID not in ChConfig.ExclusiveBatAttrMapIDList:
|
| | | exclusiveMapID
|
| | | GameWorld.DebugAnswer(curPlayer, "-------------------")
|
| | | lineup = olPlayer.GetLineup(lineupID) |
| | | lineup = olPlayer.GetLineup(lineupID, exclusiveMapID=exclusiveMapID) |
| | | GameWorld.DebugAnswer(curPlayer, "【阵容 - %s】明细总战力: %s" % (lineupID, lineup.fightPower))
|
| | | if exclusiveMapID:
|
| | | GameWorld.DebugAnswer(curPlayer, "功能地图专属阵容地图ID:%s" % exclusiveMapID)
|
| | |
|
| | | for calcIndex in ChConfig.Def_CalcAttrList:
|
| | | calcName = ChConfig.CalcAttrName.get(calcIndex, "%s" % calcIndex)
|
| | |
| | |
|
| | | return callFunc(curPlayer, mapID, funcLineID, tagType, tagID, valueList)
|
| | |
|
| | | def GetFBPlayerLineupID(curPlayer, mapID, funcLineID):
|
| | | ## 获取玩家使用的攻防阵容ID
|
| | | # @return: 攻击方阵容ID, 防守方阵容ID
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "GetFBPlayerLineupID"))
|
| | | |
| | | if callFunc == None:
|
| | | # 默认不限制
|
| | | return ShareDefine.Lineup_Main, ShareDefine.Lineup_Main
|
| | | |
| | | return callFunc(curPlayer, mapID, funcLineID)
|
| | |
|
| | | def GetFBNPCLineupInfo(curPlayer, mapID, funcLineID):
|
| | | ## 获取NPC阵容相关
|
| | | # @return: npcLineupIDList, strongerLV, difficulty
|
| | |
| | |
|
| | | return True, funcLineID
|
| | |
|
| | | def GetFBPlayerLineupID(curPlayer, mapID, funcLineID):
|
| | | ## 获取玩家使用的攻防阵容ID
|
| | | # @return: 攻击方阵容ID, 防守方阵容ID
|
| | | return ShareDefine.Lineup_ArenaAtk, ShareDefine.Lineup_ArenaDef
|
| | |
|
| | | def OnTurnFightAward(curPlayer, guid, mapID, funcLineID, winFaction, statMsg, dateStr, reqData, awardDict):
|
| | | ## 回合战斗结算奖励
|
| | | if not curPlayer:
|
| | |
| | | PlayerArena.SetRecRealmLV(recData, curPlayer.GetOfficialRank())
|
| | | PlayerArena.SetRecLV(recData, curPlayer.GetLV())
|
| | | # 名字、变更积分 +-、战力
|
| | | fightPower = TurnAttack.GetPlayerLineupFightPower(curPlayer, ShareDefine.Lineup_ArenaAtk)
|
| | | fightPower = TurnAttack.GetPlayerLineupFightPower(curPlayer)
|
| | | recData.SetUserData({"Name":curPlayer.GetPlayerName(), "AddScore":-defDecScore, "FightPower":fightPower})
|
| | | if defDecScore: # 防守方仅变更时更新
|
| | | PlayerBillboard.UpdateBillboardByID(tagPlayerID, ShareDefine.Def_BT_Arena, updScore)
|
| | |
| | | import ItemControler
|
| | | import IpyGameDataPY
|
| | | import NetPackCommon
|
| | | import PlayerOnline
|
| | | import ChConfig
|
| | |
|
| | | # 自动选择排序优先级索引
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DJGSelectEffect % sIndex, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DJGUnSelectCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DJGEffAuto, 0) # 每日重置自动开关
|
| | | RefreshDingjungeAttr(curPlayer)
|
| | | SyncDingjungeInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | else:
|
| | | if __doSelectEff(curPlayer, selectIndex, replaceHole):
|
| | | __randSelectEff(curPlayer, isReset=True)
|
| | | RefreshDingjungeAttr(curPlayer)
|
| | |
|
| | | SyncDingjungeInfo(curPlayer)
|
| | | return
|
| | |
| | | # 自动选择后重置
|
| | | for sIndex in range(randEffCnt):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DJGSelectEffect % sIndex, 0)
|
| | | |
| | | RefreshDingjungeAttr(curPlayer)
|
| | | return True
|
| | |
|
| | | def __getUnlockEffHoleCnt(curPlayer):
|
| | |
| | | break
|
| | | effIDList.append(effID)
|
| | | if effIDList:
|
| | | GameWorld.DebugLog("已存在未选择的加成效果等选择后再生成: effIDList=%s,unSelectCnt=%s" % (effIDList, unSelectCnt))
|
| | | #GameWorld.DebugLog("已存在未选择的加成效果等选择后再生成: effIDList=%s,unSelectCnt=%s" % (effIDList, unSelectCnt))
|
| | | return effIDList
|
| | |
|
| | | fullLVEffIDList = [] # 已满级的效果ID列表
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DJGEffect % replaceIndex, effInfo)
|
| | | return True
|
| | |
|
| | | def RefreshDingjungeAttr(curPlayer):
|
| | | CalcDingjungeAttr(curPlayer)
|
| | | PlayerOnline.GetOnlinePlayer(curPlayer).RefreshRoleAttr(exclusiveMapID=ChConfig.Def_FBMapID_Dingjunge)
|
| | | return
|
| | |
|
| | | def CalcDingjungeAttr(curPlayer):
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | attrDict = {}
|
| | | |
| | | effHoleCnt = __getUnlockEffHoleCnt(curPlayer)
|
| | | for eIndex in range(effHoleCnt):
|
| | | effInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DJGEffect % eIndex)
|
| | | if not effInfo:
|
| | | continue
|
| | | effID, effLV = effInfo / 100, effInfo % 100
|
| | | effIpyData = IpyGameDataPY.GetIpyGameData("FBDJGEffect", effID)
|
| | | if not effIpyData:
|
| | | continue
|
| | | attrID = effIpyData.GetAttrID()
|
| | | attrValue = effIpyData.GetAttrValue()
|
| | | attrValueTotal = attrValue * effLV
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValueTotal
|
| | | #GameWorld.DebugLog("eIndex=%s,effID=%s,attrID=%s,attrValue=%s,effLV=%s,%s" % (eIndex, effID, attrID, attrValue, effLV, attrDict), playerID)
|
| | | |
| | | # 保存计算值
|
| | | GameWorld.DebugLog("定军属性: %s" % attrDict, playerID)
|
| | | PlayerOnline.GetOnlinePlayer(curPlayer).SetCalcAttr(ChConfig.Def_CalcAttr_Dingjunge, attrDict)
|
| | | return
|
| | |
|
| | | def SyncDingjungeInfo(curPlayer):
|
| | | clientPack = ChPyNetSendPack.tagSCDingjungeInfo()
|
| | | clientPack.TodayPass = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DJGLineID)
|
| | |
| | |
|
| | | # 主阵容调整,重载生效的卡牌
|
| | | if lineupID == ShareDefine.Lineup_Main:
|
| | | for exclusiveMapID in ChConfig.ExclusiveBatAttrMapIDList:
|
| | | exclusiveLineup = olPlayer.GetLineup(lineupID, False, exclusiveMapID=exclusiveMapID)
|
| | | exclusiveLineup.UpdLineup(heroItemDict, shapeType)
|
| | | PlayerOnline.reloadEffHeroCard(curPlayer, olPlayer)
|
| | | return
|
| | |
|
| | |
| | | import IpyGameDataPY
|
| | | import FormulaControl
|
| | | import PlayerPrestigeSys
|
| | | import GameLogic_Dingjunge
|
| | | import PlayerBeauty
|
| | | import PlayerFamily
|
| | | import PlayerHorse
|
| | |
| | | class Lineup():
|
| | | ## 阵容
|
| | |
|
| | | def __init__(self, playerID, lineupID):
|
| | | def __init__(self, playerID, lineupID, exclusiveMapID=0):
|
| | | self.playerID = playerID
|
| | | self.lineupID = lineupID
|
| | | self.exclusiveMapID = exclusiveMapID # 大于0时代表是某个功能地图专用,如定军阁,阵容与主阵容相同,只是属性、战力可能不一样
|
| | | self.olPlayer = None
|
| | | self.shapeType = 0
|
| | | self.heroItemDict = {} # 阵容武将背包索引信息 {itemIndex:posNum, ...}
|
| | |
| | | self.lineupChange = True
|
| | | self.shapeType = shapeType
|
| | | self.heroItemDict = heroItemDict
|
| | | GameWorld.DebugLog("更新阵容: lineupID=%s,%s" % (self.lineupID, heroItemDict), self.playerID)
|
| | | GameWorld.DebugLog("更新阵容: lineupID=%s,exclusiveMapID=%s,%s" % (self.lineupID, self.exclusiveMapID, heroItemDict), self.playerID)
|
| | | self.RefreshLineupAttr(refreshForce)
|
| | | if not isReload and self.olPlayer.curPlayer:
|
| | | if not isReload and self.olPlayer.curPlayer and not self.exclusiveMapID:
|
| | | PlayerHero.Sync_Lineup(self.olPlayer.curPlayer, self.lineupID)
|
| | | return
|
| | |
|
| | |
| | | # 属性、阵容
|
| | | self._calcAttrDict = {} # 功能点属性统计 {calcIndex:{attrID:value, ...}, ...}
|
| | | self._calcSpecEffDict = {} # 功能点特殊效果统计 {calcIndex:effInfo, ...}
|
| | | self._lineupDict = {} # 上阵阵容 {lineupID:Lineup, ...}
|
| | | self._lineupDict = {} # 上阵阵容 {lineKey:Lineup, ...} lineKey 为 lineupID 或者 (lineupID, exclusiveMapID)
|
| | | self._effectiveCardDict = {} # 加成属性生效的武将卡牌信息 {heroID:[cardAddPer, itemIndex, inMain], ...}
|
| | |
|
| | | # 主线战斗
|
| | |
| | | ## 是否真的在线
|
| | | return self.curPlayer != None
|
| | |
|
| | | def GetLineup(self, lineupID, checkAttr=True):
|
| | | def GetLineup(self, lineupID, checkAttr=True, exclusiveMapID=0):
|
| | | # @param checkAttr: 检查刷新到最新阵容属性
|
| | | lineup = None
|
| | | if lineupID in self._lineupDict:
|
| | | lineup = self._lineupDict[lineupID]
|
| | | lineKey = lineupID
|
| | | if exclusiveMapID:
|
| | | if exclusiveMapID in ChConfig.ExclusiveBatAttrMapIDList:
|
| | | lineKey = (lineupID, exclusiveMapID)
|
| | | else:
|
| | | exclusiveMapID = 0
|
| | | if lineKey in self._lineupDict:
|
| | | lineup = self._lineupDict[lineKey]
|
| | | else:
|
| | | lineup = Lineup(self.playerID, lineupID)
|
| | | self._lineupDict[lineupID] = lineup
|
| | | lineup = Lineup(self.playerID, lineupID, exclusiveMapID)
|
| | | self._lineupDict[lineKey] = lineup
|
| | | lineup.olPlayer = self
|
| | | if checkAttr:
|
| | | lineup.CheckRefreshLineupAttr()
|
| | |
| | | self.RefreshRoleAttr()
|
| | | return
|
| | |
|
| | | def RefreshRoleAttr(self, refreshForce=False, isAllLineup=False):
|
| | | def RefreshRoleAttr(self, refreshForce=False, isAllLineup=False, exclusiveMapID=0):
|
| | | '''刷新主公属性,影响主公属性的功能点属性变化时统一调用此函数
|
| | | @param refreshForce: 是否强制立马刷新
|
| | | @param isAllLineup: 是否只同步刷所有阵容属性,如果设置False则默认仅刷主阵容属性
|
| | |
| | | GameWorld.DebugLog("请求刷属性: refreshForce=%s" % (refreshForce), self.playerID)
|
| | | # 主公属性刷新时,所有阵容都要同步刷新
|
| | | for lineup in self._lineupDict.values():
|
| | | if exclusiveMapID and lineup.exclusiveMapID != exclusiveMapID:
|
| | | # 有指定的话只要指定的即可
|
| | | continue
|
| | | lineup.SetNeedRefreshState()
|
| | |
|
| | | if refreshForce:
|
| | | self.DoRefreshRoleAttr(isAllLineup)
|
| | | self.DoRefreshRoleAttr(isAllLineup, exclusiveMapID)
|
| | | return
|
| | |
|
| | | def DoRefreshRoleAttr(self, isAllLineup=False):
|
| | | def DoRefreshRoleAttr(self, isAllLineup=False, exclusiveMapID=0):
|
| | | '''执行刷属性,默认额外刷主阵容,其他阵容可以用到的时候再刷新
|
| | | @param isAllLineup: 是否刷所有阵容,如果设置False则默认仅刷主阵容属性
|
| | | @return: 是否有刷属性,0-无;1-有
|
| | |
| | |
|
| | | isRefresh = False
|
| | | # 同步执行阵容属性刷新
|
| | | for lineupID, lineup in self._lineupDict.items():
|
| | | if not isAllLineup and lineupID != ShareDefine.Lineup_Main:
|
| | | continue
|
| | | for lineup in self._lineupDict.values():
|
| | | if not isAllLineup:
|
| | | # 有指定的话只要指定的即可
|
| | | if exclusiveMapID:
|
| | | if lineup.exclusiveMapID != exclusiveMapID:
|
| | | continue
|
| | | |
| | | # 否则只刷主阵容,指定地图有效的也不需要刷
|
| | | elif lineup.lineupID != ShareDefine.Lineup_Main or lineup.exclusiveMapID != 0:
|
| | | continue
|
| | | if lineup.CheckRefreshLineupAttr():
|
| | | isRefresh = True
|
| | |
|
| | |
| | | checkUpdEffHeroCard(self, heroItem) # 检查更新生效的卡牌
|
| | |
|
| | | itemIndex = heroItem.GetItemPlaceIndex()
|
| | | for lineupID, lineup in self._lineupDict.items():
|
| | | for lineKey, lineup in self._lineupDict.items():
|
| | | if lineup.CheckHeroItemUpdate(itemIndex):
|
| | | if lineupID not in effLineupIDList:
|
| | | effLineupIDList.append(lineupID)
|
| | | if lineKey not in effLineupIDList:
|
| | | effLineupIDList.append(lineKey)
|
| | |
|
| | | GameWorld.DebugLog("武将物品变化: itemIndex=%s, 影响阵容:%s" % (itemIndex, effLineupIDList), self.playerID)
|
| | | return effLineupIDList
|
| | | return
|
| | |
|
| | | def GetLastBatBuffer(self): return self._lastBatBufferInfo
|
| | | def SetLastBatBuffer(self, guid, batBuffer):
|
| | |
| | | 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))
|
| | | #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)
|
| | |
| | | shapeType = lineShapeTypeDict.get(lineupID, 0)
|
| | | lineup.UpdLineup(heroItemDict, shapeType, isReload=True)
|
| | |
|
| | | if lineupID == ShareDefine.Lineup_Main:
|
| | | for exclusiveMapID in ChConfig.ExclusiveBatAttrMapIDList:
|
| | | exclusiveLineup = olPlayer.GetLineup(lineupID, False, exclusiveMapID=exclusiveMapID)
|
| | | exclusiveLineup.UpdLineup(heroItemDict, shapeType, isReload=True)
|
| | | |
| | | PlayerHero.Sync_Lineup(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | PlayerHJG.CalcHJGAttr(curPlayer)
|
| | | PlayerHorse.CalcHorseAttr(curPlayer)
|
| | | PlayerBeauty.CalcBeautyAttr(curPlayer)
|
| | | GameLogic_Dingjunge.CalcDingjungeAttr(curPlayer)
|
| | | return
|
| | |
|
| | | def doRefreshLineupAttr(curPlayer, olPlayer, lineup):
|
| | |
| | | '''
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | lineupID = lineup.lineupID
|
| | | exclusiveMapID = lineup.exclusiveMapID
|
| | |
|
| | | GameWorld.DebugLog("刷新阵容属性: lineupID=%s" % lineupID, playerID)
|
| | | GameWorld.DebugLog("刷新阵容属性: lineupID=%s,exclusiveMapID=%s" % (lineupID, exclusiveMapID), playerID)
|
| | | GameWorld.DebugLog(" itemIndex-posNum : %s" % lineup.heroItemDict, playerID)
|
| | |
|
| | | lineup.FreeLineupHero()
|
| | |
| | | hjgAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_HJG)
|
| | | horseAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Horse)
|
| | | beautyAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Beauty)
|
| | | dingjungeAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Dingjunge) if exclusiveMapID == ChConfig.Def_FBMapID_Dingjunge else {}
|
| | |
|
| | | GameWorld.DebugLog(" 国家武将统计=%s" % countryHeroInfo, playerID)
|
| | | GameWorld.DebugLog(" 羁绊武将统计=%s" % fetterHeroInfo, playerID)
|
| | |
| | | GameWorld.DebugLog(" 主幻境阁属性=%s" % hjgAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公坐骑属性=%s" % horseAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公红颜属性=%s" % beautyAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 定军专属属性=%s" % dingjungeAttrDict, playerID)
|
| | |
|
| | | effCardAddPer = 0
|
| | | for effInfo in olPlayer.GetEffectiveCardDict().values():
|
| | |
| | |
|
| | | beautyValue = beautyAttrDict.get(attrID, 0)
|
| | | beautyPer = beautyAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | | |
| | | dingjungeValue = dingjungeAttrDict.get(attrID, 0)
|
| | | dingjungePer = dingjungeAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | |
|
| | | heroSelfValue, heroSelfPer = selfAttrDict.get(attrID, 0), 0 # 武将自身基值
|
| | | inheritPer = 1 # 继承比例,默认100%
|
| | |
| | | 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,
|
| | | "dingjungeValue":dingjungeValue, "dingjungePer":dingjungePer,
|
| | | "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,
|
| | |
| | | % (heroID, fightPowerTotal, fightPower, skillFightPower, logAttrDict, lineupHero.heroSkillIDList), playerID)
|
| | |
|
| | | lineup.fightPower = lineupFightPower
|
| | | GameWorld.DebugLog(" 阵容最终战力: lineupID=%s,lineupFightPower=%s" % (lineupID, lineupFightPower), playerID)
|
| | | GameWorld.DebugLog(" 阵容最终战力: lineupID=%s,lineupFightPower=%s,exclusiveMapID=%s" % (lineupID, lineupFightPower, exclusiveMapID), playerID)
|
| | |
|
| | | # 非主线阵容不处理以下内容
|
| | | if lineupID != ShareDefine.Lineup_Main:
|
| | | if lineupID != ShareDefine.Lineup_Main or exclusiveMapID:
|
| | | return
|
| | |
|
| | | PlayerControl.SetFightPower(curPlayer, lineupFightPower)
|
| | |
| | |
|
| | | LineupObjMax = 6 # 阵容最大上阵武将数
|
| | |
|
| | | # 阵容定义
|
| | | # 阵容定义,主动进攻阵容只使用主阵容,功能可以有指定的阵容,如防守阵容、系统PK阵容等
|
| | | LineupList = (
|
| | | Lineup_Main, # 主阵容 1
|
| | | Lineup_ArenaAtk, # 竞技场进攻阵容 2
|
| | | Lineup_2, # 废弃
|
| | | Lineup_ArenaDef, # 竞技场防守阵容 3
|
| | | ) = range(1, 1 + 3)
|
| | |
|