示例#1
0
        public void DoHint(bool verified = false)
        {
            Game.Tutorial.FinishPiece(TutorialSystem.TutorialPiece.Hint2);
            Game.Tutorial.FinishPiece(TutorialSystem.TutorialPiece.Hint1);

            if (m_Hint == null)
            {
                if (NetworkManager.Net.HardCurrency < 2)
                {
                    m_MessageBox = new MessageBox("You don't have enough coins for a hint (2)", MessageBoxButtons.BuyCoinsCancel, (int)MessageBoxContext.InsufficientFunds_Hint, Game.ScreenWidth, Game.ScreenHeight);
                }
                else if (m_bVerifyHintPurchase && !verified)
                {
                    m_MessageBox = new MessageBox("Would you like to spend 2 coins for a hint?", MessageBoxButtons.YesNo, (int)MessageBoxContext.InsufficientFunds_Hint, Game.ScreenWidth, Game.ScreenHeight, "Don't ask again");
                }
                else
                {
                    // Subtract the coins
                    NetworkManager.Net.SpendCoins(2, 1);

                    // Show the hint
                    List<Clue> visibleClues = new List<Clue>();
                    visibleClues.AddRange(m_HorizontalCluePanel.Clues);
                    visibleClues.AddRange(m_VerticalCluePanel.Clues);
                    m_Hint = m_Puzzle.GenerateHint(visibleClues.ToArray());

                    // Modify the count
                    m_iHintCount++;
                    int maxHints = NetworkManager.Net.VipData.Hints;
                    m_ButtonPanel.SetHintCount(maxHints - m_iHintCount, maxHints);

                    SavePuzzle();

                    // Play the sound
                    // m_SoundManager.PlayGameHint();
                }
            }
        }
示例#2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if( Game.CurrentScene != this )
                return;

            m_ButtonPanel.SetCoins(NetworkManager.Net.HardCurrency);
            if (m_Hint != null)
            {
                if( m_Hint.ShouldHide(m_Puzzle) )
                    m_Hint = null;
            }

            if (m_Puzzle.IsCompleted())
            {
                DoEndScreenUpdate(gameTime);
            }
        }
示例#3
0
        public Hint GenerateHint(Clue[] VisibleClues)
        {
            Hint hRet = null;

            // Pick a clue that we could use for a hint
            for (int i = 0; i < VisibleClues.Length; i++)
            {
                SetMarker();
                if (VisibleClues[i] != null)
                {
                    int iUseCount = VisibleClues[i].m_iUseCount;
                    VisibleClues[i].Analyze(this);
                    RestoreMarker();

                    if (VisibleClues[i].m_iUseCount > iUseCount)
                    {
                        // This clue can do something, use it for the hint
                        hRet = new Hint();
                        if (!hRet.Init(this, VisibleClues[i]))
                        {
                            continue;
                        }
                        break;
                    }
                }
            }

            return hRet;
        }