少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using System;
 
 
namespace vnxbqy.UI
{
    
    public class BossShowModel : Singleton<BossShowModel>
    {
        public BossShowModel()
        {
            BossShowing = false;
            showTargetList = new List<ShowActor>();
            TimeMgr.Instance.OnSyntonyEvent += OnSyntonyEvent;
            StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
        }
 
        GameObject bossShowCam;
        private ActorShowConfig actorShowModel;
        TaskModel m_TaskModel;
        TaskModel taskmodel
        {
            get
            {
                return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>());
            }
        }
 
        public int NpcID { get; private set; }
        public int reqDungeonLineId = -1;
        public List<ShowActor> showTargetList { get; private set; }
        public bool BossShowing { get; private set; }
        public Camera showCamera { get; private set; }
        public ShowActor showHero { get; private set; }
        public List<ShowActor> showNpcs = new List<ShowActor>();
        public bool satisfyStep { get; private set; }
        private bool serverNotify = false;
        private int cacheMapId = 0;
        private Int3 taskInfo = Int3.zero;
        private const string BOSS_SHOW_KEY = "BossShow";
        public event Action bossShowPreparedEvent;
        public event Action bossShowCompletedEvent;
 
        public void StartBossShow(int npcId)
        {
            if (!ActorShowConfig.GetActorShowModel(PlayerDatas.Instance.baseData.MapID, npcId, out actorShowModel))
            {
                return;
            }
            Start(PlayerDatas.Instance.baseData.MapID, npcId);
        }
 
        public void Start(int mapId, int npcId)
        {
            try
            {
                reqDungeonLineId = -1;
                if (!ActorShowConfig.GetActorShowModel(mapId, npcId, out actorShowModel))
                {
                    return;
                }
                satisfyStep = SatisfyBossShowStep(actorShowModel);
                SaveBossShowStep(actorShowModel);
                //if (actorShowModel.BindMissionID != 0)
                //{
                //    MissionDetailDates missionDetailDates = null;
                //    taskmodel.allMissionDict.TryGetValue(actorShowModel.BindMissionID, out missionDetailDates);
                //    if (missionDetailDates == null || missionDetailDates.MissionState != 1)
                //    {
                //        return;
                //    }
                //    if (GetMisstionShow(actorShowModel.BindMissionID))
                //    {
                //        return;
                //    }
                //    SetMisstionShow(actorShowModel.BindMissionID);
                //}
                if (BossShowing && StageLoad.Instance.currentStage is DungeonStage)
                {
                    return;
                }
                BossShowing = true;
                NpcID = npcId;
                if (actorShowModel.type != 3)
                {
                    ActiveBossModel(true);
                }
                ActiveBossShowCam(true);
                CameraController.Instance.CameraObject.enabled = false;
 
                if (WindowCenter.Instance.IsOpen<TreasureBaseWin>())
                {
                    WindowJumpMgr.Instance.ClearJumpData();
                    WindowCenter.Instance.Close<TreasureBaseWin>();
                    WindowCenter.Instance.Close<TreasureSelectWin>();
                    WindowCenter.Instance.Open<MainInterfaceWin>();
                }
 
                ActiveUI(false);
                var _hero = PlayerDatas.Instance.hero;
                if (_hero != null && !_hero.ActorInfo.serverDie)
                {
                    _hero.Behaviour.StopHandupAI(true);
                }
                TimeMgr.Instance.Register(TimeMgr.SyntonyType.BossShow, (float)actorShowModel.length / 1000);
 
                if (actorShowModel.showNameTime > 0)
                {
                    TimeMgr.Instance.Register(TimeMgr.SyntonyType.BossShowName, (float)actorShowModel.showNameTime / 1000);
                }
 
                if (actorShowModel.Dialogue > 0 && actorShowModel.DialogueTime > 0)
                {
                    TimeMgr.Instance.Register(TimeMgr.SyntonyType.BossShowDialogue, (float)actorShowModel.DialogueTime / 1000);
                }
 
                if (actorShowModel.soundId > 0)
                {
                    if (actorShowModel.soundTime == 0)
                    {
                        PlaySound(actorShowModel.soundId);
                    }
                    else
                    {
                        TimeMgr.Instance.Register(TimeMgr.SyntonyType.BossShowSound, (float)actorShowModel.soundTime / 1000);
                    }
                }
 
                if (bossShowPreparedEvent != null)
                {
                    bossShowPreparedEvent();
                }
            }
            catch (Exception e)
            {
                BossShowing = false;
                Debug.LogError(e.Message + e.StackTrace);
            }
        }
 
        public void StartBossShow(int mapId, int lineId)
        {
            if (BossShowing)
            {
                return;
            }
            var configs = ActorShowConfig.GetValues();
            ActorShowConfig _showModel = null;
            foreach (var config in configs)
            {
                if (config.MapID == mapId && config.line == lineId)
                {
                    _showModel = config;
                    break;
                }
            }
            if (_showModel != null)
            {
                SnxxzGame.Instance.StartCoroutine(Co_StartBossShow(_showModel));
            }
        }
 
        public void StopBossShow()
        {
            if (!BossShowing)
            {
                return;
            }
            BossShowing = false;
            SoundPlayer.Instance.StopUIAudio();
            SoundPlayer.Instance.musicAudioSource.mute = false;
            ActiveBossShowCam(false);
            if (NpcID != 0)
            {
                ActiveBossModel(false);
            }
            ActiveDialogue(false);
            CameraController.Instance.CameraObject.enabled = true;
            ActiveUI(true);
            if (serverNotify)
            {
                CA223_tagCMNPCShowEnd pak = new CA223_tagCMNPCShowEnd();
                pak.EndType = 0;
                pak.NPCID = (uint)NpcID;
                GameNetSystem.Instance.SendInfo(pak);
            }
            var _handleFight = true;
            if (ActorShowConfig.GetActorShowModel(PlayerDatas.Instance.baseData.MapID, NpcID, out actorShowModel))
            {
                if (actorShowModel.type == 3 || actorShowModel.type == 2)
                {
                    _handleFight = false;
                    CB104_tagCMClientStartFB _pak = new CB104_tagCMClientStartFB();
                    GameNetSystem.Instance.SendInfo(_pak);
                }
                if (actorShowModel.type == 3)
                {
                    SendGuideComplete((DungeonShowType)actorShowModel.NpcID);
                }
                if (actorShowModel.BindMissionID.x != 0)
                {
                    taskmodel.AutomaticTripToTask(taskmodel.currentMission);
                }
            }
            var _hero = PlayerDatas.Instance.hero;
            if (_handleFight && _hero != null && !_hero.ActorInfo.serverDie)
            {
                bool _needStart = false;
                int _dgDataID = ModelCenter.Instance.GetModel<DungeonModel>().GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
                var dungeonOpen = DungeonOpenTimeConfig.Get(_dgDataID);
                if (dungeonOpen != null)
                {
                    if (dungeonOpen.DoFight == 1)
                    {
                        _needStart = true;
                    }
                }
                else
                {
                    if (!ClientSceneManager.Instance.IsClientFightMode)
                    {
                        _needStart = true;
                    }
                }
 
                if (_needStart)
                {
                    _hero.Behaviour.StartHandupAI();
                }
            }
 
            TimeMgr.Instance.UnRegister(TimeMgr.SyntonyType.BossShow);
            TimeMgr.Instance.UnRegister(TimeMgr.SyntonyType.BossShowName);
            TimeMgr.Instance.UnRegister(TimeMgr.SyntonyType.BossShowDialogue);
            TimeMgr.Instance.UnRegister(TimeMgr.SyntonyType.BossShowSound);
 
            if (bossShowCompletedEvent != null)
            {
                bossShowCompletedEvent();
            }
        }
 
        private void OnSyntonyEvent(TimeMgr.SyntonyType type)
        {
            if (type == TimeMgr.SyntonyType.BossShow)
            {
                StopBossShow();
            }
            else if (type == TimeMgr.SyntonyType.BossShowName)
            {
                ActiveBossName();
            }
            else if (type == TimeMgr.SyntonyType.BossShowDialogue)
            {
                ActiveDialogue(true);
            }
            else if (type == TimeMgr.SyntonyType.BossShowSound)
            {
                if (actorShowModel != null)
                {
                    PlaySound(actorShowModel.soundId);
                }
            }
        }
 
        private void PlaySound(int _soundId)
        {
            SoundPlayer.Instance.musicAudioSource.mute = true;
            SoundPlayer.Instance.PlayUIAudio(_soundId);
        }
 
        private void ActiveBossShowCam(bool _active)
        {
            var prefab = UILoader.LoadBossShow(actorShowModel.cam);
            if (_active && (actorShowModel.type == 3 || showTargetList.Count > 0))
            {
                bossShowCam = UnityEngine.Object.Instantiate<GameObject>(prefab);
                RaycastHit _hit;
                var _pos = actorShowModel.type == 3 ? new Vector3((float)actorShowModel.PosX[0] / 200, 0, actorShowModel.PosY[0] / 200) :
                    showTargetList[0].m_Model.transform.position;
                var _origin = _pos;
                if (actorShowModel.Height.Length > 1)
                {
                    _origin.x = (float)actorShowModel.Height[0] / 200;
                    _origin.y = 0;
                    _origin.z = (float)actorShowModel.Height[1] / 200;
                }
                _origin.y = 100f;
                Ray _ray = new Ray(_origin, Vector3.down);
                float height = 0;
                if (Physics.Raycast(_ray, out _hit, 100f, LayerUtility.WalkbleMask))
                {
                    height = _hit.point.y;
                }
                showCamera = GetBossShowCam(bossShowCam.transform);
                bossShowCam.transform.position = actorShowModel.type == 3 ? _pos.SetY(height) :
                    showTargetList[0].m_Model.transform.position.SetY(height);
                if (actorShowModel != null)
                {
                    bossShowCam.transform.rotation = MathUtility.GetClientRotationFromAngle(actorShowModel.NpcFace[0]);
                }
                else
                {
                    bossShowCam.transform.rotation = showTargetList[0].m_Model.transform.rotation;
                }
                bossShowCam.SetActive(true);
            }
            else
            {
                if (bossShowCam != null)
                {
                    bossShowCam.SetActive(false);
                    UnityEngine.Object.Destroy(bossShowCam);
                }
            }
        }
        public void ActiveBossModel(bool _active)
        {
            if (!_active)
            {
                if (showTargetList.Count > 0)
                {
                    for (int i = 0; i < showTargetList.Count; i++)
                    {
                        if (showTargetList[i].npcId == 1)
                        {
                            showTargetList[i].Destroy();
                            continue;
                        }
                        List<ShowActor> list = GetShowActor(showTargetList[i].npcId);
                        if (list == null)
                        {
                            list = new List<ShowActor>();
                            showActorDic.Add(showTargetList[i].npcId, list);
                        }
                        showTargetList[i].Disappear();
                        list.Add(showTargetList[i]);
                    }
                }
                showTargetList.Clear();
                showHero = null;
                showNpcs.Clear();
            }
            else
            {
                showHero = null;
                showNpcs.Clear();
                showTargetList.Clear();
                for (int i = 0; i < actorShowModel.NpcFace.Length; i++)
                {
                    List<ShowActor> list = GetShowActor(actorShowModel.showNpcs[i]);
                    ShowActor showActor = null;
                    if (list != null && list.Count > 0)
                    {
                        showActor = list[0];
                        list.RemoveAt(0);
                    }
                    if (showActor == null)
                    {
                        var _instanceid = GetInstanceId();
                        showActor = new ShowActor(actorShowModel.showNpcs[i], i, _instanceid, actorShowModel);
                        m_ShowActorInstanceDict.Add(_instanceid, showActor);
 
                        if (actorShowModel.showNpcs[i] == 1
                            && i < actorShowModel.showName.Length && actorShowModel.showName[i] == 1)
                        {
                            showHero = showActor;
                        }
                    }
                    else
                    {
                        showActor.Appear(i, actorShowModel);
                    }
 
                    if (actorShowModel.showNpcs[i] != 1
                        && i < actorShowModel.showName.Length && actorShowModel.showName[i] == 1)
                    {
                        showNpcs.Add(showActor);
                    }
 
                    showTargetList.Add(showActor);
                }
            }
        }
        private void ActiveUI(bool _active)
        {
            UIRoot uiRoot = WindowCenter.Instance.uiRoot;
            uiRoot.EnableCanvas(_active, 
                                      uiRoot.baseCanvas,
                                      uiRoot.lifeBarCanvas,
                                      uiRoot.nameCanvas,
                                      uiRoot.normalCanvas,
                                      uiRoot.modalCanvas,
                                      uiRoot.tipsCanvas,
                                      uiRoot.systemCanvas,
                                      uiRoot.recycleBin,
                                      uiRoot.fightCanvasGroup.damageNumGroups[0].parent);
            if (!_active)
            {
                CameraUtility.RemoveCullingMask(CameraManager.uiCamera, LayerUtility.UIEffectLayer);
                if (!WindowCenter.Instance.IsOpen<BossShowWin>())
                {
                    BossShowWin.bossShowId = actorShowModel.ID;
                    WindowCenter.Instance.Open<BossShowWin>();
                }
            }
            else
            {
                CameraUtility.AddCullingMask(CameraManager.uiCamera, LayerUtility.UIEffectLayer);
                if (WindowCenter.Instance.IsOpen<BossShowWin>())
                {
                    WindowCenter.Instance.Close<BossShowWin>();
                }
            }
        }
        public event Action OnBossNameEvent;
 
        public void ActiveBossName()
        {
            if (OnBossNameEvent != null)
            {
                OnBossNameEvent();
            }
        }
 
        private void ActiveDialogue(bool _show)
        {
            if (_show && !WindowCenter.Instance.IsOpen<BossShowDialogueWin>())
            {
                var _task = ModelCenter.Instance.GetModel<TaskModel>();
                _task._TaskNow = actorShowModel.Dialogue;
                WindowCenter.Instance.Open<BossShowDialogueWin>();
            }
            else if (!_show && WindowCenter.Instance.IsOpen<BossShowDialogueWin>())
            {
                WindowCenter.Instance.Close<BossShowDialogueWin>();
            }
        }
 
        public Transform GetBossShowCamAnimator(Transform parent)
        {
            Animator animator = parent.GetComponent<Animator>();
            if (animator != null)
            {
                return parent;
            }
            foreach (Transform child in parent)
            {
                var trans = GetBossShowCamAnimator(child);
                if (trans == null)
                {
                    continue;
                }
                else
                {
                    return trans;
                }
            }
            return null;
        }
 
        public Camera GetBossShowCam(Transform parent)
        {
            Camera cam = parent.GetComponent<Camera>();
            if (cam != null)
            {
                return cam;
            }
            foreach (Transform child in parent)
            {
                cam = GetBossShowCam(child);
                if (cam == null)
                {
                    continue;
                }
                else
                {
                    return cam;
                }
            }
            return null;
        }
 
        public void ReceivePackage(H0827_tagMissionDesc vNetData)
        {
            var _taskInfo = new Int3((int)vNetData.MissionID, vNetData.MissionState, vNetData.DiscriptionIndex);
            if (_taskInfo != taskInfo)
            {
                taskInfo = _taskInfo;
                if (DTC0403_tagPlayerLoginLoadOK.finishedLogin)
                {
                    var configs = ActorShowConfig.GetValues();
                    foreach (var config in configs)
                    {
                        if (config.BindMissionID == taskInfo)
                        {
                            Start(config.MapID, config.NpcID);
                            if (PlayerDatas.Instance.hero != null)
                            {
                                PlayerDatas.Instance.hero.StopAll();
                            }
                            return;
                        }
                    }
                }
            }
        }
 
        public void OnNpcAppear(int npcID)
        {
            if (BossShowing)
            {
                return;
            }
            if (!ActorShowConfig.GetActorShowModel(PlayerDatas.Instance.baseData.MapID, npcID, out actorShowModel))
            {
                return;
            }
            if (actorShowModel.type != 1)
            {
                return;
            }
            serverNotify = false;
            StartBossShow(npcID);
        }
 
        private bool GetMisstionShow(int missionID)
        {
            return LocalSave.GetBool(StringUtility.Contact(BOSS_SHOW_KEY, PlayerDatas.Instance.PlayerId, missionID));
        }
 
        public void SetMisstionShow(int missionID, bool value = true)
        {
            LocalSave.SetBool(StringUtility.Contact(BOSS_SHOW_KEY, PlayerDatas.Instance.PlayerId, missionID), value);
        }
 
        public void StartBossShow(uint npcID)
        {
            if (BossShowing)
            {
                return;
            }
            if (!ActorShowConfig.GetActorShowModel(PlayerDatas.Instance.baseData.MapID, (int)npcID, out actorShowModel))
            {
                return;
            }
            if (actorShowModel.type != 0)
            {
                return;
            }
            serverNotify = true;
            StartBossShow((int)npcID);
        }
 
        private void OnStageLoadFinish()
        {
            if (!(StageLoad.Instance.currentStage is DungeonStage))
            {
                cacheMapId = 0;
            }
 
            if (PlayerDatas.Instance.baseData.MapID == cacheMapId || cacheMapId == 0)
            {
                cacheMapId = PlayerDatas.Instance.baseData.MapID;
                return;
            }
 
            cacheMapId = PlayerDatas.Instance.baseData.MapID;
 
            var list = ActorShowConfig.GetValues();
            ActorShowConfig _showModel = null;
            foreach (var config in list)
            {
                if (config.MapID == PlayerDatas.Instance.baseData.MapID
                    && (config.line == 1000 || config.line == reqDungeonLineId)
                    && config.type == 2)
                {
                    if (!RequireBossShow(config.MapID, config.line))
                    {
                        break;
                    }
                    _showModel = config;
                    break;
                }
                else if (config.MapID == PlayerDatas.Instance.baseData.MapID && config.type == 3)
                {
                    SnxxzGame.Instance.StartCoroutine(Co_StartSceneShow(config));
                    return;
                }
            }
            if (_showModel != null)
            {
                SnxxzGame.Instance.StartCoroutine(Co_StartBossShow(_showModel));
            }
        }
 
        IEnumerator Co_StartBossShow(ActorShowConfig _showModel)
        {
            StartBossShow(_showModel.NpcID);
            yield return null;
        }
 
        IEnumerator Co_StartSceneShow(ActorShowConfig _showModel)
        {
            if (GetState((DungeonShowType)_showModel.NpcID))
            {
                yield break;
            }
            var _dungeonCfg = DungeonOpenTimeConfig.Get(_showModel.MapID);
            if (_dungeonCfg != null && _dungeonCfg.FBType != 1)
            {
                var _team = ModelCenter.Instance.GetModel<TeamModel>();
                if (_team.myTeam.GetOnlineMemberCount() > 1)
                {
                    SetState((DungeonShowType)_showModel.NpcID);
                    SendGuideComplete((DungeonShowType)_showModel.NpcID);
                    yield break;
                }
            }
            SetState((DungeonShowType)_showModel.NpcID);
            StartBossShow(_showModel.NpcID);
            yield return null;
        }
 
        public Dictionary<int, List<ShowActor>> showActorDic = new Dictionary<int, List<ShowActor>>();
 
        public List<ShowActor> GetShowActor(int npcID)
        {
            List<ShowActor> list = null;
            showActorDic.TryGetValue(npcID, out list);
            return list;
        }
 
        private Dictionary<int, ShowActor> m_ShowActorInstanceDict = new Dictionary<int, ShowActor>();
 
        public ShowActor GetShowActorInstance(int _instance)
        {
            if (m_ShowActorInstanceDict.ContainsKey(_instance))
            {
                return m_ShowActorInstanceDict[_instance];
            }
            return null;
        }
 
        private static int presentInstanceId = 0;
        public int GetInstanceId()
        {
            return presentInstanceId++;
        }
 
        private List<uint> m_DungeonStates = new List<uint>();
 
        public void UpdateState(uint[] _states)
        {
            if (_states == null)
            {
                return;
            }
            var _start = (int)DungeonShowType.None / 31;
            if (_start < _states.Length)
            {
                var _index = 0;
                for (int i = _start; i < _states.Length; i++)
                {
                    if (m_DungeonStates.Count <= _index)
                    {
                        m_DungeonStates.Add(_states[i]);
                    }
                    else
                    {
                        m_DungeonStates[_index] = _states[i];
                    }
                    _index++;
                }
            }
        }
 
        public bool GetState(DungeonShowType _type)
        {
            int _key = (int)_type;
            var _start = _key / 31 - (int)DungeonShowType.None / 31;
            var _index = _key - (_key / 31) * 31;
            if (_start < m_DungeonStates.Count && _start >= 0)
            {
                return MathUtility.GetBitValue(m_DungeonStates[_start], (ushort)_index);
            }
            return false;
        }
 
        public void SetState(DungeonShowType _type, bool _state = true)
        {
            int _key = (int)_type;
            var _start = _key / 31 - (int)DungeonShowType.None / 31;
            var _index = _key - (_key / 31) * 31;
            if (_start >= m_DungeonStates.Count)
            {
                m_DungeonStates.Add((uint)MathUtility.SetBitValue(0, (ushort)_index, _state));
            }
            else
            {
                m_DungeonStates[_start] = (uint)MathUtility.SetBitValue((int)m_DungeonStates[_start], (ushort)_index, _state);
            }
        }
 
        private void SendGuideComplete(DungeonShowType _type, bool _state = true)
        {
            CA222_tagCMSetGuideOK _pak = new CA222_tagCMSetGuideOK();
            _pak.GuideIndex = (byte)_type;
            _pak.IsOK = _state ? (byte)1 : (byte)0;
            GameNetSystem.Instance.SendInfo(_pak);
        }
 
        public enum DungeonShowType : byte
        {
            None = 200,
            DemonJar = 201,
            FairyLand = 202,
            //后续IL开发添加预设
            default1,
            default2,
            default3,
            default4,
            default5,
            default6,
            default7,
            default8,
            default9,
            default10,
        }
 
        private void SaveBossShowStep(ActorShowConfig config, bool value = true)
        {
            if (config.step == 0)
            {
                return;
            }
            var playerId = PlayerDatas.Instance.baseData.PlayerID;
            LocalSave.SetBool(StringUtility.Contact("BossShowStep_", playerId, "_", config.MapID, "_", config.NpcID), value);
        }
 
        private bool SatisfyBossShowStep(ActorShowConfig config)
        {
            if (config.step == 0)
            {
                return false;
            }
            var playerId = PlayerDatas.Instance.baseData.PlayerID;
            return LocalSave.GetBool(StringUtility.Contact("BossShowStep_", playerId, "_", config.MapID, "_", config.NpcID));
        }
 
        #region 魔族法宝特殊判断
        bool RequireBossShow(int mapId, int lineId)
        {
            if (mapId != 41110)
            {
                return true;
            }
            var model = ModelCenter.Instance.GetModel<TreasureModel>();
            var list = model.GetTreasureCategory(TreasureCategory.Demon);
            for (int i = 0; i < list.Count; i++)
            {
                TreasureDungeon treasureDungeon;
                if (model.TryGetTreasureDungeon(list[i], out treasureDungeon))
                {
                    var count = treasureDungeon.dungeonInfos.Count;
                    if (count > 0 && treasureDungeon.dungeonInfos[0].lineId == lineId)
                    {
                        var maxLevel = treasureDungeon.dungeonInfos[count - 1].level;
                        if (treasureDungeon.currentLevel < maxLevel - 1)
                        {
                            return false;
                        }
                    }
                }
            }
            return true;
        }
        #endregion
    }
}