Răsfoiți Sursa

实现标签技能2.0的天和地,暂时用刚体的drag实现飞行敌人被风吹动后的减速效果

HY-LSZNWIN10\Administrator 1 lună în urmă
părinte
comite
2af0a8e1df

+ 18 - 10
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_1004.prefab

@@ -232,7 +232,6 @@ MonoBehaviour:
   owner: {fileID: 1986582536140952583}
   attackerID: 0
   curX: 0
-  mats: []
 --- !u!114 &1645771639631463631
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -326,9 +325,10 @@ MonoBehaviour:
   compressionSpeed: {x: 0.2, y: 0.4}
   jumpVel: 5
   haveVulnerable: 0
+  vulnerableRate: 0
   vulnerableTime: 0
   stackingWoudsTime: 0
-  stackingWordsNum: 0
+  stackingWords: 0
   resistances:
     controlOrder: 0
     Float: -0
@@ -1388,6 +1388,12 @@ MonoBehaviour:
   platformRotZ: 0
   RotLerpSpeed: 0.6
   RotLerpTime: 0
+  needToAdjustFlyHeight: 1
+  flyHeight: 0
+  maxFlyHeight: 6
+  minFlyHeight: 10
+  flyUpTime: 0.1
+  isAdjustHeight: 0
   matState: 1
   spinee: {fileID: 0}
   mesh: {fileID: 0}
@@ -1397,12 +1403,7 @@ MonoBehaviour:
   outline1Mats:
   - {fileID: 2100000, guid: 916bb121eaeae3b43914636f946abdcd, type: 2}
   moveSpeed: 8.205597
-  needToAdjustFlyHeight: 1
-  flyHeight: 0
-  maxFlyHeight: 6
-  minFlyHeight: 10
-  flyUpTime: 0.1
-  isAdjustHeight: 0
+  moveSpeedScale: 1
   isDamageReduction: 0
   reductionDegree: 0
   reductionEffect: {fileID: 0}
@@ -1421,7 +1422,14 @@ MonoBehaviour:
   heavyDamage: 0
   killer: {fileID: 0}
   isFrozen: 0
-  frozenTime: 0
+  electrifyAttackSpeedScale: 0.6
+  electrifyMoveSpeedScale: 0.6
+  isElectrify: 0
+  isPetrify: 0
+  petrifyTime: 0
+  petrifyHp: 0
+  isOnFire: 0
+  fireStacks: 0
   exp: 1
   tag: 0
   dieEffect: {fileID: 417478504669294145, guid: 2a4e7e280b9d19042ba0f57ae5edf736, type: 3}
@@ -1455,7 +1463,7 @@ Rigidbody:
   m_GameObject: {fileID: 8639832132491289359}
   serializedVersion: 2
   m_Mass: 8
-  m_Drag: 0.1
+  m_Drag: 1
   m_AngularDrag: 0.05
   m_UseGravity: 0
   m_IsKinematic: 0

+ 18 - 10
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_1005.prefab

@@ -232,7 +232,6 @@ MonoBehaviour:
   owner: {fileID: 1986582536140952583}
   attackerID: 0
   curX: 0
-  mats: []
 --- !u!114 &5163334812499902333
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -326,9 +325,10 @@ MonoBehaviour:
   compressionSpeed: {x: 0.2, y: 0.4}
   jumpVel: 5
   haveVulnerable: 0
+  vulnerableRate: 0
   vulnerableTime: 0
   stackingWoudsTime: 0
-  stackingWordsNum: 0
+  stackingWords: 0
   resistances:
     controlOrder: 0
     Float: 0
@@ -1389,6 +1389,12 @@ MonoBehaviour:
   platformRotZ: 0
   RotLerpSpeed: 0.6
   RotLerpTime: 0
+  needToAdjustFlyHeight: 0
+  flyHeight: 0
+  maxFlyHeight: 0
+  minFlyHeight: 0
+  flyUpTime: 0.1
+  isAdjustHeight: 0
   matState: 1
   spinee: {fileID: 0}
   mesh: {fileID: 0}
@@ -1398,12 +1404,7 @@ MonoBehaviour:
   outline1Mats:
   - {fileID: 2100000, guid: 916bb121eaeae3b43914636f946abdcd, type: 2}
   moveSpeed: 8.205597
-  needToAdjustFlyHeight: 0
-  flyHeight: 0
-  maxFlyHeight: 0
-  minFlyHeight: 0
-  flyUpTime: 0.1
-  isAdjustHeight: 0
+  moveSpeedScale: 1
   isDamageReduction: 0
   reductionDegree: 0
   reductionEffect: {fileID: 0}
@@ -1422,7 +1423,14 @@ MonoBehaviour:
   heavyDamage: 0
   killer: {fileID: 0}
   isFrozen: 0
-  frozenTime: 0
+  electrifyAttackSpeedScale: 0.6
+  electrifyMoveSpeedScale: 0.6
+  isElectrify: 0
+  isPetrify: 0
+  petrifyTime: 0
+  petrifyHp: 0
+  isOnFire: 0
+  fireStacks: 0
   exp: 1
   tag: 0
   dieEffect: {fileID: 417478504669294145, guid: 2a4e7e280b9d19042ba0f57ae5edf736, type: 3}
@@ -1456,7 +1464,7 @@ Rigidbody:
   m_GameObject: {fileID: 8639832132491289359}
   serializedVersion: 2
   m_Mass: 8
-  m_Drag: 0
+  m_Drag: 1
   m_AngularDrag: 0.05
   m_UseGravity: 0
   m_IsKinematic: 0

+ 7 - 5
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_1007.prefab

@@ -232,7 +232,6 @@ MonoBehaviour:
   owner: {fileID: 1986582536140952583}
   attackerID: 0
   curX: 0
-  mats: []
 --- !u!114 &9182774060409537036
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -414,6 +413,7 @@ MonoBehaviour:
   compressionSpeed: {x: 0.2, y: 0.4}
   jumpVel: 5
   haveVulnerable: 0
+  vulnerableRate: 0
   vulnerableTime: 0
   stackingWoudsTime: 0
   stackingWords: 0
@@ -1422,12 +1422,14 @@ MonoBehaviour:
   heavyDamage: 0
   killer: {fileID: 0}
   isFrozen: 0
-  frozenTime: 0
   electrifyAttackSpeedScale: 0.6
   electrifyMoveSpeedScale: 0.6
   isElectrify: 0
-  electrifyTime: 0
-  electrifyEffectPrefab: {fileID: 0}
+  isPetrify: 0
+  petrifyTime: 0
+  petrifyHp: 0
+  isOnFire: 0
+  fireStacks: 0
   exp: 10
   tag: 0
   dieEffect: {fileID: 0}
@@ -1461,7 +1463,7 @@ Rigidbody:
   m_GameObject: {fileID: 8639832132491289359}
   serializedVersion: 2
   m_Mass: 15
-  m_Drag: 0
+  m_Drag: 1
   m_AngularDrag: 0.05
   m_UseGravity: 0
   m_IsKinematic: 0

+ 18 - 10
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_1014.prefab

@@ -232,7 +232,6 @@ MonoBehaviour:
   owner: {fileID: 1986582536140952583}
   attackerID: 0
   curX: 0
-  mats: []
 --- !u!114 &9182774060409537036
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -414,9 +413,10 @@ MonoBehaviour:
   compressionSpeed: {x: 0.2, y: 0.4}
   jumpVel: 5
   haveVulnerable: 0
+  vulnerableRate: 0
   vulnerableTime: 0
   stackingWoudsTime: 0
-  stackingWordsNum: 0
+  stackingWords: 0
   resistances:
     controlOrder: 0
     Float: 0
@@ -1389,6 +1389,12 @@ MonoBehaviour:
   platformRotZ: 0
   RotLerpSpeed: 0.6
   RotLerpTime: 0
+  needToAdjustFlyHeight: 0
+  flyHeight: 0
+  maxFlyHeight: 0
+  minFlyHeight: 0
+  flyUpTime: 0.1
+  isAdjustHeight: 0
   matState: 1
   spinee: {fileID: 0}
   mesh: {fileID: 0}
@@ -1398,12 +1404,7 @@ MonoBehaviour:
   outline1Mats:
   - {fileID: 2100000, guid: 916bb121eaeae3b43914636f946abdcd, type: 2}
   moveSpeed: 5
-  needToAdjustFlyHeight: 0
-  flyHeight: 0
-  maxFlyHeight: 0
-  minFlyHeight: 0
-  flyUpTime: 0.1
-  isAdjustHeight: 0
+  moveSpeedScale: 1
   isDamageReduction: 0
   reductionDegree: 0
   reductionEffect: {fileID: 0}
@@ -1422,7 +1423,14 @@ MonoBehaviour:
   heavyDamage: 0
   killer: {fileID: 0}
   isFrozen: 0
-  frozenTime: 0
+  electrifyAttackSpeedScale: 0.6
+  electrifyMoveSpeedScale: 0.6
+  isElectrify: 0
+  isPetrify: 0
+  petrifyTime: 0
+  petrifyHp: 0
+  isOnFire: 0
+  fireStacks: 0
   exp: 1
   tag: 0
   dieEffect: {fileID: 417478504669294145, guid: 71b8503fcde80984c9c72cdff74b849a, type: 3}
@@ -1456,7 +1464,7 @@ Rigidbody:
   m_GameObject: {fileID: 8639832132491289359}
   serializedVersion: 2
   m_Mass: 10
-  m_Drag: 0
+  m_Drag: 1
   m_AngularDrag: 0.05
   m_UseGravity: 0
   m_IsKinematic: 0

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

@@ -789,16 +789,16 @@ public class Demonic : MoveCharacter
                     //        player.nextSummonNum++;
                     //    }
                     //}
-                    if (GameManager.instance.isGroundEnable && !canFly)
-                    {
-                        int randomInt = Random.Range(0, 100);
-                        if (randomInt < GameManager.instance.groundProbability)
-                        {
-                            SoulDead soulDead =  PoolManager.Instantiate(Resources.Load<GameObject>("Prefab/SoulDead"),transform.position).GetComponent<SoulDead>();
-                            soulDead.Init(player, id);
-                            soulDead.transform.position = transform.position;
-                        }
-                    }
+                    //if (GameManager.instance.isGroundEnable && !canFly)
+                    //{
+                    //    int randomInt = Random.Range(0, 100);
+                    //    if (randomInt < GameManager.instance.groundProbability)
+                    //    {
+                    //        SoulDead soulDead =  PoolManager.Instantiate(Resources.Load<GameObject>("Prefab/SoulDead"),transform.position).GetComponent<SoulDead>();
+                    //        soulDead.Init(player, id);
+                    //        soulDead.transform.position = transform.position;
+                    //    }
+                    //}
                 }
                 else
                 {
@@ -807,16 +807,16 @@ public class Demonic : MoveCharacter
                     dieKeepTime = totalDieKeepTime;
                     summonEndToDie = false;
                     PlayersInput.instance[playerID].OnDemonicRecycle(this);
-                    if (GameManager.instance.isGroundEnable && !canFly)
-                    {
-                        int randomInt = Random.Range(0, 100);
-                        if (randomInt < GameManager.instance.groundProbability)
-                        {
-                            SoulDead soulDead = PoolManager.Instantiate(Resources.Load<GameObject>("Prefab/SoulDead"), transform.position).GetComponent<SoulDead>();
-                            soulDead.Init(player, id);
-                            soulDead.transform.position = transform.position;
-                        }
-                    }
+                    //if (GameManager.instance.isGroundEnable && !canFly)
+                    //{
+                    //    int randomInt = Random.Range(0, 100);
+                    //    if (randomInt < GameManager.instance.groundProbability)
+                    //    {
+                    //        SoulDead soulDead = PoolManager.Instantiate(Resources.Load<GameObject>("Prefab/SoulDead"), transform.position).GetComponent<SoulDead>();
+                    //        soulDead.Init(player, id);
+                    //        soulDead.transform.position = transform.position;
+                    //    }
+                    //}
                 }
                 break;
             case CharacterState.LockSoul:

+ 20 - 0
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -1615,6 +1615,26 @@ public class PlayerController : MoveCharacter
             attackInfo.criticalChance = gameManager.criticalChance;
             attackInfo.lifesteal = gameManager.lifesteal;
         }
+        if ((GameManager.instance.isSkyEnable && demonic.canFly))
+        {
+            for (int i = 0; i < attackController.attackMethod_summon.Length; i++)
+            {
+                AttackInfo attackInfo = attackController.attackMethod_summon[i].attackInfo;
+                attackInfo.damage += (int)(demonicDic[0].Count * GameManager.instance.attackRate);
+                Debug.Log("飞行兵的数量是:" + demonicDic[0].Count + ",增加的伤害为" + (int)(demonicDic[0].Count * GameManager.instance.attackRate));
+            }
+            for (int i = 0; i < attackController.attackMethod_march.Length; i++)
+            {
+                AttackInfo attackInfo = attackController.attackMethod_summon[i].attackInfo;
+                attackInfo.damage += (int)(demonicDic[0].Count * GameManager.instance.attackRate);
+            }        
+        }
+        else if (GameManager.instance.isGroundEnable && !demonic.canFly)
+        {
+            int num = demonicDic[1].Count + demonicDic[2].Count;
+            demonic.attributeStatus.resistances.armor += (int)(num * GameManager.instance.armorRate);
+            Debug.Log("地面兵的数量是:" + num + ",增加的防御为" + (int)(num * GameManager.instance.armorRate));
+        }
         demonic.attributeStatus.resistances.armor = gameManager.armor;
         demonic.attributeStatus.resistances.dodge = gameManager.dodge;
         demonic.regeneration = gameManager.regeneration;

+ 8 - 6
ActionTowerDefense/Assets/Scripts/GameManager.cs

@@ -104,15 +104,17 @@ public class GameManager : MonoBehaviour
     [FoldoutGroup("标签/岩")] [LabelText("石像生命值占总生命比值")] public float stoneHpRadio = 1;
 
     [FoldoutGroup("标签/天")] [LabelText("是否启用")] public bool isSkyEnable = false;
-    [FoldoutGroup("标签/天")] [LabelText("最大比例")] public float maxScale = 2;
-    [FoldoutGroup("标签/天")] [LabelText("地面高度")] public float groundHeight = 0;
-    [FoldoutGroup("标签/天")] [LabelText("成长比例")] public float enlargeScale = 0.3f;
+    [FoldoutGroup("标签/天")] [LabelText("每个兵提供的攻击buff比率")] public float attackRate = 0.01f;
+    //[FoldoutGroup("标签/天")] [LabelText("最大比例")] public float maxScale = 2;
+    //[FoldoutGroup("标签/天")] [LabelText("地面高度")] public float groundHeight = 0;
+    //[FoldoutGroup("标签/天")] [LabelText("成长比例")] public float enlargeScale = 0.3f;
 
 
     [FoldoutGroup("标签/地")] [LabelText("是否启用")] public bool isGroundEnable = false;
-    [FoldoutGroup("标签/地")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int groundProbability = 100;
-    [FoldoutGroup("标签/地")] [LabelText("复活时间")] [PropertyRange(0, 100)] public float resurrectionTime = 3;
-    [FoldoutGroup("标签/地")] [LabelText("魂骸血量")] [PropertyRange(0, 100)] public int deadHp = 20;
+    [FoldoutGroup("标签/地")] [LabelText("每个兵提供的防御buff比率")] public float armorRate = 0.01f;
+    //[FoldoutGroup("标签/地")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int groundProbability = 100;
+    //[FoldoutGroup("标签/地")] [LabelText("复活时间")] [PropertyRange(0, 100)] public float resurrectionTime = 3;
+    //[FoldoutGroup("标签/地")] [LabelText("魂骸血量")] [PropertyRange(0, 100)] public int deadHp = 20;
 
     [Header("商店刷新")]
     [ValidateInput("CheckTagWeight","标签池子概率总和不是100%")]

+ 6 - 6
ActionTowerDefense/Assets/Scripts/Soul.cs

@@ -112,12 +112,12 @@ public class Soul : MonoBehaviour
 
     private void FixedUpdate()
     {
-        if (GameManager.instance.isSkyEnable)
-        {
-            scale = (transform.position.y - GameManager.instance.groundHeight) * GameManager.instance.enlargeScale;
-            scale = Mathf.Min(scale, GameManager.instance.maxScale);
-            soulObj.localScale = new Vector3(Mathf.Max(1, scale), Mathf.Max(1, scale), Mathf.Max(1, scale));
-        }
+        //if (GameManager.instance.isSkyEnable)
+        //{
+        //    scale = (transform.position.y - GameManager.instance.groundHeight) * GameManager.instance.enlargeScale;
+        //    scale = Mathf.Min(scale, GameManager.instance.maxScale);
+        //    soulObj.localScale = new Vector3(Mathf.Max(1, scale), Mathf.Max(1, scale), Mathf.Max(1, scale));
+        //}
 
         if (isShoot)
         {

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

@@ -14,14 +14,14 @@ public class SoulDead : Character
     {
         player = _player;
         demonicId = _demonicId;
-        resurrectionTime = GameManager.instance.resurrectionTime;
-        resurrectionTimer = Time.time;
+        //resurrectionTime = GameManager.instance.resurrectionTime;
+        //resurrectionTimer = Time.time;
         isInit = true;
     }
 
     private void OnEnable()
     {
-        totalHp = GameManager.instance.deadHp;
+        //totalHp = GameManager.instance.deadHp;
         hp = totalHp;
         isDie = false;
         invincibleTime = 0.5f;