public bool GetBattleAction_BattleTalk(CharacterLogic chLogic, ref IActionMenu.UIActionButtonInfo info) { //找到临近的4个单位的id var center = chLogic.GetTileCoord(); var sidewayCharacter = chapterManager.GetSidewayCharacter(center); List <BattleTalkEventActionInfo> talkEvents = new List <BattleTalkEventActionInfo>(); foreach (var v in sidewayCharacter) { var t = chapterManager.Event.EventInfo.GetBattleTalkEvent(chLogic.GetID(), v.Logic.GetID()); if (t != null) { talkEvents.Add(new BattleTalkEventActionInfo(v.Logic, t)); } } if (talkEvents.Count == 0) { Debug.Log("没有Talk事件"); return(false); } Debug.Log("找到相匹配的Tald Event" + Utils.TextUtil.GetListString(talkEvents)); info.name = talkEvents[0].Event.GetButtonText(); info.action = () => { HideBattlaActionMenu(false); //进入选择Target阶段,然后将TalkEvents和坐标一并传入到BattleManager里面的SelectTarget阶段。 //点击选择后执行绑定后的动作 battleManager.SelectTalkCharacter(talkEvents); }; info.enable = chLogic.IsActionEnable(EnumActionType.Talk); return(true); }
/// <summary> /// 检查是否拥有位置事件 /// </summary> /// <param name="chLogic"></param> /// <param name="info"></param> /// <returns></returns> public bool GetBattleAction_Location(CharacterLogic chLogic, ref IActionMenu.UIActionButtonInfo info) { var locationEvent = chapterManager.Event.EventInfo.GetLocationEvent(chLogic.GetTileCoord(), chLogic.GetID()); if (locationEvent == null) { Debug.Log("没有Location事件"); return(false); } Debug.Log("找到相匹配的Location Event" + locationEvent); EnumActionType actionType = EnumActionType.OpenTreasureBox; if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.占领) { actionType = EnumActionType.All; } if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.访问) { actionType = EnumActionType.Visit; } info.name = locationEvent.GetButtonText(); info.action = () => { gameMode.BeforePlaySequence(); HideBattlaActionMenu(false); if (locationEvent.Sequence != null) { locationEvent.Execute(chapterManager.Event.EventInfo, () => { gameMode.AfterPlaySequence(); if (locationEvent.Caption != EventInfoCollection.EnumLocationEventCaption.占领)//如果是占领,则不再弹出选项菜单了 { ShowBattleActionMenu(ActionMenuState, chLogic); } }); } chLogic.ConsumeActionPoint(actionType); if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.占领) { //gameMode.ChapterManager.CheckWin_Seize(); } if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.开门) { //gameMode.GridTileManager.OpenDoor(new Vector2Int(0, 0)); } }; info.enable = chLogic.IsActionEnable(actionType); return(true); }
public void CheckAttackAction(CharacterLogic chLogic) { var attack = new IActionMenu.UIActionButtonInfo("攻击", BattleAction_Attack, chLogic.IsActionEnable(EnumActionType.Attack)); BattleActionMenu.AddAction(attack); }
public void CheckWaitAction(CharacterLogic chLogic) { var end = new IActionMenu.UIActionButtonInfo("待机", BattleAction_End, chLogic.IsActionEnable(EnumActionType.Wait)); BattleActionMenu.AddAction(end); }
public void CheckMoveAction(CharacterLogic chLogic) { var move = new IActionMenu.UIActionButtonInfo("移动", BattleAction_Move, chLogic.IsActionEnable(EnumActionType.Move)); BattleActionMenu.AddAction(move); }