Ver código fonte

漂浮时有20%易伤:受到伤害增加20%

SZAND\msx_2 1 ano atrás
pai
commit
1f749c410b
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      ActionTowerDefense/Assets/Scripts/MoveCharacter.cs

+ 6 - 0
ActionTowerDefense/Assets/Scripts/MoveCharacter.cs

@@ -327,6 +327,8 @@ public class MoveCharacter : Character
         }
     }
 
+    public float easyToGetHit = 0.2f;
+
     public override void BeHit(int damage, Vector3 force, bool changeHurt, float repelValue)
     {
         if (!isTran)
@@ -341,6 +343,10 @@ public class MoveCharacter : Character
                 return;
             }
 
+            if (isFloat)
+            {
+                damage = (int)((1 + easyToGetHit) * damage);
+            }
             hp -= damage;
             uiHp.Show(hp, totalHp);
             if (hp <= 0)