9652 【越南】【yn_ver1】【主干】【qkbt52】【x7bt5】【bt7】增加共享视野层(仙盟boss、骑宠boss支持共享视野层)
| | |
| | |
|
| | | #--------------------------------------------------------------------------
|
| | |
|
| | | def CheckSightLevel(attacker, defender):
|
| | | ## 判断是否可视视野层级
|
| | | # @return 是否在可视视野层
|
| | | if not attacker.GetVisible() or not defender.GetVisible():
|
| | | return False
|
| | | if defender.GetSightLevel() == ChConfig.SightLevel_Public or attacker.GetSightLevel() == ChConfig.SightLevel_Public:
|
| | | return True
|
| | | return attacker.GetSightLevel() == defender.GetSightLevel()
|
| | |
|
| | | #--------攻击对象判断,给内层调用
|
| | |
|
| | | ## 攻击对象,通用判断
|
| | |
| | | #GameWorld.Log("defender = %s->%s 这个对象不可攻击"%(defender.GetName(),defender.GetID()))
|
| | | return False
|
| | |
|
| | | if attacker.GetSightLevel() != defender.GetSightLevel():
|
| | | if not CheckSightLevel(attacker, defender):
|
| | | return False
|
| | |
|
| | | atkObjType = attacker.GetGameObjType()
|
| | |
| | | if curObjType not in hurtTypeList:
|
| | | return None, None
|
| | |
|
| | | if attacker.GetSightLevel() != curObj.GetSightLevel():
|
| | | if not AttackCommon.CheckSightLevel(attacker, curObj):
|
| | | return None, None
|
| | |
|
| | | #攻击对象
|
| | |
| | | Def_PlayerSight_Hack = 3 #外挂玩家视野
|
| | |
|
| | | Def_PlayerInSightObjCount_Default = 30
|
| | |
|
| | | #公共视野层级
|
| | | SightLevel_Public = 1
|
| | | #---------------------------------------------------------------------
|
| | | #NPC刷新时间间隔
|
| | | TYPE_NPC_Tick_ProcessAI = 0 #NPC逻辑调用间隔
|
| | |
| | | return
|
| | | if not curNPC.GetVisible():
|
| | | return
|
| | | if curPlayer.GetSightLevel() != curNPC.GetSightLevel():
|
| | | if not AttackCommon.CheckSightLevel(curPlayer, curNPC):
|
| | | return
|
| | | curHP = GameObj.GetHP(curNPC)
|
| | | AttackCommon.NPCAddObjInHurtList(curPlayer, curNPC, curHP, curHP)
|
| | |
| | | FBDict_EncourageCnt = 'FBDict_EncourageCnt' #鼓舞过次数
|
| | | Map_FB_StartTick = 'Map_FB_StartTick' #活动开始时间
|
| | |
|
| | | Map_SightLevelCounter = 'Map_SightLevelCounter' #视野层级人数计数器
|
| | |
|
| | | (
|
| | | Def_BossTime, #BOSS时间
|
| | | Def_LeaveTime, #离开时间
|
| | |
| | | if state:
|
| | | if not GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick):
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, tick)
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_SightLevelCounter, 0)
|
| | | else:
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, 0)
|
| | | if not GameWorld.GetGameFB().GetGameFBDictByKey(FBDict_IsOver):
|
| | |
| | | if fbStep >= FB_Step_Over:
|
| | | PlayerControl.PlayerLeaveFB(curPlayer)
|
| | | return
|
| | |
|
| | | |
| | | sightPlayerCount = IpyGameDataPY.GetFuncCfg("LeagueBOSSSight", 1)
|
| | | counter = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_SightLevelCounter) + 1
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_SightLevelCounter, counter)
|
| | | sightLevel = (counter - 1) / sightPlayerCount + 10 # 自定义视野层级从10开始,1为公共视野层
|
| | | PlayerControl.SetPlayerSightLevel(curPlayer, sightLevel)
|
| | | GameWorld.DebugLog("counter=%s,SetPlayerSightLevel=%s" % (counter, sightLevel), playerID)
|
| | | |
| | | if familyID not in PyGameData.g_allfamilyBossDict:
|
| | | PyGameData.g_allfamilyBossDict[familyID] = [curPlayer.GetFamilyName(), 0, [playerID]]
|
| | | elif playerID not in PyGameData.g_allfamilyBossDict[familyID][2]:
|
| | |
| | | __DoLogicAllFamilyBossOver(1, tick, dropPosX, dropPosY)
|
| | | return
|
| | |
|
| | |
|
| | | def DoFBRebornNPC(curNPC, tick):
|
| | | ##副本有NPC召出
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | bossID = CurFBLineBOSSID(lineID)
|
| | | if curNPC.GetNPCID() == bossID:
|
| | | curNPC.SetSightLevel(ChConfig.SightLevel_Public) # 设置boss为公共视野层级
|
| | | |
| | | return
|
| | |
|
| | | def GetBossRemainHPPer(copyMapID, tick):
|
| | | bossID = CurFBLineBOSSID()
|
| | |
| | | FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
|
| | | Map_FB_StartTick = 'Map_FB_StartTick' #活动开始时间
|
| | |
|
| | | Map_SightLevelCounter = 'Map_SightLevelCounter' #视野层级人数计数器
|
| | |
|
| | | (
|
| | | Def_BossTime, #BOSS时间
|
| | | Def_LeaveTime, #离开时间
|
| | |
| | | if state:
|
| | | if not GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick):
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, tick)
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_SightLevelCounter, 0)
|
| | | else:
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, 0)
|
| | | if GameWorld.GetGameFB().GetFBStep() == FB_Step_Fighting:
|
| | |
| | | if fbStep == FB_Step_Open:
|
| | | FBCommon.SetFBStep(FB_Step_Fighting, tick)
|
| | | UpdateHurtInfo(curPlayer, 0, True)
|
| | | |
| | | |
| | | sightPlayerCount = IpyGameDataPY.GetFuncCfg("HorsePetBOSSSight", 1)
|
| | | counter = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_SightLevelCounter) + 1
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_SightLevelCounter, counter)
|
| | | sightLevel = (counter - 1) / sightPlayerCount + 10 # 自定义视野层级从10开始,1为公共视野层
|
| | | PlayerControl.SetPlayerSightLevel(curPlayer, sightLevel)
|
| | | GameWorld.DebugLog("counter=%s,SetPlayerSightLevel=%s" % (counter, sightLevel), playerID)
|
| | | |
| | | gameFB = GameWorld.GetGameFB()
|
| | | # 上鼓舞buff
|
| | | encourageLV = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_EncourageLV)
|
| | |
| | | GameWorld.GetGameFB().SetGameFBDict(FBDict_IsOver, tick)
|
| | | return
|
| | |
|
| | | def DoFBRebornNPC(curNPC, tick):
|
| | | ##副本有NPC召出
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | bossID = CurFBLineBOSSID(lineID)
|
| | | if curNPC.GetNPCID() == bossID:
|
| | | curNPC.SetSightLevel(ChConfig.SightLevel_Public) # 设置boss为公共视野层级
|
| | | |
| | | return
|
| | |
|
| | | def GetBossRemainHPPer(copyMapID, funcLineID, tick):
|
| | | bossID = CurFBLineBOSSID(funcLineID)
|
| | |
| | | GameWorld.Log(" 非协助伤血玩家没有攻击boss次数,不计!playerID=%s" % playerID, self.npcID, self.lineID)
|
| | | return False
|
| | |
|
| | | if player.GetInitOK() and (not player.GetVisible() or player.GetSightLevel() != self.curNPC.GetSightLevel()):
|
| | | if player.GetInitOK() and (not player.GetVisible() or not AttackCommon.CheckSightLevel(player, self.curNPC)):
|
| | | GameWorld.DebugLog("伤血玩家不可见,不计!playerID=%s" % playerID, self.npcID, self.lineID)
|
| | | if self.logDetail:
|
| | | GameWorld.Log(" 伤血玩家不可见,不计!playerID=%s" % playerID, self.npcID, self.lineID)
|
| | |
| | | playerDisableReason[playerID] = "dead"
|
| | | continue
|
| | |
|
| | | if not player.GetVisible() or player.GetSightLevel() != curNPC.GetSightLevel():
|
| | | if not player.GetVisible() or not AttackCommon.CheckSightLevel(player, curNPC):
|
| | | playerDisableReason[playerID] = "no visible or sightLevel different"
|
| | | continue
|
| | |
|
| | |
| | | '''第一个可攻击的最大伤血对象
|
| | | @return: atkPlayer, hurtType, hurtID
|
| | | '''
|
| | | |
| | | import AttackCommon
|
| | | atkPlayer, atkHurtType, atkHurtID = None, 0, 0
|
| | | curNPC = self.curNPC
|
| | | refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
|
| | |
| | | playerDisableReason[playerID] = "dead"
|
| | | continue
|
| | |
|
| | | if not player.GetVisible() or player.GetSightLevel() != curNPC.GetSightLevel():
|
| | | if not player.GetVisible() or not AttackCommon.CheckSightLevel(player, curNPC):
|
| | | playerDisableReason[playerID] = "no visible or sightLevel different"
|
| | | continue
|
| | |
|