chenxin
2020-12-05 fa584507591723218b0a6f99ab1d446490e9efa0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Collections.Generic;
using UnityEngine;
using TowerDefense.Agents;
 
/**
 * 魔法护盾
 * @Author: chenxin
 * @Date: 2020-11-02 17:13:58
 */
namespace KTGMGemClient
{
    public class BossSkillShieldWall : EndlessBossSkill
    {
        public BossSkillShieldWall(boss_skill param) : base(param) { }
 
        /// <summary>
        /// 释放技能
        /// </summary>
        public override void ReleaseSkill()
        {
            base.ReleaseSkill();
            List<int> tunelIdList = GetTunelList();
            
            if (tunelIdList.Count > 0)
            {
                for (int i = 0; i < tunelIdList.Count; ++i)
                {
                    List<Agent> agents = AgentInsManager.instance.GetAgentsByTunel(tunelIdList[i]);
 
                    if (agents == null) continue;
 
                    for (int j = 0; j < agents.Count; ++j)
                    {
                        float shieldValue = agents[j].configuration.currentHealth * SkillData.effect[0];
                        agents[j].configuration.AddShieldWall(shieldValue, SkillData.effect[1]);
                    }
                }
            }
        }
 
        public override void Init()
        {
            base.Init();
            Debug.Log("--------------------- 魔法护盾技能初始化 ---------------------");
        }
    }
}