From e1dcfa049cd7f676fb56c91bee6737dce0aed7e4 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 25 四月 2019 13:39:02 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Fight/GameActor/GActor.cs                |    8 ++++----
 Fight/GameActor/GA_NpcClientFightNorm.cs |    9 +++++++--
 Fight/Actor/Skill/AttackHandler.cs       |   16 +++++++++++++++-
 Fight/GameActor/GA_NpcClientCollect.cs   |   11 -----------
 Fight/GameActor/GA_NpcClientFightBoss.cs |    4 +---
 5 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/Fight/Actor/Skill/AttackHandler.cs b/Fight/Actor/Skill/AttackHandler.cs
index f8c3212..96e8c5c 100644
--- a/Fight/Actor/Skill/AttackHandler.cs
+++ b/Fight/Actor/Skill/AttackHandler.cs
@@ -206,10 +206,24 @@
                     }
                     else if (target is GA_NpcClientFightNorm)
                     {
-                        if ((target as GA_NpcClientFightNorm).NpcConfig.AIType == 198)
+                        var _cnpc = target as GA_NpcClientFightNorm;
+                        if (_cnpc.NpcConfig.AIType == 198)
                         {
                             _doReduceHp = false;
                         }
+                        else if (_cnpc.lockHp > 0)
+                        {
+                            var _lockHp = (ulong)(target.ActorInfo.RealMaxHp * _cnpc.lockHp);
+                            if ((ulong)hurtValue >= target.ActorInfo.Hp)
+                            {
+                                target.ActorInfo.ResetHp((int)_lockHp);
+                                _doReduceHp = false;
+                            }
+                            else if (target.ActorInfo.Hp - (ulong)hurtValue < _lockHp)
+                            {
+                                hurtValue = (int)(target.ActorInfo.Hp - _lockHp);
+                            }
+                        }
                     }
 
                     if (_doReduceHp)
diff --git a/Fight/GameActor/GA_NpcClientCollect.cs b/Fight/GameActor/GA_NpcClientCollect.cs
index b78d2b3..24ba8b3 100644
--- a/Fight/GameActor/GA_NpcClientCollect.cs
+++ b/Fight/GameActor/GA_NpcClientCollect.cs
@@ -6,11 +6,6 @@
 
 public class GA_NpcClientCollect : GA_NpcClientFunc
 {
-    public static UnityAction<uint> OnCollectFinished;
-    private static List<uint> m_ArrivedList = new List<uint>();
-
-    private bool m_IsMainWinOpen = false;
-
     protected override void OnInit(GameNetPackBasic package)
     {
         base.OnInit(package);
@@ -77,12 +72,6 @@
     protected override void OnFixedUpdate()
     {
         base.OnFixedUpdate();
-
-        if (!m_IsMainWinOpen)
-        {
-            m_IsMainWinOpen = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
-            return;
-        }
 
         GA_Hero _hero = PlayerDatas.Instance.hero;
 
diff --git a/Fight/GameActor/GA_NpcClientFightBoss.cs b/Fight/GameActor/GA_NpcClientFightBoss.cs
index 5ff9f1e..009a32d 100644
--- a/Fight/GameActor/GA_NpcClientFightBoss.cs
+++ b/Fight/GameActor/GA_NpcClientFightBoss.cs
@@ -13,10 +13,8 @@
     /// </summary>
     public static UnityAction<uint, int, ulong, ulong> s_HpRefresh;
 
-    protected override void OnInit(GameNetPackBasic package)
+    protected sealed override void InitAI()
     {
-        base.OnInit(package);
-
         if (NpcConfig.NPCID == 30902001)
         {
             m_AIHandler = new AI_Boss_HYQ(this, BornPos);
diff --git a/Fight/GameActor/GA_NpcClientFightNorm.cs b/Fight/GameActor/GA_NpcClientFightNorm.cs
index fc287ee..065201e 100644
--- a/Fight/GameActor/GA_NpcClientFightNorm.cs
+++ b/Fight/GameActor/GA_NpcClientFightNorm.cs
@@ -135,6 +135,13 @@
         m_ProcessManager = new ProcessManager();
         m_ProcessManager.Load(this);
 
+        InitAI();
+
+        heroAttacked = false;
+    }
+
+    protected virtual void InitAI()
+    {
         if (NpcConfig.AIType == 1)
         {
             m_AIHandler = new AI_Npc_200(this, BornPos);
@@ -143,8 +150,6 @@
         {
             m_AIHandler = new AI_Npc_198(this, BornPos);
         }
-
-        heroAttacked = false;
     }
 
     public override void OnClick()
diff --git a/Fight/GameActor/GActor.cs b/Fight/GameActor/GActor.cs
index 0097a26..d7d3f11 100644
--- a/Fight/GameActor/GActor.cs
+++ b/Fight/GameActor/GActor.cs
@@ -694,8 +694,8 @@
         {
             if (!TryGetValidPos(_clntPos, ref _adjustPos))
             {
-                Debug.LogWarningFormat("鏈嶅姟绔粰瀹氬潗鏍�: {0} 鏄犲皠鑷冲鎴风鍧愭爣: {1} 涓哄鎴风鏃犳硶鐭鐨勯殰纰嶇偣...褰撳墠鍦板浘: {2}",
-                    new Vector2(sPosX, sPosY), new Vector2(_clntPos.x, _clntPos.z), PlayerDatas.Instance.baseData.MapID);
+                Debug.LogWarningFormat("瀵硅薄: {3} : 鏈嶅姟绔粰瀹氬潗鏍�: {0} 鏄犲皠鑷冲鎴风鍧愭爣: {1} 涓哄鎴风鏃犳硶鐭鐨勯殰纰嶇偣...褰撳墠鍦板浘: {2}",
+                    new Vector2(sPosX, sPosY), new Vector2(_clntPos.x, _clntPos.z), PlayerDatas.Instance.baseData.MapID, ServerInstID);
                 return;
             }
         }
@@ -703,8 +703,8 @@
         float _groundHeight = Pos.y;
         if (!CollisionUtility.TryGetGroundHeight(_adjustPos, out _groundHeight))
         {
-            Debug.LogErrorFormat("鏈嶅姟绔粰瀹氬潗鏍�: {0} 鏄犲皠鑷冲鎴风鍧愭爣: {1} 骞朵笖鐭鍚�: {2}瀹㈡埛绔棤娉曚粠姝ょ偣璁$畻鍑哄湴鏉块珮搴�...",
-                new Vector2(sPosX, sPosY), new Vector2(_clntPos.x, _clntPos.y), new Vector2(_adjustPos.x, _adjustPos.z));
+            Debug.LogErrorFormat("瀵硅薄: {3} : 鏈嶅姟绔粰瀹氬潗鏍�: {0} 鏄犲皠鑷冲鎴风鍧愭爣: {1} 骞朵笖鐭鍚�: {2}瀹㈡埛绔棤娉曚粠姝ょ偣璁$畻鍑哄湴鏉块珮搴�...",
+                new Vector2(sPosX, sPosY), new Vector2(_clntPos.x, _clntPos.y), new Vector2(_adjustPos.x, _adjustPos.z), ServerInstID);
         }
 
         _adjustPos.y = _groundHeight;

--
Gitblit v1.8.0