예제 #1
0
    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);
    }
예제 #2
0
 //[RuntimeInitializeOnLoadMethod]
 //public static void LoadFromRecord() {
 //    CharacterInfo info = new CharacterInfo();
 //   info= info.Load<CharacterInfo>();
 //    Debug.Log(info.Items.Weapons.Count);
 //}
 public CharacterInfo(CharacterLogic Logic)
 {
     ID        = Logic.GetID();
     Level     = Logic.GetLevel();
     Exp       = Logic.GetExp();
     Career    = Logic.GetCareer();
     Attribute = Logic.GetAttribute();
     CurrentHP = Logic.GetCurrentHP();
     MaxHP     = Logic.GetMaxHP();
     Items     = new ItemGroup();
     Skills    = new SkillGroup();
 }
예제 #3
0
    /// <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);
    }