Procházet zdrojové kódy

增加攻击力技能新增献祭比例

SZAND\msx_2 před 10 měsíci
rodič
revize
8f6ff786fe

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

@@ -1067,6 +1067,7 @@ MonoBehaviour:
   photosphereObj: {fileID: 256012001268456902, guid: ba2e5bcb5c7ac604ea72b2fcb544a3cb, type: 3}
   photosphereHp: 1000
   attackEffect: {fileID: 417478504669294145, guid: 3b9e1b8087a2c2441a51fff8fec35d4f, type: 3}
+  addRate: 0.2
   mountain: {fileID: 8587706472837483213, guid: d966b0d5004eaad49b37c963f1aaa584, type: 3}
   mountainOffset: {x: 0, y: 7, z: 0}
   wavePowerObj: {fileID: 8625694250200680089, guid: 2ee85ceccd170b94b8ba929f3b58af5f, type: 3}

+ 25 - 22
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -179,7 +179,10 @@ public class PlayerController : MoveCharacter
     public GameObject photosphereObj;
     [Header("밟헷沂좆샘鑒")] public int photosphereHp;
     //묑샌제
+    [Header("藤속묑샌제景槻")]
     public GameObject attackEffect;
+    [Header("묑샌제窘셈궐절")]
+    public float addRate;
     //揭�箕땅
     public GameObject mountain;
     public Vector3 mountainOffset;
@@ -850,28 +853,28 @@ public class PlayerController : MoveCharacter
                     photosphere.hp = boostNum * photosphereHp;
                     break;
                 case ConductSkills.AddAttack:
-                    //List<Demonic> newGiants = new List<Demonic>();
-                    //foreach (Demonic d in giants)
-                    //{
-                    //    if (!d.isDie)
-                    //    {
-                    //        newGiants.Add(d);
-                    //        if (d.addAttackEffect == null)
-                    //        {
-                    //            d.addAttackEffect = Instantiate(attackEffect, d.bodyTrans.position, new Quaternion(0, 0, 0, 0), d.bodyTrans);
-                    //        }
-                    //        d.addAttackEffect.transform.GetChild(0).gameObject.SetActive(true);
-                    //    }
-                    //}
-                    //giants = newGiants;
-                    //foreach (Demonic d in giants)
-                    //{
-                    //    int[] damages = d.curDamage;
-                    //    for (int i = 0; i < damages.Length; i++)
-                    //    {
-                    //        damages[i] += giantNum * swordNum;
-                    //    }
-                    //}
+                    List<Demonic> newGiants = new List<Demonic>();
+                    foreach (Demonic d in giants)
+                    {
+                        if (!d.isDie)
+                        {
+                            newGiants.Add(d);
+                            if (d.addAttackEffect == null)
+                            {
+                                d.addAttackEffect = Instantiate(attackEffect, d.bodyTrans.position, new Quaternion(0, 0, 0, 0), d.bodyTrans);
+                            }
+                            d.addAttackEffect.transform.GetChild(0).gameObject.SetActive(true);
+                        }
+                    }
+                    giants = newGiants;
+                    foreach (Demonic d in giants)
+                    {
+                        int[] damages = d.curDamage2;
+                        for (int i = 0; i < damages.Length; i++)
+                        {
+                            damages[i] += (int)(addRate * boostNum * damages[i]);
+                        }
+                    }
                     break;
                 //폭묘可
                 case ConductSkills.Mountain: