| | |
| | | if strengthenPlayerCnt:
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | dataMapID = FBCommon.GetRecordMapID(mapID)
|
| | | formulaKey = "MapCoefficient_%s" % mapID
|
| | | playerCntAttrCoefficient = playerCntCoefficient.get(mapID, {})
|
| | | if not playerCntAttrCoefficient and dataMapID in playerCntCoefficient:
|
| | | playerCntAttrCoefficient = playerCntCoefficient[dataMapID]
|
| | | formulaKey = "MapCoefficient_%s" % dataMapID
|
| | | if npcID in npcIDPlayerCntCoefficient:
|
| | | playerCntAttrCoefficient = npcIDPlayerCntCoefficient[npcID]
|
| | | formulaKey = "NPCCoefficient_%s" % npcID
|
| | | for attrKey, coefficientDict in playerCntAttrCoefficient.items():
|
| | | if attrKey in attrDict:
|
| | | attrValue = attrDict[attrKey]
|
| | |
| | | if not hasattr(npcData, attrFuncName):
|
| | | continue
|
| | | attrValue = getattr(npcData, attrFuncName)()
|
| | | coefficient = GameWorld.GetDictValueByRangeKey(coefficientDict, strengthenPlayerCnt, 1)
|
| | | # 按字典配置
|
| | | if isinstance(coefficientDict, dict):
|
| | | coefficient = GameWorld.GetDictValueByRangeKey(coefficientDict, strengthenPlayerCnt, 1)
|
| | | # 按公式配置
|
| | | elif isinstance(coefficientDict, str):
|
| | | formulaKey = "%s_%s" % (formulaKey, attrKey)
|
| | | coefficient = eval(FormulaControl.GetCompileFormula(formulaKey, coefficientDict))
|
| | | else:
|
| | | coefficient = 1
|
| | | attrDict[attrKey] = int(attrValue * coefficient)
|
| | |
|
| | | #GameWorld.DebugLog("计算NPC属性成长: npcID=%s,strengthenLV=%s,strengthenPlayerCnt=%s,baseMaxHP=%s,attrDict=%s"
|
| | |
| | | self.__AllKillerDict, curTeam, hurtType, hurtID = self.__FindNPCKillerInfo(isGameBoss)
|
| | | self.__OwnerHurtType, self.__OwnerHurtID = hurtType, hurtID
|
| | | if isGameBoss:
|
| | | GameWorld.Log("npcID=%s,hurtType=%s,hurtID=%s" % (npcID, hurtType, hurtID))
|
| | | GameWorld.Log("__GiveObjPrize npcID=%s,hurtType=%s,hurtID=%s" % (npcID, hurtType, hurtID))
|
| | |
|
| | | #最后一击处理
|
| | | self.__DoLastTimeHurtLogic()
|
| | |
| | | curTeamPlayer.GetPosY()) > ChConfig.Def_Team_GetExpScreenDist:
|
| | | if isLog:
|
| | | GameWorld.Log(" i=%s, 队员超出指定距离!memPlayerID=%s,npcPos(%s,%s),playerPos(%s,%s)"
|
| | | % (i, curTeamPlayer.GetPlayerID(), curNPC.GetPosX(), curNPC.GetPosY(), curPlayer.GetPosX(), curPlayer.GetPosY()))
|
| | | % (i, curTeamPlayer.GetPlayerID(), curNPC.GetPosX(), curNPC.GetPosY(), curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY()))
|
| | | continue
|
| | |
|
| | | hurtObjTuple = (None, curTeam)
|