Ver Fonte

击飞方向随机

WGL há 3 meses atrás
pai
commit
4550aa94a4

+ 12 - 0
ActionTowerDefense/Assets/Resources/Prefab/MySoldier/Demonic_Giant.prefab

@@ -114,6 +114,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -242,6 +243,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -302,6 +304,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -337,6 +340,11 @@ MonoBehaviour:
   isFly: 0
   decelerationRatioX: 2
   decelerationRatioY: 15
+  startFlyAngle: 15
+  flyingRotateSpeedRange: {x: 15, y: 45}
+  compressionDegree: 0.8
+  compressionSpeed: {x: 0.2, y: 0.4}
+  jumpVel: 5
   haveVulnerable: 0
   vulnerableTime: 0
   stackingWoudsTime: 0
@@ -808,6 +816,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -867,6 +876,7 @@ MonoBehaviour:
       blowUp:
         directionType: 0
         dir: {x: -1, y: 1, z: 0}
+        dirRandom: {x: 0.5, y: 0.5, z: 0}
         force: 130
         time: 2
         haveLandingDamage: 1
@@ -930,6 +940,7 @@ MonoBehaviour:
       blowUp:
         directionType: 0
         dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
         force: 0
         time: 0
         haveLandingDamage: 0
@@ -994,6 +1005,7 @@ MonoBehaviour:
       blowUp:
         directionType: 0
         dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
         force: 0
         time: 0
         haveLandingDamage: 0

+ 47 - 0
ActionTowerDefense/Assets/Resources/Prefab/MySoldier/Demonic_Sword.prefab

@@ -395,6 +395,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -403,6 +404,7 @@ MonoBehaviour:
     shotDown:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -416,6 +418,9 @@ MonoBehaviour:
     vulnerable:
       rate: 0
       time: 0
+    stackingWounds:
+      damage: 0
+      time: 0
     changeDamage:
       rate: 0
     sustainedInjury:
@@ -451,6 +456,7 @@ MonoBehaviour:
       blowUp:
         directionType: 0
         dir: {x: 0.5, y: 1, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
         force: 200
         time: 3
         haveLandingDamage: 0
@@ -459,6 +465,7 @@ MonoBehaviour:
       shotDown:
         directionType: 0
         dir: {x: -1, y: -4, z: 0}
+        dirRandom: {x: 0.5, y: 0.5, z: 0}
         force: 200
         time: 5
         haveLandingDamage: 1
@@ -472,6 +479,9 @@ MonoBehaviour:
       vulnerable:
         rate: 0
         time: 0
+      stackingWounds:
+        damage: 0
+        time: 0
       changeDamage:
         rate: 0
       sustainedInjury:
@@ -511,6 +521,7 @@ MonoBehaviour:
       blowUp:
         directionType: 0
         dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
         force: 0
         time: 0
         haveLandingDamage: 0
@@ -519,6 +530,7 @@ MonoBehaviour:
       shotDown:
         directionType: 0
         dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
         force: 0
         time: 0
         haveLandingDamage: 0
@@ -532,6 +544,9 @@ MonoBehaviour:
       vulnerable:
         rate: 0
         time: 0
+      stackingWounds:
+        damage: 0
+        time: 0
       changeDamage:
         rate: 0
       sustainedInjury:
@@ -572,6 +587,7 @@ MonoBehaviour:
       blowUp:
         directionType: 0
         dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
         force: 0
         time: 0
         haveLandingDamage: 0
@@ -580,6 +596,7 @@ MonoBehaviour:
       shotDown:
         directionType: 0
         dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
         force: 0
         time: 0
         haveLandingDamage: 0
@@ -593,6 +610,9 @@ MonoBehaviour:
       vulnerable:
         rate: 0
         time: 0
+      stackingWounds:
+        damage: 0
+        time: 0
       changeDamage:
         rate: 0
       sustainedInjury:
@@ -771,6 +791,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -779,6 +800,7 @@ MonoBehaviour:
     shotDown:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -792,6 +814,9 @@ MonoBehaviour:
     vulnerable:
       rate: 0
       time: 0
+    stackingWounds:
+      damage: 0
+      time: 0
     changeDamage:
       rate: 0
     sustainedInjury:
@@ -1084,6 +1109,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -1092,6 +1118,7 @@ MonoBehaviour:
     shotDown:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -1105,6 +1132,9 @@ MonoBehaviour:
     vulnerable:
       rate: 0
       time: 0
+    stackingWounds:
+      damage: 0
+      time: 0
     changeDamage:
       rate: 0
     sustainedInjury:
@@ -1506,6 +1536,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -1514,6 +1545,7 @@ MonoBehaviour:
     shotDown:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -1527,6 +1559,9 @@ MonoBehaviour:
     vulnerable:
       rate: 0
       time: 0
+    stackingWounds:
+      damage: 0
+      time: 0
     changeDamage:
       rate: 0
     sustainedInjury:
@@ -1563,6 +1598,7 @@ MonoBehaviour:
     blowUp:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -1571,6 +1607,7 @@ MonoBehaviour:
     shotDown:
       directionType: 0
       dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
       force: 0
       time: 0
       haveLandingDamage: 0
@@ -1584,6 +1621,9 @@ MonoBehaviour:
     vulnerable:
       rate: 0
       time: 0
+    stackingWounds:
+      damage: 0
+      time: 0
     changeDamage:
       rate: 0
     sustainedInjury:
@@ -1595,8 +1635,15 @@ MonoBehaviour:
   isFly: 0
   decelerationRatioX: 2
   decelerationRatioY: 15
+  startFlyAngle: 15
+  flyingRotateSpeedRange: {x: 15, y: 45}
+  compressionDegree: 0.8
+  compressionSpeed: {x: 0.2, y: 0.4}
+  jumpVel: 5
   haveVulnerable: 0
   vulnerableTime: 0
+  stackingWoudsTime: 0
+  stackingWordsNum: 0
   resistances:
     controlOrder: 0
     Float: 0

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

@@ -57,6 +57,7 @@ public class AttackInfo
         }
         [LabelText("击飞模式")] public DirectionType directionType;
         [LabelText("方向")] public Vector3 dir;
+        [LabelText("方向的随机范围")] public Vector3 dirRandom;
         [LabelText("力")] public float force;
         [LabelText("落地后眩晕时间")] public float time;
         [LabelText("落地是否有伤害")] [ToggleLeft] public bool haveLandingDamage;
@@ -77,6 +78,7 @@ public class AttackInfo
         }
         [LabelText("击落模式")] public DirectionType directionType;
         [LabelText("方向")] public Vector3 dir;
+        [LabelText("方向的随机范围")] public Vector3 dirRandom;
         [LabelText("力")] public float force;
         [LabelText("落地后眩晕时间")] public float time;
         [LabelText("落地是否有伤害")] [ToggleLeft]public bool haveLandingDamage;

+ 10 - 3
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -310,7 +310,7 @@ public class AttributeStatus : MonoBehaviour
                             }
                             character.ani.Play("weak", 0, 0);
                             character.bodyCollider.layer = character.gameObject.layer;
-                            vel = vel/2f;
+                            vel = vel/5f;
                             vel.y = jumpVel;
                             character.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, character.platformRotZ);
                             character.mecanim.transform.rotation = Quaternion.Euler(0, 0, 0);
@@ -468,7 +468,10 @@ public class AttributeStatus : MonoBehaviour
         this.attackInfo = attackInfo;
         AttackInfo.BlowUp blowUp = attackInfo.blowUp;
         attributeTime = blowUp.time * (1 - resistances.BlowUp);
-        Vector3 vec3 = blowUp.dir.normalized;
+        Vector3 vec3 = new Vector3(
+            blowUp.dir.x + UnityEngine.Random.Range(-blowUp.dirRandom.x/2f, blowUp.dirRandom.x/2f),
+            blowUp.dir.y + UnityEngine.Random.Range(-blowUp.dirRandom.y/2f, blowUp.dirRandom.y/2f), 
+            0).normalized;
         int attackDir = 0; 
         switch (blowUp.directionType)
         {
@@ -489,6 +492,7 @@ public class AttributeStatus : MonoBehaviour
         rb.useGravity = true;
         rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
         rb.velocity = Vector3.zero;
+
         rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
         rb.transform.rotation = Quaternion.Euler(0, 0, 0);
         character.mecanim.transform.rotation = Quaternion.Euler(0, 0, startFlyAngle * attackDir);
@@ -505,7 +509,10 @@ public class AttributeStatus : MonoBehaviour
         this.attackInfo = attackInfo;
         AttackInfo.ShotDown shotDown = attackInfo.shotDown;
         attributeTime = shotDown.time * (1 - resistances.ShotDown);
-        Vector3 vec3 = shotDown.dir.normalized;
+        Vector3 vec3 = new Vector3(
+            shotDown.dir.x + UnityEngine.Random.Range(-shotDown.dirRandom.x / 2f, shotDown.dirRandom.x / 2f),
+            shotDown.dir.y + UnityEngine.Random.Range(-shotDown.dirRandom.y / 2f, shotDown.dirRandom.y / 2f),
+            0).normalized;
         int attackDir = 0;
         switch (shotDown.directionType)
         {