chenxin
2020-11-24 5caa573ce573fa0427845b2224b3a6005781e80e
Assets/Scripts/TowerDefense/Level/AgentInsManager.cs
@@ -684,6 +684,13 @@
            for (int idx = 0; idx < mgr.listAgent.Count; idx++)
            {
                Agent eag = mgr.listAgent[idx];
                Vector3 fpos = eag.transform.position;
                fpos.y = 0;
                float dist = Vector3.Distance(fpos, pos);
                if (radius < dist)
                    continue;
                bool isDeath = eag.isDead;
                if (eag.AgentType == SpawnAgentType.BubbleBomb)
@@ -697,12 +704,6 @@
                }
                else
                {
                    Vector3 fpos = eag.transform.position;
                    fpos.y = 0;
                    float dist = Vector3.Distance(fpos, pos);
                    if (radius < dist)
                        continue;
                    float damage = slinfo.skilleffect[2];
                    damage += (slinfo.skilleffect[1] / 100.0f * eag.configuration.maxHealth);
                    damage = (float)Math.Floor(damage);
@@ -762,7 +763,7 @@
        for (int ti = listAg.Count - 1; ti >= 0; ti--)
        {
            Agent eag = listAg[ti];
            if (eag.isDead) continue;
            if (eag.AgentType == SpawnAgentType.BubbleBomb)
@@ -786,6 +787,8 @@
                    else if (EndlessGameUI.instanceExists)
                        EndlessGameUI.instance.generateBloodText(fpos, damage, false, false);
                }
                eag.PlayFireSkillHit();
                if (eag.isDead)
                    ++deathCount;
@@ -863,21 +866,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;
            }
        }
@@ -938,6 +949,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);