Merge 3811 【前端】前期BOSS分线修改
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HB106_tagMCNotifyPlayerMove), typeof(DTCB106_tagMCNotifyPlayerMove));
|
| | | Register(typeof(H0132_tagCreateRoleSucess), typeof(DTC0132_tagCreateRoleSucess));
|
| | | Register(typeof(HA326_tagMCNPCIDCollectionCntInfo), typeof(DTCA326_tagMCNPCIDCollectionCntInfo));
|
| | | Register(typeof(HA904_tagGCDogzNPCRefreshTime), typeof(DTCA904_tagGCDogzNPCRefreshTime));
|
| | |
| | | _player.ActorInfo.moveSpeed = 500f / vNetData.Speed;
|
| | | _player.MoveToPosition(_destPosition);
|
| | | }
|
| | |
|
| | | if(vNetData.ObjID == PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | MapTransferUtility.Instance.Clear();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | BossFakeLineUtility.Instance.lastBossNpcID = 0;
|
| | | BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup - 61;
|
| | | }
|
| | |
|
| | | if (_targetFight.NpcConfig.IsBoss > 1 && vNetData.KillerID == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | BossFakeLineUtility.Instance.RecordBossKillTime(_targetFight.NpcConfig.NPCID,System.DateTime.Now);
|
| | | }
|
| | | }
|
| | |
|
| | | _actor.SetAnimatorSpeed(1);
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, September 26, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | |
| | | public class DTCB106_tagMCNotifyPlayerMove : DtcBasic |
| | | { |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | var package = vNetPack as HB106_tagMCNotifyPlayerMove; |
| | | |
| | | if (PlayerDatas.Instance.hero == null |
| | | || package == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | MapTransferUtility.Instance.Clear(); |
| | | |
| | | if (package.NPCID != 0) |
| | | { |
| | | GAStaticDefine.NPCLocation _npcLocation; |
| | | var _findLocation = GAStaticDefine.TryGetMapNPCLocation((int)package.NPCID, out _npcLocation); |
| | | if (_findLocation) |
| | | { |
| | | Vector3 _destPos = new Vector3(_npcLocation.position.x, PlayerDatas.Instance.hero.Pos.y, _npcLocation.position.y); |
| | | PlayerDatas.Instance.hero.MoveToPosition(_destPos, _npcLocation.scope); |
| | | MapTransferUtility.Instance.MapTransferDoType = MapTransferUtility.E_MapTransferDoType.Npc; |
| | | MapTransferUtility.Instance.NpcID = (int)package.NPCID; |
| | | } |
| | | else |
| | | { |
| | | DebugEx.LogWarningFormat("找不到NPCID: {0} 在Npc刷新表中的配置", package.NPCID); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Vector3 _pos = new Vector3((package.PosX - GA_Hero.MapOffset.x) * .5f, 0, (package.PosY - GA_Hero.MapOffset.z) * .5f); |
| | | PlayerDatas.Instance.hero.MoveToPosition(_pos); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3826652b2693c1a4aba8f48340defea8 |
| | | timeCreated: 1537926963 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | BossLineStateInfo[i] = new tagGCBossShuntLineState(); |
| | | TransBytes(out BossLineStateInfo[i].BossID, vBytes, NetDataType.DWORD); |
| | | TransBytes(out BossLineStateInfo[i].DeadLineCount, vBytes, NetDataType.BYTE); |
| | | TransBytes(out BossLineStateInfo[i].DeadLineList, vBytes, NetDataType.BYTE, BossLineStateInfo[i].DeadLineCount); |
| | | TransBytes(out BossLineStateInfo[i].LineCount, vBytes, NetDataType.BYTE); |
| | | TransBytes(out BossLineStateInfo[i].LineIDList, vBytes, NetDataType.BYTE, BossLineStateInfo[i].LineCount); |
| | | TransBytes(out BossLineStateInfo[i].StateList, vBytes, NetDataType.BYTE, BossLineStateInfo[i].LineCount); |
| | | } |
| | | } |
| | | |
| | | public struct tagGCBossShuntLineState |
| | | { |
| | | public uint BossID; // bossID |
| | | public byte DeadLineCount; |
| | | public byte[] DeadLineList; // 已死亡的线路列表 |
| | | public byte LineCount; |
| | | public byte[] LineIDList; // 线路ID列表 |
| | | public byte[] StateList; // 对应状态列表, 0-被击杀,1-活着 |
| | | } |
| | | |
| | | } |
| | |
| | | TransBytes(out BossInfoList[i].RecordLen, vBytes, NetDataType.WORD); |
| | | TransBytes(out BossInfoList[i].KillRecord, vBytes, NetDataType.Chars, BossInfoList[i].RecordLen); |
| | | TransBytes(out BossInfoList[i].RefreshSecond, vBytes, NetDataType.DWORD); |
| | | TransBytes(out BossInfoList[i].RefreshCD, vBytes, NetDataType.DWORD); |
| | | } |
| | | } |
| | | |
| | |
| | | public ushort RecordLen; // 长度 |
| | | public string KillRecord; // 最近击杀记录时间玩家名size = RecordLen |
| | | public uint RefreshSecond; // 刷新倒计时, 秒 |
| | | public uint RefreshCD; // 刷新总CD时, 秒 |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 06 通知玩家向目标点移动 #tagMCNotifyPlayerMove |
| | | |
| | | public class HB106_tagMCNotifyPlayerMove : GameNetPackBasic { |
| | | public uint PosX; |
| | | public uint PosY; |
| | | public uint NPCID; //目标点寻路NPCID, 可能为0 |
| | | |
| | | public HB106_tagMCNotifyPlayerMove () { |
| | | _cmd = (ushort)0xB106; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out PosX, vBytes, NetDataType.DWORD); |
| | | TransBytes (out PosY, vBytes, NetDataType.DWORD); |
| | | TransBytes (out NPCID, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fc7982354b8dd52459548536ebb5977d |
| | | timeCreated: 1537926821 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using TableConfig; |
| | | using System; |
| | | using Snxxz.UI; |
| | | |
| | | public class BossFakeLineUtility : Singleton<BossFakeLineUtility> |
| | | { |
| | | int m_MakeFakeLineTimes = 0; |
| | | public int makeFakeLineTimes |
| | | { |
| | | public int makeFakeLineTimes { |
| | | get { return m_MakeFakeLineTimes; } |
| | | set { m_MakeFakeLineTimes = Mathf.Clamp(value, 0, int.MaxValue); } |
| | | } |
| | | |
| | | bool m_ShowFakeLine = false; |
| | | public bool showFakeLine |
| | | { |
| | | public bool showFakeLine { |
| | | get { return m_ShowFakeLine; } |
| | | set { m_ShowFakeLine = value; } |
| | | } |
| | | |
| | | public BossFakeLineUtility() |
| | | { |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += OnAccountSwitch; |
| | | } |
| | | |
| | | //这个值在初见boss和最后看见boss的时候记录,其值为time.time+1分钟,这段时间内告诉玩家其所在分线的boss的死亡情况,否则告诉玩家公共boss的死亡情况。 |
| | |
| | | } |
| | | } |
| | | |
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } |
| | | Dictionary<int, DateTime> bossKillTimes = new Dictionary<int, DateTime>(); |
| | | |
| | | public void RecordBossKillTime(int npcId, DateTime time) |
| | | { |
| | | var key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "_", npcId); |
| | | bossKillTimes[npcId] = time; |
| | | LocalSave.SetString(key, time.ToString()); |
| | | } |
| | | |
| | | public bool IsBossKilledRecently(int npcId) |
| | | { |
| | | FindPreciousModel.BossInfo bossInfo; |
| | | var totalCd = 0; |
| | | if (findPreciousModel.TryGetBossInfo(npcId, out bossInfo)) |
| | | { |
| | | totalCd = bossInfo.rebornTotalCd; |
| | | } |
| | | |
| | | if (bossKillTimes.ContainsKey(npcId)) |
| | | { |
| | | var killTime = bossKillTimes[npcId]; |
| | | if ((int)((DateTime.Now - killTime).TotalSeconds) < totalCd) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | var key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "_", npcId); |
| | | var timeString = LocalSave.GetString(key); |
| | | if (string.IsNullOrEmpty(timeString)) |
| | | { |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | var tempTime = DateTime.Now; |
| | | if (DateTime.TryParse(timeString, out tempTime)) |
| | | { |
| | | if ((int)((DateTime.Now - tempTime).TotalSeconds) < totalCd) |
| | | { |
| | | bossKillTimes[npcId] = tempTime; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | private void OnAccountSwitch() |
| | | { |
| | | bossKillTimes.Clear(); |
| | | } |
| | | |
| | | } |
| | |
| | | #region npc
|
| | | public int NpcID
|
| | | {
|
| | | get; private set;
|
| | | get; set;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | |
|
| | | MapModel _model = ModelCenter.Instance.GetModel<MapModel>();
|
| | | GActor _npc = null;
|
| | |
|
| | | // 加入判断是否世界BOSS判断
|
| | | WorldBossConfig _worldBoss = Config.Instance.Get<WorldBossConfig>(npcID);
|
| | |
|
| | | if (_findLocation)
|
| | | {
|
| | | var _mapConfig = Config.Instance.Get<MapConfig>(_npcLocation.mapId);
|
| | | // 中立地图
|
| | | if (_mapConfig.Camp == 5 && _worldBoss != null)
|
| | | {
|
| | | if (_npcLocation.mapId == PlayerDatas.Instance.baseData.MapID)
|
| | | {
|
| | | Send_WorldTransfer(_npcLocation.mapId,
|
| | | new Vector3(_hero.Pos.x * 2, 0, _hero.Pos.z * 2),
|
| | | MapTransferType.WorldTransport, 0, npcID);
|
| | | }
|
| | | else
|
| | | {
|
| | | Send_WorldTransfer(_npcLocation.mapId,
|
| | | new Vector3(_mapConfig.BornPoints[0].x, 0, _mapConfig.BornPoints[0].y),
|
| | | MapTransferType.WorldTransport, 0, npcID);
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | FairyGrabBossConfig _fairyBoss = Config.Instance.Get<FairyGrabBossConfig>(npcID);
|
| | | bool _isBoss = _worldBoss != null || _fairyBoss != null;
|
| | | if (_isBoss && _findLocation)
|
| | |
| | | BossInfo bossInfo;
|
| | | if (TryGetBossInfo(bossId, out bossInfo))
|
| | | {
|
| | | bossInfo.deadLines.Clear();
|
| | | bossInfo.deadLines.AddRange(bossLineInfo.DeadLineList);
|
| | | bossInfo.lineToAlives.Clear();
|
| | | for (var j = 0; j < bossLineInfo.LineIDList.Length; j++)
|
| | | {
|
| | | var line = bossLineInfo.LineIDList[j];
|
| | | var state = bossLineInfo.StateList[j];
|
| | | bossInfo.lineToAlives[line] = state == 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | bool isCommunalAlive { get; set; }
|
| | | public List<BossKillRecord> killRecords = new List<BossKillRecord>();
|
| | | public DateTime refreshTime { get; private set; }
|
| | | public List<byte> deadLines = new List<byte>();
|
| | | public Dictionary<int, bool> lineToAlives = new Dictionary<int, bool>();
|
| | | public int rebornTotalCd { get; private set; }
|
| | |
|
| | | public BossInfo(int _id)
|
| | | {
|
| | |
| | | public void UpdateBossInfo(HA902_tagGCGameWorldBossInfo.tagBossInfoObj _bossInfo)
|
| | | {
|
| | | isCommunalAlive = _bossInfo.IsAlive == 1;
|
| | | rebornTotalCd = (int)_bossInfo.RefreshCD;
|
| | | killRecords.Clear();
|
| | | if (!string.IsNullOrEmpty(_bossInfo.KillRecord))
|
| | | {
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | else if ((BossFakeLineUtility.Instance.lastBossNpcID == bossId && Time.realtimeSinceStartup < BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime)
|
| | | && !IsLineBossDead(PlayerDatas.Instance.baseData.FBID))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return isCommunalAlive;
|
| | | var isMistakeBoss = BossFakeLineUtility.Instance.lastBossNpcID == bossId
|
| | | && Time.realtimeSinceStartup < BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime;
|
| | | var isLineBossAlive = IsLineBossAlive(PlayerDatas.Instance.baseData.FBID);
|
| | |
|
| | | if (isMistakeBoss && isLineBossAlive)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | var neutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | | if (neutralMap)
|
| | | {
|
| | | return isLineBossAlive;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (BossFakeLineUtility.Instance.IsBossKilledRecently(bossId))
|
| | | {
|
| | | return !IsAnyLineBossDead();
|
| | | }
|
| | | else
|
| | | {
|
| | | return IsAnyLineBossAlive();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | bool IsLineBossDead(int _lineId)
|
| | | bool IsLineBossAlive(int _lineId)
|
| | | {
|
| | | return deadLines.Contains((byte)_lineId);
|
| | | return lineToAlives.ContainsKey(_lineId) && lineToAlives[_lineId];
|
| | | }
|
| | |
|
| | | bool IsAnyLineBossAlive()
|
| | | {
|
| | | foreach (var item in lineToAlives)
|
| | | {
|
| | | if (item.Value)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | bool IsAnyLineBossDead()
|
| | | {
|
| | | foreach (var item in lineToAlives)
|
| | | {
|
| | | if (!item.Value)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public int[] autoBuyItemPrices;
|
| | |
|
| | | public List<int> neutralMaps = new List<int>();
|
| | | public List<int> neutralBossMaps = new List<int>();
|
| | |
|
| | | public int demonJarRedPoint { get; private set; }
|
| | | public string LoadLV { get; private set; }
|
| | |
| | | lowHpRemind = GetInt("LowHpRemind");
|
| | | autoBuyItemIds = GetIntArray("BuyItemPrice", 1);
|
| | | autoBuyItemPrices = GetIntArray("BuyItemPrice", 2);
|
| | | neutralMaps.AddRange(GetIntArray("BossListMapID"));
|
| | | neutralMaps.AddRange(GetIntArray("MapLine", 4));
|
| | | neutralBossMaps.AddRange(GetIntArray("BossListMapID"));
|
| | |
|
| | | var _propertyIconCfg = Config.Instance.Get<FuncConfigConfig>("PropertyIcon");
|
| | | var _propertyIconJson = LitJson.JsonMapper.ToObject(_propertyIconCfg.Numerical1);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if (isNeutralMap)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | var inDungeon = IsDungeon();
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if (_areaType == MapArea.E_Type.Boss && !_enter)
|
| | | {
|
| | |
| | | var inDungeon = IsDungeon();
|
| | |
|
| | | bool IsBossBool = PlayerDatas.Instance.hero == null ? false : MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if (!recordPositionBool)
|
| | | {
|
| | |
| | | {
|
| | | var inDungeon = IsDungeon();
|
| | | bool IsBossBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if (recordPositionBool)//显示功能入口
|
| | | {
|
| | |
| | | members.Clear();
|
| | | }
|
| | |
|
| | | public int GetAnyNearByMember()
|
| | | {
|
| | | for (int i = 0; i < members.Count; i++)
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var lineId = PlayerDatas.Instance.baseData.FBID;
|
| | | if (members[i].mapId == mapId && members[i].lineId == lineId)
|
| | | {
|
| | | return members[i].id;
|
| | | }
|
| | | }
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class Teammate
|