瀏覽代碼

击飞落地伤害根据距离来算

WGL 3 月之前
父節點
當前提交
53d6f834be

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Characters/AttackController.cs

@@ -60,7 +60,7 @@ public class AttackInfo
         [LabelText("薯")] public float force;
         [LabelText("邈華綴悈婠奀潔")] public float time;
         [LabelText("邈華岆瘁衄夼漲")] [ToggleLeft] public bool haveLandingDamage;
-        [LabelText("邈華夼漲")] [ShowIf("haveLandingDamage")] public int landingDamage;
+        [LabelText("邈華夼漲掀薹")] [ShowIf("haveLandingDamage")] public int landingDamageRate;
         [LabelText("諷秶脯撰")] public int ControlOrder;
     }
     private bool ShowBlowUpValue() => attackEffect.Contains(AttackEffect.BlowUp);

+ 6 - 1
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -47,6 +47,7 @@ public class AttributeStatus : MonoBehaviour
     private int landingDamage;
     private Character landingDamageFrom;
     private Vector3 startFlyPos;
+    private float landingDamageRate;
 
     [TabGroup("Ò×ÉË")]
     [DisplayOnly] public bool haveVulnerable;
@@ -290,7 +291,10 @@ public class AttributeStatus : MonoBehaviour
                             hitState = 1;
                             if (haveLandingDamage)
                             {
-                                //if()
+                                if(specialState == SpecialState.BlownUp)
+                                {
+                                    landingDamage = (int)(Mathf.Abs(transform.position.x - startFlyPos.x) * landingDamageRate);
+                                }
                                 character.BeHit(landingDamage, landingDamageFrom);
                             }
                         }
@@ -426,6 +430,7 @@ public class AttributeStatus : MonoBehaviour
         rb.transform.rotation = Quaternion.Euler(0, 0, 0);
         haveLandingDamage = blowUp.haveLandingDamage;
         startFlyPos = transform.position;
+        landingDamageRate = blowUp.landingDamageRate;
         hitState = 0;
         isFly = false;
         character.ani.Play("hitted", 0, 0);