| | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessOneTimeKillCount, deathCount); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 处理战场上的兵线伤害,以兵线为单位对怪物进行伤害---所有兵线 |
| | | /// </summary> |
| | | /// <param name="waveline"></param> |
| | | /// <param name="sid"></param> |
| | | /// <param name="slevel"></param> |
| | | /// <param name="opponent"></param> |
| | | public void ExecAllWavelineAttack(int sid, int slevel, bool opponent) |
| | | { |
| | | skilllevelinfo slinfo = JsonDataCenter.GetSkillLevelInfo(sid, slevel + 1); |
| | | if (slinfo == null) return; |
| | | |
| | | WaveLineAgentInsMgr wavelineIns; |
| | | if (opponent) |
| | | { |
| | | for (int i = 0; i < oppoAgentWaveLineArray.Length; i++) |
| | | { |
| | | wavelineIns = oppoAgentWaveLineArray[i]; |
| | | CalculateWavelineAttack(slinfo, wavelineIns, sid, slevel); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < agentWaveLineArray.Length; i++) |
| | | { |
| | | wavelineIns = agentWaveLineArray[i]; |
| | | CalculateWavelineAttack(slinfo, wavelineIns, sid, slevel); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private void CalculateWavelineAttack(skilllevelinfo slinfo, WaveLineAgentInsMgr wavelineIns, int sid, int slevel) |
| | | { |
| | | 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; |
| | | float damage = slinfo.skilleffect[2]; |
| | | damage += (slinfo.skilleffect[1] / 100.0f * eag.configuration.maxHealth); |
| | | damage = (float)Math.Floor(damage); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | eag.PlayFireSkillHit(); |
| | | |
| | | if (eag.isDead) |
| | | ++deathCount; |
| | | } |
| | | |
| | | } |
| | | if (deathCount > 1) |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessOneTimeKillCount, deathCount); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 每一帧更新,更新之后获取几个刚性数据: |
| | | /// 1:血量最多的AgentInstance. |