From f2f4e1e45981bb294a5221ade7b4646cc3e29d35 Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Wed, 11 Nov 2020 18:56:44 +0800 Subject: [PATCH] 无尽模式分数 --- Assets/Scripts/TowerDefense/Level/AgentInsManager.cs | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs b/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs index a45f46f..eb2c66e 100644 --- a/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs +++ b/Assets/Scripts/TowerDefense/Level/AgentInsManager.cs @@ -676,6 +676,7 @@ if (slinfo.atcmod.Count < 2) return; float radius = slinfo.atcmod[1]; + int deathCount = 0; for (int ti = 0; ti < mgrList.Length; ti++) { @@ -683,6 +684,7 @@ for (int idx = 0; idx < mgr.listAgent.Count; idx++) { Agent eag = mgr.listAgent[idx]; + bool isDeath = eag.isDead; if (eag.AgentType == SpawnAgentType.BubbleBomb) { @@ -714,6 +716,9 @@ EndlessGameUI.instance.generateBloodText(fpos, damage, false, false); } + if (!isDeath && eag.isDead) + ++deathCount; + if (eag.isDead) continue; else @@ -722,6 +727,8 @@ } } + if (deathCount > 1) + EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessOneTimeKillCount, deathCount); return; } @@ -749,13 +756,21 @@ if (wavelineIns == null) return; List<Agent> listAg = wavelineIns.listAgent; + // 统计被火技能直接烧死的数量 + int deathCount = 0; for (int ti = listAg.Count - 1; ti >= 0; ti--) { Agent eag = listAg[ti]; + + if (eag.isDead) continue; if (eag.AgentType == SpawnAgentType.BubbleBomb) + { EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessFireSkillKillBubbleBomb, (eag as BubbleBombAgent).Id); + // 泡泡炸弹是直接就被火技能秒杀的 + ++deathCount; + } else { Vector3 fpos = eag.transform.position; @@ -771,8 +786,14 @@ else if (EndlessGameUI.instanceExists) EndlessGameUI.instance.generateBloodText(fpos, damage, false, false); } + + if (eag.isDead) + ++deathCount; } + } + if (deathCount > 1) + EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessOneTimeKillCount, deathCount); } /// <summary> @@ -823,7 +844,7 @@ /// 对当前Agent同一列内一定区域内的怪物进行攻击: /// </summary> /// <param name="ag"></param> - public void StartExplodeAttack(Agent ag, float damage) + public int StartExplodeAttack(Agent ag, float damage) { WaveLineAgentInsMgr tmgr; if (!ag.opponentAgent) @@ -831,11 +852,13 @@ else tmgr = this.oppoAgentWaveLineArray[ag.waveLineID]; - if (tmgr.getAgentInsNum() <= 1) return; + if (tmgr.getAgentInsNum() <= 1) return 0; List<Agent> listAg = tmgr.listAgent; Vector3 tpos = ag.transform.position; + int deathCount = 0; + for (int ti = listAg.Count - 1; ti >= 0; ti--) { Agent eag = listAg[ti]; @@ -853,8 +876,13 @@ else if (EndlessGameUI.instanceExists) EndlessGameUI.instance.generateBloodText(fpos, damage, false, false); } + if (eag.isDead) + ++deathCount; } } + + return deathCount; + /* foreach (Agent eag in listAg) { if (eag == ag) continue; -- Gitblit v1.9.1