|
@@ -2,108 +2,126 @@ using Common.Utility.CombatEvent;
|
|
|
using Fort23.Core;
|
|
|
using GameLogic.Combat.CombatTool;
|
|
|
using GameLogic.Combat.CombatType;
|
|
|
+using GameLogic.Combat.Hero;
|
|
|
using GameLogic.Hero;
|
|
|
using UnityEngine;
|
|
|
|
|
|
namespace GameLogic.Combat.CombatGuide
|
|
|
{
|
|
|
- public class Guide_GongJiang:GuideBasic
|
|
|
+ public class Guide_GongJiang : GuideBasic
|
|
|
{
|
|
|
protected bool isTrgger;
|
|
|
-
|
|
|
+ private AccountFileInfo.HeroData heroData2;
|
|
|
+ private HeroInfo heroInfo;
|
|
|
+ private int state;
|
|
|
+
|
|
|
+ private CombatHeroEntity heroEntity;
|
|
|
protected override void ProUpdate()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
Trigger();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
protected void Trigger()
|
|
|
{
|
|
|
- if (isTrgger)
|
|
|
+ if (state == 0)
|
|
|
{
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (isTrgger)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- if (CombatController.currActiveCombat.CombatTypeBasic.dieHeroCount > 20)
|
|
|
- {
|
|
|
- isTrgger = true;
|
|
|
- Guide2();
|
|
|
+ LevelBattleCombatType levelBattleCombatType =
|
|
|
+ (LevelBattleCombatType)CombatController.currActiveCombat.CombatTypeBasic;
|
|
|
+ if (levelBattleCombatType._levelBattleConfig.ID == 2 && !levelBattleCombatType.isActiveCombat &&
|
|
|
+ !CombatController.currActiveCombat.isStopAi)
|
|
|
+ {
|
|
|
+ isTrgger = true;
|
|
|
+ Guide2_0();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- private async void Guide2()
|
|
|
- {
|
|
|
- LevelBattleCombatType levelBattleCombatType =
|
|
|
- (LevelBattleCombatType)CombatController.currActiveCombat.CombatTypeBasic;
|
|
|
- int[] monsterId = new int[] { 9000101, 9000107, 9000108 };
|
|
|
- CombatHeroEntity[] allHero = CombatController.currActiveCombat.CombatHeroController.GetHero(false);
|
|
|
- CombatHeroEntity combatHeroEntity = allHero[0];
|
|
|
- Vector3 d = combatHeroEntity.dotPos + combatHeroEntity.faceDir * -10;
|
|
|
- CTaskAwaitBuffer cTaskAwaitBuffer = new CTaskAwaitBuffer();
|
|
|
- for (int i = 0; i < 5; i++)
|
|
|
+ else if (state == 1)
|
|
|
{
|
|
|
- int monsterIndx = CombatCalculateTool.Instance.GetOdd(0, monsterId.Length);
|
|
|
- int id = monsterId[monsterIndx];
|
|
|
- int level = 1;
|
|
|
- int star = 1;
|
|
|
- Vector3 pos = d + new Vector3(CombatCalculateTool.Instance.GetOdd(-150, 150) * 0.01f, 0,
|
|
|
- CombatCalculateTool.Instance.GetOdd(-150, 150) * 0.01f);
|
|
|
- levelBattleCombatType.ExtraCreateEnemy(cTaskAwaitBuffer, id, level, star, pos);
|
|
|
+ if (isTrgger)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ CombatHeroEntity[] allHero = CombatController.currActiveCombat.CombatHeroController.GetHero(false);
|
|
|
+ if (Vector3.Distance(allHero[0].dotPos, heroEntity.dotPos) < 5)
|
|
|
+ {
|
|
|
+ isTrgger = true;
|
|
|
+ Guide2_1();
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- await cTaskAwaitBuffer.WaitAll();
|
|
|
- await TimerComponent.Instance.WaitAsync(1000);
|
|
|
- Guide2_1();
|
|
|
}
|
|
|
|
|
|
- private async void Guide2_1()
|
|
|
+ private async void Guide2_0()
|
|
|
{
|
|
|
- CombatController.currActiveCombat.isStopAi = true;
|
|
|
- ShowDialogueEventData showDialogueEventData = ShowDialogueEventData.Create();
|
|
|
- showDialogueEventData.finish = Guide2_2;
|
|
|
- showDialogueEventData.dialogueMessaga = new string[] { "怎么办我们后面好像也有敌人~~" };
|
|
|
- showDialogueEventData.messageShowType = ShowDialogueEventData.MessageShowType.Verbatim;
|
|
|
- EventManager.Instance.Dispatch(CustomEventType.ShowDialogue, showDialogueEventData);
|
|
|
- }
|
|
|
-
|
|
|
- private async void Guide2_2()
|
|
|
- {
|
|
|
- AccountFileInfo.HeroData heroData2 = new AccountFileInfo.HeroData
|
|
|
+ heroData2 = new AccountFileInfo.HeroData
|
|
|
{
|
|
|
heroModelId = 116,
|
|
|
- heroPowerId = 5,
|
|
|
+ heroPowerId = 10,
|
|
|
heroPromoteId = 3,
|
|
|
isLead = true,
|
|
|
};
|
|
|
- HeroInfo heroInfo = new HeroInfo();
|
|
|
+ heroInfo = new HeroInfo();
|
|
|
heroInfo.InitHero(heroData2);
|
|
|
- AccountFileInfo.Instance.playerData.HeroListData.Add(heroData2);
|
|
|
- PlayerManager.Instance.heroController.AddHero(heroInfo);
|
|
|
- AccountFileInfo.Instance.playerData.combatGuideIndex = 2;
|
|
|
- AccountFileInfo.Instance.SavePlayerData();
|
|
|
|
|
|
- CombatHeroEntity[] allHero = CombatController.currActiveCombat.CombatHeroController.GetHero(false);
|
|
|
- CombatHeroEntity heroEntity = CObjectPool.Instance.Fetch<CombatHeroEntity>();
|
|
|
+ LevelBattleCombatType levelBattleCombatType =
|
|
|
+ (LevelBattleCombatType)CombatController.currActiveCombat.CombatTypeBasic;
|
|
|
+ heroEntity = CObjectPool.Instance.Fetch<CombatHeroEntity>();
|
|
|
heroEntity.IsEnemy = false;
|
|
|
heroEntity.number = 1;
|
|
|
- Vector3 pos = allHero[0].dotPos + allHero[0].faceDir * -2;
|
|
|
+ Vector3 pos = levelBattleCombatType.currBannerHero.dotPos ;
|
|
|
await heroEntity.Init(new CombatAIBasic(), heroInfo, pos,
|
|
|
delegate(CombatHeroEntity entity)
|
|
|
{
|
|
|
CombatController.currActiveCombat.CombatHeroController.AddHero(entity);
|
|
|
});
|
|
|
+
|
|
|
+ // heroEntity.CombatAIBasic.ChangeState(CombatHeroStateType.NullState);
|
|
|
+ CombatController.currActiveCombat.isStopAi = true;
|
|
|
ShowDialogueEventData showDialogueEventData = ShowDialogueEventData.Create();
|
|
|
showDialogueEventData.finish = delegate
|
|
|
{
|
|
|
- heroEntity.CombatHeroSkillControl.AddCommandSkill(
|
|
|
- heroEntity.CombatHeroSkillControl.GetSkillBasic(40001));
|
|
|
CombatController.currActiveCombat.isStopAi = false;
|
|
|
- CombatGuideManager.Instance.NextGuide();
|
|
|
+ state = 1;
|
|
|
+ isTrgger = false;
|
|
|
};
|
|
|
- showDialogueEventData.dialogueMessaga = new string[] { "后面的事情交给我,看我百步穿杨,百发百中!" };
|
|
|
+ showDialogueEventData.dialogueMessaga = new string[] { "救命呀~", "救命~~~" };
|
|
|
+ showDialogueEventData.messageShowType = ShowDialogueEventData.MessageShowType.Verbatim;
|
|
|
+ EventManager.Instance.Dispatch(CustomEventType.ShowDialogue, showDialogueEventData);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private async void Guide2_1()
|
|
|
+ {
|
|
|
+ CombatController.currActiveCombat.isStopAi = true;
|
|
|
+ ShowDialogueEventData showDialogueEventData = ShowDialogueEventData.Create();
|
|
|
+ showDialogueEventData.finish = Guide2_2;
|
|
|
+ showDialogueEventData.dialogueMessaga = new string[] { "越往深林深处走怪物越强大了,这里的怪我有点招架不足了,我能不能加入你们一起探险?" };
|
|
|
showDialogueEventData.messageShowType = ShowDialogueEventData.MessageShowType.Verbatim;
|
|
|
EventManager.Instance.Dispatch(CustomEventType.ShowDialogue, showDialogueEventData);
|
|
|
}
|
|
|
|
|
|
+ private async void Guide2_2()
|
|
|
+ {
|
|
|
+ ShowDialogueEventData showDialogueEventData = ShowDialogueEventData.Create();
|
|
|
+ showDialogueEventData.finish = delegate
|
|
|
+ {
|
|
|
+ AccountFileInfo.Instance.playerData.HeroListData.Add(heroData2);
|
|
|
+ PlayerManager.Instance.heroController.AddHero(heroInfo);
|
|
|
+ AccountFileInfo.Instance.playerData.combatGuideIndex =3;
|
|
|
+ AccountFileInfo.Instance.SavePlayerData();
|
|
|
+ EventManager.Instance.Dispatch(CustomEventType.AlterCombatHero, null);
|
|
|
+ CombatController.currActiveCombat.isStopAi = false;
|
|
|
+ CombatGuideManager.Instance.NextGuide();
|
|
|
+ };
|
|
|
+ showDialogueEventData.dialogueMessaga = new string[] { "没问题,我们正缺你这样的勇士。","欢迎加入我们的队伍,让我们一起看看深林深处是什么在作怪。" };
|
|
|
+ showDialogueEventData.messageShowType = ShowDialogueEventData.MessageShowType.Verbatim;
|
|
|
+ EventManager.Instance.Dispatch(CustomEventType.ShowDialogue, showDialogueEventData);
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|