| | |
| | |
|
| | | if not isDead:
|
| | | if refreshInterval and tick - curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_LastRefreshHurtTick) < refreshInterval:
|
| | | return self.__GetAtkObjByHurtList()
|
| | | return self.__GetAtkObjByHurtList(isDead)
|
| | |
|
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_LastRefreshHurtTick, tick)
|
| | |
|
| | |
| | |
|
| | | isInHurt = self.__hurtSortList != []
|
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_InHurtProtect, isInHurt)
|
| | | return self.__GetAtkObjByHurtList()
|
| | | return self.__GetAtkObjByHurtList(isDead)
|
| | |
|
| | | def __UnAssistPlayerHurtValidLogic(self, playerID, refreshPoint, tick):
|
| | | ## 非协助玩家伤血有效性检查逻辑
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def __GetAtkObjByHurtList(self):
|
| | | def __GetAtkObjByHurtList(self, isDead):
|
| | | '''第一个可攻击的最大伤血对象,也是实际的归属者或队伍
|
| | | 因为玩家伤血掉线、死亡有一定时间的保留机制,故最大伤血不一定是可攻击目标(归属者)
|
| | | 注意: 该规则必须与最终算归属的规则一致,不然可能导致归属错乱
|
| | |
| | | atkPlayer, atkHurtType, atkHurtID = None, 0, 0
|
| | | curNPC = self.curNPC
|
| | | refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
|
| | | for hurtObj in self.__hurtSortList:
|
| | | for rank, hurtObj in enumerate(self.__hurtSortList, 1):
|
| | |
|
| | | hurtID = hurtObj.GetValueID()
|
| | | hurtType = hurtObj.GetValueType()
|
| | |
| | | else:
|
| | | continue
|
| | |
|
| | | playerDisableReason = {}
|
| | | maxHurtValue = 0
|
| | | for playerID in playerIDList:
|
| | |
|
| | |
| | | continue
|
| | |
|
| | | if player.GetHP() <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | playerDisableReason[playerID] = "dead"
|
| | | continue
|
| | |
|
| | | if not player.GetVisible() or player.GetSightLevel() != curNPC.GetSightLevel():
|
| | | playerDisableReason[playerID] = "no visible or sightLevel different"
|
| | | continue
|
| | |
|
| | | if not self.__GetIsInRefreshPoint(player.GetPosX(), player.GetPosY(), refreshPoint):
|
| | | playerDisableReason[playerID] = "not in boss area"
|
| | | continue
|
| | |
|
| | | if playerID not in self.__hurtPlayerDict:
|
| | | playerDisableReason[playerID] = "no hurt"
|
| | | continue
|
| | | hurtPlayer = self.__hurtPlayerDict[playerID]
|
| | | hurtValue = hurtPlayer.GetHurtValue()
|
| | |
| | |
|
| | | if maxHurtValue:
|
| | | return atkPlayer, atkHurtType, atkHurtID
|
| | | |
| | | if rank == 1 and isDead:
|
| | | GameWorld.Log("boss死亡时,第一名团队没有归属权! playerDisableReason=%s" % playerDisableReason)
|
| | |
|
| | | return atkPlayer, atkHurtType, atkHurtID
|
| | |
|
| | |
| | | return True
|
| | |
|
| | | def RefreshHurtList(curNPC, tick, refreshInterval=3000, isDead=False):
|
| | | ## 刷新伤血列表
|
| | | # @return: atkPlayer, ownerType, ownerID
|
| | | defendHurtList = GetPlayerHurtList(curNPC)
|
| | | if not defendHurtList:
|
| | | return
|