| | |
| | | import BattleObj
|
| | | import TurnAttack
|
| | | import PyGameData
|
| | | import SkillCommon
|
| | | import ShareDefine
|
| | | import PlayerPreset
|
| | | import PlayerControl
|
| | |
| | | import ChEquip
|
| | |
|
| | | import time
|
| | |
|
| | | g_calcDetail = 0
|
| | |
|
| | | class LineupHero():
|
| | | ## 阵容武将,注意:同一个武将在不同阵容中可能属性不一样
|
| | |
| | | horseAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Horse)
|
| | | beautyAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Beauty)
|
| | | minggeAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Mingge, mgPresetID)
|
| | | mgSkillLVDict = olPlayer.GetCalcSpecInfo(ChConfig.Def_CalcAttr_Mingge, mgPresetID)
|
| | | dingjungeAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Dingjunge) if exclusiveMapID == ChConfig.Def_FBMapID_Dingjunge else {}
|
| | |
|
| | | GameWorld.DebugLog(" 国家武将统计=%s" % countryHeroInfo, playerID)
|
| | |
| | | GameWorld.DebugLog(" 主幻境阁属性=%s" % hjgAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公坐骑属性=%s" % horseAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公红颜属性=%s" % beautyAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公命格属性=%s,mgPresetID=%s" % (minggeAttrDict, mgPresetID), playerID)
|
| | | GameWorld.DebugLog(" 主公命格属性=%s,技能:%s,mgPresetID=%s" % (minggeAttrDict, mgSkillLVDict, mgPresetID), playerID)
|
| | | GameWorld.DebugLog(" 定军专属属性=%s" % dingjungeAttrDict, playerID)
|
| | | effCardAddPer = heroPreset.GetEffCardAddPer()
|
| | | effCardAddPer /= 10000.0
|
| | |
| | | OfficialLV = curPlayer.GetOfficialRank()
|
| | | GameWorld.DebugLog(" PlayerLV=%s,OfficialLV=%s" % (PlayerLV, OfficialLV), playerID)
|
| | |
|
| | | mgSkillFightPower = 0
|
| | | for skillTypeID, skillLV in mgSkillLVDict.items():
|
| | | skillID = SkillCommon.GetSkillIDBySkillTypeID(skillTypeID, skillLV)
|
| | | skillData = IpyGameDataPY.GetIpyGameData("Skill", skillID)
|
| | | if not skillData:
|
| | | continue
|
| | | paramDict = {"SkillPower":skillData.GetFightPower(), "PlayerLV":PlayerLV, "OfficialLV":OfficialLV}
|
| | | sFightPower = FormulaControl.Eval("skillFPFormula", skillFPFormula, paramDict, toInt=True)
|
| | | mgSkillFightPower += sFightPower
|
| | | if mgSkillLVDict:
|
| | | GameWorld.DebugLog(" 命格技能战力=%s,mgSkillLVDict=%s" % (mgSkillFightPower, mgSkillLVDict), playerID)
|
| | | |
| | | fpRatioIpyData = IpyGameDataPY.GetIpyGameData("FightPowerRatio", OfficialLV)
|
| | |
|
| | | lineupFightPower = 0 # 阵容总战力
|
| | | lineupFightPower += mgSkillFightPower
|
| | | |
| | | for heroID, selfAttrDict in heroSelfAttrInfo.items():
|
| | | lineupHero = presetLineup.GetLineupHeroByID(heroID)
|
| | | if not lineupHero:
|
| | |
| | | attrValue = FormulaControl.Eval("baseAttrFormula", baseAttrFormula, attrParamDict, toInt=False, ndigits=3)
|
| | | else:
|
| | | attrValue = FormulaControl.Eval("otherAttrFormula", otherAttrFormula, attrParamDict, toInt=False, ndigits=3)
|
| | | #GameWorld.DebugLog(" attrID=%s,attrValue=%s,attrParamDict=%s" % (attrID, attrValue, attrParamDict))
|
| | | |
| | | # 前端对比刷属性明细时需要
|
| | | if g_calcDetail and attrValue > 0:
|
| | | calcParamDict = {}
|
| | | for k, v in attrParamDict.items():
|
| | | if not v or (k == "inheritPer" and v == 1):
|
| | | continue
|
| | | calcParamDict[k] = v
|
| | | GameWorld.DebugLogEx(" heroID=%s,attrID=%s,attrValue=%s,%s", heroID, attrID, attrValue, calcParamDict)
|
| | | |
| | | attrIpyData = IpyGameDataPY.GetIpyGameData("PlayerAttr", attrID)
|
| | | attrName = attrIpyData.GetParameter() if attrIpyData else "%s" % attrID
|
| | | attrRatioName = "%sRatio" % attrName
|
| | |
| | | faction, num = ChConfig.Def_FactionA, 1 # 主线战斗玩家自己默认阵营A的第1个战斗阵容
|
| | | batLineup = mainTurnFight.getBatFaction(faction).getBatlineup(num)
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for posNum, objID in batLineup.posObjIDDict.items():
|
| | | for posNum, objID in batLineup.getPosObjIDDict().items():
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | continue
|
| | | if batObj.GetBatObjType() != ChConfig.BatObjType_BatHero:
|
| | | continue
|
| | | lineupHero = presetLineup.GetLineupHero(posNum)
|
| | | if lineupHero.heroBatAttrDict:
|
| | | batObj.UpdInitBatAttr(lineupHero.heroBatAttrDict, lineupHero.heroSkillIDList)
|