fix:修复部分NPC血量超过亿用错接口导致逻辑异常问题,如AI根据血量释放技能
| | |
| | | #根据副本需求, 过滤NPC
|
| | | for curNPC in gameNPCList:
|
| | | #尸体不处理
|
| | | if curNPC.GetHP() <= 0:
|
| | | if GameObj.GetHP(curNPC) <= 0:
|
| | | continue
|
| | |
|
| | | #召唤兽特殊判断
|
| | |
| | | import NPCCommon
|
| | | import BuffSkill
|
| | | import ChNPC
|
| | |
|
| | | import GameObj
|
| | | import random
|
| | |
|
| | | #当前副本地图的状态
|
| | |
| | |
|
| | | objID = curNPC.GetID()
|
| | | npcID = curNPC.GetNPCID()
|
| | | g_curBossDict["%s_%s" % (objID, npcID)] = [objID, npcID, curNPC.GetHP(), curNPC.GetMaxHP(), |
| | | g_curBossDict["%s_%s" % (objID, npcID)] = [objID, npcID, GameObj.GetHP(curNPC), GameObj.GetMaxHP(curNPC), |
| | | curNPC.GetPosX(), curNPC.GetPosY()]
|
| | |
|
| | | __CheckOutTimeBuff(tick)
|
| | |
| | | hpPerList = sorted(hpPerDict.keys(), reverse = True)
|
| | | maxBuffCnt = bossBuffInfo[2]
|
| | |
|
| | | nowHPPer = defender.GetHP() * 100 / defender.GetMaxHP() # 当前百分比
|
| | | nowHPPer = GameObj.GetHP(defender) * 100 / GameObj.GetMaxHP(defender) # 当前百分比
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | hpPerMarkKey = FBDict_BossHPPerMark % (objID, npcID)
|
| | | hpPerLogicMark = gameFB.GetGameFBDictByKey(hpPerMarkKey)
|
| | |
| | | # @return 布尔值
|
| | | def CheckSkillTrigger(curNPC, triggerDict, npcSkillindex, tick):
|
| | | skillInfo = triggerDict.get(npcSkillindex)
|
| | |
|
| | | if skillInfo != None:
|
| | | #当前血量
|
| | | hpPercent = int(curNPC.GetHP()/float(GameObj.GetMaxHP(curNPC))*100)
|
| | | hpPercent = int(GameObj.GetHP(curNPC)/float(GameObj.GetMaxHP(curNPC))*100)
|
| | | checkHP = skillInfo[0]
|
| | |
|
| | | #血量未到
|
| | |
| | | self.__AddAngryValue(npcAngry, curObjID, curObjType, plusAngryValue, canPile)
|
| | |
|
| | | #激活呆滞的NPC
|
| | | if curNPC.GetHP() > 0 and not curNPC.GetIsNeedProcess() :
|
| | | if GameObj.GetHP(curNPC) > 0 and not curNPC.GetIsNeedProcess() :
|
| | | curNPC.SetIsNeedProcess(True)
|
| | |
|
| | |
|