Jelajahi Sumber

修改变身法师

SZAND\msx_2 1 tahun lalu
induk
melakukan
7c9f62f0bc

+ 5 - 5
ActionTowerDefense/Assets/Resources/Prefab/FX/FloatEffectRange.prefab

@@ -27,7 +27,7 @@ Transform:
   m_GameObject: {fileID: 417478504669294145}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 0.3, y: 1, z: 1}
+  m_LocalScale: {x: 9, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 2968649781918792408}
@@ -46,7 +46,7 @@ BoxCollider:
   m_IsTrigger: 1
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 22, y: 100, z: 20}
+  m_Size: {x: 0.9, y: 100, z: 20}
   m_Center: {x: 0, y: 0, z: 0}
 --- !u!114 &8741738695297186910
 MonoBehaviour:
@@ -4991,9 +4991,9 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 1778035823894722524}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: -17.737343, y: -0.91955495, z: -0.03686603}
+  m_LocalPosition: {x: 0, y: 20, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
-  m_ConstrainProportionsScale: 0
+  m_ConstrainProportionsScale: 1
   m_Children: []
   m_Father: {fileID: 6831563428749086452}
   m_RootOrder: 0
@@ -9931,7 +9931,7 @@ Transform:
   m_GameObject: {fileID: 6008376839226252313}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 20, z: 0}
-  m_LocalScale: {x: 30, y: 100, z: 1}
+  m_LocalScale: {x: 1, y: 100, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 8337439227001923642}

+ 1 - 1
ActionTowerDefense/Assets/Resources/Prefab/FX/FloatLockEffect.prefab

@@ -33837,7 +33837,7 @@ Transform:
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 2, y: 2, z: 2}
-  m_ConstrainProportionsScale: 1
+  m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 4149265334792540602}
   - {fileID: 689271863}

+ 118 - 0
ActionTowerDefense/Assets/Resources/Prefab/FX/TranFloatRange.prefab

@@ -0,0 +1,118 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &1247990008503402803
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 5427332482301308701}
+  - component: {fileID: 3625073627269843618}
+  m_Layer: 0
+  m_Name: Square
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &5427332482301308701
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1247990008503402803}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 4394943661753138170}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!212 &3625073627269843618
+SpriteRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1247990008503402803}
+  m_Enabled: 1
+  m_CastShadows: 0
+  m_ReceiveShadows: 0
+  m_DynamicOccludee: 1
+  m_StaticShadowCaster: 0
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 0
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 0
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_FlipX: 0
+  m_FlipY: 0
+  m_DrawMode: 0
+  m_Size: {x: 1, y: 1}
+  m_AdaptiveModeThreshold: 0.5
+  m_SpriteTileMode: 0
+  m_WasSpriteAssigned: 1
+  m_MaskInteraction: 0
+  m_SpriteSortPoint: 0
+--- !u!1 &2633192158325483446
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 4394943661753138170}
+  m_Layer: 0
+  m_Name: TranFloatRange
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &4394943661753138170
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2633192158325483446}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 5427332482301308701}
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

+ 7 - 0
ActionTowerDefense/Assets/Resources/Prefab/FX/TranFloatRange.prefab.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c51a663ee138c374f8e9fc17c05c1df9
+PrefabImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 15 - 6
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Float.prefab

@@ -789,6 +789,8 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  smoke: {fileID: 0}
+  hitRate: 1
 --- !u!1 &7414577738945366659
 GameObject:
   m_ObjectHideFlags: 0
@@ -1030,19 +1032,26 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   controller: {fileID: 0}
-  changeTime: 30
   UIoffset: {x: 0, y: 0, z: 0}
   mpJ: 10
-  mpK: 40
-  mpL: 100
-  intervalTime: 0.5
+  mpK: 10
+  mpL: 150
+  CDJ: 0.5
+  CDK: 2
+  CDL: 5
+  intervalTimeJ: 0
+  intervalTimeK: 0
+  intervalTimeL: 0
   minTime: 7
   maxTime: 9
   toFloat: 0
-  lockeffect: {fileID: 7959709114612421421, guid: 6d10e54fe2c6a92468d4458f98fea44e, type: 3}
+  lockeffect: {fileID: 2633192158325483446, guid: c51a663ee138c374f8e9fc17c05c1df9, type: 3}
   fe: {fileID: 417478504669294145, guid: 243eb0eff66414445990654286d861d1, type: 3}
   moveSpeed: 0.05
-  keepFloatTime: 5
+  keepFloatTime: 3
+  minRange: 5
+  maxRange: 20
+  maxKMp: 150
   LAttackDamage: 100
 --- !u!114 &3290368322717680010
 MonoBehaviour:

+ 8 - 8
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -1258,10 +1258,6 @@ public class PlayerController : MoveCharacter
             {
                 mp += mpReplySpeed * Time.deltaTime;
             }
-            if (mp > totalMp)
-            {
-                mp = totalMp;
-            }
         }
         if (floatState != 0)
         {
@@ -1270,16 +1266,20 @@ public class PlayerController : MoveCharacter
                 lostMp += mpReplySpeed * Time.deltaTime;
                 mp -= mpReplySpeed * Time.deltaTime;
             }
-            if (mp < 0)
-            {
-                mp = 0;
-            }
             if (lostMp >= addMp)
             {
                 Instantiate(soul, transform.position, new Quaternion(0, 0, 0, 0), null);
                 lostMp = 0;
             }
         }
+        if (mp > totalMp)
+        {
+            mp = totalMp;
+        }
+        if (mp < 0)
+        {
+            mp = 0;
+        }
         uiMp.Show(mp, totalMp);
     }
 

+ 121 - 21
ActionTowerDefense/Assets/Scripts/Spirits/Trans_Float.cs

@@ -12,7 +12,20 @@ public class Trans_Float : MonoBehaviour
     public int mpK;
     public int mpL;
 
-    public float intervalTime;              //攻击硬直
+    public float CDJ;
+    public float CDK;
+    public float CDL;
+    private float pastCDJ;
+    private float pastCDK;
+    private float pastCDL;
+    private bool isCDJ;
+    private bool isCDK;
+    private bool isCDL;
+
+    public float intervalTimeJ;              //攻击硬直
+    public float intervalTimeK;              //攻击硬直
+    public float intervalTimeL;              //攻击硬直
+    private float intervalTime;
     private float pastAttackTime;
     private bool canAttack = true;
 
@@ -34,13 +47,21 @@ public class Trans_Float : MonoBehaviour
     private bool once = false;
 
     public float keepFloatTime;             //K键最大持续时间
+    public float minRange, maxRange;        //K键浮空场范围
+    public int maxKMp;                      //K键最大耗蓝
     private float pastTime;
+    private float continueMp;               //mp持续减少程度
+    private float isLosingMp;
+    private float continueRange;            //浮空场持续变宽程度
 
-    public int LAttackDamage;             //L键摔落伤害
+    public int LAttackDamage;               //L键摔落伤害
 
     private void Start()
     {
         controller = GetComponentInParent<PlayerController>();
+        controller.isMpRepel = false;
+        controller.mp = controller.totalMp;
+        controller.uiMp.Show(controller.mp, controller.totalMp);
         //controller.changeTime = changeTime;
         dem = GetComponent<Demonic>();
         controller.canMove = true;
@@ -50,8 +71,41 @@ public class Trans_Float : MonoBehaviour
         curFe.SetActive(false);
     }
 
+    private void OnDisable()
+    {
+        controller.isMpRepel = true;
+    }
+
+    private void DeMp(int deMP)
+    {
+        controller.mp -= deMP;
+        controller.uiMp.Show(controller.mp, controller.totalMp);
+    }
+
+    private void ToInterval(int deMP)
+    {
+        DeMp(deMP);
+        if (intervalTime != 0)
+        {
+            controller.canMove = false;
+            canAttack = false;
+            controller.ChangeState(CharacterState.Idle);
+        }
+        else
+        {
+            controller.canMove = true;
+        }
+    }
+
+    private void KContinueValue()
+    {
+        continueMp = (maxKMp - mpK) / keepFloatTime;
+        continueRange = (maxRange - minRange) / keepFloatTime;
+    }
+
     private void Update()
     {
+        //硬直
         if (!canAttack)
         {
             pastAttackTime += Time.deltaTime;
@@ -59,16 +113,46 @@ public class Trans_Float : MonoBehaviour
             {
                 canAttack = true;
                 pastAttackTime = 0;
+                controller.canMove = true;
             }
         }
-        if (controller.isinputJ && canAttack)
+        if (isCDJ)
+        {
+            pastCDJ += Time.deltaTime;
+            if (pastCDJ >= CDJ)
+            {
+                isCDJ = false;
+                pastCDJ = 0;
+            }
+        }
+        if (isCDK)
+        {
+            pastCDK += Time.deltaTime;
+            if (pastCDK >= CDK)
+            {
+                isCDK = false;
+                pastCDK = 0;
+            }
+        }
+        if (isCDL)
+        {
+            pastCDL += Time.deltaTime;
+            if (pastCDL >= CDL)
+            {
+                isCDL = false;
+                pastCDL = 0;
+            }
+        }
+        //J
+        if (!isCDJ && controller.isinputJ && canAttack)
         {
             if (controller.mp >= mpJ)
             {
-                controller.mp -= mpJ;
-                controller.uiMp.Show(controller.mp, controller.totalMp);
-                canAttack = false;
+                isCDJ = true;
+                intervalTime = intervalTimeJ;
+                ToInterval(mpJ);
                 controller.isinputJ = false;
+                //首次攻击触发漂浮
                 if (isFirst)
                 {
                     if (!dem.attackToFloat)
@@ -77,6 +161,7 @@ public class Trans_Float : MonoBehaviour
                         dem.attackToFloat = true;
                     }
                 }
+                //攻击保底min~max次触发漂浮
                 else
                 {
                     if (!dem.attackToFloat)
@@ -96,25 +181,37 @@ public class Trans_Float : MonoBehaviour
                 Debug.Log("mp不足");
             }
         }
-        if (controller.isinputK)
+        //K
+        if (!isCDK && controller.isinputK)
         {
             if (controller.mp >= mpK)
             {
-                pastTime += Time.deltaTime;
-                controller.canMove = false;
-                controller.ChangeState(CharacterState.Idle);
-                //controller.rb.velocity = new Vector3(0, 0, 0);
                 if (!once)
                 {
+                    controller.canMove = false;
+                    controller.ChangeState(CharacterState.Idle);
+                    KContinueValue();
+                    once = true;
                     isK = true;
                     once = true;
                     curlock.transform.position = transform.position;
+                    Vector3 orig = curlock.transform.localScale;
+                    curlock.transform.localScale = new Vector3(minRange, orig.y, orig.z);
                     curlock.SetActive(true);
                 }
-                curlock.transform.position += new Vector3(controller.moveVec.x, 0, 0) * moveSpeed;
-                if (pastTime >= keepFloatTime)
+                if (pastTime <= keepFloatTime)
                 {
-                    controller.isinputK = false;
+                    pastTime += Time.deltaTime;
+                    isLosingMp += continueMp * Time.deltaTime;
+                    if (isLosingMp >= mpK)
+                    {
+                        DeMp(mpK);
+                        isLosingMp -= mpK;
+                    }
+                    if (curlock.transform.localScale.x < maxRange)
+                    {
+                        curlock.transform.localScale += new Vector3(continueRange * Time.deltaTime, 0, 0);
+                    }
                 }
             }
             else
@@ -124,23 +221,26 @@ public class Trans_Float : MonoBehaviour
         }
         if(isK && !controller.isinputK)
         {
-            controller.mp -= mpK;
-            controller.uiMp.Show(controller.mp, controller.totalMp);
+            isCDK = true;
             pastTime = 0;
             isK = false;
-            controller.canMove = true;
-            controller.ChangeState(CharacterState.Idle);
+            intervalTime = intervalTimeK;
+            ToInterval(0);
             once = false;
             curFe.transform.position = curlock.transform.position;
+            Vector3 v = curFe.transform.localScale;
+            curFe.transform.localScale = new Vector3(curlock.transform.localScale.x, v.y, v.z);
             curlock.SetActive(false);
             curFe.SetActive(true);
         }
-        if (controller.isinputL)
+        //L
+        if (!isCDL && controller.isinputL)
         {
             if (controller.mp >= mpL)
             {
-                controller.mp -= mpL;
-                controller.uiMp.Show(controller.mp, controller.totalMp);
+                isCDL = true;
+                intervalTime = intervalTimeL;
+                ToInterval(mpL);
                 controller.isinputL = false;
                 foreach (MoveCharacter f in FloatData.eneIsFloating)
                 {