WGL il y a 1 mois
Parent
commit
632dfc27c9

+ 1 - 2
ActionTowerDefense/Assets/Resources/Prefab/Conduct/Photosphere.prefab

@@ -46,10 +46,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7f05745e0e6d2be409434d91f3900653, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  owner: {fileID: 0}
   conductController: {fileID: 0}
-  conductId: 0
   stayTime: 10
+  breakEffect: {fileID: 417478504669294145, guid: 2a4e7e280b9d19042ba0f57ae5edf736, type: 3}
   hp: 0
   bulletPrefab: {fileID: 7473170563405908938, guid: 78ed8700e43860e48b7bd70b4cbc14d3, type: 3}
   rate: 1

+ 32 - 11
ActionTowerDefense/Assets/Resources/Prefab/GameManager.prefab

@@ -171,6 +171,11 @@ MonoBehaviour:
     - 60
     - 50
     - 50
+    cd:
+    - 20
+    - 15
+    - 10
+    - 5
     sacrificeValue: 0a0000000a0000000a0000000a000000
     power: 01000000020000000300000004000000
     effectBonus:
@@ -178,11 +183,6 @@ MonoBehaviour:
     - 2
     - 3
     - 4
-    cd:
-    - 20
-    - 15
-    - 10
-    - 5
     randomRange: {x: 8, y: 4}
     canDie: 0
   flyingSwords:
@@ -193,6 +193,11 @@ MonoBehaviour:
     - 80
     - 60
     - 50
+    cd:
+    - 20
+    - 15
+    - 10
+    - 10
     sacrificeValue: 0a0000000a0000000a0000000a000000
     power: 01000000010000000100000001000000
     effectBonus:
@@ -200,11 +205,6 @@ MonoBehaviour:
     - 2
     - 3
     - 4
-    cd:
-    - 20
-    - 15
-    - 10
-    - 10
     obj: {fileID: 256012001268456902, guid: 26ed0fb31296bdd4bb45e22ce2b925bc, type: 3}
   iceRain:
     attributeTag: 3
@@ -214,6 +214,11 @@ MonoBehaviour:
     - 60
     - 50
     - 50
+    cd:
+    - 20
+    - 15
+    - 10
+    - 5
     sacrificeValue: 0a0000000a0000000a0000000a000000
     power: 0a0000000f000000140000001e000000
     effectBonus:
@@ -221,12 +226,28 @@ MonoBehaviour:
     - 2
     - 3
     - 4
+    obj: {fileID: 256012001268456902, guid: 758282baf4c34f04a86e4bb81a0afbdd, type: 3}
+  barrier:
+    attributeTag: 0
+    bUseFixedSacrifice: 1
+    sacrificeRatio:
+    - 100
+    - 60
+    - 50
+    - 50
     cd:
     - 20
     - 15
     - 10
     - 5
-    obj: {fileID: 256012001268456902, guid: 758282baf4c34f04a86e4bb81a0afbdd, type: 3}
+    sacrificeValue: 0a0000000a0000000a0000000a000000
+    power: 01000000020000000300000004000000
+    effectBonus:
+    - 1
+    - 2
+    - 3
+    - 4
+    obj: {fileID: 256012001268456902, guid: ba2e5bcb5c7ac604ea72b2fcb544a3cb, type: 3}
 --- !u!114 &1880576200062196086
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 3 - 7
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -5873,7 +5873,6 @@ MonoBehaviour:
   - 1
   - 1
   - 1
-  conductCanRelease: 010101
   conductReadyTip: {fileID: 946637326309089849}
   timeSlowingMultiplier: 0.15
   fixedDeltaTime: 0
@@ -6077,10 +6076,12 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   rarity: 000000000000000000000000
+  bUseFixedSacrifice: 000000
   conversionRate:
   - 0
   - 0
   - 0
+  sacrificeValue: 000000000000000000000000
   totalCD:
   - 0
   - 0
@@ -6090,15 +6091,11 @@ MonoBehaviour:
   - 0
   - 0
   conductSkills: 030000000100000003000000
+  photosphere: {fileID: 0}
   giant:
     bigGiant: {fileID: 5440846222648032759, guid: d64528a2dcc945b4a9ea5d5a859679f3, type: 3}
     temptHp: 300
     temptTime: 0
-  photon:
-    obj: {fileID: 256012001268456902, guid: ba2e5bcb5c7ac604ea72b2fcb544a3cb, type: 3}
-    photosphereHp: 1000
-    havePhoton: 0
-    photosphere: {fileID: 0}
 --- !u!114 &1048751460627304294
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -6447,7 +6444,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:

+ 12 - 9
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -135,7 +135,6 @@ public class PlayerController : MoveCharacter
     private int cacheConductId;
     [Header("召唤相应时间")] [Tooltip("在此时间内松手为召唤")] public float totalCacheSummonTime;
     [Header("融魂相应时间")] [Tooltip("在此时间以外松手为融魂")] public float[] canConductTime;
-    public bool[] conductCanRelease;        //能否进入指挥技蓄力状态
     public ConductReadyTip conductReadyTip; //指挥技就绪
     private bool isReadyConduct;
     [Header("时间倍率")] [Tooltip("时间速度放慢到正常的几倍")] public float timeSlowingMultiplier;
@@ -541,13 +540,8 @@ public class PlayerController : MoveCharacter
             && conductController.cd[nowConductButton] <= 0)
         {
             CheckTurn();
-            if (conductCanRelease[nowConductButton])
-            {
-                ChangeState(CharacterState.Conduct);
-                return true;
-            }
-            return false;
-
+            ChangeState(CharacterState.Conduct);
+            return true;
         }
         if (btnEastUp || btnWestUp || btnSouthUp || btnTransClick || cacheSummonTime > 0)
         {
@@ -1739,8 +1733,17 @@ public class PlayerController : MoveCharacter
 
     public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
-        if (conductController.HavePhoton(attackFrom, attackMethod.attackInfo.damage))
+        Photosphere photosphere = conductController.photosphere;
+        if (photosphere)
         {
+            if(damage == -1)
+            {
+                photosphere.hp -= attackMethod.attackInfo.damage;
+            }
+            else
+            {
+                photosphere.hp -= damage;
+            }
             return;
         }
         base.BeHit(attackMethod, attackFrom);

+ 0 - 1
ActionTowerDefense/Assets/Scripts/Conduct/AngryBullet.cs

@@ -115,7 +115,6 @@ public class AngryBullet : MonoBehaviour
                 self.enabled = true;
                 break;
             case BulletState.die:
-                owner.conductCanRelease[conductId] = true;
                 gameObject.SetActive(false);
                 break;
             default:

+ 31 - 48
ActionTowerDefense/Assets/Scripts/Conduct/ConductController.cs

@@ -22,6 +22,7 @@ public class ConductController : MonoBehaviour
     public float[] cd;
     [LabelText("融魂技")] public ConductSkills[] conductSkills;
 
+    public Photosphere photosphere;
     [Serializable] public struct Giant
     {
         public GameObject bigGiant;
@@ -33,19 +34,6 @@ public class ConductController : MonoBehaviour
     private bool ShowGiant() => conductSkills.Contains(ConductSkills.Giant);
     [ShowIf("ShowGiant")][LabelText("合成大胖子参数")]
     public Giant giant;
-
-    [Serializable]public struct Photon
-    {
-        public GameObject obj;
-        [LabelText("血量基数")]
-        public int photosphereHp;
-        [DisplayOnly] public bool havePhoton;
-        [HideInInspector] public Photosphere photosphere;
-    }
-    private bool ShowPhotosphere() => conductSkills.Contains(ConductSkills.Photon);
-    [ShowIf("ShowPhotosphere")][LabelText("光球参数")]
-    public Photon photon;
-
     
     private void Awake()
     {
@@ -79,6 +67,13 @@ public class ConductController : MonoBehaviour
                     sacrificeValue[i] = iceRain.sacrificeValue[demonicRarity];
                     totalCD[i] = iceRain.cd[demonicRarity];
                     break;
+                case ConductSkills.Barrier:
+                    ConductManager.Barrier barrier = conductManager.barrier;
+                    bUseFixedSacrifice[i] = barrier.bUseFixedSacrifice;
+                    conversionRate[i] = barrier.sacrificeRatio[demonicRarity];
+                    sacrificeValue[i] = barrier.sacrificeValue[demonicRarity];
+                    totalCD[i] = barrier.cd[demonicRarity];
+                    break;
             }
         }
     }
@@ -149,8 +144,10 @@ public class ConductController : MonoBehaviour
             {
                 d.ChangeState(CharacterState.Die);
             }
-            int attackDamage = playerController.demonicPrefabs[demonicId].GetComponent<Demonic>().attackController.attackMethod_summon[0].attackInfo.damage
-                + soldierLevelRecord.seb[demonicId].summonAttack
+            Demonic prefabDemonic = playerController.demonicPrefabs[demonicId].GetComponent<Demonic>();
+            SoldierLevelRecord.SoldierExtraBuff soldierExtraBuff = soldierLevelRecord.seb[demonicId];
+            int attackDamage = prefabDemonic.attackController.attackMethod_summon[0].attackInfo.damage
+                + soldierExtraBuff.summonAttack
                 + gameManager.damage;
             List<int> myTreasureTag = gameManager.myTreasuresTag;
             float tagAdd = 1;
@@ -206,6 +203,25 @@ public class ConductController : MonoBehaviour
                     iceRainController.damage = (int)(attackDamage * tagAdd);
                     iceRainController.Biu();
                     break;
+                case ConductSkills.Barrier:
+                    ConductManager.Barrier barrier = conductManager.barrier;
+                    Photosphere photosphere;
+                    if (this.photosphere)
+                    {
+                        obj = this.photosphere.gameObject;
+                        photosphere = this.photosphere;
+                    }
+                    else
+                    {
+                        obj = PoolManager.Instantiate(barrier.obj);
+                        obj.transform.parent = transform;
+                        photosphere = obj.GetComponent<Photosphere>();
+                        this.photosphere = photosphere;
+                    }
+                    obj.transform.position = transform.position + Vector3.up;
+                    photosphere.hp = prefabDemonic.totalHp + soldierExtraBuff.hp + gameManager.totalHp;
+                    photosphere.conductController = this;
+                    break;
                 /*胖子*/
                 //融合大胖子
                 case ConductSkills.Giant:
@@ -251,40 +267,7 @@ public class ConductController : MonoBehaviour
                     bs.Attack_summon();
                     demonicObj.SetActive(true);
                     break;
-                //光球
-                case ConductSkills.Photon:
-                    playerController.conductCanRelease[demonicId] = false;
-                    obj = PoolManager.Instantiate(photon.obj);
-                    obj.transform.position = transform.position + Vector3.up;
-                    Photosphere photosphere = obj.GetComponent<Photosphere>();
-                    photosphere.owner = playerController;
-                    photosphere.conductId = demonicId;
-                    photosphere.hp = boostNum * photon.photosphereHp;
-                    photosphere.conductController = this;
-                    photon.photosphere = photosphere;
-                    photon.havePhoton = true;
-                    break;
-                    //        case ConductSkills.SwordsControl:
-                    //            conductCanRelease[cacheConductId] = false;
-                    //            obj = Instantiate(flyingSwordsObj, transform);
-                    //            obj.transform.position = transform.position + Vector3.up;
-                    //            SwordsControl swordsControl = obj.GetComponentInChildren<SwordsControl>();
-                    //            swordsControl.owner = this;
-                    //            swordsControl.conductId = cacheConductId;
-                    //            swordsControl.boostNum = boostNum;
-                    //            break;
-
             }
         }
     }
-
-    public bool HavePhoton(Character attackFrom, int damage)
-    {
-        if (photon.havePhoton)
-        {
-            photon.photosphere.Reflex(attackFrom.beHitTrigger, damage);
-            return true;
-        }
-        return false;
-    }
 }

+ 19 - 5
ActionTowerDefense/Assets/Scripts/Conduct/ConductManager.cs

@@ -10,10 +10,10 @@ public enum ConductSkills
     [LabelText("冥火涅槃")] NetherfireRebirth,
     [LabelText("电光炮")] FlyingSwords,
     [LabelText("冰雨")] IceRain,
+    [LabelText("保护罩")] Barrier,
     [LabelText("合成大胖子")]
     Giant,
-    [LabelText("光球")]
-    Photon,
+    
 }
 public class ConductManager : MonoBehaviour
 {
@@ -25,10 +25,10 @@ public class ConductManager : MonoBehaviour
         [LabelText("标签")] public AttributeTag attributeTag;
         [LabelText("献祭方式")] [Tooltip("勾选定额;不勾选百分比")] public bool bUseFixedSacrifice;
         [ShowIf("@!bUseFixedSacrifice")][LabelText("献祭比例(%)")] public float[] sacrificeRatio;
+        [ShowIf("@!bUseFixedSacrifice")] [LabelText("CD")] public float[] cd;
         [ShowIf("bUseFixedSacrifice")][LabelText("献祭数量")] public int[] sacrificeValue;
         [LabelText("效果规模")] public int[] power;
         [LabelText("效果加成(%)")] public float[] effectBonus;
-        [LabelText("CD")] public float[] cd;
         [LabelText("随机范围")] public Vector2 randomRange;
         [LabelText("是否会死亡")] public bool canDie;
     }
@@ -40,10 +40,10 @@ public class ConductManager : MonoBehaviour
         [LabelText("标签")] public AttributeTag attributeTag;
         [LabelText("献祭方式")] [Tooltip("勾选定额;不勾选百分比")] public bool bUseFixedSacrifice;
         [ShowIf("@!bUseFixedSacrifice")] [LabelText("献祭比例(%)")] public float[] sacrificeRatio;
+        [ShowIf("@!bUseFixedSacrifice")] [LabelText("CD")] public float[] cd;
         [ShowIf("bUseFixedSacrifice")] [LabelText("献祭数量")] public int[] sacrificeValue;
         [LabelText("效果规模")] public int[] power;
         [LabelText("效果加成(%)")] public float[] effectBonus;
-        [LabelText("CD")] public float[] cd;
         public GameObject obj;
     }
     [LabelText("电光炮")] public FlyingSwords flyingSwords;
@@ -54,14 +54,28 @@ public class ConductManager : MonoBehaviour
         [LabelText("标签")] public AttributeTag attributeTag;
         [LabelText("献祭方式")] [Tooltip("勾选定额;不勾选百分比")] public bool bUseFixedSacrifice;
         [ShowIf("@!bUseFixedSacrifice")] [LabelText("献祭比例(%)")] public float[] sacrificeRatio;
+        [ShowIf("@!bUseFixedSacrifice")] [LabelText("CD")] public float[] cd;
         [ShowIf("bUseFixedSacrifice")] [LabelText("献祭数量")] public int[] sacrificeValue;
         [LabelText("效果规模")] public int[] power;
         [LabelText("效果加成(%)")] public float[] effectBonus;
-        [LabelText("CD")] public float[] cd;
         public GameObject obj;
     }
     [LabelText("冰雨")] public IceRain iceRain;
 
+    //保护罩
+    [Serializable] public struct Barrier
+    {
+        [LabelText("标签")] public AttributeTag attributeTag;
+        [LabelText("献祭方式")] [Tooltip("勾选定额;不勾选百分比")] public bool bUseFixedSacrifice;
+        [ShowIf("@!bUseFixedSacrifice")] [LabelText("献祭比例(%)")] public float[] sacrificeRatio;
+        [ShowIf("@!bUseFixedSacrifice")] [LabelText("CD")] public float[] cd;
+        [ShowIf("bUseFixedSacrifice")] [LabelText("献祭数量")] public int[] sacrificeValue;
+        [LabelText("效果规模")] public int[] power;
+        [LabelText("效果加成(%)")] public float[] effectBonus;
+        public GameObject obj;
+    }
+    [LabelText("保护罩")] public Barrier barrier;
+
     private void Awake()
     {
         if(!instance)

+ 0 - 1
ActionTowerDefense/Assets/Scripts/Conduct/Mountain.cs

@@ -16,7 +16,6 @@ public class Mountain : MonoBehaviour
         if (foot.TrigGround)
         {
             gameObject.SetActive(false);
-            pc.conductCanRelease[id] = true;
         }
     }
 

+ 13 - 8
ActionTowerDefense/Assets/Scripts/Conduct/Photosphere.cs

@@ -1,3 +1,4 @@
+using Sirenix.OdinInspector;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
@@ -5,11 +6,10 @@ using UnityEngine;
 public class Photosphere : MonoBehaviour
 {
     //组件
-    public PlayerController owner;
     public ConductController conductController;
-    public int conductId;
     
-    [Header("停留时间")]public float stayTime;
+    [LabelText("停留时间")]public float stayTime;
+    [LabelText("破碎特效")]public GameObject breakEffect;
     private float time;
     [Header("吸收伤害")]public int hp;
     public GameObject bulletPrefab;
@@ -17,10 +17,16 @@ public class Photosphere : MonoBehaviour
     private void Update()
     {
         time += Time.deltaTime;
-        if (time >= stayTime || owner.isDie)
+        if (hp <= 0)
+        {
+            conductController.photosphere = null;
+            Transform trans = PoolManager.Instantiate(breakEffect).transform;
+            trans.position = transform.position;
+            gameObject.SetActive(false);
+        }
+        if (time >= stayTime || hp<= 0)
         {
-            owner.conductCanRelease[conductId] = true;
-            conductController.photon.havePhoton = false;
+            conductController.photosphere = null;
             gameObject.SetActive(false);
         }
     }
@@ -31,10 +37,9 @@ public class Photosphere : MonoBehaviour
         GameObject obj =PoolManager.Instantiate(bulletPrefab);
         Vector3 attackDir = (beHitTrigger.owner.beSearchTrigger.transform.position - transform.position).normalized;
         //obj.GetComponent<Bullet>().BeShoot(beHitTrigger.owner, transform.position, attackDir, true, true, beHitTrigger.owner);
-        obj.GetComponent<MagicBullet>().Reflex(damage,beHitTrigger.owner,transform.position, attackDir,owner);
+        //obj.GetComponent<MagicBullet>().Reflex(damage,beHitTrigger.owner,transform.position, attackDir,owner);
         if (hp <= 0)
         {
-            owner.conductCanRelease[conductId] = true;
             gameObject.SetActive(false);
         }
     }

+ 0 - 1
ActionTowerDefense/Assets/Scripts/Conduct/SwordsControl.cs

@@ -38,7 +38,6 @@ public class SwordsControl : MonoBehaviour
         time += Time.deltaTime;
         if (time >= totalTime || owner.isDie)
         {
-            owner.conductCanRelease[conductId] = true;
             parent.SetActive(false);
         }
     }

+ 0 - 1
ActionTowerDefense/Assets/Scripts/Conduct/WavePowerSkill.cs

@@ -74,7 +74,6 @@ public class WavePowerSkill : MonoBehaviour
 
     public void ActiveFalse()
     {
-        pc.conductCanRelease[cacheID] = true;
         pc.rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
         pc.rb.useGravity = true;
         gameObject.SetActive(false);