wgl 5 сар өмнө
parent
commit
0b78166b63

+ 4 - 0
ActionTowerDefense/Assets/Scripts/Characters/AttackController.cs

@@ -59,6 +59,8 @@ public class AttackInfo
         [LabelText("方向")] public Vector3 dir;
         [LabelText("力")] public float force;
         [LabelText("落地后眩晕时间")] public float time;
+        [LabelText("落地是否有伤害")] [ToggleLeft] public bool haveLandingDamage;
+        [LabelText("落地伤害")] [ShowIf("haveLandingDamage")] public int landingDamage;
         [LabelText("控制层级")] public int ControlOrder;
     }
     private bool ShowBlowUpValue() => attackEffect.Contains(AttackEffect.BlowUp);
@@ -77,6 +79,8 @@ public class AttackInfo
         [LabelText("方向")] public Vector3 dir;
         [LabelText("力")] public float force;
         [LabelText("落地后眩晕时间")] public float time;
+        [LabelText("落地是否有伤害")] [ToggleLeft]public bool haveLandingDamage;
+        [LabelText("落地伤害")] [ShowIf("haveLandingDamage")] public int landingDamage;
         [LabelText("控制层级")] public int ControlOrder;
     }
     private bool ShowShotDownValue() => attackEffect.Contains(AttackEffect.ShotDown);

+ 13 - 0
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -43,6 +43,8 @@ public class AttributeStatus : MonoBehaviour
     [TabGroup("샌령샌쭝")] [DisplayOnly] public bool isFly;
     [TabGroup("샌령샌쭝")] [LabelText("X렘蕨羸제")] public float decelerationRatioX = 2f;
     [TabGroup("샌령샌쭝")] [LabelText("Y렘蕨羸제")] public float decelerationRatioY = 15f;
+    private bool haveLandingDamage;
+    private int landingDamage;
 
     [TabGroup("弄�")]
     [DisplayOnly] public bool haveVulnerable;
@@ -265,6 +267,10 @@ public class AttributeStatus : MonoBehaviour
                             vel = Vector3.zero;
                             character.ani.Play("weak", 0, 0);
                             hitState = 1;
+                            if (haveLandingDamage)
+                            {
+                                character.BeHit(landingDamage);
+                            }
                         }
                         else
                         {
@@ -312,6 +318,7 @@ public class AttributeStatus : MonoBehaviour
             rb.useGravity = false;
             rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionY;
         }
+        haveLandingDamage = false;
         character.ChangeState(CharacterState.Idle);
     }
 
@@ -393,6 +400,9 @@ public class AttributeStatus : MonoBehaviour
         rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
         rb.velocity = Vector3.zero;
         rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
+        haveLandingDamage = blowUp.haveLandingDamage;
+        landingDamage = blowUp.landingDamage;
+
         hitState = 0;
         character.ani.Play("hitted", 0, 0);
         isFly = false;
@@ -422,6 +432,9 @@ public class AttributeStatus : MonoBehaviour
         rb.velocity = Vector3.zero;
         rb.AddForce(vec3 * shotDown.force * (1 - resistances.ShotDown), ForceMode.Impulse);
         character.ani.Play("hitted", 0, 0);
+        haveLandingDamage = shotDown.haveLandingDamage;
+        landingDamage = shotDown.landingDamage;
+
         hitState = 0;
         isFly = false;
         character.ChangeState(CharacterState.SpecialStatus_ShotDown);