Exemplo n.º 1
0
    /// <summary>
    /// フラグの設定
    /// </summary>
    /// <param name="quest_id"></param>
    public void SetFlag(uint quest_id)
    {
        IsActiveNew  = false;
        IsActiveFlag = false;
        bool isQuestClear     = ServerDataUtil.ChkRenewBitFlag(ref UserDataAdmin.Instance.m_StructPlayer.flag_renew_quest_clear, quest_id);
        bool isMissonComplete = ServerDataUtil.ChkRenewBitFlag(ref UserDataAdmin.Instance.m_StructPlayer.flag_renew_quest_mission_complete, quest_id);
        bool isNew            = ServerDataUtil.ChkRenewBitFlag(ref UserDataAdmin.Instance.m_StructPlayer.flag_renew_quest_check, quest_id);

        if (isQuestClear && isMissonComplete)
        {
            // コンプリートフラグの表示
            IsActiveFlag = true;
            FlagImage    = ResourceManager.Instance.Load("comp_flag_q");
        }
        else if (isQuestClear)
        {
            // クリアフラグの表示
            IsActiveFlag = true;
            FlagImage    = ResourceManager.Instance.Load("clear_flag_q");
        }
        else if (!isNew && m_QuestType != ExecType.Event)
        {
            // NEWフラグの表示
            IsActiveNew = true;
        }
    }
Exemplo n.º 2
0
    private void setupQuest()
    {
        m_QuestSelect.isEndShowList = false;
        m_QuestSelect.QuestList.Clear();
        m_questButtons.Clear();

        if (m_SelectAreaIndex >= m_QuestSelect.EpisodeList.Count)
        {
            return;
        }

        EpisodeDataContext episodeData = m_QuestSelect.EpisodeList[m_SelectAreaIndex];

        MasterDataArea areaMaster = episodeData.master;

        if (areaMaster == null)
        {
            return;
        }

        List <MasterDataQuest2> quest2List = MasterFinder <MasterDataQuest2> .Instance.SelectWhere("where area_id = ?", areaMaster.fix_id);

        quest2List.Sort((a, b) => (int)a.fix_id - (int)b.fix_id);
        MasterDataQuest2[] quest2Array = quest2List.ToArray();
        if (quest2Array == null)
        {
            return;
        }

        MainMenuParam.m_QuestStaminaAmend = (float)episodeData.amend.m_QuestSelectAreaAmendStamina / 100.0f;

        //クエストリスト更新
        {
            uint _count         = 0;
            uint _notClearCount = 0;
            bool bSkip          = false;
            for (int i = 0; i < quest2Array.Length; i++)
            {
                uint             _index        = _count;
                MasterDataQuest2 _masterQuest2 = quest2Array[i];

                if (_masterQuest2.active != MasterDataDefineLabel.BoolType.ENABLE)
                {
                    continue;
                }

                if (_masterQuest2.story != 0 && _notClearCount != 0)
                {
                    //未クリアクエスト以降のシナリオはスキップ
                    bSkip = true;
                }
                else if (_masterQuest2.story == 0 &&
                         !ServerDataUtil.ChkRenewBitFlag(ref UserDataAdmin.Instance.m_StructPlayer.flag_renew_quest_clear, quest2Array[i].fix_id))
                {
                    //1つめの未クリアは表示
                    if (_notClearCount != 0)
                    {
                        bSkip = true;
                    }

                    _notClearCount++;
                }

                if (bSkip)
                {
                    continue;
                }

                var model = new ListItemModel(_index);
                model.OnClicked += () =>
                {
                    SelectQuest(_index);
                };
                m_questButtons.Add(model);

                QuestDataContext newQuest = new QuestDataContext(model);
                newQuest.master           = _masterQuest2;
                newQuest.area_category_id = m_MasterAreaCategory.fix_id;
                newQuest.boss             = MasterDataUtil.GetGuerrillaBossParamFromQuestID(_masterQuest2.fix_id);
                newQuest.m_QuestId        = _index + 1;

                if (_masterQuest2.story == 0)
                {
                    newQuest.m_QuestType = QuestDataContext.ExecType.Quest2;
                    newQuest.IconLabel   = GameTextUtil.GetText("questselect_text1");
                    {
                        //詳細情報テキスト差し替え
                        MasterDataQuestAppearance[] questAppearance = MasterFinder <MasterDataQuestAppearance> .Instance.SelectWhere("where area_category_id = ?", MainMenuParam.m_QuestSelectAreaCateID).ToArray();

                        if (questAppearance.IsNullOrEmpty() == false)
                        {
                            // newQuest.IconLabel = GameTextUtil.GetText(questAppearance[0].boss_text_key);
                            // テキストキーではなく直接テキストが入っている
                            newQuest.IconLabel = questAppearance[0].boss_text_key;
                        }
                    }
                    UnitIconImageProvider.Instance.Get(
                        _masterQuest2.boss_chara_id,
                        sprite => { newQuest.IconImage = sprite; });
                }
                else
                {
                    newQuest.m_QuestType = QuestDataContext.ExecType.Event;
                    newQuest.IconLabel   = GameTextUtil.GetText("questselect_text2");
                    newQuest.IconImage   = ResourceManager.Instance.Load("storyicon");
                }

                string titleFormat = GameTextUtil.GetText("questselect_questname1");
                if (newQuest.boss != null)
                {
                    titleFormat = GameTextUtil.GetText("questselect_questname2");
                }

                newQuest.Title       = string.Format(titleFormat, _masterQuest2.quest_name);
                newQuest.Index       = _index;
                newQuest.SelectImage = m_SelectSprite;

                //                newQuest.BackGroundTexture = m_QuestSelect.BackGroundImage.texture;

                newQuest.IsActivePoint = false;
                switch (_masterQuest2.consume_type)
                {
                case 1:    //スタミナ
                    newQuest.IsActivePoint = true;
                    newQuest.PointLabel    = GameTextUtil.GetText("questselect_text3");
                    if (episodeData.amend.m_QuestSelectAreaAmendStamina == 100)
                    {
                        newQuest.m_Point = (uint)_masterQuest2.consume_value;
                        newQuest.Point   = string.Format("{0}", _masterQuest2.consume_value);
                    }
                    else
                    {
                        uint point = (uint)((float)_masterQuest2.consume_value * ((float)episodeData.amend.m_QuestSelectAreaAmendStamina / 100.0f));
                        newQuest.m_Point = point;
                        newQuest.Point   = string.Format(GameTextUtil.GetText("stmina_bahutext"), point);
                    }

                    //スコア倍率アップ
                    newQuest.AmendText = "";
                    if (_masterQuest2.story == 0 &&
                        _masterQuest2.consume_value != 0 &&
                        episodeData.amend.m_FlagAmendScore)
                    {
                        float score_rate = (float)episodeData.amend.m_QuestSelectAreaAmendScore / 100.0f;
                        newQuest.AmendText = string.Format("スコア {0:0.0}倍", score_rate);
                    }
                    break;

                case 2:    //Key
                {
                    newQuest.IsActivePoint = true;
                    newQuest.m_Point       = (uint)_masterQuest2.consume_value;
                    string             strFormat  = GameTextUtil.GetText("questselect_text5");
                    MasterDataQuestKey _keyMaster = MasterDataUtil.GetMasterDataQuestKeyFromAreaCategoryID(m_MasterAreaCategory.fix_id);
                    if (_keyMaster != null)
                    {
                        newQuest.PointLabel = string.Format(strFormat, _keyMaster.key_name);
                    }
                    newQuest.Point = string.Format("{0}", _masterQuest2.consume_value);
                }
                break;

                case 3:    //Ticket
                    newQuest.IsActivePoint = true;
                    newQuest.m_Point       = (uint)_masterQuest2.consume_value;
                    newQuest.PointLabel    = GameTextUtil.GetText("questselect_text4");
                    newQuest.Point         = string.Format("{0}", _masterQuest2.consume_value);
                    break;
                }

                newQuest.SetFlag(quest2Array[i].fix_id);

                m_QuestSelect.QuestList.Add(newQuest);

                _count++;
            }

            //-------------------------------------------------
            // イベントスケジュールがあるが検索
            //-------------------------------------------------
            MasterDataEvent eventMaster = MasterDataUtil.GetMasterDataEventFromID(areaMaster.event_id);
            m_QuestSelect.m_EventMaster = eventMaster;
            if (eventMaster != null &&
                eventMaster.event_schedule_show == MasterDataDefineLabel.BoolType.ENABLE)
            {
                m_QuestSelect.IsViewDetailButton = true;
            }
            else
            {
                m_QuestSelect.IsViewDetailButton = false;
            }
        }


        // View更新
        foreach (var episodeButton in m_episodeButtons)
        {
            episodeButton.HideArrow();
        }

        // インジケーターを表示
        if (LoadingManager.Instance != null)
        {
            LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.ASSETBUNDLE);
        }
        m_QuestSelect.Show(episodeData.masterDataAreaCategory.fix_id, () =>
        {
            foreach (var questButton in m_questButtons)
            {
                questButton.Appear();
            }

            foreach (var episodeButton in m_episodeButtons)
            {
                if (episodeButton.isSelected)
                {
                    episodeButton.ShowArrow();
                }
                else
                {
                    episodeButton.HideArrow();
                }
            }
            //戻るボタン抑制解除
            SetSuspendReturn(false);

            StartCoroutine(WaitShowQuestList(() =>
            {
                m_QuestSelect.isEndShowList = true;
            }));
        }, () =>
        {
            // インジケーターを閉じる
            if (LoadingManager.Instance != null)
            {
                LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE);
            }
        });
    }