wgl hai 7 meses
pai
achega
f5c819b9b2

+ 93 - 4
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_11001.prefab

@@ -171,6 +171,29 @@ MonoBehaviour:
   isSingleAttack: 1
   cantSingleAttack: 0
   trigedObjs: []
+  attackInfo:
+    damage: 0
+    attackDir: {x: 0, y: 0, z: 0}
+    attackEffect: 
+    force: 0
+    changeHurt: 0
+    repelValue: 0
+    blowUp:
+      dir: {x: 0, y: 0, z: 0}
+      force: 0
+      time: 0
+    shotDown:
+      dir: {x: 0, y: 0, z: 0}
+      force: 0
+      timel: 0
+    stun:
+      time: 0
+    armorPenetration:
+      rate: 0
+    changeDamage:
+      rate: 0
+    sustainedInjury:
+      damage: 0
   damage: 0
   force: {x: 0, y: 0, z: 0}
   changeHurt: 0
@@ -190,6 +213,7 @@ GameObject:
   - component: {fileID: 5720304588384615462}
   - component: {fileID: 1837193195824484407}
   - component: {fileID: 2437299196472462355}
+  - component: {fileID: 4708446721582069133}
   m_Layer: 8
   m_Name: Enemy_11001
   m_TagString: Enemy
@@ -272,6 +296,7 @@ MonoBehaviour:
   outline1Mats:
   - {fileID: 2100000, guid: 79dada70fee9fbc49a327168481d3def, type: 2}
   foot: {fileID: 2437299196663985756}
+  attributeStatus: {fileID: 0}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
   canMove: 1
@@ -381,16 +406,33 @@ MonoBehaviour:
   nextEndKeyTime: 0
   curKeyNum: 0
   attackType: 0
+  curDamage: 0
   canHitFly: 1
   armorPiercing: 0
   attackInfo:
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    attackEffect: 
     force: 0
     changeHurt: 0
     repelValue: 0
+    blowUp:
+      dir: {x: 0, y: 0, z: 0}
+      force: 0
+      time: 0
+    shotDown:
+      dir: {x: 0, y: 0, z: 0}
+      force: 0
+      timel: 0
+    stun:
+      time: 0
+    armorPenetration:
+      rate: 0
+    changeDamage:
+      rate: 0
+    sustainedInjury:
+      damage: 0
   addAttackEffect: {fileID: 0}
-  curDamage: 0
   attackTrigger: {fileID: 2280520615464243483}
   isAttackTriggerOn: 0
   bulletPrefab: {fileID: 0}
@@ -399,7 +441,6 @@ MonoBehaviour:
   shootAlwaysTrack: 0
   targetTypes: 010000000300000002000000
   beTargetCharacter: []
-  getDistanceOffset: 0
   attackMethod:
   - id: 1
     attackName: "\u5934\u69CC"
@@ -408,9 +449,26 @@ MonoBehaviour:
     attackInfo:
       damage: 30
       attackDir: {x: 0, y: 0, z: 0}
+      attackEffect: 
       force: 0
       changeHurt: 0
       repelValue: 0
+      blowUp:
+        dir: {x: 0, y: 0, z: 0}
+        force: 0
+        time: 0
+      shotDown:
+        dir: {x: 0, y: 0, z: 0}
+        force: 0
+        timel: 0
+      stun:
+        time: 0
+      armorPenetration:
+        rate: 0
+      changeDamage:
+        rate: 0
+      sustainedInjury:
+        damage: 0
     attackTrigger: {fileID: 2280520615464243483}
     targetTypes: 010000000300000002000000
     canHitFly: 1
@@ -419,7 +477,6 @@ MonoBehaviour:
     shootPos: []
     shootTrack: 0
     shootAlwaysTrack: 0
-    curDamage: 0
   curAttackMethod:
     id: 0
     attackName: 
@@ -428,9 +485,26 @@ MonoBehaviour:
     attackInfo:
       damage: 0
       attackDir: {x: 0, y: 0, z: 0}
+      attackEffect: 
       force: 0
       changeHurt: 0
       repelValue: 0
+      blowUp:
+        dir: {x: 0, y: 0, z: 0}
+        force: 0
+        time: 0
+      shotDown:
+        dir: {x: 0, y: 0, z: 0}
+        force: 0
+        timel: 0
+      stun:
+        time: 0
+      armorPenetration:
+        rate: 0
+      changeDamage:
+        rate: 0
+      sustainedInjury:
+        damage: 0
     attackTrigger: {fileID: 0}
     targetTypes: 
     canHitFly: 0
@@ -439,7 +513,6 @@ MonoBehaviour:
     shootPos: []
     shootTrack: 0
     shootAlwaysTrack: 0
-    curDamage: 0
 --- !u!54 &2437299196472462355
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -456,6 +529,22 @@ Rigidbody:
   m_Interpolate: 0
   m_Constraints: 120
   m_CollisionDetection: 0
+--- !u!114 &4708446721582069133
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2437299196472462361}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 1d04dd6e35d71724689001e450625c39, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  curSpecialStates: ffffffff
+  strikeStunTime: 0
+  decelerationRatioX: 2
+  decelerationRatioY: 15
 --- !u!1 &2437299196663985757
 GameObject:
   m_ObjectHideFlags: 0

+ 2 - 1
ActionTowerDefense/Assets/Scripts/Characters/AttackTrigger.cs

@@ -83,7 +83,8 @@ public class AttackTrigger : MonoBehaviour
                     }
                     curDamage = (int)(curDamage * (100f / (100 + c)) + 0.5f);
                 }
-                hitTrigger.BeHit(curDamage, force, changeHurt, repelValue);
+                //hitTrigger.BeHit(curDamage, force, changeHurt, repelValue);
+                hitTrigger.BeHit(attackInfo, owner.bodyTrans.localScale.x);
                 if (hitTrigger.owner.debugAttackFrom)
                 {
                     hitTrigger.owner.DebugAttackFrom(owner.name, curDamage);

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

@@ -23,7 +23,7 @@ public class BeHitTrigger : MonoBehaviour
     {
         owner.BeHit(damage, force, changeHurt, repelValue);
     }
-    public void Behit(AttackInfo attackInfo,float dir)
+    public void BeHit(AttackInfo attackInfo,float dir)
     {
         owner.BeHit(attackInfo,dir);
     }

+ 1 - 2
ActionTowerDefense/Assets/Scripts/Characters/Character.cs

@@ -20,8 +20,7 @@ public enum CharacterState
     Rush = 9,
     Sprint = 10,
     Die = 11,
-    Weak = 12,
-    SpecialStatus,
+    SpecialStatus = 12,
 
     Float = 15,             //¿ÕÖÐÆ¯¸¡
 

+ 3 - 81
ActionTowerDefense/Assets/Scripts/Characters/Demonic.cs

@@ -522,67 +522,6 @@ public class Demonic : MoveCharacter
                     break;
                 }
                 break;
-            case CharacterState.Weak:
-                if (rb.velocity.magnitude > 1)
-                {
-                    if (!isBeBlownUp)
-                    {
-                        isBeBlownUp = true;
-                        ani.Play("hitted", 0, 0);
-                    }
-                    Vector3 vel = rb.velocity;
-                    if (foot.TrigGround && vel.y <= 0)
-                    {
-                        vel = Vector3.zero;
-                    }
-                    else
-                    {
-                        vel.x -= vel.x * decelerationRatio * Time.deltaTime;
-                        vel.y += extraFallGravity * Time.deltaTime;
-                    }
-
-                    //vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
-                    //vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
-                    rb.velocity = vel;
-                }
-                else
-                {
-                    if (isBeBlownUp)
-                    {
-                        isBeBlownUp = false;
-                    }
-                    if (weakTime <= -0.1)
-                    {
-                        if (upFirstAfterWeaknessOrNot)
-                        {
-                            if (AdjustHeight())
-                            {
-                                ChangeState(CharacterState.Idle);
-                            }
-                            else
-                            {
-                                if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "walk")
-                                {
-                                    ani.Play("walk", 0, 0);
-                                }
-                            }
-                        }
-                        else
-                        {
-                            ChangeState(CharacterState.Idle);
-                        }
-                        break;
-                    }
-                    else
-                    {
-                        if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "weak")
-                        {
-                            ani.Play("weak", 0, 0);
-                            rb.velocity = Vector3.zero;
-                        }
-                    }
-                }
-                break;
             case CharacterState.LockSoul:
                 if (!isReturnSoulTower)
                 {
@@ -629,6 +568,9 @@ public class Demonic : MoveCharacter
                     }
                 }
                 break;
+            case CharacterState.SpecialStatus:
+                attributeStatus.SpecialStateEffect();
+                break;
             default:
                 break;
         }
@@ -699,15 +641,6 @@ public class Demonic : MoveCharacter
             case CharacterState.Die:
                 isDie = false;
                 break;
-            case CharacterState.Weak:
-                beRepelValue = totalBeRepelValue;
-                newTotalWeakTime = totalWeakTime;
-                if (canFly)
-                {
-                    rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionY;
-                    rb.useGravity = false;
-                }
-                break;
             case CharacterState.Float:
                 canMove = true;
                 break;
@@ -756,17 +689,6 @@ public class Demonic : MoveCharacter
                 ani.Play("die", 0, 0);
                 isDie = true;
                 dieKeepTime = totalDieKeepTime;
-                break;
-            case CharacterState.Weak:
-                weakTime = newTotalWeakTime;
-                rb.AddForce(weakForce);
-                if (canFly)
-                {
-                    rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
-                    rb.useGravity = true;
-                    flyHeight = Random.Range(minHeight, maxHeight);
-                }
-
                 break;
             case CharacterState.Float:
                 canMove = false;

+ 3 - 118
ActionTowerDefense/Assets/Scripts/Characters/Enemy.cs

@@ -455,92 +455,6 @@ public class Enemy : MoveCharacter
                     break;
                 }
                 break;
-            case CharacterState.Weak:
-                if (rb.velocity.magnitude > 1)
-                {
-                    if (!isBeBlownUp)
-                    {
-                        isBeBlownUp = true;
-                        ani.Play("hitted", 0, 0);
-                    }
-                    Vector3 vel = rb.velocity;
-                    if (foot.TrigGround && vel.y <= 0)
-                    {
-                        vel = Vector3.zero;
-                    }
-                    else
-                    {
-                        if (!hasBeReboundedX)
-                        {
-                            vel.x -= vel.x * decelerationRatio * Time.deltaTime;
-                            if (!hasBeReboundedX && isBeReboundedX)
-                            {
-                                hasBeReboundedX = true;
-                                vel.x = 0;
-                            }
-                        }
-                        if (!hasBeReboundedY)
-                        {
-                            vel.y += extraFallGravity * Time.deltaTime;
-                            if (!hasBeReboundedY && isBeReboundedY)
-                            {
-                                hasBeReboundedY = true;
-                                vel.y = 0;
-                            }
-                        }
-                    }
-
-                    //vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
-                    //vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
-                    rb.velocity = vel;
-                }
-                else
-                {
-                    if (isBeBlownUp)
-                    {
-                        isBeBlownUp = false;
-                        isBeReboundedX = false;
-                        isBeReboundedY = false;
-                        hasBeReboundedX = false;
-                        hasBeReboundedY = false;
-                    }
-                    if (weakTime <= -0.1)
-                    {
-                        if (upFirstAfterWeaknessOrNot)
-                        {
-                            if (canFly)
-                            {
-                                rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionY;
-                                rb.useGravity = false;
-                            }
-                            if (AdjustHeight())
-                            {
-                                ChangeState(CharacterState.Idle);
-                            }
-                            else
-                            {
-                                if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "walk")
-                                {
-                                    ani.Play("walk", 0, 0);
-                                }
-                            }
-                        }
-                        else
-                        {
-                            ChangeState(CharacterState.Idle);
-                        }
-                        break;
-                    }
-                    else
-                    {
-                        if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "weak")
-                        {
-                            ani.Play("weak", 0, 0);
-                            rb.velocity = Vector3.zero;
-                        }
-                    }
-                }
-                break;
             case CharacterState.Coma:
                 pastComaTime += Time.deltaTime;
                 if (pastComaTime >= comaTime)
@@ -548,6 +462,9 @@ public class Enemy : MoveCharacter
                     ChangeState(CharacterState.Idle);
                 }
                 break;
+            case CharacterState.SpecialStatus:
+                attributeStatus.SpecialStateEffect();
+                break;
             default:
                 break;
         }
@@ -585,18 +502,6 @@ public class Enemy : MoveCharacter
             case CharacterState.Die:
                 isDie = false;
                 break;
-            case CharacterState.Weak:
-                beRepelValue = totalBeRepelValue;
-                newTotalWeakTime = totalWeakTime;
-                if (isBeBlownUp)
-                {
-                    isBeBlownUp = false;
-                    isBeReboundedX = false;
-                    isBeReboundedY = false;
-                    hasBeReboundedX = false;
-                    hasBeReboundedY = false;
-                }
-                break;
             case CharacterState.Float:
                 canMove = true;
                 break;
@@ -654,26 +559,6 @@ public class Enemy : MoveCharacter
                 dieKeepTime = totalDieKeepTime;
                 DropSouls();
                 break;
-            case CharacterState.Weak:
-                switch (oldState)
-                {
-                    case CharacterState.Rush:
-                        state = oldState;
-                        beRepelValue = totalBeRepelValue;
-                        break;
-                    default:
-                        weakTime = newTotalWeakTime;
-                        rb.AddForce(weakForce);
-                        if (canFly)
-                        {
-                            rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
-                            rb.useGravity = true;
-                        }
-
-                        //hurtKeepTime = minHurtKeepTime;
-                        break;
-                }
-                break;
             default:
                 break;
         }

+ 0 - 56
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -1575,50 +1575,6 @@ public class PlayerController : MoveCharacter
                     }
                 }
                 break;
-            case CharacterState.Weak:
-
-                if (rb.velocity.magnitude > 1)
-                {
-                    if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "hitted")
-                    {
-                        ani.Play("hitted", 0, 0);
-                        aniCollider.Play("Hurt", 0, 0);
-                    }
-                    Vector3 vel = rb.velocity;
-                    if (!canFly)
-                    {
-                        if (foot.TrigGround && vel.y < 0)
-                        {
-                            vel.y = 0;
-                        }
-                        else
-                        {
-                            vel += Vector3.up * extraFallGravity * Time.deltaTime;
-                        }
-
-                    }
-
-                    vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
-                    vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
-                    rb.velocity = vel;
-                }
-                else
-                {
-                    if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "weak")
-                    {
-                        ani.Play("weak", 0, 0);
-                        aniCollider.Play("Weak", 0, 0);
-                        rb.velocity = Vector3.zero;
-                        weakTime = totalWeakTime;
-                    }
-                    rb.velocity = new Vector3(velocityAddition, rb.velocity.y, 0);
-                }
-                if (weakTime <= 0)
-                {
-                    ChangeState(CharacterState.Idle);
-                    break;
-                }
-                break;
             case CharacterState.Conduct:
                 if (CheckConduct())
                 {
@@ -1776,10 +1732,6 @@ public class PlayerController : MoveCharacter
         {
             return;
         }
-        if (newState == CharacterState.Weak)
-        {
-            return;
-        }
         Vector3 velocity = rb.velocity;
         switch (state)
         {
@@ -1832,10 +1784,6 @@ public class PlayerController : MoveCharacter
                 }
                 isDie = false;
                 break;
-            case CharacterState.Weak:
-                beRepelValue = totalBeRepelValue;
-                newTotalWeakTime = totalWeakTime;
-                break;
             case CharacterState.Conduct:
                 rb.isKinematic = false;
                 Time.timeScale = 1;
@@ -1948,10 +1896,6 @@ public class PlayerController : MoveCharacter
                 isDie = true;
                 dieKeepTime = totalDieKeepTime;
                 break;
-            case CharacterState.Weak:
-                weakTime = newTotalWeakTime;
-                //hurtKeepTime = minHurtKeepTime;
-                break;
             case CharacterState.Conduct:
                 conductTime = 0;
                 rb.velocity = Vector3.zero;