From eec5d6d844ddc23eca705ddf3dff9d4a2140f701 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期六, 25 八月 2018 10:20:05 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Core/GameEngine/Model/ConfigManager.cs                                           |    2 
 System/KnapSack/PreciousItemGetBehaviour.cs                                      |    9 +
 Utility/EnumHelper.cs                                                            |    4 
 Fight/Actor/Skill/AttackHandler.cs                                               |    4 
 Fight/Actor/HeroBehaviour.cs                                                     |   23 ++
 Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs |   23 ++
 System/Vip/VipRechargeWin.cs                                                     |    1 
 System/SystemSetting/SystemSetWin.cs                                             |   16 -
 Utility/ResolutionUtility.cs                                                     |    2 
 System/Team/TeamPrepareWin.cs                                                    |    8 
 Fight/GameActor/GA_Hero.cs                                                       |   20 --
 System/Treasure/TreasureModel.cs                                                 |   62 +++++--
 Fight/GameActor/GActorFight.cs                                                   |   44 +++++
 Fight/GameActor/GActorPlayerBase.cs                                              |  101 +++++++++++
 System/WindowBase/WindowCenter.cs                                                |    3 
 Fight/Actor/AI/HeroAI_KillUntilDie.cs                                            |    4 
 Fight/Actor/Skill/SoBodyControl.cs                                               |   10 +
 Utility/RuntimeLogUtility.cs                                                     |    2 
 System/Welfare/MultipleRealmPointModel.cs                                        |   23 ++
 Fight/Actor/State/SMB/SMB_Base.cs                                                |   53 ++++-
 Fight/PreFightMission.cs                                                         |    4 
 System/NewBieGuidance/NewBieCenter.cs                                            |    5 
 Utility/MathUtility.cs                                                           |   15 +
 Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0428_tagPlayerRideHorse.cs   |    6 
 Fight/GameActor/GAStaticDefine.cs                                                |    8 
 System/Treasure/TreasureCyclicScroll.cs                                          |   10 +
 Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs   |    2 
 Fight/Actor/AI/HeroAI_Auto.cs                                                    |   10 
 28 files changed, 377 insertions(+), 97 deletions(-)

diff --git a/Core/GameEngine/Model/ConfigManager.cs b/Core/GameEngine/Model/ConfigManager.cs
index 003ed96..fd45cf7 100644
--- a/Core/GameEngine/Model/ConfigManager.cs
+++ b/Core/GameEngine/Model/ConfigManager.cs
@@ -478,6 +478,7 @@
     {
         if (isPlaying && _task.state == TaskState.ReadFileFailure)
         {
+            Thread.Sleep(30);
             ReadFile(_task, OnEndReadFile<T>);
         }
         else
@@ -493,6 +494,7 @@
         if (isPlaying && _task.state == TaskState.ParseFailure)
         {
             Debug.LogFormat("閰嶇疆琛ㄨВ鏋愬け璐ワ細{0}", _task.taskName);
+            Thread.Sleep(30);
             ReadFile(_task, OnEndReadFile<T>);
         }
     }
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0428_tagPlayerRideHorse.cs b/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0428_tagPlayerRideHorse.cs
index 5e973e0..76ebf20 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0428_tagPlayerRideHorse.cs
+++ b/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0428_tagPlayerRideHorse.cs
@@ -2,7 +2,7 @@
 using TableConfig;
 using Snxxz.UI;
 
-//04 28 玩家上马#tagPlayerRideHorse
+//04 28 锟斤拷锟斤拷锟斤拷锟�#tagPlayerRideHorse
 
 
 
@@ -32,7 +32,9 @@
                 return;
             }
 
-            if (_hero == null || _hero.MovingState == E_MovingState.Ride)
+            if (_hero == null
+             || _hero.MovingState == E_MovingState.Ride
+             || _hero.IsPolyMorph)
             {
                 return;
             }
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs b/Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs
index 55c81cd..0414717 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs
+++ b/Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs
@@ -191,14 +191,21 @@
 
                         if (_attacker is GA_Player)
                         {
+                            var _hero = _cTarget as GA_Hero;
+
                             if (PlayerDatas.Instance.extersion.bossState == 1)
                             {
-                                GA_Hero _hero = PlayerDatas.Instance.hero;
                                 if (_hero.SelectTarget == null
                                  || _hero.SelectTarget is GActorNpcFight)
                                 {
                                     _hero.SelectTarget = _hero.LockTarget = _attacker;
                                 }
+                            }
+
+                            if (_hero != null && _hero.MovingState == E_MovingState.Ride)
+                            {
+                                DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(false);
+                                _hero.SwitchHorse(0);
                             }
                         }
                     }
@@ -282,7 +289,7 @@
 
                                 if (AttackHandler.CheckPull(_attacker, _cTarget, 0))
                                 {
-                                    _cTarget.StartBeatBack(0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
+                                    _cTarget.StartBeatBack(_attacker.ServerInstID, 0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                                 }
                             }
 
@@ -557,6 +564,16 @@
                 {
                     GAMgr.Instance.OnPlayerSyncCountChange();
                 }
+
+                if (_attacker is GA_Player)
+                {
+                    var _hero = _cTarget as GA_Hero;
+                    if (_hero != null && _hero.MovingState == E_MovingState.Ride)
+                    {
+                        DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(false);
+                        _hero.SwitchHorse(0);
+                    }
+                }
             }
             else if (_attacker.ServerInstID == PlayerDatas.Instance.PlayerId)
             {
@@ -622,7 +639,7 @@
 
                     if (AttackHandler.CheckPull(_attacker, _cTarget, 0))
                     {
-                        _cTarget.StartBeatBack(0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
+                        _cTarget.StartBeatBack(_attacker.ServerInstID, 0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                     }
 
                     if (_sTarget.HurtHP != 0)
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs b/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
index 7de5f47..a814003 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
@@ -217,7 +217,7 @@
 
                     if (AttackHandler.CheckPull(_attacker, _cTarget, 0))
                     {
-                        _cTarget.StartBeatBack(0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
+                        _cTarget.StartBeatBack(_attacker.ServerInstID, 0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                     }
 
                     if (_sTarget.HurtHP != 0)
diff --git a/Fight/Actor/AI/HeroAI_Auto.cs b/Fight/Actor/AI/HeroAI_Auto.cs
index 908f9c8..a2b8f69 100644
--- a/Fight/Actor/AI/HeroAI_Auto.cs
+++ b/Fight/Actor/AI/HeroAI_Auto.cs
@@ -109,7 +109,7 @@
         UserInputHandler.OnCirclePanelTouched += OnActiveInterrupt;
         UserInputHandler.OnClickedFloor += OnClickFloor;
         GA_Hero.OnLockTargetChanged += OnLockTargetChanged;
-        GA_Hero.OnUserClickSkill += OnUserClickSkill;
+        HeroBehaviour.OnUserClickSkill += OnUserClickSkill;
 
         OnEnter();
     }
@@ -123,6 +123,11 @@
         }
 
         GA_Hero _hero = PlayerDatas.Instance.hero;
+
+        if (_hero.IsPolyMorph)
+        {
+            return;
+        }
 
         if (_hero.SelectTarget == _hero)
         {
@@ -216,7 +221,6 @@
 
                 break;
             case 1:// 鏆傚仠鐘舵��
-
                 if (m_NeedMoveToPos)
                 {
                     if (StatusMgr.Instance.CanMove(PlayerDatas.Instance.PlayerId))
@@ -380,7 +384,7 @@
         }
         UserInputHandler.OnCirclePanelTouched -= OnActiveInterrupt;
         UserInputHandler.OnClickedFloor -= OnClickFloor;
-        GA_Hero.OnUserClickSkill -= OnUserClickSkill;
+        HeroBehaviour.OnUserClickSkill -= OnUserClickSkill;
 
         OnExit();
     }
diff --git a/Fight/Actor/AI/HeroAI_KillUntilDie.cs b/Fight/Actor/AI/HeroAI_KillUntilDie.cs
index 0ab7acb..189ac01 100644
--- a/Fight/Actor/AI/HeroAI_KillUntilDie.cs
+++ b/Fight/Actor/AI/HeroAI_KillUntilDie.cs
@@ -57,7 +57,7 @@
 
         UserInputHandler.OnCirclePanelTouched += OnActiveInterrupt;
         UserInputHandler.OnClickedFloor += OnClickFloor;
-        GA_Hero.OnUserClickSkill += OnUserClickSkill;
+        HeroBehaviour.OnUserClickSkill += OnUserClickSkill;
         GA_Hero.OnLockTargetChanged += OnLockTargetChanged;
         HeroBehaviour.OnStartHandupAI += OnStartHandupAI;
         MapTransferUtility.s_OnHeroStartMoveToNPC += OnStartMoveToNpc;
@@ -258,7 +258,7 @@
     {
         UserInputHandler.OnCirclePanelTouched -= OnActiveInterrupt;
         UserInputHandler.OnClickedFloor -= OnClickFloor;
-        GA_Hero.OnUserClickSkill -= OnUserClickSkill;
+        HeroBehaviour.OnUserClickSkill -= OnUserClickSkill;
         GA_Hero.OnLockTargetChanged -= OnLockTargetChanged;
         HeroBehaviour.OnStartHandupAI -= OnStartHandupAI;
         MapTransferUtility.s_OnHeroStartMoveToNPC -= OnStartMoveToNpc;
diff --git a/Fight/Actor/HeroBehaviour.cs b/Fight/Actor/HeroBehaviour.cs
index a402850..b5340f3 100644
--- a/Fight/Actor/HeroBehaviour.cs
+++ b/Fight/Actor/HeroBehaviour.cs
@@ -17,6 +17,11 @@
 
     public static event UnityAction<int> onCastSkill;
 
+    /// <summary>
+    /// 褰撶敤鎴风偣鍑讳簡鎶�鑳芥寜閽�, 骞跺垏鎶�鑳藉彲浠ラ噴鏀剧殑鏃跺�欒皟鐢�
+    /// </summary>
+    public static event UnityAction<int> OnUserClickSkill;
+
     public enum E_BehaviourState
     {
         None,
@@ -75,6 +80,11 @@
          || MapArea.IsInMapArea(m_Hero.CurMapArea, MapArea.E_Type.RebornSafe))
         {
             SysNotifyMgr.Instance.ShowTip("NoFighting");
+            return;
+        }
+
+        if (m_Hero.IsPolyMorph)
+        {
             return;
         }
 
@@ -173,6 +183,11 @@
             _data.targetServerInstID = m_Hero.SelectTarget.ServerInstID;
             _data.defaultSkillID = m_WillUsedSkillID;
             m_Hero.aiHandler.currentType = E_HeroAIType.KillUntilDie;
+        }
+
+        if(OnUserClickSkill != null)
+        {
+            OnUserClickSkill(m_WillUsedSkillID);
         }
     }
 
@@ -724,6 +739,14 @@
                     // 浜虹墿, 闈炲皬鎬笉璁$畻浼ゅ,涓嶇敓鎴愬鎴风鏁版嵁
                     if (_target.ActorType == GameObjType.gotPlayer)
                     {
+                        GA_Player _player = _target as GA_Player;
+                        if (_player != null)
+                        {
+                            if (_player.MovingState == E_MovingState.Ride)
+                            {
+                                _player.SwitchHorse(0);
+                            }
+                        }
                         continue;
                     }
 
diff --git a/Fight/Actor/Skill/AttackHandler.cs b/Fight/Actor/Skill/AttackHandler.cs
index 059b4e3..ff8237b 100644
--- a/Fight/Actor/Skill/AttackHandler.cs
+++ b/Fight/Actor/Skill/AttackHandler.cs
@@ -122,7 +122,7 @@
 
             if (CheckPull(attacker, target, soConfig.bodyControlId))
             {
-                target.StartBeatBack(soConfig.bodyControlId, MathUtility.ForwardXZ(target.Pos, attacker.Pos));
+                target.StartBeatBack(attacker.ServerInstID, soConfig.bodyControlId, MathUtility.ForwardXZ(target.Pos, attacker.Pos));
             }
         }
 
@@ -1080,7 +1080,7 @@
             // 鏀诲嚮鑰呮槸鐜╁
             if (attacker.ActorType == GameObjType.gotPlayer)
             {
-                return false;
+                return _bodyControl.useForPlayer && target.CanPushedBack();
             }
             else if (attacker.ActorType == GameObjType.gotNPC)
             {
diff --git a/Fight/Actor/Skill/SoBodyControl.cs b/Fight/Actor/Skill/SoBodyControl.cs
index f269087..eb8ba01 100644
--- a/Fight/Actor/Skill/SoBodyControl.cs
+++ b/Fight/Actor/Skill/SoBodyControl.cs
@@ -7,4 +7,14 @@
 
     [Tooltip("琛ㄧ幇鐨勬椂闂�")]
     public float duration;// 绉诲姩鏃堕棿
+
+    [Tooltip("鏄惁瀵圭帺瀹剁被鍨嬬敓鏁�")]
+    public bool useForPlayer = false;
+
+    [Tooltip("鏄帹杩樻槸鎷�, 鎵撻挬鏄帹,涓嶆墦閽╂槸鎷�")]
+    public bool pushOrPull = true;
+
+    [Tooltip(@"闄愬埗浣嶇疆, 浠ラ噴鏀捐�呬负涓績鐨勫亸绉�
+               鍙互涓鸿礋鍊�")]
+    public float limitDistance = 100;
 }
\ No newline at end of file
diff --git a/Fight/Actor/State/SMB/SMB_Base.cs b/Fight/Actor/State/SMB/SMB_Base.cs
index de44069..3290439 100644
--- a/Fight/Actor/State/SMB/SMB_Base.cs
+++ b/Fight/Actor/State/SMB/SMB_Base.cs
@@ -91,6 +91,7 @@
 
     protected void AddToNpcPosList(GActorFight attacker, GActorFight target, int bodyControlId, Vector3 direction, List<NPCPos> npcPosList)
     {
+        // Debug.LogFormat("{0} attack {1} ==================== 0", attacker.GetType().ToString(), target.GetType().ToString());
         if (PreFightMission.Instance.IsFinished() == false)
         {
             return;
@@ -103,10 +104,20 @@
 
         SoBodyControl _bodyControl = ScriptableObjectLoader.LoadSoBodyControl(bodyControlId);
 
+        if (!_bodyControl.pushOrPull)
+        {
+            direction = -direction;
+        }
+
         float _distance = _bodyControl.curve.keys[_bodyControl.curve.length - 1].time;
 
         Vector3 _checkPos = target.Pos;
         Vector3 _pullPosition = _checkPos + direction * _distance;
+
+        if (!_bodyControl.pushOrPull)
+        {
+            _pullPosition = attacker.Pos + MathUtility.ForwardXZ(target.Pos, attacker.Pos) * 0.5f;
+        }
 
         _checkPos.y = 0;
         _pullPosition.y = 0;
@@ -117,24 +128,36 @@
             _pullPosition = _hit.position;
         }
 
+        // 鍙涓昏瀵艰嚧鐨勬帹閫昏緫. 濡傛灉鏄叾浠栦汉鐨勯��涓嶈
+        if (target is GActorNpcFight)
+        {
+            if (attacker is GA_Player)
+            {
+                return;
+            }
+        }
+
         if (GActor.TryGetValidPos(_pullPosition, ref _checkPos))
         {
             if (target.ActorType == GameObjType.gotPlayer)
             {
-                GActorPlayerBase _player = target as GActorPlayerBase;
-                //Debug.Log("--------------------------- 8");
-                if (_player.MovingState != E_MovingState.Ride)
+                if (target is GA_Hero)
                 {
-                    //Debug.Log("--------------------------- 9");
-                    CB402_tagCMNPCBeatBack _beatBack = new CB402_tagCMNPCBeatBack();
-                    _beatBack.ObjType = (byte)GameObjType.gotPlayer;
-                    _beatBack.Count = 1;
-                    _beatBack.NPCPosList = new CB402_tagCMNPCBeatBack.tagCMNPCPos[1];
-                    _beatBack.NPCPosList[0] = new CB402_tagCMNPCBeatBack.tagCMNPCPos();
-                    _beatBack.NPCPosList[0].ObjID = (uint)target.ServerInstID;
-                    _beatBack.NPCPosList[0].PosX = (ushort)(_checkPos.x * 2f + GA_Hero.MapOffset.x);
-                    _beatBack.NPCPosList[0].PosY = (ushort)(_checkPos.z * 2f + GA_Hero.MapOffset.x);
-                    GameNetSystem.Instance.SendInfo(_beatBack);
+                    GActorPlayerBase _player = target as GActorPlayerBase;
+                    //Debug.Log("--------------------------- 8");
+                    if (_player.MovingState != E_MovingState.Ride)
+                    {
+                        // Debug.LogFormat("{0} attack {1} ==================== 9", attacker.GetType().ToString(), target.GetType().ToString());
+                        CB402_tagCMNPCBeatBack _beatBack = new CB402_tagCMNPCBeatBack();
+                        _beatBack.ObjType = (byte)GameObjType.gotPlayer;
+                        _beatBack.Count = 1;
+                        _beatBack.NPCPosList = new CB402_tagCMNPCBeatBack.tagCMNPCPos[1];
+                        _beatBack.NPCPosList[0] = new CB402_tagCMNPCBeatBack.tagCMNPCPos();
+                        _beatBack.NPCPosList[0].ObjID = (uint)target.ServerInstID;
+                        _beatBack.NPCPosList[0].PosX = (ushort)(_checkPos.x * 2f + GA_Hero.MapOffset.x);
+                        _beatBack.NPCPosList[0].PosY = (ushort)(_checkPos.z * 2f + GA_Hero.MapOffset.z);
+                        GameNetSystem.Instance.SendInfo(_beatBack);
+                    }
                 }
                 //else
                 //{
@@ -146,8 +169,8 @@
                 NPCPos _npcPos = new NPCPos
                 {
                     objId = (int)target.ServerInstID,
-                    posX = (int)(_checkPos.x * 2f),
-                    posY = (int)(_checkPos.z * 2f)
+                    posX = (int)(_checkPos.x * 2f + GA_Hero.MapOffset.x),
+                    posY = (int)(_checkPos.z * 2f + GA_Hero.MapOffset.z)
                 };
                 npcPosList.Add(_npcPos);
             }
diff --git a/Fight/GameActor/GAStaticDefine.cs b/Fight/GameActor/GAStaticDefine.cs
index a4acc6b..fe5b4af 100644
--- a/Fight/GameActor/GAStaticDefine.cs
+++ b/Fight/GameActor/GAStaticDefine.cs
@@ -389,8 +389,12 @@
                 }
             }
 
-            //Debug.LogFormat("{0} 鏀诲嚮 {1}, 澧冪晫: {2} <=> {3}, 鏄惁浜х敓浜嗗帇鍒�: {4}",
-            //    caster.ServerInstID, target.ServerInstID, _casterRealm, _targetRealm, _casterRealm > _targetRealm);
+            if (attackType == (int)HurtAttackType.Suppress)
+            {
+                _casterRealm = 1;
+                _targetRealm = 0;
+                _pattern = (PopUpNum.Pattern)(((int)HurtAttackType.Normal - 1) * 3);
+            }
 
             var popupInfo = new PopUpNum.PopupInfo()
             {
diff --git a/Fight/GameActor/GA_Hero.cs b/Fight/GameActor/GA_Hero.cs
index 4eac3bb..6cf8751 100644
--- a/Fight/GameActor/GA_Hero.cs
+++ b/Fight/GameActor/GA_Hero.cs
@@ -24,10 +24,6 @@
     /// 褰撳垏鎹㈤攣瀹氱洰鏍囩殑鏃跺��, 涓虹┖鐨勬椂鍊檌d=0
     /// </summary>
     public static event UnityAction<uint> OnLockTargetChanged;
-    /// <summary>
-    /// 褰撶敤鎴风偣鍑讳簡鎶�鑳芥寜閽�, 骞跺垏鎶�鑳藉彲浠ラ噴鏀剧殑鏃跺�欒皟鐢�
-    /// </summary>
-    public static event UnityAction<int> OnUserClickSkill;
     public static event UnityAction<uint, string> OnKillPlayer;
 
     private GameObject m_Light;
@@ -506,7 +502,8 @@
             && !IsDaZuo()
             && State != E_ActorState.Roll
             && !s_MapSwitching
-            && !heavenBattleModel.IsBattlePrepare;
+            && !heavenBattleModel.IsBattlePrepare
+            && !m_Beating;
     }
 
     public bool CanCastSkill()
@@ -519,7 +516,8 @@
             && State != E_ActorState.Roll
             && State != E_ActorState.Mocked
             && !s_MapSwitching
-            && !heavenBattleModel.IsBattlePrepare;
+            && !heavenBattleModel.IsBattlePrepare
+            && !m_Beating;
     }
 
     public void StopAll()
@@ -719,11 +717,6 @@
         }
 
         Behaviour.StartKillUntilDieAI();
-
-        if (OnUserClickSkill != null)
-        {
-            OnUserClickSkill(0);
-        }
     }
 
     public void CastSkill(int skillID)
@@ -788,11 +781,6 @@
         }
 
         Behaviour.StartKillUntilDieAI(skillID);
-
-        if (OnUserClickSkill != null)
-        {
-            OnUserClickSkill(skillID);
-        }
     }
 
     #endregion
diff --git a/Fight/GameActor/GActorFight.cs b/Fight/GameActor/GActorFight.cs
index 40b9d2b..6dd057d 100644
--- a/Fight/GameActor/GActorFight.cs
+++ b/Fight/GameActor/GActorFight.cs
@@ -181,14 +181,26 @@
     private float m_BeatStartTime;
     protected bool m_Beating;
     private Vector3 m_BeatDirection;
+    private bool m_PushOrPull;
+    private uint m_AttackerSID;
+    private float m_LimitDistance;
 
-    public void StartBeatBack(int configID, Vector3 direction)
+    public void StartBeatBack(uint attacker, int configID, Vector3 direction)
     {
         SoBodyControl _config = ScriptableObjectLoader.LoadSoBodyControl(configID);
 
         if (_config == null || _config.curve == null)
         {
             return;
+        }
+
+        m_AttackerSID = attacker;
+        m_LimitDistance = _config.limitDistance;
+        m_PushOrPull = _config.pushOrPull;
+
+        if (!m_PushOrPull)
+        {
+            direction = -direction;
         }
 
         m_BeatDirection = direction;
@@ -237,6 +249,36 @@
         Vector3 _pos = m_StartBeatPos + _h + _v;
         Vector3 _end = _pos;
 
+        GActor _attacker = GAMgr.Instance.GetBySID(m_AttackerSID);
+
+        float _dis = MathUtility.DistanceSqrtXZ(_attacker.Pos, _end);
+
+        if (m_PushOrPull)
+        {
+            if (MathUtility.DistanceSqrtXZ(_attacker.Pos, _end) > m_LimitDistance * m_LimitDistance)
+            {
+                _end = _attacker.Pos + m_BeatDirection * m_LimitDistance;
+            }
+        }
+        else
+        {
+            Vector3 _limPos = _attacker.Pos;
+            _limPos.y = 0;
+            _limPos = _limPos - m_BeatDirection * m_LimitDistance;
+            Vector3 _dir2 = (_end - _limPos).normalized;
+
+            bool _isOp = MathUtility.OppositeDir(-m_BeatDirection, _dir2);
+            bool _isLimDis = MathUtility.DistanceSqrtXZ(_attacker.Pos, _end) < m_LimitDistance * m_LimitDistance;
+
+            if (_isOp
+             || _isLimDis)
+            {
+                _end = _attacker.Pos - m_BeatDirection * m_LimitDistance;
+                needSyncGroundHeight = true;
+                m_Beating = false;
+            }
+        }
+
         Vector3 _position = m_StartBeatPos;
         _position.y = 0;
         _end.y = 0;
diff --git a/Fight/GameActor/GActorPlayerBase.cs b/Fight/GameActor/GActorPlayerBase.cs
index 2aa1f66..d02a752 100644
--- a/Fight/GameActor/GActorPlayerBase.cs
+++ b/Fight/GameActor/GActorPlayerBase.cs
@@ -39,6 +39,7 @@
     protected HeadUpName m_HeadUpName = null;
 
     private int m_HorseActionType = 0;
+    public int nextComAtkIndex = -1;
 
     public JobSetupConfig JobSetup { get; protected set; }
 
@@ -62,8 +63,6 @@
         }
     }
 
-    public int nextComAtkIndex = -1;
-
     public void SwitchHeadNameBindNode(bool castingSkill)
     {
         // 瑙掕壊琚殣钘忕姸鎬佷笅涓嶆墽琛屽ご椤跺悕绉板垏鎹㈤�昏緫
@@ -82,6 +81,87 @@
             {
                 m_HeadUpName.target = MP_Name;
             }
+        }
+    }
+
+    public bool IsPolyMorph { get; private set; }
+    private GameObject m_SheepModel;
+    private bool m_SheepIsDefaultNpc;
+    public virtual void Polymorph(bool doOrNo)
+    {
+        IsPolyMorph = doOrNo;
+
+        if (IsPolyMorph)
+        {
+            ChangeBinderToRoot();
+
+            // 姝e湪楠戜箻鐘舵�佷笅
+            if (MovingState == E_MovingState.Ride)
+            {
+                m_HorseModel.transform.position = Constants.Special_Hide_Position;
+                SwitchHorse(0);
+                DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(false);
+            }
+            else
+            {
+                m_ClothesModel.transform.position = Constants.Special_Hide_Position;
+            }
+
+            m_SheepIsDefaultNpc = false;
+            var _p = InstanceResourcesLoader.LoadNpc(10101001);
+            if (_p == null)
+            {
+                _p = InstanceResourcesLoader.LoadDefaultFightNPC();
+                m_SheepIsDefaultNpc = true;
+            }
+
+            m_SheepModel = GameObjectPoolManager.Instance.RequestGameObject(_p);
+            m_SheepModel.transform.SetParent(m_Root);
+
+            var _a = m_SheepModel.GetComponent<Animator>();
+            if (_a)
+            {
+                _a.enabled = true;
+                _a.SetInteger(GAStaticDefine.Param_ActorInstID, (int)ClientInstID);
+                m_ClothesAnimator.enabled = false;
+                m_ClothesAnimator = _a;
+            }
+
+            if (ShowOrHide)
+            {
+                m_SheepModel.transform.localPosition = Vector3.zero;
+            }
+            else
+            {
+                m_SheepModel.transform.localPosition = Constants.Special_Hide_Position;
+            }
+
+            m_SheepModel.transform.localRotation = Quaternion.identity;
+        }
+        else
+        {
+            if (m_SheepModel)
+            {
+                if (m_SheepIsDefaultNpc)
+                {
+                    GameObjectPoolManager.Instance.ReleaseDefaultFightNPC(m_SheepModel);
+                }
+                else
+                {
+                    var _prefab = InstanceResourcesLoader.LoadNpc(10101001);
+                    GameObjectPoolManager.Instance.ReleaseGameObject(_prefab, m_SheepModel);
+                }
+            }
+
+            m_SheepModel = null;
+            m_ClothesModel.transform.localPosition = Vector3.zero;
+
+            ChangeBinderToClothes();
+
+            m_ClothesAnimator = m_ClothesModel.GetComponent<Animator>();
+            m_ClothesAnimator.enabled = true;
+            m_ClothesAnimator.SetInteger(GAStaticDefine.Param_ActorInstID, (int)ClientInstID);
+            m_ClothesAnimator.SetInteger(GAStaticDefine.Param_MoveState, (int)E_MovingState.Normal);
         }
     }
 
@@ -974,8 +1054,11 @@
             }
             if (ShowOrHide)
             {
-                m_ClothesModel.transform.localPosition = Vector3.zero;
-                m_ClothesModel.transform.localRotation = Quaternion.identity;
+                if (!IsPolyMorph)
+                {
+                    m_ClothesModel.transform.localPosition = Vector3.zero;
+                    m_ClothesModel.transform.localRotation = Quaternion.identity;
+                }
             }
             else
             {
@@ -987,12 +1070,18 @@
             if (m_WingModel)
             {
                 MovingState = E_MovingState.Fly;
-                m_ClothesAnimator.SetInteger(GAStaticDefine.Param_MoveState, (int)E_MovingState.Fly);
+                if (!IsPolyMorph)
+                {
+                    m_ClothesAnimator.SetInteger(GAStaticDefine.Param_MoveState, (int)E_MovingState.Fly);
+                }
             }
             else
             {
                 MovingState = E_MovingState.Normal;
-                m_ClothesAnimator.SetInteger(GAStaticDefine.Param_MoveState, (int)E_MovingState.Normal);
+                if (!IsPolyMorph)
+                {
+                    m_ClothesAnimator.SetInteger(GAStaticDefine.Param_MoveState, (int)E_MovingState.Normal);
+                }
             }
 
             SwitchHeadNameBindNode(false);
diff --git a/Fight/PreFightMission.cs b/Fight/PreFightMission.cs
index b81a26a..d618391 100644
--- a/Fight/PreFightMission.cs
+++ b/Fight/PreFightMission.cs
@@ -902,7 +902,7 @@
              _model2.clickClosed = false;
 
              m_AfterAttackType = E_AfterAttackType.RefreshRock;
-             GA_Hero.OnUserClickSkill += OnCastSkill;
+             HeroBehaviour.OnUserClickSkill += OnCastSkill;
 
              _model2.onClose = null;
 
@@ -1135,7 +1135,7 @@
 
     private void OnCastSkill(int skillID)
     {
-        GA_Hero.OnUserClickSkill -= OnCastSkill;
+        HeroBehaviour.OnUserClickSkill -= OnCastSkill;
 
         if (m_AfterAttackType == E_AfterAttackType.RefreshRock)
         {
diff --git a/System/KnapSack/PreciousItemGetBehaviour.cs b/System/KnapSack/PreciousItemGetBehaviour.cs
index 2ba7692..b877851 100644
--- a/System/KnapSack/PreciousItemGetBehaviour.cs
+++ b/System/KnapSack/PreciousItemGetBehaviour.cs
@@ -43,7 +43,6 @@
 
         public void ShowItem()
         {
-            m_PreciousItem.gameObject.SetActive(false);
             if (model.currentShowItem != default(PreciousItemGetModel.PreciousItem))
             {
                 var itemModel = playerPack.GetItemModelByGUID(model.currentShowItem.guid);
@@ -62,6 +61,14 @@
                         m_PreciousItem.gameObject.SetActive(true);
                     }
                 }
+                else
+                {
+                    m_PreciousItem.gameObject.SetActive(false);
+                }
+            }
+            else
+            {
+                m_PreciousItem.gameObject.SetActive(false);
             }
             model.isGetNewItem = false;
         }
diff --git a/System/NewBieGuidance/NewBieCenter.cs b/System/NewBieGuidance/NewBieCenter.cs
index 08ab7fe..8d80910 100644
--- a/System/NewBieGuidance/NewBieCenter.cs
+++ b/System/NewBieGuidance/NewBieCenter.cs
@@ -193,7 +193,10 @@
             currentGuide = 0;
             WindowCenter.Instance.CloseImmediately<NewBieWin>();
 
-            completeGuidesBuf.Add(guideRecord);
+            if (!completeGuidesBuf.Contains(guideRecord))
+            {
+                completeGuidesBuf.Add(guideRecord);
+            }
 
             var send = new CA222_tagCMSetGuideOK();
             send.GuideIndex = (byte)_id;
diff --git a/System/SystemSetting/SystemSetWin.cs b/System/SystemSetting/SystemSetWin.cs
index ad86884..b50a600 100644
--- a/System/SystemSetting/SystemSetWin.cs
+++ b/System/SystemSetting/SystemSetWin.cs
@@ -193,16 +193,14 @@
         private void SwitchGameFrame()
         {
             var gameFrame = SystemSetting.Instance.GetGameFrame();
-            switch (gameFrame)
+
+            if (gameFrame==GameFrame.HalfFrame)
             {
-                case GameFrame.HalfFrame:
-                    SystemSetting.Instance.SetGameFrame(GameFrame.FullFrame);
-                    break;
-                case GameFrame.FullFrame:
-                    SystemSetting.Instance.SetGameFrame(GameFrame.HalfFrame);
-                    break;
-                default:
-                    break;
+                SystemSetting.Instance.SetGameFrame(GameFrame.FullFrame);
+            }
+            else
+            {
+                SystemSetting.Instance.SetGameFrame(GameFrame.HalfFrame);
             }
         }
 
diff --git a/System/Team/TeamPrepareWin.cs b/System/Team/TeamPrepareWin.cs
index e0930c0..08b9972 100644
--- a/System/Team/TeamPrepareWin.cs
+++ b/System/Team/TeamPrepareWin.cs
@@ -34,6 +34,7 @@
         bool rejectManual = false;
 
         TeamModel model { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
+
         #region Built-in
         protected override void BindController()
         {
@@ -48,6 +49,11 @@
 
         protected override void OnPreOpen()
         {
+            if (NewBieCenter.Instance.inGuiding)
+            {
+                NewBieCenter.Instance.FinishNewBieGuide(NewBieCenter.Instance.currentGuide);
+            }
+
             rejectManual = false;
             if (!model.myTeam.iamCaptainer)
             {
@@ -187,7 +193,7 @@
         IEnumerator Co_DelayCloseWin()
         {
             yield return null;
-            WindowCenter.Instance.Open<TeamPrepareWin>();
+            WindowCenter.Instance.Close<TeamPrepareWin>();
         }
 
     }
diff --git a/System/Treasure/TreasureCyclicScroll.cs b/System/Treasure/TreasureCyclicScroll.cs
index b178d5f..c9de8f3 100644
--- a/System/Treasure/TreasureCyclicScroll.cs
+++ b/System/Treasure/TreasureCyclicScroll.cs
@@ -136,9 +136,15 @@
                     achievementBehaviour.linerMove.from = achievementBehaviour.rectTransform.anchoredPosition;
                     var toY = achievementBehaviour.rectTransform.anchoredPosition.y + cellSize.y + spacing.y;
                     achievementBehaviour.linerMove.to = achievementBehaviour.rectTransform.anchoredPosition.SetY(toY);
-
                     achievementBehaviour.linerMove.duration = relocationTime;
-                    achievementBehaviour.linerMove.Begin();
+                    if (achievementBehaviour.linerMove.gameObject.activeInHierarchy)
+                    {
+                        achievementBehaviour.linerMove.Begin();
+                    }
+                    else
+                    {
+                        achievementBehaviour.linerMove.Stop();
+                    }
                 }
             }
         }
diff --git a/System/Treasure/TreasureModel.cs b/System/Treasure/TreasureModel.cs
index b832be8..1a27740 100644
--- a/System/Treasure/TreasureModel.cs
+++ b/System/Treasure/TreasureModel.cs
@@ -245,6 +245,7 @@
             FuncOpen.Instance.OnFuncStateChangeEvent += OnFunctionStateChange;
             packageModel.RefreshItemCountAct += OnPackageItemChange;
             WindowCenter.Instance.windowAfterOpenEvent += OnWindowOpen;
+            NewBieCenter.Instance.guideCompletedEvent += GuideComplete;
         }
 
         public override void UnInit()
@@ -252,6 +253,7 @@
             achievementModel.achievementProgressUpdateEvent -= OnAchievementProgressUpdate;
             achievementModel.achievementAwardableEvent -= OnAchievementAwardable;
             achievementModel.achievementCompletedEvent -= OnAchievementCompleted;
+            NewBieCenter.Instance.guideCompletedEvent -= GuideComplete;
 
             DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= OnGetSkillLevelUpResult;
             PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= OnTreasurePotentialSPChange;
@@ -392,7 +394,7 @@
             LocalSave.SetInt(StringUtility.Contact(_playerId, _type, "_TreasureUnlockShow"), _id);
         }
 
-        public void SetTreasureStageShow(int _id,int _stage)
+        public void SetTreasureStageShow(int _id, int _stage)
         {
             LocalSave.SetInt(StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID,
                 "_TreasureStageShow_", _id), _stage);
@@ -525,17 +527,7 @@
                             newGotTreasureId = id;
                             treasureEntranceShowId = id;
 
-                            var mapConfig = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID);
-                            if (mapConfig.MapFBType == (int)MapType.OpenCountry)
-                            {
-                                if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>())
-                                {
-                                    if (PreFightMission.Instance.IsFinished())
-                                    {
-                                        WindowCenter.Instance.Open<TreasureNewGotWin>();
-                                    }
-                                }
-                            }
+                            OpenTreasureNewGot();
                         }
 
                         if (treasureCollectingShowId == id)
@@ -845,13 +837,7 @@
         {
             if (_window is MainInterfaceWin)
             {
-                if (newGotTreasureId != 0)
-                {
-                    if (PreFightMission.Instance.IsFinished())
-                    {
-                        WindowCenter.Instance.Open<TreasureNewGotWin>();
-                    }
-                }
+                SnxxzGame.Instance.StartCoroutine(Co_OpenTreasureNewGot());
                 if (needDisplayReguluLevelUp)
                 {
                     CheckReguluPop();
@@ -859,6 +845,44 @@
             }
         }
 
+        void GuideComplete(int _id)
+        {
+            SnxxzGame.Instance.StartCoroutine(Co_OpenTreasureNewGot());
+        }
+
+        IEnumerator Co_OpenTreasureNewGot()
+        {
+            yield return WaitingForSecondConst.WaitMS600;
+            OpenTreasureNewGot();
+        }
+
+        public void CheckOpenTreasureNewGot()
+        {
+            SnxxzGame.Instance.StartCoroutine(Co_OpenTreasureNewGot());
+        }
+
+        private void OpenTreasureNewGot()
+        {
+            if (!(StageManager.Instance.CurrentStage is DungeonStage) || !serverInited)
+            {
+                return;
+            }
+            if (!PreFightMission.Instance.IsFinished() || newGotTreasureId == 0
+                || NewBieCenter.Instance.inGuiding || !WindowCenter.Instance.CheckOpen<MainInterfaceWin>()
+                || WindowCenter.Instance.ExitAnyFullScreenOrMaskWinLEqual(WindowType.Base)
+                || WindowCenter.Instance.CheckOpen<TreasureNewGotWin>())
+            {
+                return;
+            }
+            var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
+            var mapId = dungeonModel.GetDungeonDataIdByMapId(PlayerDatas.Instance.baseData.MapID);
+            if (mapId == 41110)
+            {
+                return;
+            }
+            WindowCenter.Instance.Open<TreasureNewGotWin>();
+        }
+
         private void UpdateSkillLevelUpRedpoint(int _treasureId)
         {
             if (treasures.ContainsKey(_treasureId))
diff --git a/System/Vip/VipRechargeWin.cs b/System/Vip/VipRechargeWin.cs
index 54d6ae0..0b919ba 100644
--- a/System/Vip/VipRechargeWin.cs
+++ b/System/Vip/VipRechargeWin.cs
@@ -133,6 +133,7 @@
             if (!WindowJumpMgr.Instance.IsJumpState)
             {
                 WindowCenter.Instance.Open<MainInterfaceWin>();
+                ModelCenter.Instance.GetModel<TreasureModel>().CheckOpenTreasureNewGot();
             }
         }
         #endregion
diff --git a/System/Welfare/MultipleRealmPointModel.cs b/System/Welfare/MultipleRealmPointModel.cs
index 22b0f85..881227e 100644
--- a/System/Welfare/MultipleRealmPointModel.cs
+++ b/System/Welfare/MultipleRealmPointModel.cs
@@ -6,7 +6,7 @@
     public class MultipleRealmPointModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
     {
         public Redpoint multipleRed = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20908);
-        public string LocalRecord_Key = "MultipleRealmRecord";
+        public string LocalRecord_Key;
         bool isNewDay = false;
 
         public event Action<int> onStateUpate;
@@ -14,7 +14,7 @@
         public override void Init()
         {
             OpenServerActivityCenter.Instance.Register(8, this);
-          
+            //StageManager.Instance.onStageLoadFinish += CheckReconnect;
         }
 
         public void OnBeforePlayerDataInitialize()
@@ -29,19 +29,19 @@
 
         public void OnPlayerLoginOk()
         {
-            LocalRecord_Key = StringUtility.Contact(LocalRecord_Key, PlayerDatas.Instance.baseData.PlayerID);
-            CheckShowRed();
+            LocalRecord_Key = StringUtility.Contact("MultipleRealmRecord", PlayerDatas.Instance.baseData.PlayerID);
             OperationTimeHepler.Instance.operationStartEvent -= RefreshOperationState;
             OperationTimeHepler.Instance.operationStartEvent += RefreshOperationState;
             OperationTimeHepler.Instance.operationEndEvent -= RefreshOperationState;
             OperationTimeHepler.Instance.operationEndEvent += RefreshOperationState;
             OperationTimeHepler.Instance.operationServerCloseEvent -= RefreshOperationClose;
             OperationTimeHepler.Instance.operationServerCloseEvent += RefreshOperationClose;
+            CheckShowRed();
         }
 
         public override void UnInit()
         {
-          
+            StageManager.Instance.onStageLoadFinish -= CheckReconnect;
         }
 
         public bool IsOpen
@@ -61,6 +61,15 @@
                 return multipleRed.state == RedPointState.Simple;
             }
         }
+
+        private void CheckReconnect()
+        {
+            if (!(StageManager.Instance.CurrentStage is DungeonStage))
+            {
+                CheckShowRed();
+            }
+        }
+
 
         private void RefreshOperationClose(Operation type)
         {
@@ -89,16 +98,20 @@
 
             if(!isNewDay)
             {
+              
                 if (!PlayerPrefs.HasKey(LocalRecord_Key))
                 {
+                    DebugEx.Log("璁剧疆璁板綍鏃堕棿锛�" + TimeUtility.ServerNow.Day);
                     LocalSave.SetInt(LocalRecord_Key, TimeUtility.ServerNow.Day);
                     isNewDay = true;
                 }
                 else
                 {
+                    DebugEx.Log("寰楀埌璁板綍鏃堕棿锛�" + LocalSave.GetInt(LocalRecord_Key));
                     if (TimeUtility.ServerNow.Day != LocalSave.GetInt(LocalRecord_Key))
                     {
                         isNewDay = true;
+                        DebugEx.Log("璁剧疆璁板綍鏃堕棿锛�" + TimeUtility.ServerNow.Day);
                         LocalSave.SetInt(LocalRecord_Key, TimeUtility.ServerNow.Day);
                     }
                 }
diff --git a/System/WindowBase/WindowCenter.cs b/System/WindowBase/WindowCenter.cs
index 2923870..be8d403 100644
--- a/System/WindowBase/WindowCenter.cs
+++ b/System/WindowBase/WindowCenter.cs
@@ -13,7 +13,8 @@
         public event Action<Window> jumpWindowCloseEvent;
         List<string> closeAllIgnoreWindows = new List<string>() {
             "MessageWin", "NewBieWin", "NewItemGetWin", "AttributePromoteShowWin" ,"DungeonBeginCoolDownWin","DungeonFightWin","StatusTipWin"
-            ,"ScrollTipWin","MarqueeWin","ExperienceOpenWin","TrumpetWin","BattlePrepareCoolDownWin","DungeonGradeWin","BattleHintWin"
+            ,"ScrollTipWin","MarqueeWin","ExperienceOpenWin","TrumpetWin","BattlePrepareCoolDownWin","DungeonGradeWin","BattleHintWin",
+            "TreasureDungeonMissionHintWin",
         };
 
         UIRoot m_UIRoot;
diff --git a/Utility/EnumHelper.cs b/Utility/EnumHelper.cs
index 584dc03..bba531e 100644
--- a/Utility/EnumHelper.cs
+++ b/Utility/EnumHelper.cs
@@ -1292,7 +1292,9 @@
     /** 闂伩 */
     Miss,
     /** 鍏嶇柅 */
-    Immune
+    Immune,
+    /** 鍘嬪埗 */
+    Suppress
 }
 
 public enum E_PlayerState
diff --git a/Utility/MathUtility.cs b/Utility/MathUtility.cs
index 3a162b0..ec01aa7 100644
--- a/Utility/MathUtility.cs
+++ b/Utility/MathUtility.cs
@@ -154,6 +154,21 @@
         return (target - self).normalized;
     }
 
+    public static bool IsSameDir(Vector3 vec1, Vector3 vec2)
+    {
+        vec1.y = 0;
+        vec2.y = 0;
+
+        return Vector3.Dot(vec1, vec2) > 0;
+    }
+
+    public static bool OppositeDir(Vector3 vec1, Vector3 vec2)
+    {
+        vec1.y = 0;
+        vec2.y = 0;
+
+        return Vector3.Dot(vec1, vec2) < 0;
+    }
     public static int Power(int a, int e)
     {
         int value = 1;
diff --git a/Utility/ResolutionUtility.cs b/Utility/ResolutionUtility.cs
index 7f98605..fe7ad68 100644
--- a/Utility/ResolutionUtility.cs
+++ b/Utility/ResolutionUtility.cs
@@ -20,7 +20,7 @@
                 currentResolution = ConvertResolution(new Vector2(1280, 720));
                 break;
             case GameQuality.Medium:
-                currentResolution = ConvertResolution(new Vector2(1280, 720));
+                currentResolution = ConvertResolution(new Vector2(1920, 1080));
                 break;
             case GameQuality.High:
                 currentResolution = ConvertResolution(new Vector2(1920, 1080));
diff --git a/Utility/RuntimeLogUtility.cs b/Utility/RuntimeLogUtility.cs
index d38aabc..eaa22df 100644
--- a/Utility/RuntimeLogUtility.cs
+++ b/Utility/RuntimeLogUtility.cs
@@ -223,7 +223,7 @@
 
         if (GUILayout.Button("閰烽叿閰�"))
         {
-
+            PlayerDatas.Instance.hero.Polymorph(!PlayerDatas.Instance.hero.IsPolyMorph);
         }
 
         if (GUILayout.Button("鐩存帴閲嶈繛"))

--
Gitblit v1.8.0