فهرست منبع

爆炸击退效果

LAPTOP-OM1V99U2\永远de小亡灵 1 سال پیش
والد
کامیت
1970eb41dd

+ 4 - 4
ActionTowerDefense/Assets/Resources/Prefab/FX/FollowSoulEffect.prefab

@@ -151814,8 +151814,8 @@ MonoBehaviour:
   attackInfo:
     damage: 200
     attackDir: {x: 2, y: 2, z: 0}
-    force: 5000
-    changeHurt: 1
+    force: 1000
+    changeHurt: 0
     repelValue: 100
   destroyTime: 5
   characters: []
@@ -151905,8 +151905,8 @@ MonoBehaviour:
   attackInfo:
     damage: 400
     attackDir: {x: 2, y: 2, z: 0}
-    force: 5000
-    changeHurt: 1
+    force: 1000
+    changeHurt: 0
     repelValue: 100
   destroyTime: 5
   characters: []

+ 6 - 2
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -558,6 +558,8 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  smoke: {fileID: 0}
+  hitRate: 1
 --- !u!1 &1757064525815025384
 GameObject:
   m_ObjectHideFlags: 0
@@ -845,7 +847,7 @@ MonoBehaviour:
   decelerationRatio: 1
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
-  hurtChangeVelocity: 1
+  hurtChangeVelocity: 10
   comaTime: 5
   pastComaTime: 0
   isCaughtByCook: 0
@@ -890,7 +892,6 @@ MonoBehaviour:
   - {fileID: 2437299196472462361, guid: 00861cbb6651ced4a85013d35a07b3e6, type: 3}
   - {fileID: 5440846222648032759, guid: 1d487061d2e4ceb409a42daadf985eec, type: 3}
   - {fileID: 2437299196472462361, guid: 0e7e5e45ddc25b641963c78f68b041b8, type: 3}
-  changeTime: 30
   demonicPrefabs:
   - {fileID: 8639832132491289359, guid: 4c2987691cdb47040b3a55ff928803c3, type: 3}
   - {fileID: 5440846222648032759, guid: 05825e721b2832f478f66e78daed901f, type: 3}
@@ -926,6 +927,8 @@ MonoBehaviour:
   leaveGroundCanJumpTime: 0.15
   cacheJumpTime: 0
   totalCacheJumpTime: 0.1
+  tandemJumpTime: 0
+  totalTandemJumpTime: 0.1
   summonTime: 0
   cacheAttackTime: 0
   totalCacheAttackTime: 0.1
@@ -939,6 +942,7 @@ MonoBehaviour:
   cacheRushTime: 0
   totalCacheRushTime: 0.1
   airJumped: 0
+  jumpNumber: 2
   attackState: 0
   attackMoveSpeed: 5
   rushDir: {x: 0, y: 0, z: 0}

+ 29 - 0
ActionTowerDefense/Assets/Resources/Spine/spirits_float/Spirits_Float_Controller.controller

@@ -547,6 +547,32 @@ AnimationClip:
   m_HasGenericRootTransform: 0
   m_HasMotionFloatCurves: 0
   m_Events: []
+--- !u!1102 &2881634056442606781
+AnimatorState:
+  serializedVersion: 6
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: fall
+  m_Speed: 1
+  m_CycleOffset: 0
+  m_Transitions: []
+  m_StateMachineBehaviours: []
+  m_Position: {x: 50, y: 50, z: 0}
+  m_IKOnFeet: 0
+  m_WriteDefaultValues: 1
+  m_Mirror: 0
+  m_SpeedParameterActive: 0
+  m_MirrorParameterActive: 0
+  m_CycleOffsetParameterActive: 0
+  m_TimeParameterActive: 0
+  m_Motion: {fileID: 8287016944109629240, guid: 2951b5820f17f3f4fb10e136bb42a4c6, type: 2}
+  m_Tag: 
+  m_SpeedParameter: 
+  m_MirrorParameter: 
+  m_CycleOffsetParameter: 
+  m_TimeParameter: 
 --- !u!1102 &4208557621901587763
 AnimatorState:
   serializedVersion: 6
@@ -792,6 +818,9 @@ AnimatorStateMachine:
   - serializedVersion: 1
     m_State: {fileID: 7657413966448323634}
     m_Position: {x: 653.58417, y: 208.78006, z: 0}
+  - serializedVersion: 1
+    m_State: {fileID: 2881634056442606781}
+    m_Position: {x: 500, y: 250, z: 0}
   m_ChildStateMachines: []
   m_AnyStateTransitions: []
   m_EntryTransitions: []

+ 1 - 1
ActionTowerDefense/Assets/Scripts/MoveCharacter.cs

@@ -327,7 +327,6 @@ public class MoveCharacter : Character
 
     public override void BeHit(int damage, Vector3 force, bool changeHurt, float repelValue)
     {
-
         if (!isTran)
         {
 
@@ -370,6 +369,7 @@ public class MoveCharacter : Character
             if (changeHurt && beRepelValue <= 0)
             {
                 ChangeState(CharacterState.Weak);
+                
             }
 
         }

+ 10 - 2
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -940,11 +940,19 @@ public class PlayerController : MoveCharacter
                         break;
                     }
                 }
+                Vector3 vel = rb.velocity;
                 if (!foot.TrigGround)
                 {
-                    rb.velocity += Vector3.up * extraFallGravity * Time.deltaTime;
+                    if (canfly)
+                    {
+                        vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
+                    }
+                    else
+                    {
+                        vel += Vector3.up * extraFallGravity * Time.deltaTime;
+                    }
+                    
                 }
-                Vector3 vel = rb.velocity;
                 vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
                 rb.velocity = vel;
                 CachedPlayerInput();

+ 4 - 0
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Invisible.cs

@@ -144,6 +144,10 @@ public class ESpirits_Invisible : MonoBehaviour
                 
                 break;
             case InvisibleState.FindPlayer:
+                if (enemy.targetCharacter == null)
+                {
+                    enemy.ChosePlayer();
+                }
                 pos1 = new Vector3(transform.position.x, transform.position.y, 0);
                 pos2 = new Vector3(enemy.targetCharacter.transform.position.x,
                     enemy.targetCharacter.transform.position.y + 0.5f, 0);

+ 55 - 46
ActionTowerDefense/Assets/Scripts/Spirits/SoulBoom.cs

@@ -44,59 +44,63 @@ public class SoulBoom : MonoBehaviour
                         Vector3 target;
                         Vector3 pos1 = characters[i].transform.position;
                         Vector3 pos2 = transform.position;
-                        if (pos1.x > pos2.x)
-                        {
-                            if (pos1.y > pos2.y)
-                            {
-                                target = new Vector3(-attackInfo.attackDir.x, attackInfo.attackDir.y,0);
-                            }
-                            else if(pos1.y < pos2.y)
-                            {
-                                target = new Vector3(-attackInfo.attackDir.x, -attackInfo.attackDir.y,0);
+                        target = (pos1 - pos2).normalized;
+                        //if (pos1.x > pos2.x)
+                        //{
+                        //    if (pos1.y > pos2.y)
+                        //    {
+                        //        target = new Vector3(attackInfo.attackDir.x, attackInfo.attackDir.y,0);
+                        //    }
+                        //    else if(pos1.y < pos2.y)
+                        //    {
+                        //        target = new Vector3(attackInfo.attackDir.x, -attackInfo.attackDir.y,0);
 
-                            }
-                            else
-                            {
-                                target = new Vector3(-attackInfo.attackDir.x, 0,0);
-                            }
-                        }
-                        else if(pos1.x < pos2.x)
-                        {
-                            if(pos1.y > pos2.y)
-                            {
-                                target = new Vector3(attackInfo.attackDir.x, attackInfo.attackDir.y, 0);
-                            }
-                            else if(pos1.y < pos2.y)
-                            {
-                                target = new Vector3(attackInfo.attackDir.x, -attackInfo.attackDir.y, 0);
-                            }
-                            else
-                            {
-                                target = new Vector3(attackInfo.attackDir.x, 0, 0);
-                            }
+                        //    }
+                        //    else
+                        //    {
+                        //        target = new Vector3(attackInfo.attackDir.x, 0,0);
+                        //    }
+                        //}
+                        //else if(pos1.x < pos2.x)
+                        //{
+                        //    if(pos1.y > pos2.y)
+                        //    {
+                        //        target = new Vector3(-attackInfo.attackDir.x, attackInfo.attackDir.y, 0);
+                        //    }
+                        //    else if(pos1.y < pos2.y)
+                        //    {
+                        //        target = new Vector3(-attackInfo.attackDir.x, -attackInfo.attackDir.y, 0);
+                        //    }
+                        //    else
+                        //    {
+                        //        target = new Vector3(-attackInfo.attackDir.x, 0, 0);
+                        //    }
 
-                        }
-                        else
-                        {
-                            if (pos1.y > pos2.y)
-                            {
-                                target = new Vector3(0, attackInfo.attackDir.y, 0);
-                            }
-                            else if (pos1.y < pos2.y)
-                            {
-                                target = new Vector3(0, -attackInfo.attackDir.y, 0);
-                            }
-                            else
-                            {
-                                target = new Vector3(0, 0, 0);
-                            }
+                        //}
+                        //else
+                        //{
+                        //    if (pos1.y > pos2.y)
+                        //    {
+                        //        target = new Vector3(0, attackInfo.attackDir.y, 0);
+                        //    }
+                        //    else if (pos1.y < pos2.y)
+                        //    {
+                        //        target = new Vector3(0, -attackInfo.attackDir.y, 0);
+                        //    }
+                        //    else
+                        //    {
+                        //        target = new Vector3(0, 0, 0);
+                        //    }
 
-                        }
+                        //}
 
                         
                         characters[i].BeHit
-                            (attackInfo.damage, target * attackInfo.force,
+                            (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;
@@ -121,6 +125,11 @@ public class SoulBoom : MonoBehaviour
             && other.name == "BodyCollider")
         {
             MoveCharacter character = other.GetComponentInParent<MoveCharacter>();
+            if (character.rb == null)
+            {
+                character = character.transform.parent.GetComponent<MoveCharacter>();
+
+            }
             if (!characters.Exists(t => t == character))
             {
                 characters.Add(character);