hch
2019-05-25 d3115b04ecd4b349327482b3a0be41fae1673cae
6942 【后端】视野层级设计
7个文件已修改
27 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/SummonNPC_Attack_SummonNPC.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameObj.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -768,6 +768,9 @@
        #GameWorld.Log("defender = %s->%s 这个对象不可攻击"%(defender.GetName(),defender.GetID()))
        return False
    
    if attacker.GetSightLevel() != defender.GetSightLevel():
        return False
    atkObjType = attacker.GetGameObjType()
    defObjType = defender.GetGameObjType()
    # 如果是玩家 打 NPC
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/SummonNPC_Attack_SummonNPC.py
@@ -73,10 +73,17 @@
        return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_None
    
    if curPlayer != None and curTagPlayer != None :
        #私有木桩只能自己打自己的
        if curTagSummon.GetType() in [ChConfig.ntPriWoodPilePVE, ChConfig.ntPriWoodPilePVP]:
            if not GameWorld.IsSameObj(curPlayer, curTagPlayer):
                return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_None
            return ChConfig.Type_Relation_Enemy , ChConfig.Def_PASysMessage_None
        #同一玩家不互相攻击
        if GameWorld.IsSameObj(curPlayer, curTagPlayer):
            return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_None
        
        #检查攻击模式
        if not AttackCommon.CheckPlayerAttackMode_Player(curPlayer, curTagPlayer):
            return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_AttackMode
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
@@ -1097,6 +1097,9 @@
    if curObjType not in hurtTypeList:
        return None, None
    
    if attacker.GetSightLevel() != curObj.GetSightLevel():
        return None, None
    #攻击对象
    if not curTag:
        curTag = GameWorld.GetObj(curObj.GetID(), curObjType)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
@@ -7294,10 +7294,10 @@
    visible = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
    if visible:
        curPlayer.SetVisible(True)
        curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)
        curPlayer.SetSightLevel(0)
    else:
        curPlayer.SetVisible(False)
        curPlayer.SetSight(0)
        curPlayer.SetSightLevel(curPlayer.GetID())
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameObj.py
@@ -443,6 +443,8 @@
    def GetVisible(self): return _IPY_GameObj.IPY_GameObj_GetVisible(self)
    def SetIsBlind(self, *args): return _IPY_GameObj.IPY_GameObj_SetIsBlind(self, *args)
    def GetIsBlind(self): return _IPY_GameObj.IPY_GameObj_GetIsBlind(self)
    def SetSightLevel(self, *args): return _IPY_GameObj.IPY_GameObj_SetSightLevel(self, *args)
    def GetSightLevel(self): return _IPY_GameObj.IPY_GameObj_GetSightLevel(self)
    def CanSeeOther(self, *args): return _IPY_GameObj.IPY_GameObj_CanSeeOther(self, *args)
    def RefreshView(self): return _IPY_GameObj.IPY_GameObj_RefreshView(self)
    def UpdatePos(self): return _IPY_GameObj.IPY_GameObj_UpdatePos(self)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -1035,7 +1035,7 @@
    #刷新玩家的视野
    if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
        GameWorld.DebugLog("===登录本服地图时,处于跨服或自定义场景状态,不刷新视野!", curPlayer.GetPlayerID())
        curPlayer.SetSight(0)
        curPlayer.SetSightLevel(curPlayer.GetID())
    elif curPlayer.GetLV() > 1:
        PlayerState.ChangePlayerSigh(curPlayer, tick)
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py
@@ -498,7 +498,7 @@
    
    curPlayer.SetCanAttack(False)
    curPlayer.SetVisible(False)
    curPlayer.SetSight(0)
    curPlayer.SetSightLevel(curPlayer.GetID())
    curPet = curPlayer.GetPetMgr().GetFightPet()
    if curPet:
        curPet.SetVisible(False)
@@ -518,9 +518,9 @@
    ## 退出自定义场景状态
    curPlayer.SetCanAttack(True)
    curPlayer.SetVisible(True)
    curPlayer.SetSight(0)
    curPlayer.SetSightLevel(curPlayer.GetID())
    curPlayer.RefreshView()
    curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)
    curPlayer.SetSightLevel(0)
    curPlayer.RefreshView()
    curPet = curPlayer.GetPetMgr().GetFightPet()
    if curPet: