Procházet zdrojové kódy

击晕由stun改为weak,修改behit传参

wgl před 6 měsíci
rodič
revize
73920007a9

+ 3 - 3
ActionTowerDefense/Assets/Scripts/Bullet.cs

@@ -66,7 +66,7 @@ public class Bullet : MonoBehaviour
             dis2.z = dis1.z;
             if (Vector3.Distance(dis1,dis2) < 0.1)
             {
-                trackTarget.BeHit(attackInfo, transform.position.x < trackTarget.transform.position.x?-1:1) ;
+                trackTarget.BeHit(attackInfo, owner) ;
                 if (trackTarget.debugAttackFrom)
                 {
                     trackTarget.DebugAttackFrom(owner.name, attackInfo.damage);
@@ -158,7 +158,7 @@ public class Bullet : MonoBehaviour
                     switch (bulletType)
                     {
                         case BulletType.Single:
-                            hitTrigger.BeHit(attackInfo, dir);
+                            hitTrigger.BeHit(attackInfo, owner);
                             if (hitTrigger.owner.debugAttackFrom)
                             {
                                 hitTrigger.owner.DebugAttackFrom(owner.name, attackInfo.damage);
@@ -188,7 +188,7 @@ public class Bullet : MonoBehaviour
                             }
                             break;
                         case BulletType.Penetrate:
-                            hitTrigger.BeHit(attackInfo,dir);
+                            hitTrigger.BeHit(attackInfo,owner);
                             if (hitTrigger.owner.debugAttackFrom)
                             {
                                 hitTrigger.owner.DebugAttackFrom(owner.name, attackInfo.damage);

+ 6 - 6
ActionTowerDefense/Assets/Scripts/Characters/AttackController.cs

@@ -12,7 +12,7 @@ public enum AttackEffect
     [LabelText("漂浮")]FloatState = 0,
     [LabelText("击飞")]BlowUp = 1,
     [LabelText("击落")]ShotDown = 2,
-    [LabelText("击晕")]Stun = 3, 
+    [LabelText("击晕")]Weak = 3, 
 
     //非控制
     [LabelText("穿甲")]Armor,
@@ -78,14 +78,14 @@ public class AttackInfo
     public ShotDown shotDown;
 
     //击晕
-    [Serializable]public struct Stun
+    [Serializable]public struct Weak
     {
         [LabelText("持续时间")]
         public float time;
     }
-    private bool ShowStunValue() => attackEffect.Contains(AttackEffect.Stun);
-    [ShowIf("ShowStunValue")][LabelText("击晕参数")]
-    public Stun stun;
+    private bool ShowWeakValue() => attackEffect.Contains(AttackEffect.Weak);
+    [ShowIf("ShowWeakValue")][LabelText("击晕参数")]
+    public Weak weak;
 
     //穿甲
     [Serializable]public struct Armor
@@ -133,7 +133,7 @@ public class AttackInfo
         ai.attackDir = attackDir;
         ai.blowUp = blowUp;
         ai.shotDown = shotDown;
-        ai.stun = stun;
+        ai.weak = weak;
         ai.armor = armor;
         ai.changeDamage = changeDamage;
         ai.sustainedInjury = sustainedInjury;

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

@@ -62,7 +62,7 @@ public class AttackTrigger : MonoBehaviour
                     return;
                 }
                 trigedObjs.Add(hitTrigger);
-                hitTrigger.BeHit(attackInfo, owner.bodyTrans.localScale.x);
+                hitTrigger.BeHit(attackInfo, owner);
                 if (hitTrigger.owner.debugAttackFrom)
                 {
                     hitTrigger.owner.DebugAttackFrom(owner.name, attackInfo.damage);

+ 8 - 8
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -11,7 +11,7 @@ public enum SpecialState
     FloatState = 0,
     ShotDown = 1,
     BlownUp = 2,
-    Stun = 3,
+    Weak = 3,
 }
 
 public class AttributeStatus : MonoBehaviour
@@ -38,7 +38,7 @@ public class AttributeStatus : MonoBehaviour
         [Range(0, 1)][LabelText("击落抗性")]
         public float ShotDown;
         [Range(0, 1)][LabelText("击晕抗性")]
-        public float Stun;
+        public float Weak;
 
         [Space]
         //非控制效果抗性
@@ -236,7 +236,7 @@ public class AttributeStatus : MonoBehaviour
                 }
                 break;
             //眩晕
-            case SpecialState.Stun:
+            case SpecialState.Weak:
                 if (attributeTime <= 0)
                 {
                     curSpecialStates = SpecialState.Null;
@@ -341,15 +341,15 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //受到击晕
-    public void AddStun(AttackInfo.Stun stun)
+    public void AddWeak(AttackInfo.Weak weak)
     {
-        if (PriorityOrder(SpecialState.Stun))
+        if (PriorityOrder(SpecialState.Weak))
         {
             return;
         }
-        attributeTime = stun.time * (1 - resistances.Stun);
-        curSpecialStates = SpecialState.Stun;
-        character.ChangeState(CharacterState.SpecialStatus_Stun);
+        attributeTime = weak.time * (1 - resistances.Weak);
+        curSpecialStates = SpecialState.Weak;
+        character.ChangeState(CharacterState.SpecialStatus_Weak);
     }
 
     //受到穿甲

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

@@ -23,9 +23,9 @@ public class BeHitTrigger : MonoBehaviour
         owner.BeHit(damage);
     }
 
-    public void BeHit(AttackInfo attackInfo,float dir)
+    public void BeHit(AttackInfo attackInfo, Character attackFrom)
     {
-        owner.BeHit(attackInfo,dir);
+        owner.BeHit(attackInfo,attackFrom);
     }
 
     private void Update()

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

@@ -25,7 +25,7 @@ public enum CharacterState
     SpecialStatus_Float,
     SpecialStatus_ShotDown,
     SpecialStatus_BlowUp,
-    SpecialStatus_Stun,
+    SpecialStatus_Weak,
 
     LockSoul = 25,          //在锁魂塔中
     Conduct = 26,           //在指挥中
@@ -197,7 +197,7 @@ public class Character : MonoBehaviour
     }
 
     //造成伤害附加其他效果
-    public virtual void BeHit(AttackInfo attackInfo, float dir)
+    public virtual void BeHit(AttackInfo attackInfo, Character attackFrom)
     {
         if (invincibleTime > 0)
         {

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Characters/Demonic.cs

@@ -515,8 +515,8 @@ public class Demonic : MoveCharacter
             case CharacterState.SpecialStatus_ShotDown:
                 attributeStatus.SpecialStateEffect(SpecialState.ShotDown);
                 break;
-            case CharacterState.SpecialStatus_Stun:
-                attributeStatus.SpecialStateEffect(SpecialState.Stun);
+            case CharacterState.SpecialStatus_Weak:
+                attributeStatus.SpecialStateEffect(SpecialState.Weak);
                 break;
             default:
                 break;

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

@@ -398,8 +398,8 @@ public class Enemy : MoveCharacter
             case CharacterState.SpecialStatus_ShotDown:
                 attributeStatus.SpecialStateEffect(SpecialState.ShotDown);
                 break;
-            case CharacterState.SpecialStatus_Stun:
-                attributeStatus.SpecialStateEffect(SpecialState.Stun);
+            case CharacterState.SpecialStatus_Weak:
+                attributeStatus.SpecialStateEffect(SpecialState.Weak);
                 break;
             default:
                 break;

+ 6 - 6
ActionTowerDefense/Assets/Scripts/Characters/MoveCharacter.cs

@@ -209,9 +209,9 @@ public class MoveCharacter : Character
     }
 
     //造成伤害附加其他效果
-    public override void BeHit(AttackInfo attackInfo, float dir)
+    public override void BeHit(AttackInfo attackInfo, Character attackFrom)
     {
-        base.BeHit(attackInfo, dir);
+        base.BeHit(attackInfo, attackFrom);
         int damage = attackInfo.damage;
         if (attackInfo.attackEffect.Length > 0)
         {
@@ -226,15 +226,15 @@ public class MoveCharacter : Character
                         break;
                     //击飞
                     case AttackEffect.BlowUp:
-                        attributeStatus.AddBlowUp(attackInfo.blowUp,dir);
+                        attributeStatus.AddBlowUp(attackInfo.blowUp, attackFrom.transform.localScale.x < 0 ? -1 : 1);
                         break;
                     //击落
                     case AttackEffect.ShotDown:
-                        attributeStatus.AddShotDown(attackInfo.shotDown,dir);
+                        attributeStatus.AddShotDown(attackInfo.shotDown, attackFrom.transform.localScale.x < 0 ? -1 : 1);
                         break;
                     //击晕
-                    case AttackEffect.Stun:
-                        attributeStatus.AddStun(attackInfo.stun);
+                    case AttackEffect.Weak:
+                        attributeStatus.AddWeak(attackInfo.weak);
                         break;
 
                     /*非控制*/

+ 5 - 4
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -1304,8 +1304,8 @@ public class PlayerController : MoveCharacter
             case CharacterState.SpecialStatus_ShotDown:
                 attributeStatus.SpecialStateEffect(SpecialState.ShotDown);
                 break;
-            case CharacterState.SpecialStatus_Stun:
-                attributeStatus.SpecialStateEffect(SpecialState.Stun);
+            case CharacterState.SpecialStatus_Weak:
+                attributeStatus.SpecialStateEffect(SpecialState.Weak);
                 break;
             default:
                 break;
@@ -1832,9 +1832,10 @@ public class PlayerController : MoveCharacter
         }
     }
 
-    public override void BeHit(AttackInfo attackInfo, float dir)
+    public override void BeHit(AttackInfo attackInfo, Character attackFrom)
     {
-        base.BeHit(attackInfo, dir);
+        //conductController.
+        base.BeHit(attackInfo, attackFrom);
         //ÆÁÄ»ºìÉÁ+¶¶¶¯
         if (ss == null)
         {

+ 14 - 0
ActionTowerDefense/Assets/Scripts/Conduct/ConductController.cs

@@ -55,6 +55,8 @@ public class ConductController : MonoBehaviour
         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("¹âÇò²ÎÊý")]
@@ -156,6 +158,7 @@ public class ConductController : MonoBehaviour
                     photosphere.owner = playerController;
                     photosphere.conductId = demonicId;
                     photosphere.hp = boostNum * photon.photosphereHp;
+                    photon.havePhoton = true;
                     break;
                     //        case ConductSkills.AddAttack:
                     //            List<Demonic> newGiants = new List<Demonic>();
@@ -242,4 +245,15 @@ public class ConductController : MonoBehaviour
             }
         }
     }
+
+    public bool HavePhoton(Character attackFrom, int damage)
+    {
+        if (photon.havePhoton)
+        {
+            photon.photosphere.Reflex(attackFrom.beHitTrigger, damage);
+            gameObject.SetActive(false);
+            return true;
+        }
+        return false;
+    }
 }

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Tower/EnemyTower.cs

@@ -131,7 +131,7 @@ public class EnemyTower : Character
         base.BeHit(damage);
     }
 
-    public override void BeHit(AttackInfo attackInfo, float dir)
+    public override void BeHit(AttackInfo attackInfo, Character attackFrom)
     {
         base.BeHit(attackInfo.damage);
     }

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Tower/Tower.cs

@@ -136,7 +136,7 @@ public class Tower : Character
         base.BeHit(damage);
     }
 
-    public override void BeHit(AttackInfo attackInfo, float dir)
+    public override void BeHit(AttackInfo attackInfo, Character attackFrom)
     {
         base.BeHit(attackInfo.damage);
     }