121 【武将】武将系统-服务端(计算主公官职属性;)
| | |
| | | Def_CalcAttr_LV, # 主公等级 0
|
| | | Def_CalcAttr_MainEquip, # 主装备 1
|
| | | Def_CalcAttr_HeroBook, # 武将图鉴 2
|
| | | ) = range(3)
|
| | | Def_CalcAttr_Realm, # 官职 3
|
| | | ) = range(4)
|
| | |
|
| | | CalcAttrName = {
|
| | | Def_CalcAttr_LV:"主公等级",
|
| | | Def_CalcAttr_MainEquip:"主装备",
|
| | | Def_CalcAttr_HeroBook:"武将图鉴",
|
| | | Def_CalcAttr_Realm:"官职",
|
| | | }
|
| | |
|
| | | ##-----------------------------------------------------------------------------------------------
|
| | |
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import FormulaControl
|
| | | import PlayerPrestigeSys
|
| | | import PlayerHero
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
| | | CalcRoleBase(curPlayer)
|
| | | ChEquip.CalcRoleEquipAttr(curPlayer)
|
| | | PlayerHero.CalcHeroAddAttr(curPlayer)
|
| | | PlayerPrestigeSys.CalcOfficialRankAttr(curPlayer)
|
| | | return
|
| | |
|
| | | def doRefreshLineupAttr(curPlayer, olPlayer, lineup):
|
| | |
| | | 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,
|
| | |
| | | import PlayerTongTianLing
|
| | | import PlayerGubao
|
| | | import PlayerTask
|
| | | import PlayerOnline
|
| | |
|
| | | #------------------------------------------------------------------------------
|
| | |
|
| | |
| | |
|
| | | addAttrIDList, addAttrValueList = realmIpyData.GetAddAttrType(), realmIpyData.GetAddAttrNum()
|
| | |
|
| | | allAttrList = [{} for i in range(4)]
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | attrDict = {}
|
| | | for i, attrID in enumerate(addAttrIDList):
|
| | | PlayerControl.CalcAttrDict_Type(attrID, addAttrValueList[i], allAttrList)
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + addAttrValueList[i]
|
| | |
|
| | | # 保存计算值
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Prestige, allAttrList)
|
| | | GameWorld.DebugLog("官职属性: %s" % attrDict, playerID)
|
| | | PlayerOnline.GetOnlinePlayer(curPlayer).SetCalcAttr(ChConfig.Def_CalcAttr_Realm, attrDict)
|
| | | return
|
| | |
|
| | | def RefreshOfficialAttr(curPlayer):
|
| | | CalcOfficialRankAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | PlayerOnline.GetOnlinePlayer(curPlayer).RefreshRoleAttr()
|
| | | return
|
| | |
|
| | | def AddRealmTaskValue(curPlayer, taskType, addValue):
|