129 【战斗】战斗系统-服务端(B424增加同步每个武将战力;演武场匹配列表战力优先同步演武场防守阵容战力;查看玩家增加同步红颜、坐骑信息;)
| | |
| | | else:
|
| | | tfObj.PosNum = posNum
|
| | | tfObj.AngreXP = batObj.GetXP()
|
| | | tfObj.FightPower = batObj.GetFightPower() % ChConfig.Def_PerPointValue
|
| | | tfObj.FightPowerEx = batObj.GetFightPower() / ChConfig.Def_PerPointValue
|
| | | tfLineup.ObjList.append(tfObj)
|
| | | tfLineup.ObjCnt = len(tfLineup.ObjList)
|
| | | tfFaction.LineupList.append(tfLineup)
|
| | |
| | | ("LV", c_ushort), # 等级,玩家的武将等级或NPC成长等级,等级显示以该值为准
|
| | | ("PosNum", c_ubyte), # 在本阵容中的站位,从1开始,非主战斗武将为0,如红颜
|
| | | ("AngreXP", c_ushort), # 当前怒气值
|
| | | ("FightPower", c_int), # 战力,求余亿部分
|
| | | ("FightPowerEx", c_int), # 战力,整除亿部分
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.LV = 0
|
| | | self.PosNum = 0
|
| | | self.AngreXP = 0
|
| | | self.FightPower = 0
|
| | | self.FightPowerEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | MaxHPEx:%d,
|
| | | LV:%d,
|
| | | PosNum:%d,
|
| | | AngreXP:%d
|
| | | AngreXP:%d,
|
| | | FightPower:%d,
|
| | | FightPowerEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.ObjID,
|
| | |
| | | self.MaxHPEx,
|
| | | self.LV,
|
| | | self.PosNum,
|
| | | self.AngreXP
|
| | | self.AngreXP,
|
| | | self.FightPower,
|
| | | self.FightPowerEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | matchInfo = ChPyNetSendPack.tagSCArenaMatchInfo()
|
| | | matchInfo.PlayerID = matchID
|
| | | if viewCache:
|
| | | fightPower = PlayerViewCache.GetLineupFightPower(viewCache, ShareDefine.Lineup_ArenaDef)
|
| | | matchInfo.PlayerName = viewCache.GetPlayerName()
|
| | | matchInfo.RealmLV = viewCache.GetRealmLV()
|
| | | matchInfo.LV = viewCache.GetLV()
|
| | | matchInfo.Face = viewCache.GetFace()
|
| | | matchInfo.FacePic = viewCache.GetFacePic()
|
| | | matchInfo.FightPower = viewCache.GetFightPower()
|
| | | matchInfo.FightPowerEx = viewCache.GetFightPowerEx()
|
| | | matchInfo.FightPower = fightPower % ChConfig.Def_PerPointValue
|
| | | matchInfo.FightPowerEx = fightPower / ChConfig.Def_PerPointValue
|
| | | matchInfo.TitleID = viewCache.GetTitleID()
|
| | | else:
|
| | | matchInfo.PlayerName = "p%s" % matchID
|
| | |
| | | SyncBeautyInfo(curPlayer, [beautyID])
|
| | | return
|
| | |
|
| | | def GetBeautyActCnt(curPlayer):
|
| | | ## 红颜已激活总数
|
| | | actCnt = 0
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetBeautyCount()):
|
| | | ipyData = ipyDataMgr.GetBeautyByIndex(index)
|
| | | beautyID = ipyData.GetBeautyID()
|
| | | if not GetBeautyState(curPlayer, beautyID):
|
| | | continue
|
| | | actCnt += 1
|
| | | return actCnt
|
| | |
|
| | | #// B2 20 红颜好感度升级 #tagCSBeautyLVUP
|
| | | #
|
| | | #struct tagCSBeautyLVUP
|
| | |
| | | import ChPyNetSendPack
|
| | | import IpyGameDataPY
|
| | | import IPY_GameWorld
|
| | | import PlayerOnline
|
| | | import PlayerBeauty
|
| | | import ShareDefine
|
| | | import TurnAttack
|
| | | import DBDataMgr
|
| | |
| | | return True
|
| | |
|
| | | return False
|
| | |
|
| | | def GetLineupFightPower(curCache, lineupID):
|
| | | ## 获取查看缓存中某个阵容对应的战力
|
| | | if not curCache:
|
| | | return 0
|
| | | plusDict = curCache.GetPlusDict()
|
| | | if "Lineup" in plusDict:
|
| | | lineupDict = plusDict["Lineup"]
|
| | | if str(lineupID) in lineupDict:
|
| | | lineupInfo = lineupDict[str(lineupID)]
|
| | | if "FightPower" in lineupInfo:
|
| | | return lineupInfo["FightPower"]
|
| | | return curCache.GetFightPowerTotal()
|
| | |
|
| | | def FindBattleViewCache(playerID):
|
| | | ## 获取可战斗的玩家缓存
|
| | |
| | |
|
| | | # 阵容
|
| | | lineupDict = {}
|
| | | for lineupID in ShareDefine.LineupList:
|
| | | for lineupID in ShareDefine.NeedViewCacheLineupIDList:
|
| | | lineupInfo = TurnAttack.GetPlayerLineupInfo(curPlayer, lineupID)
|
| | | if not lineupInfo:
|
| | | continue
|
| | | lineupDict["%s" % lineupID] = lineupInfo
|
| | | |
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | |
|
| | | # 其他
|
| | | # 红颜
|
| | | attrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Beauty)
|
| | | actCnt = PlayerBeauty.GetBeautyActCnt(curPlayer)
|
| | | beautyDict = {"Cnt":actCnt, "Attr":{str(k):v for k, v in attrDict.items()}}
|
| | |
|
| | | plusDict = {"Equip":equipDict, "Lineup":lineupDict}
|
| | | # 坐骑
|
| | | attrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Horse)
|
| | | horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseLV)
|
| | | classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
|
| | | horseDict = {"LV":horseLV, "ClassLV":classLV, "Attr":{str(k):v for k, v in attrDict.items()}}
|
| | | |
| | | plusDict = {"Equip":equipDict, "Lineup":lineupDict, "Beauty":beautyDict, "Horse":horseDict}
|
| | | curCache.SetPlusDict(plusDict)
|
| | |
|
| | | return curCache
|
| | |
| | | Lineup_ArenaDef, # 竞技场防守阵容 3
|
| | | ) = range(1, 1 + 3)
|
| | |
|
| | | # 需要存储查看缓存的阵容ID列表,一般只存储主阵容及各功能所需的防守阵容
|
| | | NeedViewCacheLineupIDList = [Lineup_Main, Lineup_ArenaDef]
|
| | |
|
| | | # 宠物物品数据状态
|
| | | Def_PetStateList = (
|
| | | Def_PetState_Null, # 无
|