123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- 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
- {
- 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 (state == 0)
- {
- if (isTrgger)
- {
- return;
- }
- LevelBattleCombatType levelBattleCombatType =
- (LevelBattleCombatType)CombatController.currActiveCombat.CombatTypeBasic;
- if (levelBattleCombatType._levelBattleConfig.ID == 2 && !levelBattleCombatType.isActiveCombat &&
- !CombatController.currActiveCombat.isStopAi)
- {
- isTrgger = true;
- Guide2_0();
- }
- }
- else if (state == 1)
- {
- if (isTrgger)
- {
- return;
- }
- CombatHeroEntity[] allHero = CombatController.currActiveCombat.CombatHeroController.GetHero(false);
- if (Vector3.Distance(allHero[0].dotPos, heroEntity.dotPos) < 5)
- {
- isTrgger = true;
- Guide2_1();
- }
- }
- }
- private async void Guide2_0()
- {
- heroData2 = new AccountFileInfo.HeroData
- {
- heroModelId = 116,
- heroPowerId = 10,
- heroPromoteId = 3,
- isLead = true,
- };
- heroInfo = new HeroInfo();
- heroInfo.InitHero(heroData2);
- LevelBattleCombatType levelBattleCombatType =
- (LevelBattleCombatType)CombatController.currActiveCombat.CombatTypeBasic;
- heroEntity = CObjectPool.Instance.Fetch<CombatHeroEntity>();
- heroEntity.IsEnemy = false;
- heroEntity.number = 1;
- 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
- {
- CombatController.currActiveCombat.isStopAi = false;
- state = 1;
- isTrgger = false;
- };
- showDialogueEventData.dialogueMessaga = new string[] { "救命呀~", "救命~~~" };
- showDialogueEventData.icon = new string[] { "icon_tx116", "icon_tx116" };
- 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.icon = new string[] { "icon_tx116"};
- 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.DeployHeroToLead(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.icon = new string[] { "icon_tx105"};
- showDialogueEventData.messageShowType = ShowDialogueEventData.MessageShowType.Verbatim;
- EventManager.Instance.Dispatch(CustomEventType.ShowDialogue, showDialogueEventData);
-
- }
- }
- }
|