|
@@ -21,185 +21,17 @@ namespace GameLogic.Combat.CombatType
|
|
|
{
|
|
|
public class LevelBattleCombatType : CombatTypeBasic
|
|
|
{
|
|
|
- private TestCombatHeroConfig testCombatHeroConfig;
|
|
|
+
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 等待复活
|
|
|
- /// </summary>
|
|
|
- protected bool _isAwaitResurrection;
|
|
|
|
|
|
- // protected TestCombatHeroConfig.EnemyGroup currEnemyGroup;
|
|
|
- /// <summary>
|
|
|
- /// 当前关卡战斗的波次节点
|
|
|
- /// </summary>
|
|
|
- protected int _currLevelBattleNodeIndex;
|
|
|
-
|
|
|
- private float _currTime;
|
|
|
- // private int _currBoChi;
|
|
|
-
|
|
|
- public LevelBattleConfig _levelBattleConfig;
|
|
|
- protected MonsterWavesConfig _currWavesConfig;
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 当前节点的波次下标
|
|
|
- /// </summary>
|
|
|
- protected int _currNodeWavesIndex;
|
|
|
-
|
|
|
-
|
|
|
- public int exp
|
|
|
- {
|
|
|
- get { return _exp; }
|
|
|
- set
|
|
|
- {
|
|
|
- _exp = value;
|
|
|
- CombatEventManager.Instance.Dispatch(CombatEventType.CombatExpAlter, null);
|
|
|
- if (!AccountFileInfo.Instance.playerData.isAllHeroDie)
|
|
|
- {
|
|
|
- if (!isBossCombat && exp >= _levelBattleConfig.exp) // 到达目标值,开始打boss
|
|
|
- {
|
|
|
- StartBossCombat();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private int _exp;
|
|
|
-
|
|
|
- private int _simulatedExp;
|
|
|
-
|
|
|
- public int CurrMaxExp
|
|
|
- {
|
|
|
- get { return _levelBattleConfig.exp; }
|
|
|
- }
|
|
|
-
|
|
|
- public bool isBossCombat;
|
|
|
-
|
|
|
-
|
|
|
- protected List<string> equipName = new List<string>()
|
|
|
- {
|
|
|
- "fx_down_zb_blue",
|
|
|
- "fx_down_zb_blue",
|
|
|
- "fx_down_zb_blue",
|
|
|
- "fx_down_zb_gold",
|
|
|
- "fx_down_zb_green",
|
|
|
- "fx_down_zb_orange",
|
|
|
- "fx_down_zb_purple",
|
|
|
- };
|
|
|
-
|
|
|
- protected override void ProInit()
|
|
|
- {
|
|
|
- _levelBattleConfig = ConfigComponent.Instance.Get<LevelBattleConfig>(_startCombatInfo.levelBattleId);
|
|
|
- _currLevelBattleNodeIndex = 0;
|
|
|
- exp = 0;
|
|
|
- _simulatedExp = 0;
|
|
|
- PlayBgm();
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 掉落逻辑放这里
|
|
|
- /// </summary>
|
|
|
- private void EntityDropLogic(CombatHeroEntity combatHeroEntity, float waitTime = 2f)
|
|
|
- {
|
|
|
- // return;
|
|
|
- List<ItemInfo> equipmentList =
|
|
|
- DropManager.Instance.DropEquipment(_levelBattleConfig, combatHeroEntity.CurrCombatHeroInfo.heroType);
|
|
|
-
|
|
|
- if (equipmentList.Count <= 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Combat_EquipFallEventData combatEquipFallEventData = Combat_EquipFallEventData.Create();
|
|
|
- //allEquip存放特效标记
|
|
|
- List<string> allEquip = new List<string>();
|
|
|
- for (int i = 0; i < equipmentList.Count; i++)
|
|
|
- {
|
|
|
- ItemInfo eqItemInfo = equipmentList[i];
|
|
|
- allEquip.Add(equipName[eqItemInfo.eqInfo.quality - 1]);
|
|
|
- }
|
|
|
-
|
|
|
- combatEquipFallEventData.fallEquip = allEquip.ToArray();
|
|
|
- combatEquipFallEventData.startPos_WorldPos = combatHeroEntity.combatHeroGameObject.position;
|
|
|
- combatEquipFallEventData.waitTime = waitTime;
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.Combat_EquipFall, combatEquipFallEventData);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
protected override void ProHeroDie(CombatHeroEntity combatHeroEntity, HarmReturnInfo harmReturnInfo)
|
|
|
{
|
|
|
- if (harmReturnInfo == null || harmReturnInfo.harmType == HarmType.SystemKo)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (combatHeroEntity.IsEnemy) //怪死了
|
|
|
- {
|
|
|
- if (!isBossCombat)
|
|
|
- {
|
|
|
- EntityDropLogic(combatHeroEntity);
|
|
|
- MiniMonsterDie(combatHeroEntity);
|
|
|
- }
|
|
|
- else if (combatHeroEntity.CurrCombatHeroInfo.heroType == 4) ///boss死了
|
|
|
- {
|
|
|
- for (int i = 0; i < 5; i++)
|
|
|
- {
|
|
|
- EntityDropLogic(combatHeroEntity, 0.8f);
|
|
|
- }
|
|
|
-
|
|
|
- BossKo(combatHeroEntity);
|
|
|
- }
|
|
|
- }
|
|
|
- else //英雄死了
|
|
|
- {
|
|
|
- CombatHeroEntity[] myHero = combatController.CombatHeroController.GetHero(false);
|
|
|
- if (myHero == null || myHero.Length <= 0) //死完了
|
|
|
- {
|
|
|
- CombatController.currActiveCombat.IsGameOver = true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public void Resume()
|
|
|
- {
|
|
|
- HarmReturnInfo newharm = new HarmReturnInfo();
|
|
|
- newharm.harmType = HarmType.SystemKo;
|
|
|
- CombatHeroEntity[] allHero = combatController.CombatHeroController.GetHero(true);
|
|
|
- if (allHero != null)
|
|
|
- {
|
|
|
- List<CombatHeroEntity> heroEntities = new List<CombatHeroEntity>();
|
|
|
- heroEntities.AddRange(allHero);
|
|
|
- for (int i = 0; i < heroEntities.Count; i++)
|
|
|
- {
|
|
|
- heroEntities[i].CombatAIBasic.ChangeState(CombatHeroStateType.Disappear);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Debug.Log("英雄死完了,等待全部英雄复活,这个版本等待2秒全体复活");
|
|
|
- PottingMobile._FailLevel(_levelBattleConfig.levelName);
|
|
|
- PlayBgm();
|
|
|
- AccountFileInfo.Instance.playerData.isAllHeroDie = true;
|
|
|
- TimerComponent.Instance.AddTimer(1000, delegate
|
|
|
- {
|
|
|
- CombatController.currActiveCombat.IsGameOver = false;
|
|
|
- CombatHeroEntity[] allMyHero = combatController.CombatHeroController.GetDieHero();
|
|
|
- BetterList<CombatHeroEntity> allMyHeroList = CombatListPool<CombatHeroEntity>.Instance.Get();
|
|
|
- allMyHeroList.AddRange(allMyHero);
|
|
|
- for (int i = 0; i < allMyHeroList.Count; i++)
|
|
|
- {
|
|
|
- CombatHeroEntity dieHero = allMyHeroList[i];
|
|
|
- if (dieHero != null && !dieHero.IsEnemy && dieHero.isDie)
|
|
|
- {
|
|
|
- dieHero.CombatAIBasic.ChangeState(CombatHeroStateType.Resurrection, isQiangZhi: true);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- allMyHeroList.Dispose();
|
|
|
- CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
|
|
|
- // CombatController.currActiveCombat.speed = 1;
|
|
|
- });
|
|
|
- isActiveCombat = false;
|
|
|
- _isAwaitResurrection = true;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void PlayBgm()
|
|
|
{
|
|
|
AudioManager.Instance.PlayBGM("combatBattle.wav");
|
|
@@ -207,91 +39,13 @@ namespace GameLogic.Combat.CombatType
|
|
|
|
|
|
private void ResurrectionFinish()
|
|
|
{
|
|
|
- _isAwaitResurrection = false;
|
|
|
- _currLevelBattleNodeIndex = 0;
|
|
|
- InitNewMonsterConfig();
|
|
|
- isBossCombat = false;
|
|
|
- exp = 0;
|
|
|
- _simulatedExp = 0;
|
|
|
- _currLevelBattleNodeIndex = 0;
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.ShowBattleExp, null);
|
|
|
- isActiveCombat = true;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void MiniMonsterDie(CombatHeroEntity combatHeroEntity)
|
|
|
- {
|
|
|
- if (isBossCombat)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- BagController.Instance.AddHeroExp(_levelBattleConfig.miniExpAndGold[0]);
|
|
|
-
|
|
|
- // BagController.Instance.DropHeroExp(combatHeroEntity.combatHeroGameObject.position, 3,
|
|
|
- // _levelBattleConfig.miniExpAndGold[0]);
|
|
|
- int odds = CombatCalculateTool.Instance.GetOdd(0, 100);
|
|
|
- if (odds < 70)
|
|
|
- {
|
|
|
- ShowTextEventData showTextEventData = ShowTextEventData.Create();
|
|
|
- showTextEventData.text = "+金幣 5";
|
|
|
- showTextEventData.Color = new Color(1f, 0.64f, 0.22f);
|
|
|
- showTextEventData.worldPos = combatHeroEntity.combatHeroGameObject.position;
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.ShowText, showTextEventData);
|
|
|
- BagController.Instance.AddCoin(5);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // //TODO 装备掉落后,飞特效得逻辑
|
|
|
- // List<string> allEquip = new List<string>();
|
|
|
- // for (int i = 0; i < 3; i++)
|
|
|
- // {
|
|
|
- // int odds = CombatCalculateTool.Instance.GetOdd();
|
|
|
- // if (odds < 20)
|
|
|
- // {
|
|
|
- // allEquip.Add(equipName[CombatCalculateTool.Instance.GetOdd(0, equipName.Count)]);
|
|
|
- // }
|
|
|
- // }
|
|
|
- //
|
|
|
- // Combat_EquipFallEventData combatEquipFallEventData = Combat_EquipFallEventData.Create();
|
|
|
- // combatEquipFallEventData.fallEquip = allEquip.ToArray();
|
|
|
- // combatEquipFallEventData.startPos_WorldPos = combatItemShowEventData.startPos_WorldPos;
|
|
|
- // EventManager.Instance.Dispatch(CustomEventType.Combat_EquipFall, combatEquipFallEventData);
|
|
|
-
|
|
|
-
|
|
|
- // BagController.Instance.AddHeroExp(10);
|
|
|
- int levelExp = combatHeroEntity.CurrCombatHeroInfo.heroType == 2 ? 1 : 1;
|
|
|
- _simulatedExp += levelExp;
|
|
|
- BagController.Instance.DropLevelExp(combatHeroEntity.combatHeroGameObject.position, levelExp, levelExp);
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- if (_simulatedExp < _levelBattleConfig.exp || AccountFileInfo.Instance.playerData.isAllHeroDie)
|
|
|
- {
|
|
|
- CombatHeroEntity[] allHero = combatController.CombatHeroController.GetHero(true);
|
|
|
- if (allHero == null || allHero.Length <= 0)
|
|
|
- {
|
|
|
- if (_currNodeWavesIndex < _currWavesConfig.monsterGroupConfigId.Length)
|
|
|
- {
|
|
|
- CreateEnemy(new CTaskAwaitBuffer());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- InitNewMonsterConfig();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void InitNewMonsterConfig()
|
|
|
- {
|
|
|
- _currNodeWavesIndex = 0;
|
|
|
- CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
|
|
|
-
|
|
|
- FindNextConfig();
|
|
|
- InitTestCombatBoChi();
|
|
|
- CreateEnemy(new CTaskAwaitBuffer());
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
protected override async CTask ProStartGame()
|
|
|
{
|
|
@@ -304,111 +58,12 @@ namespace GameLogic.Combat.CombatType
|
|
|
CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
|
|
|
}
|
|
|
|
|
|
- protected void BossKo(CombatHeroEntity combatHeroEntity)
|
|
|
- {
|
|
|
- PottingMobile._FinishLevel(_levelBattleConfig.levelName);
|
|
|
- dieHeroCount = 0;
|
|
|
- AccountFileInfo.Instance.playerData.isAllHeroDie = false;
|
|
|
- CombatHeroEntity[] allHero = combatController.CombatHeroController.GetHero(true);
|
|
|
- if (allHero != null)
|
|
|
- {
|
|
|
- HarmReturnInfo harmReturnInfo = new HarmReturnInfo();
|
|
|
- harmReturnInfo.harmType = HarmType.SystemKo;
|
|
|
-
|
|
|
- List<CombatHeroEntity> heroEntities = new List<CombatHeroEntity>();
|
|
|
- heroEntities.AddRange(allHero);
|
|
|
- for (int i = 0; i < heroEntities.Count; i++)
|
|
|
- {
|
|
|
- heroEntities[i].HeroDie(harmReturnInfo);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- BagController.Instance.DropHeroExp(combatHeroEntity.combatHeroGameObject.position, 20,
|
|
|
- _levelBattleConfig.bossExpAndGold);
|
|
|
- BagController.Instance.DropMonsterGold(combatHeroEntity.combatHeroGameObject.position, 30,
|
|
|
- 500);
|
|
|
- CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
|
|
|
- isBossCombat = false;
|
|
|
- LevelBattleConfig levelBattleConfig =
|
|
|
- ConfigComponent.Instance.Get<LevelBattleConfig>(_levelBattleConfig.ID + 1);
|
|
|
- if (levelBattleConfig.ID > 0)
|
|
|
- {
|
|
|
- AccountFileInfo.Instance.playerData.levelBattle = levelBattleConfig.ID;
|
|
|
- AccountFileInfo.Instance.SavePlayerData();
|
|
|
- _levelBattleConfig = levelBattleConfig;
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.LevelUpdate, null);
|
|
|
- }
|
|
|
-
|
|
|
- exp = 0;
|
|
|
- _simulatedExp = 0;
|
|
|
- _currLevelBattleNodeIndex = 0;
|
|
|
- InitNewMonsterConfig();
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.ShowBattleExp, null);
|
|
|
- // CombatController.currActiveCombat.speed = 0.3f;
|
|
|
- Time.timeScale = 0.3f;
|
|
|
- CombatController.currActiveCombat.isStopAi = true;
|
|
|
- TimerComponent.Instance.AddTimer(2000, delegate
|
|
|
- {
|
|
|
- PlayBgm();
|
|
|
- CombatController.currActiveCombat.isStopAi = false;
|
|
|
- CombatHeroEntity[] allMyHero = combatController.CombatHeroController.GetDieHero();
|
|
|
- BetterList<CombatHeroEntity> allMyHeroList = CombatListPool<CombatHeroEntity>.Instance.Get();
|
|
|
- allMyHeroList.AddRange(allMyHero);
|
|
|
- for (int i = 0; i < allMyHeroList.Count; i++)
|
|
|
- {
|
|
|
- CombatHeroEntity dieHero = allMyHeroList[i];
|
|
|
- if (dieHero != null && !dieHero.IsEnemy && dieHero.isDie)
|
|
|
- {
|
|
|
- dieHero.CombatAIBasic.ChangeState(CombatHeroStateType.Resurrection, isQiangZhi: true);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- allMyHeroList.Dispose();
|
|
|
-
|
|
|
- Time.timeScale = 1f;
|
|
|
- CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
|
|
|
- // CombatController.currActiveCombat.speed = 1;
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public void StartBossCombat()
|
|
|
{
|
|
|
- isBossCombat = true;
|
|
|
- CombatController.currActiveCombat.isStopAi = true;
|
|
|
- AudioManager.Instance.PlayBGM("bossBattle.wav");
|
|
|
- CombatHeroEntity[] allHero = combatController.CombatHeroController.GetHero(true);
|
|
|
- if (allHero != null)
|
|
|
- {
|
|
|
- List<CombatHeroEntity> heroEntities = new List<CombatHeroEntity>();
|
|
|
- heroEntities.AddRange(allHero);
|
|
|
- for (int i = 0; i < heroEntities.Count; i++)
|
|
|
- {
|
|
|
- heroEntities[i].CombatAIBasic.ChangeState(CombatHeroStateType.Disappear);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- CombatController.currActiveCombat.CombatHeroController.SetFollowTarget();
|
|
|
- FindNextConfig();
|
|
|
- _currWavesConfig =
|
|
|
- ConfigComponent.Instance.Get<MonsterWavesConfig>(
|
|
|
- _levelBattleConfig.BossMonsterWavesId);
|
|
|
- _currNodeWavesIndex = -1;
|
|
|
- CTaskAwaitBuffer cTaskAwaitBuffer = new CTaskAwaitBuffer();
|
|
|
-
|
|
|
- Vector3 pos = nextConfig.monsterPoint[0].position + new Vector3(
|
|
|
- CombatCalculateTool.Instance.GetOdd(-4, 4), 0, CombatCalculateTool.Instance.GetOdd(-4, 4));
|
|
|
-
|
|
|
- CreateEnemy(cTaskAwaitBuffer, _levelBattleConfig.bossMonsterId,
|
|
|
- _levelBattleConfig.bossLv, _levelBattleConfig.bossStar, 0, pos,
|
|
|
- delegate(CombatHeroEntity entity)
|
|
|
- {
|
|
|
- ShowBossHpEventData showBossHpEventData = ShowBossHpEventData.Create();
|
|
|
- showBossHpEventData.boss = entity;
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.ShowBossHp, showBossHpEventData);
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.StartBossBattle, null);
|
|
|
- });
|
|
|
- CreateEnemy(cTaskAwaitBuffer);
|
|
|
- CombatTimerManager.Instance.AddTimer(2, delegate { StartBossBattle(); });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void StartBossBattle()
|
|
@@ -419,57 +74,13 @@ namespace GameLogic.Combat.CombatType
|
|
|
|
|
|
protected void InitTestCombatBoChi()
|
|
|
{
|
|
|
- _currLevelBattleNodeIndex %= _levelBattleConfig.MonsterWavesConfigId.Length;
|
|
|
- _currWavesConfig =
|
|
|
- ConfigComponent.Instance.Get<MonsterWavesConfig>(
|
|
|
- _levelBattleConfig.MonsterWavesConfigId[_currLevelBattleNodeIndex]);
|
|
|
- _currLevelBattleNodeIndex++;
|
|
|
- _currNodeWavesIndex = -1;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
private void CreateEnemy(CTaskAwaitBuffer cTaskAwaitBuffer)
|
|
|
{
|
|
|
- if (_currWavesConfig.ID <= 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- _currNodeWavesIndex++;
|
|
|
- int nodeIndex = _currNodeWavesIndex % _currWavesConfig.monsterGroupConfigId.Length;
|
|
|
- int miniCount = _currWavesConfig.miniMonsterCount[nodeIndex];
|
|
|
- MonsterGroupConfig monsterGroupConfig =
|
|
|
- ConfigComponent.Instance.Get<MonsterGroupConfig>(
|
|
|
- _currWavesConfig.monsterGroupConfigId[nodeIndex]);
|
|
|
- // count = 500;
|
|
|
- for (int i = 0; i < miniCount; i++)
|
|
|
- {
|
|
|
- int index = i;
|
|
|
- int monsterIndex = Random.Range(0, monsterGroupConfig.miniMonsterId.Length);
|
|
|
- int monsterId = monsterGroupConfig.miniMonsterId[monsterIndex];
|
|
|
- Vector3 dir = new Vector3(
|
|
|
- CombatCalculateTool.Instance.GetOdd(-10, 10) * 0.1f, 0,
|
|
|
- CombatCalculateTool.Instance.GetOdd(-10, 10) * 0.1f).normalized;
|
|
|
- Vector3 pos = nextConfig.targetMoveStartPoint.position +
|
|
|
- dir * CombatCalculateTool.Instance.GetOdd(5, 10);
|
|
|
- CreateEnemy(cTaskAwaitBuffer, monsterId, _levelBattleConfig.monsterLv, _levelBattleConfig.monsterStar,
|
|
|
- index, pos);
|
|
|
- }
|
|
|
-
|
|
|
- int eliteCount = _currWavesConfig.eliteMonsterCount[nodeIndex];
|
|
|
- for (int i = 0; i < eliteCount; i++)
|
|
|
- {
|
|
|
- int index = i;
|
|
|
- int monsterIndex = Random.Range(0, monsterGroupConfig.eliteMonsterId.Length);
|
|
|
- int monsterId = monsterGroupConfig.eliteMonsterId[monsterIndex];
|
|
|
- Vector3 dir = new Vector3(
|
|
|
- CombatCalculateTool.Instance.GetOdd(-10, 10) * 0.1f, 0,
|
|
|
- CombatCalculateTool.Instance.GetOdd(-10, 10) * 0.1f).normalized;
|
|
|
- Vector3 pos = nextConfig.targetMoveStartPoint.position +
|
|
|
- dir * CombatCalculateTool.Instance.GetOdd(5, 10);
|
|
|
- CreateEnemy(cTaskAwaitBuffer, monsterId, _levelBattleConfig.monsterLv, _levelBattleConfig.monsterStar,
|
|
|
- index, pos);
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void CreateEnemy(CTaskAwaitBuffer cTaskAwaitBuffer, int monsterId, int level, int star, int index,
|
|
@@ -489,46 +100,11 @@ namespace GameLogic.Combat.CombatType
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
- public void ExtraCreateEnemy(CTaskAwaitBuffer cTaskAwaitBuffer, int monsterId, int level, int star, Vector3 pos)
|
|
|
- {
|
|
|
- CombatHeroEntity heroEntity = CObjectPool.Instance.Fetch<CombatHeroEntity>();
|
|
|
- heroEntity.IsEnemy = true;
|
|
|
- CombatHeroInfo combatHeroInfo = new CombatHeroInfo();
|
|
|
- combatHeroInfo.InitMonster(monsterId, level, star);
|
|
|
- cTaskAwaitBuffer.AddTask(heroEntity.Init(new CombatAIBasic(), combatHeroInfo, pos,
|
|
|
- delegate(CombatHeroEntity entity) { combatController.CombatHeroController.AddHero(entity); }));
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
protected override void ProUpdate(float t)
|
|
|
{
|
|
|
- if (_isAwaitResurrection)
|
|
|
- {
|
|
|
- CombatHeroEntity[] myHero = combatController.CombatHeroController.GetHero(false);
|
|
|
- if (myHero != null && myHero.Length >= PlayerManager.Instance.heroController.heroDicInLead.Count)
|
|
|
- {
|
|
|
- ResurrectionFinish();
|
|
|
- }
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (!isActiveCombat)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (_currWavesConfig.ID > 0)
|
|
|
- {
|
|
|
- if (_currNodeWavesIndex < _currWavesConfig.monsterGroupConfigId.Length - 1)
|
|
|
- {
|
|
|
- _currTime += Time.deltaTime;
|
|
|
- if (_currTime > _currWavesConfig.wavesDelay)
|
|
|
- {
|
|
|
- CreateEnemy(new CTaskAwaitBuffer());
|
|
|
- _currTime = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -553,28 +129,6 @@ namespace GameLogic.Combat.CombatType
|
|
|
combatController.CombatCameraControllder.root.position.y, p.z + 13);
|
|
|
}
|
|
|
|
|
|
- // private void TestCombat(CTaskAwaitBuffer cTaskAwaitBuffer)
|
|
|
- // {
|
|
|
- // testCombatHeroConfig = GameObject.FindObjectOfType<TestCombatHeroConfig>();
|
|
|
- // if (testCombatHeroConfig != null)
|
|
|
- // {
|
|
|
- // for (int i = 0; i < testCombatHeroConfig.myHeroInfo.Length; i++)
|
|
|
- // {
|
|
|
- // int index = i;
|
|
|
- // TestCombatHeroConfig.TestHeroInfoConfig testHeroInfoConfig = testCombatHeroConfig.myHeroInfo[i];
|
|
|
- // CombatHeroEntity heroEntity = new CombatHeroEntity();
|
|
|
- // heroEntity.IsEnemy = false;
|
|
|
- // heroEntity.number = i;
|
|
|
- // CombatHeroInfo combatHeroInfo = new CombatHeroInfo();
|
|
|
- // testHeroInfoConfig.CopyToCombatHeroInfo((combatHeroInfo));
|
|
|
- // cTaskAwaitBuffer.AddTask(heroEntity.Init(new CombatAIBasic(), combatHeroInfo,
|
|
|
- // delegate(CombatHeroEntity entity)
|
|
|
- // {
|
|
|
- // combatController.CombatHeroController.AddHero(entity);
|
|
|
- // heroEntity.combatHeroGameObject.SetPosition(_combatScenesConfig.heroPoint[index].position);
|
|
|
- // }));
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
+
|
|
|
}
|
|
|
}
|