Преглед на файлове

修改变身状态下不会被炸弹杀死bug

LAPTOP-OM1V99U2\永远de小亡灵 преди 1 година
родител
ревизия
4502fb3ff6
променени са 1 файла, в които са добавени 24 реда и са изтрити 11 реда
  1. 24 11
      ActionTowerDefense/Assets/Scripts/Spirits/SoulBoom.cs

+ 24 - 11
ActionTowerDefense/Assets/Scripts/Spirits/SoulBoom.cs

@@ -46,19 +46,32 @@ public class SoulBoom : MonoBehaviour
                         Vector3 pos2 = transform.position;
                         target = (pos1 - pos2).normalized;
 
-                        
-                        characters[i].BeHit
-                            (attackInfo.damage, Vector3.zero,
-                            attackInfo.changeHurt, attackInfo.repelValue);
-                        characters[i].ChangeState(CharacterState.Hurt);
-                        characters[i].rb.AddForce(target * attackInfo.force);
-                        
-                        if (isTransfiguration)
+                        if((characters[i].isTran && characters[i].pc.hp- attackInfo.damage < 0 )
+                            ||characters[i].hp - attackInfo.damage < 0)
                         {
-                            characters[i].isSoulUnstable = true;
-                            characters[i].soulUnstableTime = soulUnstableTime;
-                            characters[i].ChangeMat(2);
+                            characters[i].BeHit
+                                (attackInfo.damage, Vector3.zero,
+                                attackInfo.changeHurt, attackInfo.repelValue);
                         }
+                        else
+                        {
+                            characters[i].BeHit
+                                (attackInfo.damage, Vector3.zero,
+                                attackInfo.changeHurt, attackInfo.repelValue);
+
+                            characters[i].ChangeState(CharacterState.Hurt);
+                            characters[i].rb.AddForce(target * attackInfo.force);
+
+                            if (isTransfiguration)
+                            {
+                                characters[i].isSoulUnstable = true;
+                                characters[i].soulUnstableTime = soulUnstableTime;
+                                characters[i].ChangeMat(2);
+                            }
+
+                        }
+                        
+
 
                     }