9652 【越南】【yn_ver1】【主干】【qkbt52】【x7bt5】【bt7】增加共享视野层(仙盟boss、骑宠boss支持共享视野层)
8个文件已修改
67 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/KillScreenNPC.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_HorsePetBoss.py 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtMgr.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -746,6 +746,15 @@
#--------------------------------------------------------------------------
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()
#--------攻击对象判断,给内层调用
## 攻击对象,通用判断 
@@ -763,7 +772,7 @@
        #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()
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
@@ -1103,7 +1103,7 @@
    if curObjType not in hurtTypeList:
        return None, None
    
    if attacker.GetSightLevel() != curObj.GetSightLevel():
    if not AttackCommon.CheckSightLevel(attacker, curObj):
        return None, None
    
    #攻击对象
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -2407,6 +2407,9 @@
Def_PlayerSight_Hack = 3    #外挂玩家视野
Def_PlayerInSightObjCount_Default = 30
#公共视野层级
SightLevel_Public = 1
#---------------------------------------------------------------------
#NPC刷新时间间隔
TYPE_NPC_Tick_ProcessAI = 0           #NPC逻辑调用间隔
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/KillScreenNPC.py
@@ -86,7 +86,7 @@
        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)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py
@@ -42,6 +42,8 @@
FBDict_EncourageCnt = 'FBDict_EncourageCnt'  #鼓舞过次数
Map_FB_StartTick = 'Map_FB_StartTick' #活动开始时间
Map_SightLevelCounter = 'Map_SightLevelCounter' #视野层级人数计数器
(
    Def_BossTime,  #BOSS时间
    Def_LeaveTime,  #离开时间
@@ -128,6 +130,7 @@
    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):
@@ -173,7 +176,14 @@
    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]:
@@ -508,7 +518,14 @@
    __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()
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_HorsePetBoss.py
@@ -36,6 +36,8 @@
FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
Map_FB_StartTick = 'Map_FB_StartTick' #活动开始时间
Map_SightLevelCounter = 'Map_SightLevelCounter' #视野层级人数计数器
(
Def_BossTime,  #BOSS时间
Def_LeaveTime,  #离开时间
@@ -105,6 +107,7 @@
    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:
@@ -148,7 +151,14 @@
        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)
@@ -446,6 +456,14 @@
    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)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
@@ -543,7 +543,7 @@
                        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)
@@ -691,7 +691,7 @@
                    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
                
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtMgr.py
@@ -239,7 +239,7 @@
        '''第一个可攻击的最大伤血对象
        @return: atkPlayer, hurtType, hurtID
        '''
        import AttackCommon
        atkPlayer, atkHurtType, atkHurtID = None, 0, 0
        curNPC = self.curNPC
        refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
@@ -262,7 +262,7 @@
                    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