Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | DEBUG_STEP = 0;
|
| | | DTC0403_tagPlayerLoginLoadOK.neverLoginOk = true;
|
| | |
|
| | | MapTransferUtility.Instance.lastMoveToWorldBossTime = float.MinValue;
|
| | | MapTransferUtility.Instance.lastMoveToWorldBossNpcID = 0;
|
| | | BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = float.MaxValue;
|
| | | BossFakeLineUtility.Instance.makeFakeLineTimes = 0;
|
| | | BossFakeLineUtility.Instance.showFakeLine = false;
|
| | |
|
| | | if (beforePlayerDataInitializeEvent != null)
|
| | | {
|
| | | beforePlayerDataInitializeEvent();
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (BossInfoConfig.IsStone((int)vNetData.NPCID))
|
| | | {
|
| | | BossFakeLineUtility.Instance.HasSawLineStoneRecently((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID);
|
| | | }
|
| | |
|
| | | if (GA_PlayerXMZZ.xmzzDict.ContainsKey(vNetData.NPCID))
|
| | | {
|
| | | _actor = GAMgr.Instance.RequestPlayer<GA_PlayerXMZZ>(vNetData.ObjID, E_ActorGroup.Player, vNetData);
|
| | |
| | | MapTransferUtility.Instance.lastMoveToWorldBossTime = Time.realtimeSinceStartup;
|
| | | }
|
| | |
|
| | | BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup + 61;
|
| | | BossFakeLineUtility.Instance.lastBossNpcID = vNetData.NPCID;
|
| | | BossFakeLineUtility.Instance.HasSawLineBossRecently((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID);
|
| | | }
|
| | |
|
| | | if (_npcConfig == null)
|
| | |
| | | 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; } |
| | | } |
| | |
| | | |
| | | //这个值在初见boss和最后看见boss的时候记录,其值为time.time+1分钟,这段时间内告诉玩家其所在分线的boss的死亡情况,否则告诉玩家公共boss的死亡情况。 |
| | | public uint lastBossNpcID; |
| | | public float inMistakeForBossAliveOverTime = 0f; |
| | | public float inMistakeForBossAliveOverTime = float.MaxValue; |
| | | |
| | | public bool IsShuntBoss(int _bossId) |
| | | { |
| | |
| | | var isMistakeBoss = lastBossNpcID == bossId && Time.realtimeSinceStartup < inMistakeForBossAliveOverTime; |
| | | |
| | | //补充具体逻辑 |
| | | inMistakeForBossAliveOverTime = Time.realtimeSinceStartup + 61; |
| | | lastBossNpcID = (uint)bossId; |
| | | |
| | | return false; |
| | | } |
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void MoveToNPC(int npcID)
|
| | | public void MoveToNPC(int npcID, int sid = 0)
|
| | | {
|
| | | NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | //Debug.LogFormat(" |-- 在本地图");
|
| | | if (PlayerDatas.Instance.baseData.FBID != 0)
|
| | | {
|
| | | if (BossFakeLineUtility.Instance.IsShuntBoss(npcID))
|
| | | {
|
| | | //Debug.LogFormat(" |-- BossFakeLineUtility.Instance.makeFakeLineTimes = 1");
|
| | | BossFakeLineUtility.Instance.makeFakeLineTimes = 1;
|
| | | }
|
| | | }
|
| | | //Debug.LogFormat(" |-- 在本地图"); |
| | | // Debug.LogFormat("lastMoveToWorldBossNpcID: {0}, Time: {1}, FBID: {2}, showFakeLine: {3}, FairyBoss: {4}",
|
| | | // lastMoveToWorldBossNpcID,
|
| | | // Time.realtimeSinceStartup - lastMoveToWorldBossTime,
|
| | | // PlayerDatas.Instance.baseData.FBID,
|
| | | // BossFakeLineUtility.Instance.showFakeLine,
|
| | | // _fairyBossModel.bosses != null
|
| | | // && _fairyBossModel.bosses.Contains(npcID));
|
| | |
|
| | | if (((lastMoveToWorldBossNpcID == npcID
|
| | | && Time.realtimeSinceStartup - lastMoveToWorldBossTime < 60)
|
| | | && PlayerDatas.Instance.baseData.FBID == 0)
|
| | | || BossFakeLineUtility.Instance.showFakeLine
|
| | | || (_fairyBossModel.bosses != null
|
| | | && _fairyBossModel.bosses.Contains(npcID)))
|
| | | && Time.realtimeSinceStartup - lastMoveToWorldBossTime < 60)
|
| | | && PlayerDatas.Instance.baseData.FBID == 0)
|
| | | || BossFakeLineUtility.Instance.showFakeLine
|
| | | || (_fairyBossModel.bosses != null
|
| | | && _fairyBossModel.bosses.Contains(npcID)))
|
| | | {
|
| | | //Debug.LogFormat(" |-- 非想去的boss为60秒内行为产生且为同一只boss, {0}, {1}", BossFakeLineUtility.Instance.showFakeLine,
|
| | | //PlayerDatas.Instance.baseData.FBID);
|
| | | PlayerDatas.Instance.baseData.FBID);
|
| | | Vector3 _destPos = new Vector3(_npcLocation.position.x, _hero.Pos.y, _npcLocation.position.y);
|
| | | _hero.MoveToPosition(_destPos, _npcLocation.scope);
|
| | | }
|
| | |
| | | {
|
| | | // 处于相同地图
|
| | | if (BossFakeLineUtility.Instance.lastBossNpcID != npcID
|
| | | || Time.realtimeSinceStartup - BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime > 60)
|
| | | || Time.realtimeSinceStartup - BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime > 60)
|
| | | {
|
| | | if (BossFakeLineUtility.Instance.IsShuntBoss(npcID))
|
| | | {
|
| | | //Debug.LogFormat(" |-- BossFakeLineUtility.Instance.makeFakeLineTimes = 1");
|
| | | BossFakeLineUtility.Instance.makeFakeLineTimes = 1;
|
| | | }
|
| | |
|
| | | //Debug.LogFormat(" |-- 非想去的boss记录,或则见到boss时差超过60秒");
|
| | | Send_WorldTransfer(_npcLocation.mapId, new Vector3(_hero.Pos.x * 2, 0, _hero.Pos.z * 2), MapTransferType.WorldTransport, 0, npcID);
|
| | | }
|
| | |
| | | SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
| | | }
|
| | | break;
|
| | | case 953:
|
| | | case RoleRenameWin.renameToolId:
|
| | | WindowCenter.Instance.Open<RoleRenameWin>();
|
| | | break;
|
| | | default:
|
| | |
| | | case RoleRenameResult.RenameFailErr:
|
| | | break;
|
| | | case RoleRenameResult.RenameSuccess:
|
| | | string info = StringUtility.Contact("我是",UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName),"现在改名为",playerRename);
|
| | | string info = Language.Get("RenameText_02", UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName), playerRename);
|
| | | friendsModel.SendChatInfoByGroup(GroupType.Friend,info);
|
| | | SysNotifyMgr.Instance.ShowTip("RenameSuccess01", playerRename);
|
| | | if(WindowCenter.Instance.IsOpen<RoleRenameWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<RoleRenameWin>();
|
| | | }
|
| | | GameNetSystem.Instance.Reconnect();
|
| | | break;
|
| | | }
|
| | |
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | RoleModel roleModel { get { return ModelCenter.Instance.GetModel<RoleModel>(); } }
|
| | |
|
| | | GetItemPathModel pathModel { get { return ModelCenter.Instance.GetModel<GetItemPathModel>(); } }
|
| | | public const int renameToolId = 953;
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | |
| | |
|
| | | private void OnDisplay()
|
| | | {
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(953);
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(renameToolId);
|
| | | if (itemConfig == null) return;
|
| | | ItemCellModel cellModel = new ItemCellModel(953,false,(ulong)GetRenameToolNum());
|
| | | ItemCellModel cellModel = new ItemCellModel(renameToolId, false,(ulong)GetRenameToolNum());
|
| | | itemCell.Init(cellModel);
|
| | | if(GetRenameToolNum() > 0)
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,GetRenameToolNum().ToString()),
|
| | | "/",1);
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red,0.ToString()),
|
| | | "/", 1);
|
| | | }
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(953);
|
| | | ItemAttrData attrData = new ItemAttrData(renameToolId);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
|
| | | private int GetRenameToolNum()
|
| | | {
|
| | | return playerPack.GetItemCountByID(PackType.rptItem,953);
|
| | | return playerPack.GetItemCountByID(PackType.rptItem, renameToolId);
|
| | | }
|
| | |
|
| | | private int GetRenameToolIndex()
|
| | |
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return 0;
|
| | |
|
| | | List<int> indexlist = singlePack.ItemIndexlist(953,1);
|
| | | List<int> indexlist = singlePack.ItemIndexlist(renameToolId, 1);
|
| | | if(indexlist.Count > 0)
|
| | | {
|
| | | return indexlist[0] + 1;
|
| | |
| | | }
|
| | | if(GetRenameToolNum() < 1)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip("角色改名卡不足");
|
| | | pathModel.SetChinItemModel(renameToolId);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), StringUtility.Contact("确定改名为", renameInput.text), (bool isOk) =>
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),Language.Get("RenameText_01", renameInput.text), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | |
| | | {
|
| | | roleModel.SetRename(name);
|
| | | CA122_tagUpdatePlayerName renamePlayerName = new CA122_tagUpdatePlayerName();
|
| | | renamePlayerName.NewNameLen = (byte)name.Length;
|
| | | renamePlayerName.NewNameLen = (byte)ChatCtrl.GetUTF8InfoLen(name);
|
| | | renamePlayerName.NewName = name;
|
| | | renamePlayerName.ItemIndex = (byte)GetRenameToolIndex();
|
| | | renamePlayerName.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag;
|
| | |
| | | m_ExpSlider.ResetStage();
|
| | | m_ExpSlider.value = 1;
|
| | | m_Slider.gameObject.SetActive(false);
|
| | | int NeedExp = DogzEquipConfig.upExpTotal;
|
| | | int NeedExp =0;
|
| | | if (DogZLv > 0)
|
| | | {
|
| | | var Dogz_EquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
|
| | | NeedExp -= Dogz_EquipConfig.upExpTotal;
|
| | | var Dogz_EquipConfig_1 = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
|
| | | var Dogz_EquipConfig_2 = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 2);
|
| | | NeedExp = Dogz_EquipConfig_1.upExpTotal- Dogz_EquipConfig_2.upExpTotal;
|
| | | }
|
| | | m_ExpNum.text = NeedExp + "/" + NeedExp;
|
| | | }
|
| | |
| | | {
|
| | | JumpIndex = 0;
|
| | | godBeastModel.ItemPlace = -1;
|
| | | // godBeastModel.Absorption_Dic.Clear();
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent; |
| | |
| | | {
|
| | | if (arg1 == PackType.rptDogzEquip)
|
| | | {
|
| | | //OnCreateGridLineCell(m_ScrollerController);
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | m_GodBeastSlidingList.Init();
|
| | | m_GodBeastAttributes.Init();
|
| | |
| | | } |
| | | private void OnEnable()
|
| | | {
|
| | | playerPack.RefreshItemCountAct += RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent;
|
| | | godBeastModel.AbsorbEvent += AbsorbEvent;
|
| | | playerPack.ItemCntAddAct += RefreshItemCountAct;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct -= ItemCntReduceAct;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
|
| | | godBeastModel.AbsorbEvent -= AbsorbEvent;
|
| | | playerPack.ItemCntAddAct -= RefreshItemCountAct;
|
| | | }
|
| | |
|
| | | |
| | | |
| | |
|
| | | public void Init()
|
| | | {
|
| | |
| | | {
|
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | }
|
| | | private void ItemCntReduceAct(PackType arg1, int arg2, int arg3)
|
| | | private void MakeItemAnswerEvent(H0721_tagMakeItemAnswer obj)
|
| | | {
|
| | | if (arg1 == PackType.rptDogzItem)
|
| | | if ((int)obj.MakeType == (int)MakeType.Def_mitDogzEquipPlus)
|
| | | {
|
| | | if (m_ToggleAll.isOn)
|
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
|
| | | {
|
| | | if (arg1 == PackType.rptDogzItem)
|