WGL před 2 měsíci
rodič
revize
a76b95c1ee

+ 1 - 1
ActionTowerDefense/Assets/GameLevelEditor/GameMap/CoreScripts/Editor/GameMapEditor.cs

@@ -1275,7 +1275,7 @@ public class GameMapEditor : EditorWindow
 				tile.radius = new Vector2(cfgEnemy.Radius[0], cfgEnemy.Radius[1]);
 				tile.parameter.HP = cfgEnemy.HP;
 				tile.parameter.Attack_summon = cfgEnemy.AttackSummon;
-				tile.parameter.Attack_march = cfgEnemy.AttackMarch;
+				tile.parameter.Attack_march = new List<int>(cfgEnemy.AttackMarch);
 				tile.parameter.MinMoveSpeed = cfgEnemy.MinMoveSpeed;
 				tile.parameter.MaxMoveSpeed = cfgEnemy.MaxMoveSpeed;
 

+ 1 - 1
ActionTowerDefense/Assets/GameLevelEditor/GameMap/CoreScripts/GameMapTile.cs

@@ -8,7 +8,7 @@ public struct Parameter
 {
 	public int HP;
 	public int Attack_summon;
-	public int Attack_march;
+	public List<int> Attack_march;
 	public float MinMoveSpeed;
 	public float MaxMoveSpeed;
 }

+ 4 - 4
ActionTowerDefense/Assets/Gen/SingleEnemyConfig.cs

@@ -26,13 +26,13 @@ public sealed partial class SingleEnemyConfig :  Bright.Config.BeanBase
         { var __json0 = _json["Radius"]; if(!__json0.IsArray) { throw new SerializationException(); } Radius = new System.Collections.Generic.List<int>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0;  { if(!__e0.IsNumber) { throw new SerializationException(); }  __v0 = __e0; }  Radius.Add(__v0); }   }
         { if(!_json["HP"].IsNumber) { throw new SerializationException(); }  HP = _json["HP"]; }
         { if(!_json["AttackSummon"].IsNumber) { throw new SerializationException(); }  AttackSummon = _json["AttackSummon"]; }
-        { if(!_json["AttackMarch"].IsNumber) { throw new SerializationException(); }  AttackMarch = _json["AttackMarch"]; }
+        { var __json0 = _json["AttackMarch"]; if(!__json0.IsArray) { throw new SerializationException(); } AttackMarch = new System.Collections.Generic.List<int>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0;  { if(!__e0.IsNumber) { throw new SerializationException(); }  __v0 = __e0; }  AttackMarch.Add(__v0); }   }
         { if(!_json["MinMoveSpeed"].IsNumber) { throw new SerializationException(); }  MinMoveSpeed = _json["MinMoveSpeed"]; }
         { if(!_json["MaxMoveSpeed"].IsNumber) { throw new SerializationException(); }  MaxMoveSpeed = _json["MaxMoveSpeed"]; }
         PostInit();
     }
 
-    public SingleEnemyConfig(string Name, string SpriteName, string Color, string Type, string EnemyPrefab, System.Collections.Generic.List<int> Radius, int HP, int AttackSummon, int AttackMarch, float MinMoveSpeed, float MaxMoveSpeed ) 
+    public SingleEnemyConfig(string Name, string SpriteName, string Color, string Type, string EnemyPrefab, System.Collections.Generic.List<int> Radius, int HP, int AttackSummon, System.Collections.Generic.List<int> AttackMarch, float MinMoveSpeed, float MaxMoveSpeed ) 
     {
         this.Name = Name;
         this.SpriteName = SpriteName;
@@ -73,7 +73,7 @@ public sealed partial class SingleEnemyConfig :  Bright.Config.BeanBase
     public System.Collections.Generic.List<int> Radius { get; private set; }
     public int HP { get; private set; }
     public int AttackSummon { get; private set; }
-    public int AttackMarch { get; private set; }
+    public System.Collections.Generic.List<int> AttackMarch { get; private set; }
     public float MinMoveSpeed { get; private set; }
     public float MaxMoveSpeed { get; private set; }
 
@@ -100,7 +100,7 @@ public sealed partial class SingleEnemyConfig :  Bright.Config.BeanBase
         + "Radius:" + Bright.Common.StringUtil.CollectionToString(Radius) + ","
         + "HP:" + HP + ","
         + "AttackSummon:" + AttackSummon + ","
-        + "AttackMarch:" + AttackMarch + ","
+        + "AttackMarch:" + Bright.Common.StringUtil.CollectionToString(AttackMarch) + ","
         + "MinMoveSpeed:" + MinMoveSpeed + ","
         + "MaxMoveSpeed:" + MaxMoveSpeed + ","
         + "}";

+ 54 - 2
ActionTowerDefense/Assets/Resources/Animation/root.controller

@@ -10,7 +10,8 @@ AnimatorState:
   m_Name: assassin_aim
   m_Speed: 1
   m_CycleOffset: 0
-  m_Transitions: []
+  m_Transitions:
+  - {fileID: -5278896132840480708}
   m_StateMachineBehaviours: []
   m_Position: {x: 50, y: 50, z: 0}
   m_IKOnFeet: 0
@@ -26,6 +27,54 @@ AnimatorState:
   m_MirrorParameter: 
   m_CycleOffsetParameter: 
   m_TimeParameter: 
+--- !u!1102 &-5834519050663239832
+AnimatorState:
+  serializedVersion: 6
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: New State
+  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: 0}
+  m_Tag: 
+  m_SpeedParameter: 
+  m_MirrorParameter: 
+  m_CycleOffsetParameter: 
+  m_TimeParameter: 
+--- !u!1101 &-5278896132840480708
+AnimatorStateTransition:
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: 
+  m_Conditions: []
+  m_DstStateMachine: {fileID: 0}
+  m_DstState: {fileID: -5834519050663239832}
+  m_Solo: 0
+  m_Mute: 0
+  m_IsExit: 0
+  serializedVersion: 3
+  m_TransitionDuration: 0.25
+  m_TransitionOffset: 0
+  m_ExitTime: 0.8333333
+  m_HasExitTime: 1
+  m_HasFixedDuration: 1
+  m_InterruptionSource: 0
+  m_OrderedInterruption: 1
+  m_CanTransitionToSelf: 1
 --- !u!91 &9100000
 AnimatorController:
   m_ObjectHideFlags: 0
@@ -59,7 +108,10 @@ AnimatorStateMachine:
   m_ChildStates:
   - serializedVersion: 1
     m_State: {fileID: -8629260294423795803}
-    m_Position: {x: 200, y: 0, z: 0}
+    m_Position: {x: 290, y: 10, z: 0}
+  - serializedVersion: 1
+    m_State: {fileID: -5834519050663239832}
+    m_Position: {x: 510, y: -90, z: 0}
   m_ChildStateMachines: []
   m_AnyStateTransitions: []
   m_EntryTransitions: []

+ 137 - 36
ActionTowerDefense/Assets/Resources/Prefab/ESpirits/ESpirits_Assassin.prefab

@@ -283,7 +283,7 @@ MonoBehaviour:
     attackType: 0
     attackInfo:
       attackValue: 0
-      damage: 30
+      damage: 10
       attackDir: {x: 0, y: 0, z: 0}
       attackEffect: 
       floatState:
@@ -343,6 +343,71 @@ MonoBehaviour:
     shootTrack: 0
     shootAlwaysTrack: 0
     skill: {fileID: 0}
+  - id: 2
+    attackName: "\u51B2\u523A"
+    attackType: 0
+    attackInfo:
+      attackValue: 0
+      damage: 0
+      attackDir: {x: 0, y: 0, z: 0}
+      attackEffect: 
+      floatState:
+        time: 0
+        upTime: {x: 0, y: 0}
+        backSpeed: {x: 0, y: 0}
+        rotateSpeed: {x: 0, y: 0}
+        height: {x: 0, y: 0}
+        ControlOrder: 0
+      blowUp:
+        directionType: 0
+        dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
+        force: 0
+        time: 0
+        haveLandingDamage: 0
+        landingDamageRate: 0
+        ControlOrder: 0
+      shotDown:
+        directionType: 0
+        dir: {x: 0, y: 0, z: 0}
+        dirRandom: {x: 0, y: 0, z: 0}
+        force: 0
+        time: 0
+        haveLandingDamage: 0
+        landingDamage: 0
+        ControlOrder: 0
+      weak:
+        time: 0
+        ControlOrder: 0
+      armorPiercing:
+        rate: 0
+      vulnerable:
+        rate: 0
+        time: 0
+      stackingWounds:
+        damage: 0
+        time: 0
+      changeDamage:
+        rate: 0
+      sustainedInjury:
+        damage: 0
+      isDemSummon: 0
+    attackTrigger: {fileID: 5076973120259515033}
+    attackDistance: 1
+    maxAttackDis: 0
+    minAttackDis: 0
+    needToChange: 0
+    searchMode: 0
+    targetTypes: 010000000300000002000000
+    canHitFly: 1
+    armorPiercing: 0
+    bulletPrefab: {fileID: 0}
+    shootPos: []
+    maxUpAngle: 0
+    maxDownAngle: 0
+    shootTrack: 0
+    shootAlwaysTrack: 0
+    skill: {fileID: 0}
   curAttackMethod:
     id: 0
     attackName: 
@@ -535,22 +600,16 @@ MonoBehaviour:
   dropSoulMin: 1
   dropProbability: 100
   dropSoulAngle: 60
-  canEscape: 0
-  stopEscapeCD: 0
-  escapeSpeed: 0
-  distanceToTowerDeviation: 0
-  distanceToTowerBase: 0
-  distanceToEnemyDeviation: 0
-  distanceToEnemyBase: 0
-  canClimb: 0
-  pathCreator: {fileID: 0}
-  climbSpeed: 0
   aimPrefab: {fileID: 6373916053725309541}
+  dashTrigger: {fileID: 5076973120259515033}
   eSpiritsState: 1
   time: 1
-  attackCD: 0
-  readyDistance: 10
-  rushDistance: 10
+  attackCD: 5
+  readyDistance: 15
+  rushDistance: 15
+  readyTime: 1.5
+  rushSpeed: 30
+  fall_endAnimationClip: {fileID: 5334251204445808401, guid: f9202bebd93e9294bafe2039a427e1f2, type: 2}
 --- !u!1 &2437299196663985757
 GameObject:
   m_ObjectHideFlags: 0
@@ -595,7 +654,7 @@ BoxCollider:
   m_IsTrigger: 1
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 0.58, y: 0.12, z: 2}
+  m_Size: {x: 0.5, y: 0.5, z: 2}
   m_Center: {x: -0.035, y: 0, z: 0}
 --- !u!114 &2437299196663985756
 MonoBehaviour:
@@ -1093,15 +1152,14 @@ GameObject:
   m_Component:
   - component: {fileID: 1658938184312316380}
   - component: {fileID: 4979172509264116742}
-  - component: {fileID: 8257178686841521685}
-  - component: {fileID: 2254593709981819441}
+  - component: {fileID: 5076973120259515033}
   m_Layer: 20
   m_Name: DashAttackTrigger
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!4 &1658938184312316380
 Transform:
   m_ObjectHideFlags: 0
@@ -1130,23 +1188,7 @@ BoxCollider:
   serializedVersion: 2
   m_Size: {x: 3.2235622, y: 2, z: 20}
   m_Center: {x: -0.8882189, y: 0.96999997, z: 0}
---- !u!54 &8257178686841521685
-Rigidbody:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 8175746555017464802}
-  serializedVersion: 2
-  m_Mass: 1
-  m_Drag: 0
-  m_AngularDrag: 0.05
-  m_UseGravity: 0
-  m_IsKinematic: 0
-  m_Interpolate: 0
-  m_Constraints: 126
-  m_CollisionDetection: 0
---- !u!114 &2254593709981819441
+--- !u!114 &5076973120259515033
 MonoBehaviour:
   m_ObjectHideFlags: 0
   m_CorrespondingSourceObject: {fileID: 0}
@@ -1155,9 +1197,68 @@ MonoBehaviour:
   m_GameObject: {fileID: 8175746555017464802}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 028d37216b47ca446ba0037910919e25, type: 3}
+  m_Script: {fileID: 11500000, guid: 5eaed0a6b9d6fc6409bef80cf41a0a8e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  canBreakWall: 0
+  wallBrealNum: 10
+  isShoot: 0
+  type: 0
+  owner: {fileID: 0}
+  isSingleAttack: 0
+  cantSingleAttack: 0
+  trigedObjs: []
+  attackInfo:
+    attackValue: 0
+    damage: 0
+    attackDir: {x: 0, y: 0, z: 0}
+    attackEffect: 
+    floatState:
+      time: 0
+      upTime: {x: 0, y: 0}
+      backSpeed: {x: 0, y: 0}
+      rotateSpeed: {x: 0, y: 0}
+      height: {x: 0, y: 0}
+      ControlOrder: 0
+    blowUp:
+      directionType: 0
+      dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
+      force: 0
+      time: 0
+      haveLandingDamage: 0
+      landingDamageRate: 0
+      ControlOrder: 0
+    shotDown:
+      directionType: 0
+      dir: {x: 0, y: 0, z: 0}
+      dirRandom: {x: 0, y: 0, z: 0}
+      force: 0
+      time: 0
+      haveLandingDamage: 0
+      landingDamage: 0
+      ControlOrder: 0
+    weak:
+      time: 0
+      ControlOrder: 0
+    armorPiercing:
+      rate: 0
+    vulnerable:
+      rate: 0
+      time: 0
+    stackingWounds:
+      damage: 0
+      time: 0
+    changeDamage:
+      rate: 0
+    sustainedInjury:
+      damage: 0
+    isDemSummon: 0
+  force: {x: 0, y: 0, z: 0}
+  changeHurt: 0
+  repelValue: 0
+  offsetY: 1
+  hitRate: 1
 --- !u!1 &8203964573996106666
 GameObject:
   m_ObjectHideFlags: 0

+ 1 - 1
ActionTowerDefense/Assets/Resources/Prefab/MySoldier/Spirits_Assassin.prefab

@@ -276,7 +276,7 @@ Rigidbody:
   m_IsKinematic: 0
   m_Interpolate: 0
   m_Constraints: 120
-  m_CollisionDetection: 0
+  m_CollisionDetection: 1
 --- !u!1 &2437299196663985757
 GameObject:
   m_ObjectHideFlags: 0

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

@@ -5885,7 +5885,7 @@ Rigidbody:
   m_IsKinematic: 0
   m_Interpolate: 0
   m_Constraints: 120
-  m_CollisionDetection: 1
+  m_CollisionDetection: 2
 --- !u!114 &7794839579855634582
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -6399,7 +6399,6 @@ MeshRenderer:
   m_Materials:
   - {fileID: 2100000, guid: 1b17f7962e0b9be49bb10e99c6bd95a6, type: 2}
   - {fileID: 2100000, guid: 0c319badfe2307a48b8810d891649565, type: 2}
-  - {fileID: 2100000, guid: 1b17f7962e0b9be49bb10e99c6bd95a6, type: 2}
   - {fileID: 2100000, guid: 8f08601a75fbb72488593cad9f89acca, type: 2}
   - {fileID: 2100000, guid: 0c319badfe2307a48b8810d891649565, type: 2}
   m_StaticBatchInfo:

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

@@ -70,7 +70,7 @@ public class Enemy : MoveCharacter
     public float attackRatio;
     protected int curAttackID;
     private AttackController.AttackMethod[] am;
-    private int len;
+    public int len;
     protected float pastAttackTime;
     protected bool isConAttack;       //Á¬Ðø¹¥»÷£¬²»ÇÐidle¶¯»­
 

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

@@ -43,7 +43,7 @@ public class Polliwog : Enemy
         currentVelocity = Vector2.zero;
         SingleEnemyConfig cfgEnemy = GameManager.instance.allCfgData.CfgEnemy.Get("òòò½");
         moveSpeed =  Random.Range(cfgEnemy.MinMoveSpeed, cfgEnemy.MaxMoveSpeed);
-        attackController.attackTrigger.attackInfo.damage = cfgEnemy.AttackMarch;
+        attackController.attackTrigger.attackInfo.damage = cfgEnemy.AttackMarch[0];
         totalHp = cfgEnemy.HP;
         rotationSpeed = baseRotationSpeed + Random.Range(-rotationSpeedDeviation, rotationSpeedDeviation);
         ChangeState(CharacterState.Run);

+ 10 - 5
ActionTowerDefense/Assets/Scripts/EnemyCreater.cs

@@ -484,7 +484,7 @@ public class EnemyCreater : MonoBehaviour
                 enemyTower.hp = enemyTower.totalHp;
 
                 attackInfo = enemyTower.attackController.attackInfo;
-                attackInfo.damage = (int)(cfgEnemy.AttackMarch * AttackRatio);
+                attackInfo.damage = (int)(cfgEnemy.AttackMarch[0] * AttackRatio);
                 enemyTower.attackController.attackInfo = attackInfo;
                 enemyTower.Init();
             }
@@ -496,7 +496,7 @@ public class EnemyCreater : MonoBehaviour
                 tower.hp = tower.totalHp;
 
                 attackInfo = tower.attackController.attackInfo;
-                attackInfo.damage = (int)(cfgEnemy.AttackMarch * AttackRatio);
+                attackInfo.damage = (int)(cfgEnemy.AttackMarch[0] * AttackRatio);
                 tower.attackController.attackInfo = attackInfo;
                 tower.Init();
             }
@@ -522,12 +522,17 @@ public class EnemyCreater : MonoBehaviour
             enemy.minMoveSpeed = cfgEnemy.MinMoveSpeed * SpeedRatio;
             enemy.maxMoveSpeed = cfgEnemy.MaxMoveSpeed * SpeedRatio;
 
-            attackInfo = enemy.attackController.attackMethod[0].attackInfo;
-            attackInfo.damage = (int)(cfgEnemy.AttackMarch * AttackRatio);
-            enemy.attackController.attackMethod[0].attackInfo = attackInfo;
             enemy.attributeStatus.resistances.armor = (int)(enemy.attributeStatus.resistances.armor * ArmorRatio + 0.5f);
             foreach (var item in enemy.attackController.attackMethod)
             {
+                if(item.id == 0)
+                {
+                    item.attackInfo.damage = (int)(cfgEnemy.AttackSummon * AttackRatio);
+                }
+                else
+                {
+                    item.attackInfo.damage = (int)(cfgEnemy.AttackMarch[item.id - 1] * AttackRatio);
+                }
                 item.attackInfo.armorPiercing.rate = (int)(item.attackInfo.armorPiercing.rate * ArmorPiercingRatio);
             }
 

+ 134 - 12
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Assassin.cs

@@ -1,5 +1,3 @@
-using System.Collections;
-using System.Collections.Generic;
 using UnityEngine;
 using Sirenix.OdinInspector;
 
@@ -12,16 +10,40 @@ public class ESpirits_Assassin : Enemy
         FindPlayer, //寻找主角位置
         Ready,      //冲刺预警
         Rushing,   //向主角方向冲刺中
+        ReadyToDown,    //准备落地斩
+        Down,       //落地斩
+        DownEnd,
     }
     [FoldoutGroup("组件")] public GameObject aimPrefab;
+    [FoldoutGroup("组件")] public AttackTrigger dashTrigger;
     [FoldoutGroup("角色信息")][DisplayOnly] public ESpiritsState eSpiritsState;
 
     [Space(30)]
     [Title("ESpirits_Assassin属性")]
-    public float time;
+    [DisplayOnly] public float time;
     public float attackCD;
-    [FoldoutGroup("冲刺")] [LabelText("冲刺预警距离")]public float readyDistance;
+    [FoldoutGroup("冲刺")] [LabelText("预警距离")] public float readyDistance;
     [FoldoutGroup("冲刺")] [LabelText("冲刺距离")] public float rushDistance;
+    [FoldoutGroup("冲刺")] [LabelText("瞄准时间")] public float readyTime;
+    [FoldoutGroup("冲刺")] [LabelText("冲刺速度")] public float rushSpeed;
+    private Vector3 directionToTarget;
+    private float angleToTarget;
+    private Vector3 startRushPos;
+    private float endTime;
+    public AnimationClip fall_endAnimationClip;
+    public override void Awake()
+    {
+        base.Awake();
+        endTime = fall_endAnimationClip.length;
+    }
+
+    protected override void Start()
+    {
+        base.Start();
+        len = 1;
+        dashTrigger.attackInfo.damage = attackController.attackMethod[1].attackInfo.damage;
+    }
+
     public override void Init()
     {
         base.Init();
@@ -40,7 +62,6 @@ public class ESpirits_Assassin : Enemy
                         time += Time.deltaTime;
                         if (time > attackCD)
                         {
-                            time = 0;
                             eSpiritsState = ESpiritsState.FindPlayer;
                         }
                         break;
@@ -54,12 +75,15 @@ public class ESpirits_Assassin : Enemy
                                 rb.velocity = Vector3.zero;
                                 hitFeedbackSystem.canFreeze = false;
                                 attributeStatus.resistances.controlOrder = 1;
+                                bodyCollider.SetActive(false);
+                                rb.useGravity = false;
                                 ani.Play("charge", 0, 0);
-                                aimPrefab.transform.localScale = new Vector3(bodyTrans.localScale.x>0? -rushDistance:rushDistance, 1, 1);
-                                Vector3 directionToTarget = playerController.transform.position - aimPrefab.transform.position;
-                                float angle = Mathf.Atan2(directionToTarget.y, directionToTarget.x) * Mathf.Rad2Deg;
-                                aimPrefab.transform.rotation = Quaternion.Euler(0, 0, angle);
+                                aimPrefab.transform.localScale = new Vector3(rushDistance / 1.5f, 1, 1);
+                                directionToTarget = (playerController.transform.position + Vector3.up - aimPrefab.transform.position).normalized;
+                                angleToTarget = Mathf.Atan2(directionToTarget.y, directionToTarget.x) * Mathf.Rad2Deg;
+                                aimPrefab.transform.rotation = Quaternion.Euler(0, 0, angleToTarget);
                                 aimPrefab.SetActive(true);
+                                time = 0;
                             }
                         }
                         break;
@@ -69,11 +93,109 @@ public class ESpirits_Assassin : Enemy
                 switch (eSpiritsState)
                 {
                     case ESpiritsState.Ready:
-                        Vector3 directionToTarget = playerController.transform.position - aimPrefab.transform.position;
-                        float angle = Mathf.Atan2(directionToTarget.y, directionToTarget.x) * Mathf.Rad2Deg;
-                        aimPrefab.transform.rotation = Quaternion.Euler(0, 0, angle);
+                        directionToTarget = 
+                            (playerController.transform.position + Vector3.up - aimPrefab.transform.position).normalized;
+                        angleToTarget = Mathf.Atan2(directionToTarget.y, directionToTarget.x) * Mathf.Rad2Deg;
+                        aimPrefab.transform.rotation = Quaternion.Euler(0, 0, angleToTarget);
+                        time += Time.deltaTime;
+                        if(directionToTarget.x > 0 && bodyTrans.localScale.x > 0 
+                            || directionToTarget.x <0 && bodyTrans.localScale.x < 0)
+                        {
+                            Turn();
+                        }
+                        if(time > readyTime)
+                        {
+                            time = 0;
+                            aimPrefab.SetActive(false);
+                            ani.Play("attack_summon", 0, 0);
+                            //dashTrigger.SetActive(true);
+                            eSpiritsState = ESpiritsState.Rushing;
+                            transform.rotation = Quaternion.Euler(0, 0,
+                                bodyTrans.localScale.x > 0 ?
+                                angleToTarget - 180
+                                : angleToTarget);
+                            startRushPos = transform.position;
+                            attackController.ChooseAttack(0);
+                            dashTrigger.gameObject.SetActive(true);
+                        }
                         break;
                     case ESpiritsState.Rushing:
+                        rb.velocity = directionToTarget * rushSpeed;
+                        if(Vector3.Distance(startRushPos,transform.position) > rushDistance)
+                        {
+                            dashTrigger.gameObject.SetActive(false);
+                            rb.velocity = Vector3.zero;
+                            Quaternion targetQt = Quaternion.Euler(Vector3.zero);
+                            if (foot.TrigGround)
+                            {
+                                bodyCollider.SetActive(true);
+                                eSpiritsState = ESpiritsState.DownEnd;
+                                ani.Play("fall_end", 0, 0);
+                                rb.useGravity = true;
+                                if (!foot.haveGravity)
+                                {
+                                    transform.position = new Vector3(transform.position.x, platformPosY, transform.position.z);
+                                    targetQt = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, platformRotZ);
+                                }
+                            }
+                            else
+                            {
+                                eSpiritsState = ESpiritsState.ReadyToDown;
+                                ani.Play("charge", 0, 0);
+                                directionToTarget = Vector3.down;
+                                angleToTarget = 270;
+                            }
+                            transform.rotation = targetQt;
+                            time = 0;
+                        }
+                        break;
+                    case ESpiritsState.ReadyToDown:
+                        time += Time.deltaTime;
+                        if (time > readyTime)
+                        {
+                            ani.Play("attack_summon", 0, 0);
+                            transform.rotation = Quaternion.Euler(0, 0,
+                                bodyTrans.localScale.x > 0 ?
+                                angleToTarget - 180
+                                : angleToTarget);
+                            //dashTrigger.SetActive(true);
+                            eSpiritsState = ESpiritsState.Down;
+                            startRushPos = transform.position;
+                        }
+                        break;
+                    case ESpiritsState.Down:
+                        rb.velocity = directionToTarget * rushSpeed;
+                        if (foot.TrigGround)
+                        {
+                            bodyCollider.SetActive(true);
+                            eSpiritsState = ESpiritsState.DownEnd;
+                            rb.velocity = Vector3.zero;
+                            ani.Play("fall_end", 0, 0);
+                            rb.useGravity = true;
+                            Quaternion targetQt = Quaternion.Euler(Vector3.zero);
+                            if (!foot.haveGravity)
+                            {
+                                transform.position = new Vector3(transform.position.x, platformPosY, transform.position.z);
+                                targetQt = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, platformRotZ);
+                            }
+                            transform.rotation = targetQt;
+                            time = 0;
+                        }
+                        break;
+                    case ESpiritsState.DownEnd:
+                        time += Time.deltaTime;
+                        if(time > endTime)
+                        {
+                            eSpiritsState = ESpiritsState.Normal;
+                            ani.Play("idle", 0, 0);
+                            time = 0;
+                            hitFeedbackSystem.canFreeze = true;
+                            attributeStatus.resistances.controlOrder = 0;
+                            state = CharacterState.Idle;
+                        }
+                        break;
+                    default:
+                        base.OnState();
                         break;
                 }
                 return;

+ 41 - 14
ActionTowerDefense/GenerateDatas/json/cfgenemy.json

@@ -11,7 +11,9 @@
     ],
     "HP": 1000,
     "AttackSummon": 30,
-    "AttackMarch": 30,
+    "AttackMarch": [
+      30
+    ],
     "MinMoveSpeed": 0,
     "MaxMoveSpeed": 0
   },
@@ -27,7 +29,9 @@
     ],
     "HP": 500,
     "AttackSummon": 30,
-    "AttackMarch": 30,
+    "AttackMarch": [
+      30
+    ],
     "MinMoveSpeed": 0,
     "MaxMoveSpeed": 0
   },
@@ -43,7 +47,9 @@
     ],
     "HP": 50,
     "AttackSummon": 0,
-    "AttackMarch": 5,
+    "AttackMarch": [
+      5
+    ],
     "MinMoveSpeed": 6,
     "MaxMoveSpeed": 9
   },
@@ -59,7 +65,9 @@
     ],
     "HP": 30,
     "AttackSummon": 0,
-    "AttackMarch": 5,
+    "AttackMarch": [
+      5
+    ],
     "MinMoveSpeed": 4,
     "MaxMoveSpeed": 6
   },
@@ -75,7 +83,9 @@
     ],
     "HP": 200,
     "AttackSummon": 0,
-    "AttackMarch": 20,
+    "AttackMarch": [
+      20
+    ],
     "MinMoveSpeed": 1,
     "MaxMoveSpeed": 3
   },
@@ -91,7 +101,9 @@
     ],
     "HP": 30,
     "AttackSummon": 0,
-    "AttackMarch": 5,
+    "AttackMarch": [
+      5
+    ],
     "MinMoveSpeed": 6,
     "MaxMoveSpeed": 9
   },
@@ -107,7 +119,9 @@
     ],
     "HP": 50,
     "AttackSummon": 0,
-    "AttackMarch": 5,
+    "AttackMarch": [
+      5
+    ],
     "MinMoveSpeed": 4,
     "MaxMoveSpeed": 6
   },
@@ -123,7 +137,9 @@
     ],
     "HP": 50,
     "AttackSummon": 0,
-    "AttackMarch": 10,
+    "AttackMarch": [
+      10
+    ],
     "MinMoveSpeed": 5,
     "MaxMoveSpeed": 8
   },
@@ -139,7 +155,9 @@
     ],
     "HP": 200,
     "AttackSummon": 0,
-    "AttackMarch": 20,
+    "AttackMarch": [
+      20
+    ],
     "MinMoveSpeed": 2,
     "MaxMoveSpeed": 5
   },
@@ -155,7 +173,9 @@
     ],
     "HP": 30,
     "AttackSummon": 0,
-    "AttackMarch": 5,
+    "AttackMarch": [
+      5
+    ],
     "MinMoveSpeed": 3,
     "MaxMoveSpeed": 6
   },
@@ -171,7 +191,9 @@
     ],
     "HP": 30,
     "AttackSummon": 0,
-    "AttackMarch": 10,
+    "AttackMarch": [
+      10
+    ],
     "MinMoveSpeed": 1,
     "MaxMoveSpeed": 7
   },
@@ -187,7 +209,9 @@
     ],
     "HP": 10,
     "AttackSummon": 0,
-    "AttackMarch": 1,
+    "AttackMarch": [
+      1
+    ],
     "MinMoveSpeed": 6,
     "MaxMoveSpeed": 12
   },
@@ -202,8 +226,11 @@
       0
     ],
     "HP": 500,
-    "AttackSummon": 30,
-    "AttackMarch": 30,
+    "AttackSummon": 50,
+    "AttackMarch": [
+      30,
+      100
+    ],
     "MinMoveSpeed": 6,
     "MaxMoveSpeed": 8
   }

binární
ActionTowerDefense/Luban/Config/Datas/怪物表.xlsx