private void updateAreaAmend(uint area_id)
    {
        MasterDataArea areaMaster = MasterFinder <MasterDataArea> .Instance.Find((int)area_id);

        if (areaMaster == null)
        {
            return;
        }

        m_AreaAmendParam = MainMenuUtil.CreateAreaParamAmend(areaMaster);

        m_ChallengeSelect.IsViewFlag = false;
        m_AreaFlagTime    = 0.0f;
        m_CurrentAreaFlag = 0;
        m_AreaFlagSprits.Clear();
        m_AreaFlagValue.Clear();

        if (m_AreaAmendParam.m_FlagAmendCoin)
        {
            m_AreaFlagSprits.Add(ResourceManager.Instance.Load("flag_coin"));
            m_AreaFlagValue.Add(getStringFlagRate(m_AreaAmendParam.m_QuestSelectAreaAmendCoin));
        }
        if (m_AreaAmendParam.m_FlagAmendDrop)
        {
            m_AreaFlagSprits.Add(ResourceManager.Instance.Load("flag_drop"));
            m_AreaFlagValue.Add(getStringFlagRate(m_AreaAmendParam.m_QuestSelectAreaAmendDrop));
        }
        if (m_AreaAmendParam.m_FlagAmendEXP)
        {
            m_AreaFlagSprits.Add(ResourceManager.Instance.Load("flag_exp"));
            m_AreaFlagValue.Add(getStringFlagRate(m_AreaAmendParam.m_QuestSelectAreaAmendEXP));
        }
        if (m_AreaAmendParam.m_FlagAmendTicket)
        {
            m_AreaFlagSprits.Add(ResourceManager.Instance.Load("flag_ticket"));
            m_AreaFlagValue.Add(getStringFlagRate(m_AreaAmendParam.m_QuestSelectAreaAmendTicket));
        }
        if (m_AreaAmendParam.m_FlagAmendStamina)
        {
            m_AreaFlagSprits.Add(ResourceManager.Instance.Load("flag_stm"));
            m_AreaFlagValue.Add("");
        }
        if (m_AreaAmendParam.m_FlagAmendGuerrillaBoss)
        {
            m_AreaFlagSprits.Add(ResourceManager.Instance.Load("flag_boss"));
            m_AreaFlagValue.Add("");
        }
        if (m_AreaAmendParam.m_FlagAmendLinkPoint)
        {
            m_AreaFlagSprits.Add(ResourceManager.Instance.Load("flag_link"));
            m_AreaFlagValue.Add(getStringFlagRate(m_AreaAmendParam.m_QuestSelectAreaAmendLinkPoint));
        }

        if (m_AreaFlagSprits.Count != 0)
        {
            m_ChallengeSelect.IsViewFlag = true;
            m_ChallengeSelect.FlagImage  = m_AreaFlagSprits[m_CurrentAreaFlag];
            m_ChallengeSelect.FlagValue  = m_AreaFlagValue[m_CurrentAreaFlag];
        }
    }
Esempio n. 2
0
    private void changeText()
    {
        uint area_id = 0;
        {
            MasterDataQuest2[] master = null;
            if (DebugOptionInGame.Instance.m_Quest2fromJson == true)
            {
                master = DebugOptionInGame.Instance.masterDataQuest2;
            }
            else
            {
                master = MasterFinder <MasterDataQuest2> .Instance.GetAll();
            }
            if (master != null)
            {
                if (DebugOptionInGame.Instance.m_QuestIndex >= master.Length)
                {
                    DebugOptionInGame.Instance.m_QuestIndex = master.Length - 1;
                }
                m_TestGameManager.Quest_name = master[DebugOptionInGame.Instance.m_QuestIndex].quest_name;
                area_id = master[DebugOptionInGame.Instance.m_QuestIndex].area_id;
                DebugOptionInGame.Instance.inGameDebugDO.m_QuestId = master[DebugOptionInGame.Instance.m_QuestIndex].fix_id;
            }
        }
        MasterDataArea amaster = MasterFinder <MasterDataArea> .Instance.Find((int)area_id);

        if (amaster != null)
        {
            m_TestGameManager.Area_name   = amaster.area_name;
            m_TestGameManager.Area_detail = amaster.area_detail;
        }
        m_Text[0].text = DebugOptionInGame.Instance.m_QuestIndex.ToString();
        m_Text[1].text = DebugOptionInGame.Instance.inGameDebugDO.m_QuestId.ToString();
    }
Esempio n. 3
0
    protected override void Start()
    {
        base.Start();
        MasterDataArea area = MasterFinder <MasterDataArea> .Instance.Find(0);

        Debug.LogError("ARREA:" + area.timing_public);
    }
Esempio n. 4
0
    private void sendQuestRetire()
    {
        m_PageSwitchNext = false;
        m_QuestId        = SceneGoesParam.Instance.m_SceneGoesParamToMainMenuRetire.m_QuestID;
        bool is_auto_play = SceneGoesParam.Instance.m_SceneGoesParamToMainMenuRetire.m_IsUsedAutoPlay;

        m_QuestMaster = MasterDataUtil.GetQuest2ParamFromID(m_QuestId);
        if (m_QuestMaster != null)
        {
            m_AreaMaster = MasterFinder <MasterDataArea> .Instance.Find((int)m_QuestMaster.area_id);
        }

        //--------------------------------
        // ローカルセーブにあるリザルト情報を破棄
        //--------------------------------
        LocalSaveManager.Instance.SaveFuncGoesToMenuRetire(null);

        switch (MasterDataUtil.GetQuestType(m_QuestId))
        {
        case MasterDataDefineLabel.QuestType.NORMAL:
        {
            ServerDataUtilSend.SendPacketAPI_QuestRetire(m_QuestId, is_auto_play)
            .setSuccessAction(_data =>
                {
                    resultSuccess(_data);
                })
            .setErrorAction(_data =>
                {
                    resultError(_data);
                })
            .SendStart();
        }
        break;

        case MasterDataDefineLabel.QuestType.CHALLENGE:
        {
            ServerDataUtilSend.SendPacketAPI_ChallengeQuestRetire(m_QuestId, is_auto_play)
            .setSuccessAction(_data =>
                {
                    resultSuccess(_data);
                })
            .setErrorAction(_data =>
                {
                    resultError(_data);
                })
            .SendStart();
        }
        break;

        default:
            //Home画面へ
            m_PageSwitchNext = true;
            break;
        }
    }
Esempio n. 5
0
    static public bool MoveQuestDetail(MasterDataQuest2 quest2Master)
    {
        if (quest2Master == null)
        {
            return(false);
        }

        MasterDataArea areaMaster = MasterFinder <MasterDataArea> .Instance.Find((int)quest2Master.area_id);

        MainMenuQuestSelect.AreaAmendParam areaAmendParam = MainMenuUtil.CreateAreaParamAmend(areaMaster);

        MainMenuParam.m_QuestStamina = 0;
        MainMenuParam.m_QuestKey     = 0;
        MainMenuParam.m_QuestTicket  = 0;
        switch (quest2Master.consume_type)
        {
        case 1:
            if (areaAmendParam.m_QuestSelectAreaAmendStamina == 100)
            {
                MainMenuParam.m_QuestStamina = (uint)quest2Master.consume_value;
            }
            else
            {
                uint point = (uint)((float)quest2Master.consume_value * ((float)areaAmendParam.m_QuestSelectAreaAmendStamina / 100.0f));
                MainMenuParam.m_QuestStamina = point;
            }
            break;

        case 2:
            MainMenuParam.m_QuestKey = (uint)quest2Master.consume_value;
            break;

        case 3:
            MainMenuParam.m_QuestTicket = (uint)quest2Master.consume_value;
            break;
        }

        if (MainMenuManager.HasInstance)
        {
            MainMenuParam.m_QuestSelectAreaID     = areaMaster.fix_id;
            MainMenuParam.m_QuestSelectMissionID  = quest2Master.fix_id;
            MainMenuParam.m_QuestAreaAmendList    = areaAmendParam.m_AreaMasterDataAmendList;
            MainMenuParam.m_QuestStaminaAmend     = (float)areaAmendParam.m_QuestSelectAreaAmendStamina / 100.0f;
            MainMenuParam.m_QuestSelectAreaCateID = areaMaster.area_cate_id;
            m_jmpQuestSelectAreaCateID            = areaMaster.area_cate_id;
            m_jmpQuestSelectAreaID = areaMaster.fix_id;

            MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT_DETAIL, false, false, true);
        }

        return(true);
    }
Esempio n. 6
0
    private void updateEpsodeTime(EpisodeDataContext newEpisode, MasterDataArea area)
    {
        //残り時間計算
        newEpisode.Time = "";
        if (area.event_id != 0)
        {
            uint unTimingEnd = MainMenuUtil.GetEventTimingEnd(area.event_id);

            if (unTimingEnd != 0)
            {
                DateTime endTime  = TimeUtil.GetDateTime(unTimingEnd);
                DateTime nowTime  = TimeManager.Instance.m_TimeNow;
                TimeSpan leftTime = endTime - nowTime;
                newEpisode.Time = GameTextUtil.GetRemainStr(leftTime, GameTextUtil.GetText("general_time_01"));
            }
        }
    }
Esempio n. 7
0
    private void setupBg()
    {
        MasterDataArea areaMaster = MasterFinder <MasterDataArea> .Instance.Find((int)masters[currentIndex].area_id);

        if (areaMaster != null)
        {
            Title             = areaMaster.area_name + "\n" + masters[currentIndex].quest_name;
            idInputField.text = masters[currentIndex].fix_id.ToString();
            string backgroundname = MasterDataUtil.GetMasterDataQuestBackgroundName(masters[currentIndex].background);
            currentId = masters[currentIndex].fix_id;
            reading   = true;
            // インジケーターを表示
            if (LoadingManager.Instance != null)
            {
                LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.ASSETBUNDLE);
            }
            AssetBundler.Create().Set(backgroundname, backgroundname,
                                      (o) =>
            {
                QuestBg = o.AssetBundle.LoadAsset <Sprite>(backgroundname);
                reading = false;
                // インジケーターを閉じる
                if (LoadingManager.Instance != null)
                {
                    LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE);
                }
            },
                                      (s) =>
            {
                QuestBg = newBattleBg;
                reading = false;
                // インジケーターを閉じる
                if (LoadingManager.Instance != null)
                {
                    LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE);
                }
            }).Load();
        }
    }
Esempio n. 8
0
    /// <summary>
    /// クエストIDからリージョンIDを探す
    /// </summary>
    /// <param name="quest_id"></param>
    /// <returns></returns>
    public static uint getAreaCategoryIDFromQuestID(uint quest_id)
    {
        uint area_category_id = 0;

        MasterDataQuest2 master_data_quest = MasterDataUtil.GetQuest2ParamFromID(quest_id);

        if (master_data_quest != null)
        {
            MasterDataArea master_data_area = MasterFinder <MasterDataArea> .Instance.Find((int)master_data_quest.area_id);

            if (master_data_area != null)
            {
                MasterDataAreaCategory master_data_area_category = MasterFinder <MasterDataAreaCategory> .Instance.Find((int)master_data_area.area_cate_id);

                if (master_data_area_category != null)
                {
                    area_category_id = master_data_area_category.fix_id;
                }
            }
        }

        return(area_category_id);
    }
Esempio n. 9
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);
            }
        });
    }
Esempio n. 10
0
    //ページ初期化処理
    protected override void PageSwitchSetting(bool initalize)
    {
        base.PageSwitchSetting(initalize);

        //戻るボタン抑制
        SetSuspendReturn(true);

        if (m_QuestDetailBG == null)
        {
            m_QuestDetailBG = m_CanvasObj.GetComponentInChildren <QuestDetailBG>();
            m_QuestDetailBG.Load(MainMenuParam.m_QuestSelectAreaCateID);
            m_QuestDetailBG.SetPositionAjustStatusBar(new Vector2(0, -25), new Vector2(0, -215));
        }
        if (m_QuestDetailInfo == null)
        {
            m_QuestDetailInfo = m_CanvasObj.GetComponentInChildren <QuestDetailInfo>();
            m_QuestDetailInfo.SetModel(m_model);
        }
        if (m_QuestDetailMessage == null)
        {
            m_QuestDetailMessage = m_CanvasObj.GetComponentInChildren <QuestDetailMessage>();
            m_QuestDetailMessage.SetModel(m_model);
        }
        if (m_QuestDetailMission == null)
        {
            m_QuestDetailMission = m_CanvasObj.GetComponentInChildren <QuestDetailMission>();
            //m_QuestDetailMission.SetPosition(new Vector2(0, 270), new Vector2(0, -546));
            m_QuestDetailMission.SetModel(m_model);
        }
        if (m_QuestDetailInfo.tab == null)
        {
            m_QuestDetailInfo.tab           = m_CanvasObj.GetComponentInChildren <QuestDetailTab>();
            m_QuestDetailInfo.tab.m_IsReady = false;
        }

        m_MasterDataAreaCategory = MasterFinder <MasterDataAreaCategory> .Instance.Find((int)MainMenuParam.m_QuestSelectAreaCateID);

        m_MasterDataArea = MasterFinder <MasterDataArea> .Instance.Find((int)MainMenuParam.m_QuestSelectAreaID);

        m_AreaAmendParam = MainMenuUtil.CreateAreaParamAmend(m_MasterDataArea);
        if (MainMenuUtil.IsRenewQuest(m_MasterDataAreaCategory))
        {
            // TODO: MasterDataQuestをコメントアウトする。問題がなければ削除する。
            //m_MasterDataQuest = null;
            m_MasterDataQuest2 = MasterDataUtil.GetQuest2ParamFromID(MainMenuParam.m_QuestSelectMissionID);
            updateQuest2Detail();
        }

        m_bReturnHome = false;

        SetUpAppearAnimation();

        MainMenuManager.Instance.currentCategory = MAINMENU_CATEGORY.QUEST;

#if BUILD_TYPE_DEBUG
        if (DebugOption.Instance.disalbeDebugMenu == false)
        {
            // デバッグ用メニューの生成
            QuestDetailDebugMenu debugMenu = QuestDetailDebugMenu.Create(m_CanvasObj.transform);
            if (debugMenu != null)
            {
                debugMenu.m_QuestDetailBG = m_QuestDetailBG;
                debugMenu.m_InitCharaID   = m_MasterDataQuest2.boss_chara_id;
                debugMenu.SetPositionAjustStatusBar(new Vector2(0, -66), new Vector2(0, -132));
            }
        }
#endif
        StartCoroutine(MainMenuWebViewShowChk.PopupWebViewStart(MainMenuWebViewShowChk.PopupWebViewType.QuestStart, MainMenuParam.m_QuestSelectMissionID));
    }
    /// <summary>
    /// OKボタン選択
    /// </summary>
    /// <param name="data"></param>
    private void OnSelectOk(ChallengeSelect.EventData data)
    {
        var requirement_id = data.questMaster.quest_requirement_id;
        MasterDataQuestRequirement quest_requirement = null;

        if (requirement_id != 0)
        {
            quest_requirement = MasterDataUtil.GetMasterDataQuestRequirementFromID(requirement_id);
        }

        //--------------------------------
        // ユニット所持数が上限超えてるならクエスト不可
        //--------------------------------
        if (UserDataAdmin.Instance.m_StructPlayer.total_unit < UserDataAdmin.Instance.m_StructPlayer.unit_list.Length)
        {
            openDialogUnitOver();

            SoundUtil.PlaySE(SEID.SE_MENU_RET);
        }
        else if (quest_requirement != null &&
                 quest_requirement.limit_rank > UserDataAdmin.Instance.m_StructPlayer.rank)
        {
            //--------------------------------
            // ランク制限でクエストに入れない場合
            //--------------------------------
            openDialogRankLow();

            SoundUtil.PlaySE(SEID.SE_MENU_RET);
        }
        else if (MainMenuParam.m_QuestStamina != 0 &&
                 UserDataAdmin.Instance.m_StructPlayer.stamina_max < MainMenuParam.m_QuestStamina)
        {
            //--------------------------------
            // スタミナのMAX値が足りずクエストに入れない場合
            //--------------------------------
            openDialogStaminaLow();

            SoundUtil.PlaySE(SEID.SE_MENU_RET);
        }
        else if (MainMenuParam.m_QuestTicket != 0 &&
                 MainMenuParam.m_QuestTicket > UserDataAdmin.Instance.m_StructPlayer.have_ticket)
        {
            //--------------------------------
            // チケット対価不足
            //--------------------------------
            openDialogTicketLow();

            SoundUtil.PlaySE(SEID.SE_MENU_RET);
        }
        else if (MainMenuParam.m_QuestStamina != 0 &&
                 UserDataAdmin.Instance.m_StructPlayer.stamina_max >= data.questMaster.consume_value &&
                 MainMenuParam.m_QuestStamina > UserDataAdmin.Instance.m_StructPlayer.stamina_now)
        {
            //--------------------------------
            // スタミナが足りない場合、スタミナ回復ダイアログを表示
            //--------------------------------

            PacketStructUseItem item = useRecoverItem();

            if (item != null)
            {
                openDialogUseItem(item);
            }
            else
            {
                //--------------------------------
                // チップによる回復ルート
                //--------------------------------

                openDialogUseStone();
            }

            SoundUtil.PlaySE(SEID.SE_MENU_RET);
        }
        else
        {
            //--------------------------------
            // 特にエラーなし。次のフローへ
            //--------------------------------
            //成長ボス選択パラメータ設定
            MainMenuParam.SetChallengeSelectParam(data.questMaster.fix_id, data.bSkip, (data.bSkip ? data.SkipLevel : data.info.challenge_level));

            //成長ボスではMainMenuQuestSelectを経由しないのでAreaCategoryIDをここで設定
            MasterDataArea area = MasterDataUtil.GetAreaParamFromID(data.questMaster.area_id);
            MainMenuParam.m_QuestSelectAreaCateID = (area != null ? area.area_cate_id : 0);

            MainMenuParam.m_QuestAreaAmendList   = m_AreaAmendParam.m_AreaMasterDataAmendList;
            MainMenuParam.m_QuestSelectAreaID    = data.questMaster.area_id;
            MainMenuParam.m_QuestSelectMissionID = data.questMaster.fix_id;
            if (MainMenuManager.HasInstance)
            {
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT_FRIEND, false, false);
                SoundUtil.PlaySE(SEID.SE_MENU_OK);
            }
        }
    }
Esempio n. 12
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();
        m_Status = eStatus.NONE;
        m_Start  = false;
        if (DebugOptionInGame.Instance != null)
        {
            if (m_TestGameManager != null)
            {
                if (DebugOptionInGame.Instance.m_QuestIndex < 0)
                {
                    DebugOptionInGame.Instance.m_QuestIndex = 0;
                }
                uint area_id = 0;
                {
                    m_TestGameManager.Quest2_switch = m_Button[1];
                    MasterDataQuest2[] master = null;
                    if (DebugOptionInGame.Instance.m_Quest2fromJson == true)
                    {
                        master = DebugOptionInGame.Instance.masterDataQuest2;
                    }
                    else
                    {
                        master = MasterFinder <MasterDataQuest2> .Instance.GetAll();
                    }
                    if (master != null)
                    {
                        m_TestGameManager.Quest_name = master[DebugOptionInGame.Instance.m_QuestIndex].quest_name;
                        area_id = master[DebugOptionInGame.Instance.m_QuestIndex].area_id;
                        DebugOptionInGame.Instance.inGameDebugDO.m_QuestId = master[DebugOptionInGame.Instance.m_QuestIndex].fix_id;
                    }
                }
                MasterDataArea amaster = MasterFinder <MasterDataArea> .Instance.Find((int)area_id);

                if (amaster != null)
                {
                    m_TestGameManager.Area_name   = amaster.area_name;
                    m_TestGameManager.Area_detail = amaster.area_detail;
                }
                m_Text[0].text = DebugOptionInGame.Instance.m_QuestIndex.ToString();
                m_Text[1].text = DebugOptionInGame.Instance.inGameDebugDO.m_QuestId.ToString();
                if (DebugOptionInGame.Instance.inGameDebugDO.m_Restore == false)
                {
                    m_TestGameManager.Restore_switch = m_Button[0];
                }
                else
                {
                    m_TestGameManager.Restore_switch = m_Button[1];
                }
                if (DebugOptionInGame.Instance.inGameDebugDO.m_UseAPI == false)
                {
                    m_TestGameManager.Api_switch = m_Button[0];
                }
                else
                {
                    m_TestGameManager.Api_switch = m_Button[1];
                }
            }
            DebugOptionInGame.Instance.m_TestMode = true;
        }
        if (LocalSaveManager.Instance.LoadFuncResultVersionCheck() == false)
        {
            LocalSaveManager.Instance.SaveFuncGoesToMenuResult(null);
            LocalSaveManager.Instance.SaveFuncResultVersion();
        }
    }
    //----------------------------------------------------------------------------
    //	@brief		ローカル通知登録
    //----------------------------------------------------------------------------
    private static void RegisterNotification()
    {
        //------------------------------------------------------------------------
        //	ローカル通知の有効無効
        //------------------------------------------------------------------------
        bool enable_notification = false;

        if (LocalSaveManager.Instance == null)
        {
            return;
        }


        LocalSaveOption cOption = LocalSaveManager.Instance.LoadFuncOption();

        enable_notification = (cOption.m_OptionNotification == (int)LocalSaveDefine.OptionNotification.ON);

        if (enable_notification == false)
        {
            return;
        }

        if (TimeManager.Instance == null)
        {
            return;
        }

        //------------------------------------------------------------------------
        //	ローカル通知の登録
        //------------------------------------------------------------------------
        int  delay       = 0;
        bool bSeisekiden = false;

        MasterDataNotification[] notification_param_array = null;
        if (MasterDataUtil.IsMasterDataNotification())
        {
            notification_param_array = MasterDataUtil.GetMasterDataNotification();
        }

        MasterDataNotification notification_param;

        if (notification_param_array.IsNullOrEmpty() == false)
        {
            // パッチテキスト(通知表示しない期間)取得 v360
            string sCancelS = Patcher.Instance.GetLocalNotificationCancelStart();
            string sCancelE = Patcher.Instance.GetLocalNotificationCancelEnd();

            // 通知文言があるやつ
            for (uint i = 0; i < notification_param_array.Length; i++)
            {
                notification_param = notification_param_array[i];
                if (notification_param == null)
                {
                    continue;
                }

                string d = notification_param.timing_start.ToString() + @"00";
                // string f = "yyyyMMddHHmm";
                string   f  = "yyyyMMddHHmm";
                DateTime dt = DateTime.ParseExact(d, f, null);


                TimeSpan ts = dt.Subtract(TimeManager.Instance.m_TimeNow);
                if (ts.TotalSeconds < 0)
                {
                    // 期限を過ぎたデータは消す MasterDataEvent.fix_idと同じ
                    LocalSaveManager.Instance.RemoveFuncNotificationRequest(notification_param.fix_id);

                    continue;
                }

                //プッシュ通知のタイプが設定でOFFになっているなら弾く
                if ((notification_param.notification_type == MasterDataDefineLabel.NotificationType.EVENT ||
                     notification_param.notification_type == MasterDataDefineLabel.NotificationType.CASINO ||
                     notification_param.notification_type == MasterDataDefineLabel.NotificationType.SEISEKIDEN) &&
                    cOption.m_NotificationEvent == (int)LocalSaveDefine.OptionNotificationEvent.OFF)
                {
                    continue;
                }
                if (notification_param.notification_type == MasterDataDefineLabel.NotificationType.SEISEKIDEN)
                {
                    //すでに聖石殿の通知をしていたらその後の聖石殿の通知は弾く
                    if (bSeisekiden == true)
                    {
                        continue;
                    }
                }

                if (sCancelS.IsNOTNullOrEmpty() && sCancelE.IsNOTNullOrEmpty())
                {
                    //イベント開始タイミングがプッシュ通知を表示しない期間内ならはじくv360
                    if (sCancelS.Length == f.Length && sCancelE.Length == f.Length)
                    {
                        //パッチ登録テキストはYYYYMMDDhhmm形式のためそのままdatetimeに変換
                        DateTime dtCancelS = DateTime.ParseExact(sCancelS, f, null);
                        DateTime dtCancelE = DateTime.ParseExact(sCancelE, f, null);
                        if ((dtCancelS != null && dtCancelS <= dt) &&
                            (dtCancelE != null && dtCancelE > dt))
                        {
                            // はじく
                            continue;
                        }
                    }
                }


                delay = (int)ts.TotalSeconds;

                string notification_title = notification_param.notification_title;
                string notification_body  = notification_param.notification_body;

                if (notification_param.type != (int)ServerDataDefine.NOTIFICATION_TYPE.GACHA)
                {
                    // イベント通知フラグをチェックする
                    LocalSaveEventNotification cNotification = LocalSaveManager.Instance.CheckFuncNotificationRequest(notification_param.fix_id);
                    if (cNotification != null)
                    {
                        // データが登録されている場合
                        if (cNotification.m_Push == false)
                        {
                            // 通知しないならそのまま戻る
                            continue;
                        }
                        else
                        {
                            // 通知する場合で、テキストデータが無い場合。
                            // 初期値を入れる
                            if (notification_body == null ||
                                notification_body.Length <= 0)
                            {
                                MasterDataEvent cEventData = MasterDataUtil.GetMasterDataEventFromFixID(cNotification.m_FixID);
                                if (cEventData != null)
                                {
                                    MasterDataArea cAreaData = MasterDataUtil.GetAreaParamFromEventID(cEventData.event_id);
                                    if (cAreaData != null)
                                    {
                                        // 紐づいているエリアを見る
                                        notification_title = GameTextUtil.GetText("LOCAL_NOTIFICATION_REQUEST_TITLE");
                                        notification_body  = string.Format(GameTextUtil.GetText("LOCAL_NOTIFICATION_REQUEST_MESSAGE"), cAreaData.area_name);
                                    }
                                    // 情報が無ければ飛ばさない
                                }
                            }
                        }
                    }
                }
                // テキストデータが存在するものだけ通知に出す
                if (notification_body != null &&
                    notification_body.Length > 0)
                {
                    PQDMLocalNotification.SendNotification(notification_title,
                                                           notification_body,
                                                           delay);
                    if (notification_param.notification_type == MasterDataDefineLabel.NotificationType.SEISEKIDEN)
                    {
                        bSeisekiden = true;
                    }
                }
            }
            // 通知情報を保存する
            LocalSaveManager.Instance.SaveFuncNotificationRequest();
        }

        #region ==== スタミナMAX ====
        PacketStructPlayer cPlayer = UserDataAdmin.Instance.m_StructPlayer;
        // スタミナが減少チェック
        // 通知設定チェック
        if (cPlayer != null &&
            m_StaminaNow < cPlayer.stamina_max &&
            cOption.m_NotificationStaminaMax == (int)LocalSaveDefine.OptionNotificationStaminaMax.ON)
        {
            //----------------------------------------
            // スタミナ回復シミュレート
            // 回復に関連する時間系データを算出
            //----------------------------------------
            DateTime cRecoveryTime   = TimeUtil.ConvertServerTimeToLocalTime(cPlayer.stamina_recover);  // 開始時刻取得
            uint     unRecoveryValue = cPlayer.stamina_max - m_StaminaNow;                              // スタミナ回復量取得

            // 終了時刻算出
            cRecoveryTime = cRecoveryTime.AddSeconds(GlobalDefine.STAMINA_RECOVERY_SEC * unRecoveryValue);

            //----------------------------------------
            // ローカル通知設定
            //----------------------------------------
            TimeSpan ts = cRecoveryTime.Subtract(TimeManager.Instance.m_TimeNow);
            if (ts.TotalSeconds >= 0)
            {
                delay = (int)ts.TotalSeconds;
                PQDMLocalNotification.SendNotification(UnityUtil.GetText("LOCAL_NOTIFICATION_STAMINA_TITLE"),
                                                       UnityUtil.GetText("LOCAL_NOTIFICATION_STAMINA_MESSAGE"),
                                                       delay);
            }
        }
        #endregion
    }
Esempio n. 14
0
    /// <summary>
    /// 表示するイベント情報を取得する
    /// </summary>
    List <EventScheduleInfo> GetEvetntItemList(Category category)
    {
        List <EventScheduleInfo> eventItemList = new List <EventScheduleInfo>();

        MasterDataArea[] areaMasterArray = MasterFinder <MasterDataArea> .Instance.GetAll();

        for (int i = 0; i < areaMasterArray.Length; ++i)
        {
            MasterDataArea cAreaMasterData = areaMasterArray[i];

            // イベント情報取得
            MasterDataEvent cMasterDataEvent = null;
            if (category == Category.Active)
            {
                //開催中ページの場合、有効なイベント情報取得
                cMasterDataEvent = MasterDataUtil.GetMasterDataEventFromID(cAreaMasterData.event_id);
            }
            else
            {
                //開催予定ページの場合、開始日が未来日のイベント情報取得
                cMasterDataEvent = MasterDataUtil.GetMasterDataFurtureEventFromID(cAreaMasterData.event_id);
            }

            //--------------------------------
            //表示対象かをチェック
            //--------------------------------
            if (cMasterDataEvent == null)
            {
                continue;
            }

            uint unFixID       = 0;
            uint unTimingStart = 0;
            uint unTimingEnd   = 0;
            MasterDataDefineLabel.BoolType unScheduleShow = MasterDataDefineLabel.BoolType.NONE;

            //--------------------------------
            // 期間指定タイプによる分岐
            // @add Developer 2016/07/29 v360
            //--------------------------------
            switch (cMasterDataEvent.period_type)
            {
            // 指定(従来通り)
            default:
            case MasterDataDefineLabel.PeriodType.DESIGNATION:
                unFixID        = cMasterDataEvent.fix_id;
                unTimingStart  = cMasterDataEvent.timing_start;
                unTimingEnd    = cMasterDataEvent.timing_end;
                unScheduleShow = cMasterDataEvent.event_schedule_show;
                break;

            // サイクル
            case MasterDataDefineLabel.PeriodType.CYCLE:
                if (TimeEventManager.Instance == null)
                {
                    continue;
                }

                // エリアの表示期間のカウントダウンを算出
                CycleParam cCycleParam;
                if (category == Category.Active)
                {
                    cCycleParam = TimeEventManager.Instance.GetEventCycleParam(cMasterDataEvent.event_id);
                }
                else
                {
                    cCycleParam = TimeEventManager.Instance.GetEventCycleFurtureParam(cMasterDataEvent.event_id);
                }
                if (cCycleParam == null)
                {
                    continue;
                }

                unFixID        = cCycleParam.fixID;
                unTimingStart  = cCycleParam.timingStart;
                unTimingEnd    = cCycleParam.timingEnd;
                unScheduleShow = cCycleParam.schedule;
                break;
            }
            if (unScheduleShow != MasterDataDefineLabel.BoolType.ENABLE)
            {
                continue;
            }

            // 開催中ページの場合
            if (category == Category.Active)
            {
                //--------------------------------
                // イベント期間判定
                //--------------------------------
                bool bCheckWithinTime = TimeManager.Instance.CheckWithinTime(unTimingStart, unTimingEnd);
                if (bCheckWithinTime == false)
                {
                    continue;
                }
            }
            // 開催予定ページの場合開始時間が現在日の次の日までを表示する
            else if (category == Category.Furture)
            {
                // 時間を考慮しない開始日を取得
                int      nYear         = TimeUtil.GetDateTimeToYear(unTimingStart);
                int      nMonth        = TimeUtil.GetDateTimeToMonth(unTimingStart);
                int      nDay          = TimeUtil.GetDateTimeToDay(unTimingStart);
                DateTime cTimeStartDay = new DateTime(nYear, nMonth, nDay, 0, 0, 0);

                // 時間を考慮しない現在日を取得
                DateTime cTmpTimeNow = TimeManager.Instance.m_TimeNow;
                DateTime cTimeNowDay = new DateTime(cTmpTimeNow.Year, cTmpTimeNow.Month, cTmpTimeNow.Day, 0, 0, 0);
                // 現在日から開催日までのTimeSpanを取得
                TimeSpan timeSpan = cTimeStartDay - cTimeNowDay;
                // 開催日まで一日よりある場合は登録しない
                if (timeSpan.Days > 1)
                {
                    continue;
                }
            }

            EventScheduleInfo cEventScheduleInfo = new EventScheduleInfo();
            //--------------------------------
            // マスターの情報をそのまま使うと、
            // サイクルなどの処理で困るため、一部改変してスケジュールのマスタとする
            //--------------------------------
            cEventScheduleInfo.m_MasterDataEvent                     = new MasterDataEvent();
            cEventScheduleInfo.m_MasterDataEvent.fix_id              = unFixID;
            cEventScheduleInfo.m_MasterDataEvent.active              = cMasterDataEvent.active;
            cEventScheduleInfo.m_MasterDataEvent.period_type         = cMasterDataEvent.period_type;
            cEventScheduleInfo.m_MasterDataEvent.cycle_date_type     = cMasterDataEvent.cycle_date_type;
            cEventScheduleInfo.m_MasterDataEvent.cycle_timing_start  = cMasterDataEvent.cycle_timing_start;
            cEventScheduleInfo.m_MasterDataEvent.cycle_active_hour   = cMasterDataEvent.cycle_active_hour;
            cEventScheduleInfo.m_MasterDataEvent.timing_start        = unTimingStart;
            cEventScheduleInfo.m_MasterDataEvent.timing_end          = unTimingEnd;
            cEventScheduleInfo.m_MasterDataEvent.user_group          = cMasterDataEvent.user_group;
            cEventScheduleInfo.m_MasterDataEvent.event_id            = cMasterDataEvent.event_id;
            cEventScheduleInfo.m_MasterDataEvent.event_schedule_show = unScheduleShow;
            cEventScheduleInfo.m_MasterDataEvent.area_id             = (int)cAreaMasterData.fix_id;
            cEventScheduleInfo.m_AreaName = cAreaMasterData.area_name;
            cEventScheduleInfo.m_AreaUrl  = cAreaMasterData.area_url;

            //リストに追加
            eventItemList.Add(cEventScheduleInfo);
        }

        return(eventItemList);
    }
Esempio n. 15
0
        private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e)
        {
            MasterDataArea abc = new MasterDataArea();
            abc.TopLevel = false;

            abc.MdiParent = this;
            abc.Show();
        }