| | |
| | | #
|
| | | ##@package GM.Commands.PrintFightPower
|
| | | #
|
| | | # @todo:显示战力明细
|
| | | # @todo:输出阵容战力
|
| | | # @author hxp
|
| | | # @date 2018-01-31
|
| | | # @date 2025-07-21
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 显示战力明细
|
| | | # 详细描述: 输出阵容战力
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-01-31 20:00"""
|
| | | #"""Version = 2025-07-21 14:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import PlayerControl
|
| | |
|
| | | import PlayerOnline
|
| | | import ShareDefine
|
| | | import ChConfig
|
| | |
|
| | | #逻辑实现
|
| | | ## GM命令执行入口
|
| | |
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(curPlayer, msgList):
|
| | | mfpTypeName = ChConfig.MFPTypeName
|
| | |
|
| | | funcIndexName = ChConfig.FuncIndexName
|
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "PrintFightPower 模块类型(可选)")
|
| | | |
| | | if msgList:
|
| | | mfpType = msgList[0]
|
| | | if mfpType not in mfpTypeName:
|
| | | return
|
| | | fightPower = PlayerControl.GetMFPFightPower(curPlayer, mfpType)
|
| | | GameWorld.DebugAnswer(curPlayer, "--- %s战力(%s): %s" % (mfpTypeName[mfpType], mfpType, fightPower))
|
| | | for funcIndex in ChConfig.MFPTypeAttrFuncIndexDict[mfpType]:
|
| | | funcName = funcIndexName.get(funcIndex, "属性(%s)" % funcIndex)
|
| | | attrInfo, insidePerAttrDict, customAttrDict = PlayerControl.GetCalcAttrListValue(curPlayer, funcIndex)
|
| | | GameWorld.DebugAnswer(curPlayer, "%s:%s" % (funcName, attrInfo))
|
| | | if insidePerAttrDict:
|
| | | GameWorld.DebugAnswer(curPlayer, "%s内部加成:%s" % (funcName, insidePerAttrDict))
|
| | | if customAttrDict:
|
| | | GameWorld.DebugAnswer(curPlayer, "%s自定义属性:%s" % (funcName, customAttrDict))
|
| | | if not msgList:
|
| | | GameWorld.DebugAnswer(curPlayer, "PrintFightPower [阵容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))
|
| | | return
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "===== 总战力: %s" % PlayerControl.GetFightPower(curPlayer))
|
| | | for mfpType in ChConfig.MFPTypeAttrFuncIndexDict.keys():
|
| | | fightPower = PlayerControl.GetMFPFightPower(curPlayer, mfpType)
|
| | | mfpSkillFP = PlayerControl.GetMFPSkillFightPower(curPlayer, mfpType)
|
| | | mfpEx = PlayerControl.GetMFPExFightPower(curPlayer, mfpType)
|
| | | name = mfpTypeName.get(mfpType, "模块%s" % mfpType)
|
| | | if mfpSkillFP or mfpEx:
|
| | | GameWorld.DebugAnswer(curPlayer, "%s战力(%s): %s,技能:%s, Ex=%s" % (name, mfpType, fightPower, mfpSkillFP, mfpEx))
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "%s战力(%s): %s" % (name, mfpType, fightPower))
|
| | | lineupID = msgList[0]
|
| | | if lineupID not in ShareDefine.LineupList:
|
| | | GameWorld.DebugAnswer(curPlayer, "阵容(%s)不存在.")
|
| | | return
|
| | | |
| | | GameWorld.DebugAnswer(curPlayer, "-------------------")
|
| | | lineup = olPlayer.GetLineup(lineupID) |
| | | GameWorld.DebugAnswer(curPlayer, "【阵容 - %s】明细总战力: %s" % (lineupID, lineup.fightPower))
|
| | | |
| | | for calcIndex in ChConfig.Def_CalcAttrList:
|
| | | calcName = ChConfig.CalcAttrName.get(calcIndex, "%s" % calcIndex)
|
| | | attrDict = olPlayer.GetCalcAttr(calcIndex)
|
| | | attrInfo = ""
|
| | | for attrID in ChConfig.AttrIDList:
|
| | | attrValue = attrDict.get(attrID, 0)
|
| | | if not attrValue:
|
| | | continue
|
| | | if attrInfo:
|
| | | attrInfo += "; "
|
| | | attrInfo += "%s-%s" % (attrID, attrValue)
|
| | | GameWorld.DebugAnswer(curPlayer, "%s:%s" % (calcName, attrInfo))
|
| | | |
| | | posNumList = lineup.lineupHeroDict.keys()
|
| | | posNumList.sort()
|
| | | for posNum in posNumList:
|
| | | lineupHero = lineup.GetLineupHero(posNum)
|
| | | GameWorld.DebugAnswer(curPlayer, "---位置:%s,武将(%s) 战力: %s" % (posNum, lineupHero.heroID, lineupHero.fightPower))
|
| | | GameWorld.DebugAnswer(curPlayer, "技能:%s,战力:%s" % (lineupHero.heroSkillIDList, lineupHero.skillFightPower))
|
| | | attrInfo = ""
|
| | | for attrID in ChConfig.AttrIDList:
|
| | | attrValue = lineupHero.heroBatAttrDict.get(attrID, 0)
|
| | | if not attrValue:
|
| | | continue
|
| | | if attrInfo:
|
| | | attrInfo += "; "
|
| | | attrInfo += "%s-%s" % (attrID, attrValue)
|
| | | GameWorld.DebugAnswer(curPlayer, "属性:%s" % attrInfo)
|
| | |
|
| | | return
|
| | |
|