From 09053388ef6d58a7de59fab450c11ee0affbceb2 Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Fri, 20 Nov 2020 11:50:55 +0800 Subject: [PATCH] Merge commit 'fafc11ad74601a1c4e4b2e28165af25bd19bb5a9' into master --- Assets/Scripts/TowerDefense/UI/EndlessSettlement.cs | 2 Assets/Scripts/TowerDefense/UI/EndlessBossSkill/EndlessBossSkillManager.cs | 6 ++- Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs | 9 +--- Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs | 8 ++-- Assets/Scripts/TowerDefense/Level/AgentInsManager.cs | 33 ++++++++++------ Assets/Scripts/TowerDefense/Agents/BubbleBombAgent.cs | 7 +++ 6 files changed, 39 insertions(+), 26 deletions(-) diff --git a/Assets/Scripts/TowerDefense/Agents/BubbleBombAgent.cs b/Assets/Scripts/TowerDefense/Agents/BubbleBombAgent.cs index 5e80da5..08b8a51 100644 --- a/Assets/Scripts/TowerDefense/Agents/BubbleBombAgent.cs +++ b/Assets/Scripts/TowerDefense/Agents/BubbleBombAgent.cs @@ -103,7 +103,7 @@ protected override void LateUpdate() { - + } public override void Initialize() @@ -117,5 +117,10 @@ agentTweenSeq.Append(agScale); agentTweenSeq.AppendCallback(beDamageStart); } + + public override void PlayDeath() + { + Debug.LogError("---- BubbleBombAgent PlayDeath 正常逻辑不应该打印出这句话 ----"); + } } } \ No newline at end of file diff --git a/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs b/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs index 065abcc..53de8e1 100644 --- a/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs +++ b/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs @@ -865,21 +865,29 @@ { Agent eag = listAg[ti]; if (eag == ag) continue; - Vector3 fpos = eag.transform.position; - tpos.y = 0; - fpos.y = 0; - if (Vector3.Distance(tpos, fpos) < 8) + + if (eag.AgentType == SpawnAgentType.BubbleBomb) { - eag.TakeDamage(damage, fpos, null); - if (!eag.opponentAgent) + EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessBossSkillBubbleBombGetHit, (eag as BubbleBombAgent).Id); + } + else + { + Vector3 fpos = eag.transform.position; + tpos.y = 0; + fpos.y = 0; + if (Vector3.Distance(tpos, fpos) < 8) { - if (GameUI.instanceExists) - GameUI.instance.generateBloodText(fpos, damage, false, false); - else if (EndlessGameUI.instanceExists) - EndlessGameUI.instance.generateBloodText(fpos, damage, false, false); + eag.TakeDamage(damage, fpos, null); + if (!eag.opponentAgent) + { + if (GameUI.instanceExists) + GameUI.instance.generateBloodText(fpos, damage, false, false); + else if (EndlessGameUI.instanceExists) + EndlessGameUI.instance.generateBloodText(fpos, damage, false, false); + } + if (eag.isDead) + ++deathCount; } - if (eag.isDead) - ++deathCount; } } @@ -940,6 +948,7 @@ // 每一个被链式攻击的怪物,飘血. foreach (Agent ag in listBlood) { + if (ag.AgentType != SpawnAgentType.Normal) continue; int tid = ag.liveID; Damager damager = ag.GetComponent<Damager>(); ag.TakeDamage(chainAttackHurt, ag.position, alignment); diff --git a/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs b/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs index 57aedeb..b125abb 100644 --- a/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs +++ b/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs @@ -16,7 +16,7 @@ [RequireComponent(typeof(BoxCollider))] public class TowerPlacementGridEndless : MonoBehaviour, IPlacementArea { - public static float GRID_OPENCASH = 100; + public static float GRID_OPENCASH = 200; /// <summary> /// Prefab used to visualise the grid. @@ -642,7 +642,7 @@ m_arrTGO = new EndlessTowerGridOpen[dimensions.x, dimensions.y]; GameObject container = GameObject.Find("BuyButtonContainer"); - TowerPlacementGridEndless.GRID_OPENCASH = 100; + TowerPlacementGridEndless.GRID_OPENCASH = 200; //Debug.Log("修改了数值:" + TowerPlacementGridEndless.GRID_OPENCASH); //float[] xup = { -0.6f, -0.3f, 0, 0.3f, 0.6f }; for (int x = 0; x < dimensions.x; ++x) @@ -674,7 +674,7 @@ if (tgo) { tgo.SetBuyBtnInfo(x, y, this); - tgo.cashText.SetText(TowerPlacementGrid.GRID_OPENCASH_SELF.ToString()); + tgo.cashText.SetText(TowerPlacementGridEndless.GRID_OPENCASH.ToString()); m_arrTGO[x, y] = tgo; } } @@ -812,7 +812,7 @@ public void updateGridOpenCoin(int ix, int iy) { - GRID_OPENCASH = Mathf.Floor(GRID_OPENCASH * 1.2f); + GRID_OPENCASH = Mathf.Floor(GRID_OPENCASH * 1.25f); for (int x = 0; x < dimensions.x; x++) { diff --git a/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs b/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs index d3d58ab..8ac98e2 100644 --- a/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs +++ b/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs @@ -376,6 +376,8 @@ { BubbleBombConfig config = bubbleBombList[i]; + if (config.Agent == null || config.obj == null) continue; + // 泡泡炸弹已经触发了攻击,延时一会过后掉爱心 if (config.IsAttack) { @@ -420,7 +422,7 @@ } // 更新移动 - if (config.Agent.CanMove) + if (config.Agent != null && config.Agent.CanMove) { Vector3 pos = config.obj.transform.position; pos.z -= deltaTime * config.MoveSpeed; @@ -432,11 +434,6 @@ config.IsAttack = true; config.AttackTime = 0.65f; } - } - else - { - // cx test - Debug.LogError("---- 泡泡炸弹不能移动??? ----"); } } } diff --git a/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/EndlessBossSkillManager.cs b/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/EndlessBossSkillManager.cs index b4ac36b..506d919 100644 --- a/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/EndlessBossSkillManager.cs +++ b/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/EndlessBossSkillManager.cs @@ -206,13 +206,15 @@ { if (isPaused) return; + cdList.Clear(); + waitList.Clear(); + for (int i = 0; i < skillList.Count; ++i) { skillList[i].Reset(); + waitList.Add(skillList[i]); } - cdList.Clear(); - waitList.Clear(); isPaused = true; ChangeState(EndlessBossSkillState.Init); ClearEvent(); diff --git a/Assets/Scripts/TowerDefense/UI/EndlessSettlement.cs b/Assets/Scripts/TowerDefense/UI/EndlessSettlement.cs index f6f6780..e2497e0 100644 --- a/Assets/Scripts/TowerDefense/UI/EndlessSettlement.cs +++ b/Assets/Scripts/TowerDefense/UI/EndlessSettlement.cs @@ -62,7 +62,7 @@ EndlessUIStart.bFirstLoaded = false; EndlessUIStart.bGameStart = false; - TowerPlacementGridEndless.GRID_OPENCASH = 100; + TowerPlacementGridEndless.GRID_OPENCASH = 200; SafelyUnsubscribe(); SceneManager.LoadScene(menuSceneName); -- Gitblit v1.9.1