Exemplo n.º 1
0
    /// <summary>
    /// 文本选择
    /// </summary>
    /// <param name="textData"></param>
    public void SelectText(TextInfoBean textData)
    {
        GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData();

        switch (mTextEnum)
        {
        case TextEnum.Look:
        case TextEnum.Story:
            NextText(textData.next_order);
            break;

        case TextEnum.Talk:
            //不同的对话选项
            //对话
            //如果是对话选项
            if (textData.GetTextType() == TextInfoTypeEnum.Talk)
            {
                if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99102)))
                {
                    //对话
                    TextInfoHandler.Instance.manager.listTextData = RandomUtil.GetRandomDataByDictionary(TextInfoHandler.Instance.manager.mapTalkNormalData);
                    NextText(1);
                    //增加好感
                    if (GameCommonInfo.DailyLimitData.AddTalkNpc(mTalkNpcInfo.id))
                    {
                        gameData.GetCharacterFavorability(mTalkNpcInfo.id).AddFavorability(1);
                    }
                    //增加数据记录
                    CharacterFavorabilityBean characterFavorability = gameData.GetCharacterFavorability(mTalkNpcInfo.id);
                    characterFavorability.AddTalkNumber(1);
                }
                //退出
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99103)))
                {
                    NextText();
                }
                //招募
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99104)))
                {
                    if (gameData.CheckIsMaxWorker())
                    {
                        ToastHandler.Instance.ToastHint(TextHandler.Instance.manager.GetTextById(1051));
                    }
                    else
                    {
                        TextInfoHandler.Instance.manager.listTextData = RandomUtil.GetRandomDataByDictionary(TextInfoHandler.Instance.manager.mapTalkRecruitData);
                        NextText(1);
                    }
                }
                //送礼
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99105)))
                {
                    DialogBean             dialogData         = new DialogBean();
                    PickForItemsDialogView pickForItemsDialog = DialogHandler.Instance.CreateDialog <PickForItemsDialogView>(DialogEnum.PickForItems, this, dialogData);
                    pickForItemsDialog.SetData(null, ItemsSelectionDialogView.SelectionTypeEnum.Gift);
                }
                //换取公会勋章
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99201)))
                {
                    //对话
                    TextInfoHandler.Instance.manager.listTextData = RandomUtil.GetRandomDataByDictionary(TextInfoHandler.Instance.manager.mapTalkExchangeData);
                    NextText(1);
                }
                //换取奖杯
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99202)))
                {
                    //对话
                    TextInfoHandler.Instance.manager.listTextData = RandomUtil.GetRandomDataByDictionary(TextInfoHandler.Instance.manager.mapTalkExchangeData);
                    NextText(1);
                }
                //换取装备
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99203)))
                {
                    //对话
                    TextInfoHandler.Instance.manager.listTextData = RandomUtil.GetRandomDataByDictionary(TextInfoHandler.Instance.manager.mapTalkExchangeData);
                    NextText(1);
                }
                //换取道具
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99204)))
                {
                    //对话
                    TextInfoHandler.Instance.manager.listTextData = RandomUtil.GetRandomDataByDictionary(TextInfoHandler.Instance.manager.mapTalkExchangeData);
                    NextText(1);
                }
                //求婚
                else if (textData.content.Equals(TextHandler.Instance.manager.GetTextById(99205)))
                {
                    gameData.CheckHasItems(99900021, out bool hasItems, out long number);
                    //判断是否有信物
                    if (hasItems)
                    {
                        DialogBean dialogData = new DialogBean();
                        dialogData.content = string.Format(TextHandler.Instance.manager.GetTextById(3121), mTalkNpcInfo.name);
                        DialogHandler.Instance.CreateDialog <DialogView>(DialogEnum.Normal, this, dialogData);
                        NextText(textData.next_order);
                    }
                    else
                    {
                        ItemsInfoBean itemsInfo = GameItemsHandler.Instance.manager.GetItemsById(99900021);
                        ToastHandler.Instance.ToastHint(string.Format(TextHandler.Instance.manager.GetTextById(5023), itemsInfo.name, "1"));
                    }
                }
            }
            else
            {
                NextText(textData.next_order);
            }
            break;
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// 根据料理主题随机获取一个料理
 /// </summary>
 public MenuInfoBean GetRandomFoodDataByCookingTheme(CookingThemeBean cookingTheme)
 {
     //TODO
     return(RandomUtil.GetRandomDataByDictionary(listMenuData));
 }