| | |
| | | /// </summary> |
| | | private bool isFirstLevelCompleted = false; |
| | | |
| | | private bool isStopSecondWaveCompleted = false; |
| | | |
| | | /// <summary> |
| | | /// 切换基地 |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新手更新关卡 |
| | | /// </summary> |
| | | public void NewbieUpdateLevel() |
| | | { |
| | | ++CurrentLevel; |
| | | IsAllWaveCompleted = false; |
| | | EndlessUIStart.instance.Restart(); |
| | | WaveManager.StartWaves(CurrentLevel); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 延迟进入下一关 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | WaveManager.RestartAllWave(); |
| | | EndlessGameUI.instance.SetAttackingTowerState(true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 停止第二关波次 |
| | | /// </summary> |
| | | public void StopSecondWave() |
| | | { |
| | | Debug.LogError("--------------------- 停止第二关出怪 ---------------------"); |
| | | if (!isStopSecondWaveCompleted) |
| | | { |
| | | isStopSecondWaveCompleted = true; |
| | | PauseWave(); |
| | | } |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.SkillStep); |
| | | } |
| | | } |
| | | } |
| | |
| | | public event Action WaveCompleted; |
| | | |
| | | /// <summary> |
| | | /// 有新的敌人生成 |
| | | /// </summary> |
| | | public event Action SpawnNewAgent; |
| | | |
| | | /// <summary> |
| | | /// 波次发生改变 |
| | | /// </summary> |
| | | public event Action WaveChanged; |
| | |
| | | SafelyBroadcastWaveCompletedEvent(); |
| | | } |
| | | else |
| | | { |
| | | ++spawnedEnemies; |
| | | if (SpawnNewAgent != null) |
| | | SpawnNewAgent(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public int TotalEnemies { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// 所有兵线已经生成的敌人总数量 |
| | | /// </summary> |
| | | /// <value></value> |
| | | public int SpawnedTotalEnemies { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// 本波次剩余敌人数量 |
| | | /// </summary> |
| | | public int RemainEnemies { get; protected set; } |
| | |
| | | WaveInterval = waveData[0].Config.cooldown / 1000f; |
| | | TotalWaveLines = waveData.Count; |
| | | CompletedWaveLine = 0; |
| | | |
| | | SpawnedTotalEnemies = 0; |
| | | HideTunel(); |
| | | |
| | | // 刷新法阵的显示 |
| | |
| | | continue; |
| | | } |
| | | |
| | | waves[data.Config.tunel - 1].WaveCompleted -= OneWaveCompleted; |
| | | waves[data.Config.tunel - 1].WaveCompleted += OneWaveCompleted; |
| | | int tunelIndex = data.Config.tunel - 1; |
| | | waves[tunelIndex].WaveCompleted -= OneWaveCompleted; |
| | | waves[tunelIndex].WaveCompleted += OneWaveCompleted; |
| | | waves[tunelIndex].SpawnNewAgent -= SpawnNewAgent; |
| | | waves[tunelIndex].SpawnNewAgent += SpawnNewAgent; |
| | | waves[data.Config.tunel - 1].StartWave(data); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 有新的敌人生成 |
| | | /// </summary> |
| | | private void SpawnNewAgent() |
| | | { |
| | | ++SpawnedTotalEnemies; |
| | | |
| | | if (GameConfig.IsNewbie && EndlessUIStart.instance.beginSkillStep && SpawnedTotalEnemies >= 8) |
| | | { |
| | | EndlessUIStart.instance.beginSkillStep = false; |
| | | EndlessLevelManager.instance.StopSecondWave(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 暂停所有兵线出兵 |
| | | /// </summary> |
| | | public void PauseAllWave() |
| | |
| | | |
| | | // 处理PVE无尽模式,buff增加的伤害 |
| | | finalDamage += ProcessEndlessBuffAttack(finalDamage); |
| | | // cx test |
| | | finalDamage *= 2f; |
| | | |
| | | // 提前处理非当前Enemy的爆炸攻击: |
| | | if (chainAttackRate > 0) |
| | |
| | | // 对应放置TowerGrid的类. |
| | | protected TowerPlacementGridEndless towerGrid; |
| | | |
| | | private bool isOpenTower = false; |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | |
| | | { |
| | | if (!GameConfig.CanOpenNewTower) return; |
| | | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GetOneTowerPos); |
| | | if (!isOpenTower) |
| | | { |
| | | isOpenTower = true; |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GetOneTowerPos); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | using TowerDefense.Level; |
| | | using KTGMGemClient; |
| | | using TowerDefense.UI.HUD; |
| | | using System.Collections; |
| | | |
| | | /// <summary> |
| | | /// 无尽模式用自己的EndlessUIStart |
| | |
| | | |
| | | private bool isPause; |
| | | |
| | | public bool beginSkillStep = false; |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | |
| | | |
| | | Instantiate(Resources.Load<GameObject>("UI/Guide/GuidePanel"), this.transform); |
| | | AddGuideEvent(); |
| | | //bGameStart = true; |
| | | // 开始关卡 |
| | | //EndlessLevelManager.instance.StartLevel(); |
| | | //timeTextNew.gameObject.SetActive(true); |
| | | |
| | | // 开始播放背景音乐. |
| | | // if (bgMusic != null) |
| | | // bgMusic.Play(); |
| | | } |
| | | } |
| | | |
| | |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateSecondWave, CreateSecondWave); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.GuideFinish, NewbieGuideEnd); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | EndlessGameUI.instance.PlaceTowerForce(aTower, new IntVector2(2, 3), 2); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开始第一关的第一个波次 |
| | | /// </summary> |
| | | private void CreateFirstWave() |
| | | { |
| | | Restart(); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.FireTowerChargeEnd, OnFireTowerChargeEnd); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 火塔充能释放完成 |
| | | /// </summary> |
| | | private void OnFireTowerChargeEnd() |
| | | { |
| | | Pause(); |
| | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.ChargingEnd); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 恢复波次 |
| | | /// </summary> |
| | | private void RestartWave() |
| | | { |
| | | Restart(); |
| | | EndlessLevelManager.instance.RestartWave(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获得金币 |
| | | /// </summary> |
| | | /// <param name="gold"></param> |
| | | private void AddGold(int gold) |
| | | { |
| | | EndlessLevelManager.instance.Currency.AddCurrency(gold); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 在攻击位置上创建一个1级的水塔 |
| | | /// </summary> |
| | | private void CreateWaterLv1() |
| | | { |
| | | Tower aTower = EndlessRandomTower.instance.getTowerByName("CopyCatTower"); |
| | | EndlessGameUI.instance.PlaceTowerForce(aTower, new IntVector2(1, 3), 1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开始第二关 |
| | | /// </summary> |
| | | private void CreateSecondWave() |
| | | { |
| | | |
| | | EndlessLevelManager.instance.NewbieUpdateLevel(); |
| | | beginSkillStep = true; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 在第三条兵线释放技能宝石 |
| | | /// </summary> |
| | | private void SkillRelease() |
| | | { |
| | | EndlessLevelManager.instance.RestartWave(); |
| | | int attributeId = 99902; |
| | | int level = 1; |
| | | int waveLineIndex = 2; |
| | | |
| | | // 播放特效,并处理伤害. |
| | | EndlessWaveLineManager.instance.PlayWaveLineEffect(waveLineIndex); |
| | | AgentInsManager.instance.ExecWavelineAttack(waveLineIndex, attributeId, level, false); |
| | | StartCoroutine(Delay1()); |
| | | } |
| | | |
| | | private IEnumerator Delay1() |
| | | { |
| | | yield return new WaitForSeconds(1f); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.SkillReleaseDone); |
| | | GameConfig.IsNewbie = false; |
| | | EndlessLevelManager.instance.PauseWave(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新手引导结束 |
| | | /// </summary> |
| | | private void NewbieGuideEnd() |
| | | { |
| | | EndlessLevelManager.instance.RestartWave(); |
| | | GameConfig.IsNewbie = false; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | using UnityEngine.UI; |
| | | using TowerDefense.Nodes; |
| | | using TowerDefense.Affectors; |
| | | using KTGMGemClient; |
| | | |
| | | namespace TowerDefense.UI.HUD |
| | | { |
| | |
| | | break; |
| | | } |
| | | |
| | | if (GameConfig.IsNewbie && EndlessUIStart.instance.beginSkillStep) |
| | | { |
| | | EndlessUIStart.instance.beginSkillStep = true; |
| | | EndlessLevelManager.instance.StopSecondWave(); |
| | | } |
| | | |
| | | bool isAllDestroyed = true; |
| | | |
| | | for (int i = 0; i < AttackRowNumbers; ++i) |
| | |
| | | [[1,1,"史莱姆大王",1,1,1,0,0,0,200,1.5,2,3000,["0"],[0],0],[2,1,"史莱姆大王",1,1,2,0,0,0,200,1.5,2,3000,["0"],[0],0],[3,1,"史莱姆大王",1,1,3,1,10,1800,200,1.5,2,3000,["0"],[0],1],[4,1,"史莱姆大王",1,1,4,0,0,0,200,1.5,2,3000,["0"],[0],0],[5,1,"史莱姆大王",1,1,5,0,0,0,200,1.5,2,3000,["0"],[0],0],[6,1,"史莱姆大王",1,2,1,0,0,0,350,1.5,2,3000,["0"],[0],0],[7,1,"史莱姆大王",1,2,2,0,0,0,350,1.5,2,3000,["0"],[0],0],[8,1,"史莱姆大王",1,2,3,3,6,3000,350,1.5,2,3000,["0"],[0],3],[9,1,"史莱姆大王",1,2,4,0,0,0,350,1.5,2,3000,["0"],[0],0],[10,1,"史莱姆大王",1,2,5,0,0,0,350,1.5,2,3000,["0"],[0],0]] |
| | | [[1,1,"史莱姆大王",1,1,1,0,0,0,200,1.5,2,3000,["0"],[0],0],[2,1,"史莱姆大王",1,1,2,0,0,0,200,1.5,2,3000,["0"],[0],0],[3,1,"史莱姆大王",1,1,3,1,10,1800,200,1.5,2,3000,["0"],[0],1],[4,1,"史莱姆大王",1,1,4,0,0,0,200,1.5,2,3000,["0"],[0],0],[5,1,"史莱姆大王",1,1,5,0,0,0,200,1.5,2,3000,["0"],[0],0],[6,1,"史莱姆大王",1,2,1,0,0,0,350,1.5,2,3000,["0"],[0],0],[7,1,"史莱姆大王",1,2,2,0,0,0,350,1.5,2,3000,["0"],[0],0],[8,1,"史莱姆大王",1,2,3,3,6,3000,350,1.5,2,3000,["0"],[0],3],[9,1,"史莱姆大王",1,2,4,0,0,0,350,1.5,2,3000,["0"],[0],0],[10,1,"史莱姆大王",1,2,5,0,0,0,350,1.5,2,3000,["0"],[0],0],[11,2,"史莱姆大王",1,1,1,0,0,0,200,1.5,2,3000,["0"],[0],0],[12,2,"史莱姆大王",1,1,2,0,0,0,200,1.5,2,3000,["0"],[0],0],[13,2,"史莱姆大王",1,1,3,1,10,1800,200,1.5,2,3000,["0"],[0],1],[14,2,"史莱姆大王",1,1,4,0,0,0,200,1.5,2,3000,["0"],[0],0],[15,2,"史莱姆大王",1,1,5,0,0,0,200,1.5,2,3000,["0"],[0],0],[16,2,"史莱姆大王",1,2,1,0,0,0,350,1.5,2,3000,["0"],[0],0],[17,2,"史莱姆大王",1,2,2,0,0,0,350,1.5,2,3000,["0"],[0],0],[18,2,"史莱姆大王",1,2,3,3,6,3000,350,1.5,2,3000,["0"],[0],3],[19,2,"史莱姆大王",1,2,4,0,0,0,350,1.5,2,3000,["0"],[0],0],[20,2,"史莱姆大王",1,2,5,0,0,0,350,1.5,2,3000,["0"],[0],0]] |