예제 #1
0
        public async Task <bool> InteractWithDisplay()
        {
            Point lookingAt = PlayerLookingAt;

            Exhibit ex = ExhibitAt(lookingAt.X, lookingAt.Y);

            if (ex == null)
            {
                return(false);
            }

            RenderState.DrawCloseup = true;
            RenderState.Closeup     = ex;
            RenderState.DrawStatic  = ex.StaticBeforeCoin;

            await TextArea.PrintLine(ex.IntroductionText);

            await TextArea.PrintLine();

            await TextArea.PrintLineCentered(ex.LongName + " ", ex.TitleColor);

            if (ex.IsClosed)
            {
                await TextArea.PrintLineCentered(" - Exhibit closed - ", ex.TitleColor);

                await TextArea.PrintLine();

                await GameControl.WaitForKey();

                return(true);
            }

            await TextArea.PrintLineCentered(ex.InsertCoinText + " ", ex.TitleColor);

            await TextArea.PrintLine();

            await GameControl.WaitForKey();

            if (ex.RequiresCoin == false)
            {
                RenderState.DrawStatic = false;
                await RunExhibit(ex);
            }
            else
            {
                if (ex.HasBeenVisited == false)
                {
                    await TextArea.PrintLine("You haven't used this exhibit.");
                }
                else
                {
                    await TextArea.PrintLine();
                }

                if (Options.DisableExhibitsRequireCoins == false && ex.PlayerHasCoin == false)
                {
                    await NeedsCoinMessage(ex);

                    await GameControl.WaitAsync(500);

                    return(true);
                }
                else
                {
                    await TextArea.PrintLine(ex.UseCoinMessage);

                    await TextArea.PrintLine();

                    int choice = await QuickMenu.QuickMenu(new MenuItemList("Yes", "no"), 3);

                    if (choice == 1)
                    {
                        return(true);
                    }

                    if (Options.DisableExhibitsRequireCoins == false)
                    {
                        ex.UseCoin();
                    }

                    RenderState.DrawStatic = false;
                    await RunExhibit(ex);
                }
            }

            return(true);
        }