Эх сурвалжийг харах

击落抗性改为应用在伤害上

1243896040 2 долоо хоног өмнө
parent
commit
8f0918c999

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

@@ -335,7 +335,7 @@ public class AttributeStatus : MonoBehaviour
                                 AttackInfo.ShotDown shotDown = attackMethod.attackInfo.shotDown;
                                 if (shotDown.haveLandingDamage)
                                 {
-                                    landingDamage = (int)(Mathf.Abs(transform.position.y - startFlyPos.y) * shotDown.landingDamageRate) /*+ GameManager.instance.downDamage*/;
+                                    landingDamage = (int)(Mathf.Abs(transform.position.y - startFlyPos.y) * shotDown.landingDamageRate * (1 - resistances.ShotDown)) /*+ GameManager.instance.downDamage*/;
                                     landingDamage = Mathf.Clamp(landingDamage, shotDown.minLandingDamage, landingDamage);
                                     if (landingDamage > 0)
                                     {
@@ -546,7 +546,7 @@ public class AttributeStatus : MonoBehaviour
         }
         this.attackMethod = attackMethod;
         AttackInfo.ShotDown shotDown = attackMethod.attackInfo.shotDown;
-        attributeTime = shotDown.time * (1 - resistances.ShotDown);
+        attributeTime = shotDown.time;
         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),
@@ -568,7 +568,7 @@ public class AttributeStatus : MonoBehaviour
         rb.useGravity = true;
         rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
         rb.velocity = Vector3.zero;
-        rb.AddForce(vec3 * shotDown.force * (1 - resistances.ShotDown), ForceMode.Impulse);
+        rb.AddForce(vec3 * shotDown.force, ForceMode.Impulse);
         rb.transform.rotation = Quaternion.Euler(0, 0, 0);
         character.ani.Play("hitted", 0, 0);
         character.nowCanFly = false;