Browse Source

盔甲武士暂存

1243896040 1 week ago
parent
commit
9a68951daf

+ 8 - 1
ActionTowerDefense/Assets/Resources/Prefab/ESpirits/ESpirits_ArmoredSamurai.prefab

@@ -128,6 +128,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -280,6 +281,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -325,6 +327,8 @@ MonoBehaviour:
   floatingState: 0
   hitState: 0
   isFly: 0
+  jumpNum: 0
+  jumpNumRate: 0
   decelerationRatioX: 2
   decelerationRatioY: 15
   landingDamageFrom: {fileID: 0}
@@ -392,6 +396,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -760,9 +765,10 @@ MonoBehaviour:
         dir: {x: -1, y: 1, z: 0}
         dirRandom: {x: 0.5, y: 0.5, z: 0}
         force: 110
-        time: 2
+        time: 0
         haveLandingDamage: 1
         landingDamageRate: 3
+        jumpNum: 2
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -832,6 +838,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0

+ 8 - 0
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -5780,6 +5780,7 @@ MonoBehaviour:
   electrifyEffect: {fileID: 0}
   isOnFire: 0
   fireStacks: 0
+  isDebug: 0
   playerId: 0
   refreshPos: {x: 0, y: 10}
   canJump: 1
@@ -6005,6 +6006,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -6241,6 +6243,7 @@ MonoBehaviour:
         time: 1
         haveLandingDamage: 1
         landingDamageRate: 2.5
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -6616,6 +6619,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -6661,6 +6665,8 @@ MonoBehaviour:
   floatingState: 0
   hitState: 0
   isFly: 0
+  jumpNum: 0
+  jumpNumRate: 0.8
   decelerationRatioX: 2
   decelerationRatioY: 15
   landingDamageFrom: {fileID: 0}
@@ -6728,6 +6734,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0
@@ -7145,6 +7152,7 @@ MonoBehaviour:
         time: 0
         haveLandingDamage: 0
         landingDamageRate: 0
+        jumpNum: 0
         ControlOrder: 0
       shotDown:
         directionType: 0

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

@@ -68,6 +68,7 @@ public class AttackInfo
         [LabelText("落地后眩晕时间")] public float time;
         [LabelText("落地是否有伤害")] [ToggleLeft] public bool haveLandingDamage;
         [LabelText("落地伤害比率")] [ShowIf("haveLandingDamage")] public float landingDamageRate;
+        [LabelText("弹跳次数")] [ShowIf("haveLandingDamage")] public int jumpNum;
         [LabelText("控制层级")] public int ControlOrder;
     }
     private bool ShowBlowUpValue() => attackEffect.Contains(AttackEffect.BlowUp);

+ 25 - 11
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -43,6 +43,8 @@ public class AttributeStatus : MonoBehaviour
 
     [TabGroup("击飞击落")] [DisplayOnly] public int hitState;
     [TabGroup("击飞击落")] [DisplayOnly] public bool isFly;
+    [TabGroup("击飞击落")] [DisplayOnly] public int jumpNum;
+    [TabGroup("击飞击落")] [LabelText("弹跳力比例")] public float jumpNumRate;
     [TabGroup("击飞击落")] [LabelText("X方向阻力")] public float decelerationRatioX = 2f;
     [TabGroup("击飞击落")] [LabelText("Y方向重力")] public float decelerationRatioY = 15f;
     public Character landingDamageFrom;
@@ -58,6 +60,7 @@ public class AttributeStatus : MonoBehaviour
     [Tooltip("x为向下压缩经过的时间,y为回弹经过的时间")]
     [TabGroup("击飞击落")] [LabelText("压缩速度")] public Vector2 compressionSpeed = new Vector2(0.2f, 0.4f);
     [TabGroup("击飞击落")] [LabelText("弹跳速度")] public float jumpVel = 5f;
+    [TabGroup("击飞击落")] private Vector3 flyForce;
 
     [TabGroup("易伤")]
     [DisplayOnly] public bool haveVulnerable = false;
@@ -319,16 +322,7 @@ public class AttributeStatus : MonoBehaviour
                             if (!foot.haveGravity)
                             {
                                 character.transform.position = new Vector3(transform.position.x, character.platformPosY, transform.position.z);
-
                             }
-                            character.ani.Play(AnimatorHash.ANIMATOR_weak, 0, 0);
-                            character.bodyCollider.layer = character.gameObject.layer;
-                            vel = vel / 5f;
-                            vel.y = jumpVel;
-                            character.mecanim.transform.localPosition = Vector3.zero;
-                            character.mecanim.transform.localRotation = Quaternion.Euler(0, 0, 0);
-                            character.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, character.platformRotZ);
-                            hitState = 1;
                             int landingDamage;
                             if (specialState == SpecialState.BlownUp)
                             {
@@ -354,6 +348,24 @@ public class AttributeStatus : MonoBehaviour
                                     }
                                 }
                             }
+                            jumpNum--;
+                            if (jumpNum < 0)
+                            {
+                                vel = vel / 5f;
+                                vel.y = jumpVel;
+                                character.mecanim.transform.localPosition = Vector3.zero;
+                                character.mecanim.transform.localRotation = Quaternion.Euler(0, 0, 0);
+                                character.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, character.platformRotZ);
+                                character.ani.Play(AnimatorHash.ANIMATOR_weak, 0, 0);
+                                character.bodyCollider.layer = character.gameObject.layer;
+                                hitState = 1;
+                            }
+                            else
+                            {
+                                flyForce *= jumpNumRate;
+                                rb.AddForce(flyForce, ForceMode.Impulse);
+                                
+                            }
                             BounceEffect();
                         }
                         else
@@ -534,8 +546,9 @@ 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);
+        flyForce = vec3 * blowUp.force * (1 - resistances.BlowUp);
+        rb.AddForce(flyForce, ForceMode.Impulse);
+       
         rb.transform.rotation = Quaternion.Euler(0, 0, 0);
         character.mecanim.transform.RotateAround(
             character.transform.position + rotateCenterHeight * Vector3.up,
@@ -545,6 +558,7 @@ public class AttributeStatus : MonoBehaviour
         startFlyPos = transform.position;
         hitState = 0;
         isFly = false;
+        jumpNum = blowUp.jumpNum;
         character.ani.Play("hitted", 0, 0);
     }
 

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

@@ -1842,7 +1842,7 @@ public class PlayerController : MoveCharacter
         {
             return;
         }
-        base.BeHit(attackMethod, attackFrom);
+        base.BeHit(attackMethod, attackFrom, damage);
         //ÆÁÄ»¶¶¶¯
         if (ss == null)
         {