Ejemplo n.º 1
0
        /// <summary>
        /// Get the SubsceneState in AdventureScene
        /// </summary>
        /// <returns>The RockPegasusSubsceneState.</returns>
        private RockPegasusSubsceneState GetPegasusAdventureSubsceneState()
        {
            if (AdventureConfig.Get() == null)
            {
                return(RockPegasusSubsceneState.None);
            }

            AdventureSubScenes currentSubScene = AdventureConfig.Get().GetCurrentSubScene();

            if (currentSubScene == AdventureSubScenes.Chooser)
            {
                return(RockPegasusSubsceneState.WaitForChooseMode);
            }

            if (currentSubScene == AdventureSubScenes.Practice)
            {
                if (PracticePickerTrayDisplay.Get().IsShown() == false)
                {
                    return(RockPegasusSubsceneState.WaitForChooseDeck);
                }

                if (GetPrivateField <PracticeAIButton>(PracticePickerTrayDisplay.Get(), "m_selectedPracticeAIButton") == null)
                {
                    return(RockPegasusSubsceneState.WaitForChooseOpponent);
                }
                else
                {
                    return(RockPegasusSubsceneState.Ready);
                }
            }

            return(RockPegasusSubsceneState.None);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Config deck for a game.
        /// </summary>
        /// <param name="index">The index of deck.</param>
        public void ConfigDeck(int index)
        {
            AdventureSubScenes currentSubScene = AdventureConfig.Get().GetCurrentSubScene();

            if (currentSubScene == AdventureSubScenes.Practice)
            {
                PracticePickerTrayDisplay.Get().Show();
            }
        }
 public void ChangeSubScene(AdventureSubScenes subscene)
 {
     if (subscene == this.m_CurrentSubScene)
     {
         Debug.Log(string.Format("Sub scene {0} is already set.", subscene));
     }
     else
     {
         this.m_LastSubScenes.Push(this.m_CurrentSubScene);
         this.m_CurrentSubScene = subscene;
         this.FireSubSceneChangeEvent(true);
         this.FireAdventureModeChangeEvent();
     }
 }
    public static AdventureSubScenes GetSubSceneFromMode(AdventureDbId adventureId, AdventureModeDbId modeId)
    {
        AdventureSubScenes chooser = AdventureSubScenes.Chooser;
        int    num  = (int)adventureId;
        int    num2 = (int)modeId;
        string key  = GameUtils.GetAdventureDataRecord(num, num2).GetString("SUBSCENE_PREFAB");

        if (key != null)
        {
            int num3;
            if (< > f__switch$map31 == null)
            {
                Dictionary <string, int> dictionary = new Dictionary <string, int>(3);
                dictionary.Add("Assets/Game/UIScreens/AdventurePractice", 0);
                dictionary.Add("Assets/Game/UIScreens/AdventureMissionDisplay", 1);
                dictionary.Add("Assets/Game/UIScreens/AdventureClassChallenge", 2);
 public void ChangeToLastSubScene(bool fireevent = true)
 {
     if (this.m_LastSubScenes.Count == 0)
     {
         Debug.Log("No last sub scenes were loaded.");
     }
     else
     {
         this.m_CurrentSubScene = this.m_LastSubScenes.Pop();
         if (fireevent)
         {
             this.FireSubSceneChangeEvent(false);
         }
         this.FireAdventureModeChangeEvent();
     }
 }
 public void OnSubsceneChanged(AdventureSubScenes newscene, bool forward)
 {
     object[] objArray1 = new object[] { newscene, forward };
     base.method_8("OnSubsceneChanged", objArray1);
 }
Ejemplo n.º 7
0
 public void LoadSubScene(AdventureSubScenes subscene)
 {
     Class272.Enum20[] enumArray1 = new Class272.Enum20[] { Class272.Enum20.ValueType };
     object[]          objArray1  = new object[] { subscene };
     base.method_9("LoadSubScene", enumArray1, objArray1);
 }
Ejemplo n.º 8
0
        private void OnRockPraticeMode(bool expert)
        {
            if (SingletonOnGameRequest)
            {
                return;
            }
            SingletonOnGameRequest = true;

            if (SceneMgr.Get().IsInGame())
            {
                HoldBack(1000);
                return;
            }
            if (DeckPickerTrayDisplay.Get() == null)
            {
                HoldBack(1000);
                Log("DeckPickerTrayDisplay.Get() NULL");
                SingletonOnGameRequest = false;
                AdventureDbId     adventureId = Options.Get().GetEnum <AdventureDbId>(Option.SELECTED_ADVENTURE, AdventureDbId.PRACTICE);
                AdventureModeDbId modeId      = Options.Get().GetEnum <AdventureModeDbId>(Option.SELECTED_ADVENTURE_MODE, AdventureModeDbId.NORMAL);
                if (expert)
                {
                    modeId = Options.Get().GetEnum <AdventureModeDbId>(Option.SELECTED_ADVENTURE_MODE, AdventureModeDbId.EXPERT);
                }
                Log("AdventureConfig.Get().GetSelectedMode " + AdventureConfig.Get().GetSelectedMode());

                if (AdventureConfig.Get().CanPlayMode(adventureId, modeId))
                {
                    AdventureConfig.Get().SetSelectedAdventureMode(adventureId, modeId);
                    AdventureConfig.Get().ChangeSubSceneToSelectedAdventure();
                }
                else
                {
                    Log("AdventureConfig.Get().CanPlayMode FALSE");
                }

                return;
            }
            long deck = DeckPickerTrayDisplay.Get().GetSelectedDeckID();

            if (deck == 0)
            {
                HoldBack(1000);
                Log("DeckPickerTrayDisplay.Get() 0");
                SingletonOnGameRequest = false;
                return;
            }


            AdventureSubScenes currentSubScene = AdventureConfig.Get().GetCurrentSubScene();

            if (currentSubScene == AdventureSubScenes.Practice)
            {
                PracticePickerTrayDisplay.Get().Show();
                HoldBack(3000);
            }
            //       if (currentSubScene == AdventureSubScenes.MissionDeckPicker)
            //       {
            //           GameMgr.Get().FindGame(GameType.GT_VS_AI, formatType, (int)adventureConfig.GetMission(), selectedDeckID3, 0L);
            //       }


            HoldBack(5000);
            ScenarioDbId mission = HearthrockUtils.RandomPracticeMission();


            Notify("Mulligan");

            GameMgr.Get().FindGame(PegasusShared.GameType.GT_VS_AI, FormatType.FT_STANDARD, (int)mission, deck, 0L);
        }
Ejemplo n.º 9
0
 private void OnSubsceneChanged(AdventureSubScenes newscene, bool forward)
 {
     this.m_slidingTray.ToggleTraySlider(false, null, true);
 }