Procházet zdrojové kódy

增加法术支持抛物线路径

大爷 před 2 roky
rodič
revize
af0c13caea
1 změnil soubory, kde provedl 20 přidání a 14 odebrání
  1. 20 14
      Common/CommonAI/ZoneClient/ZoneObject.Spell.cs

+ 20 - 14
Common/CommonAI/ZoneClient/ZoneObject.Spell.cs

@@ -22,6 +22,7 @@ namespace CommonAI.ZoneClient
         public override float Z { get { return mLocal_Z; } }
         public override float RadiusSize { get { return mDisplaySize; } }
 
+        public float RotationX { get; internal set; }
         public ZoneObject Sender { get; internal set; }
         public ZoneUnit Launcher { get; internal set; }
         public ZoneUnit Target { get; internal set; }
@@ -44,7 +45,7 @@ namespace CommonAI.ZoneClient
         private int mPassTimeMS;
         private float mSpeed;
 
-        private float mMoveDistance;
+        //private float mMoveDistance;
         private int mCurveMissileIndex = -1;
 
         private PopupKeyFrames<SpellTemplate.KeyFrame> mKeyFrames;
@@ -61,7 +62,8 @@ namespace CommonAI.ZoneClient
         {
             this.Info = info;
 
-			this.mStartPos.SetX(syn.x);
+            RotationX = 0;
+            this.mStartPos.SetX(syn.x);
 			this.mStartPos.SetY(syn.y);
 			this.mPos.SetX(syn.x);
 			this.mPos.SetY(syn.y);
@@ -81,7 +83,7 @@ namespace CommonAI.ZoneClient
             this.mHitIntervalTicker = new TimeInterval<SpellTemplate.KeyFrame>(info.HitIntervalMS);
             this.mHitIntervalTicker.Tag = info.HitIntervalKeyFrame;
             this.mSpeed = info.MSpeedSEC;
-            this.mMoveDistance = 0;
+            //this.mMoveDistance = 0;
             if (syn.HasSpeed)
             {
                 this.mSpeed = syn.CurSpeed;
@@ -264,10 +266,6 @@ namespace CommonAI.ZoneClient
             }
         }
 
-        protected internal override void UpdateAI()
-        {
-        }
-
         internal protected override void Update()
         {
             int intervalMS = Parent.CurrentIntervalMS;
@@ -278,9 +276,18 @@ namespace CommonAI.ZoneClient
             {
                 updateMotion(intervalMS);
             }*/
-            updateZPos();
+            if (!this.Parent.IsSyncZ)
+            {
+                var prez = this.mLocal_Z;
+                updateZPos();
 
-            switch (Info.MType)
+                //根据z向高度的变化,调整法术x轴Rotation
+                float difz = mLocal_Z - prez;
+                float speed_distance = MoveHelper.GetDistance(intervalMS, mSpeed);
+                RotationX = (float)Math.Atan2(difz, speed_distance);
+            }
+
+            /*switch (Info.MType)
             {
                 case SpellTemplate.MotionType.AOE:
                 case SpellTemplate.MotionType.AOE_Binding:
@@ -303,7 +310,7 @@ namespace CommonAI.ZoneClient
                 MoveHelper.UpdateSpeed(intervalMS, ref mSpeed, Info.MSpeedAdd, Info.MSpeedAcc);
                 MoveHelper.UpdateMoveDistance(intervalMS, ref mMoveDistance, mSpeed);
             }
-            updateKeyFrames();
+            updateKeyFrames();*/
         }
 
         public override void SyncPos(ref SyncPosEvent.UnitPos pos)
@@ -321,10 +328,9 @@ namespace CommonAI.ZoneClient
         #region _UpdateMotions_
 
         float foxfireRoundAngle = 0f;
+        //float foxfireSeekWait = 0f;
 
-        float foxfireSeekWait = 0f;
-
-        private Logger log = LoggerFactory.GetLogger("ZoneClient");
+        private Logger log = LoggerFactory.GetLogger("ZoneClientSpell");
 
         /// <summary>
         /// 更新移动行为
@@ -485,7 +491,7 @@ namespace CommonAI.ZoneClient
                             {
                                 PreFaceTo(foxfireRoundAngle + (float)Math.PI * 0.25f);
                             }
-                            foxfireSeekWait += intervalMS;
+                            //foxfireSeekWait += intervalMS;
                         }
                         else
                         {