| | |
| | | */ |
| | | namespace KTGMGemClient |
| | | { |
| | | /// <summary> |
| | | /// 泡泡炸弹配置数据 |
| | | /// </summary> |
| | | public class BubbleBombConfig |
| | | { |
| | | public BubbleBombAgent Agent { get; set; } |
| | |
| | | |
| | | public class BossSkillBubbleBomb : EndlessBossSkill |
| | | { |
| | | public BossSkillBubbleBomb(boss_skill param) : base(param) |
| | | { |
| | | random = new System.Random(); |
| | | } |
| | | public BossSkillBubbleBomb(boss_skill param) : base(param) { } |
| | | |
| | | /// <summary> |
| | | /// 被攻击的次数 |
| | |
| | | /// 所有存在于场景中的泡泡炸弹 |
| | | /// </summary> |
| | | protected List<BubbleBombConfig> bubbleBombList; |
| | | |
| | | protected System.Random random; |
| | | |
| | | /// <summary> |
| | | /// 泡泡炸弹对象池 |
| | |
| | | { |
| | | base.ReleaseSkill(); |
| | | Debug.Log("--------------------- 泡泡炸弹释放 ---------------------"); |
| | | // cx test |
| | | SpawnBubbleBomb(); |
| | | } |
| | | |
| | |
| | | bubbleBomb.AgentType = SpawnAgentType.BubbleBomb; |
| | | bubbleBomb.opponentAgent = false; |
| | | bubbleBomb.Reset(); |
| | | bubbleBomb.Initialize(); |
| | | |
| | | // 出生位置 |
| | | Vector3 spawnPosition = EndlessLevelManager.instance.GetTunelWorldPosition(tunelIdList[i], (EndlessBossSkillTunelType)SkillData.target[1]); |
| | |
| | | config.MoveSpeed = SkillData.effect[1]; |
| | | bubbleBombList.Add(config); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取赛道列表 |
| | | /// </summary> |
| | | protected List<int> GetTunelList() |
| | | { |
| | | List<int> tunelIdList = new List<int>(); |
| | | int count = 0; |
| | | // 剩余没有用到的赛道 |
| | | List<int> remainList = new List<int>() { 1, 2, 3, 4, 5 }; |
| | | |
| | | for (int i = 0; i < SkillData.tunnel.Count; ++i) |
| | | { |
| | | // 统计6这种类型的数量 |
| | | if (SkillData.tunnel[i] == 6) |
| | | { |
| | | ++count; |
| | | continue; |
| | | } |
| | | |
| | | tunelIdList.Add(SkillData.tunnel[i]); |
| | | remainList.Remove(SkillData.tunnel[i]); |
| | | } |
| | | |
| | | for (int i = 0; i < count; ++i) |
| | | { |
| | | int num = random.Next(remainList.Count); |
| | | tunelIdList.Add(remainList[num]); |
| | | remainList.Remove(remainList[num]); |
| | | } |
| | | |
| | | return tunelIdList; |
| | | } |
| | | |
| | | public override void Reset() |
| | |
| | | if (config.Agent.bInDeathState) return; |
| | | |
| | | ++config.AttackCount; |
| | | Debug.Log($"--------------------- BubbleBombAgent Id: {id}, AttackCount:{config.AttackCount} ---------------------"); |
| | | |
| | | if (config.AttackCount >= config.NeedAttackCount) |
| | | AgentDead(config); |