10019 【砍树】回合战斗(根据地图处理默认视野)
| | |
| | | DWORD _MapID; //地图ID
|
| | | BYTE CanRide; //可否骑乘
|
| | | BYTE CanOutPet; //可否召唤宠物
|
| | | DWORD SightType; //视野类型
|
| | | };
|
| | |
|
| | | //副本总表
|
| | |
| | |
|
| | | #公共视野层级
|
| | | SightLevel_Public = 1
|
| | |
|
| | | #视野类型
|
| | | SightType_Public = 0 # 公共
|
| | | SightType_Private = 1 # 私有
|
| | | #---------------------------------------------------------------------
|
| | | #NPC刷新时间间隔
|
| | | TYPE_NPC_Tick_ProcessAI = 0 #NPC逻辑调用间隔
|
| | |
| | | ("DWORD", "MapID", 1),
|
| | | ("BYTE", "CanRide", 0),
|
| | | ("BYTE", "CanOutPet", 0),
|
| | | ("DWORD", "SightType", 0),
|
| | | ),
|
| | |
|
| | | "FBFunc":(
|
| | |
| | | def __init__(self): |
| | | self.MapID = 0
|
| | | self.CanRide = 0
|
| | | self.CanOutPet = 0 |
| | | self.CanOutPet = 0
|
| | | self.SightType = 0 |
| | | return |
| | | |
| | | def GetMapID(self): return self.MapID # 地图ID
|
| | | def GetCanRide(self): return self.CanRide # 可否骑乘
|
| | | def GetCanOutPet(self): return self.CanOutPet # 可否召唤宠物 |
| | | def GetCanOutPet(self): return self.CanOutPet # 可否召唤宠物
|
| | | def GetSightType(self): return self.SightType # 视野类型 |
| | | |
| | | # 副本总表 |
| | | class IPY_FBFunc(): |
| | |
| | | GameWorld.DebugLog(" attrName=%s,value=%s,setValue=%s,%s" % (attrName, value, setValue, attrOwner), playerID)
|
| | |
|
| | | return
|
| | | |
| | |
|
| | | def GetMapSightType():
|
| | | ## 获取地图视野类型
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", mapID)
|
| | | if not ipyMapData:
|
| | | return ChConfig.SightType_Public
|
| | | return ipyMapData.GetSightType()
|
| | |
| | | if realmDifficulty:
|
| | | GameWorld.DebugLog("===登录本服地图时,处于境界难度地图,自动设置难度! realmDifficulty=%s" % realmDifficulty, curPlayer.GetPlayerID())
|
| | | PlayerControl.SetRealmDifficulty(curPlayer, realmDifficulty)
|
| | | else:
|
| | | PlayerControl.SetPlayerSightLevelByMap(curPlayer)
|
| | |
|
| | | PlayerState.ChangePlayerSigh(curPlayer, tick)
|
| | |
|
| | |
| | | if realmDifficulty:
|
| | | GameWorld.DebugLog("===本服LoadMapOK时玩家处于境界难度地图,自动设置难度!realmDifficulty=%s" % realmDifficulty, curPlayer.GetPlayerID())
|
| | | PlayerControl.SetRealmDifficulty(curPlayer, realmDifficulty)
|
| | | |
| | | else:
|
| | | PlayerControl.SetPlayerSightLevelByMap(curPlayer)
|
| | | curPlayer.RefreshView()
|
| | | curPlayer.SetVisible(True)
|
| | |
|
| | |
| | | sightLevel = realmDifficulty
|
| | | GameWorld.DebugLog("境界地图自动设置已选择的境界难度视野: sightLevel=%s" % sightLevel)
|
| | |
|
| | | mapSightType = GameMap.GetMapSightType()
|
| | | if mapSightType == ChConfig.SightType_Private:
|
| | | sightLevel = curPlayer.GetPlayerID() # 强制为私有层级
|
| | | |
| | | curPlayer.SetSightLevel(sightLevel)
|
| | | rolePet = curPlayer.GetPetMgr().GetFightPet()
|
| | | #无出战宠物
|
| | |
| | | if not curSummon:
|
| | | continue
|
| | | curSummon.SetSightLevel(sightLevel)
|
| | | return |
| | | return
|
| | |
|
| | | def SetPlayerSightLevelByMap(curPlayer):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | sightLevel = playerSightLevel = curPlayer.GetSightLevel()
|
| | | mapSightType = GameMap.GetMapSightType()
|
| | | if mapSightType == ChConfig.SightType_Private:
|
| | | sightLevel = playerID
|
| | | else:
|
| | | # 默认公共视野 ChConfig.SightType_Public
|
| | | if playerSightLevel == playerID:
|
| | | sightLevel = 0 # 私人视野强制改为公共视野
|
| | | else:
|
| | | # 公共视野遵循其他自定义视野层级逻辑
|
| | | return
|
| | | |
| | | if sightLevel == playerSightLevel:
|
| | | return
|
| | | GameWorld.DebugLog("地图切换玩家视野: mapSightType=%s,playerSightLevel=%s to sightLevel=%s" |
| | | % (mapSightType, playerSightLevel, sightLevel), playerID)
|
| | | SetPlayerSightLevel(curPlayer, sightLevel)
|
| | | return
|