Beispiel #1
0
        private void TryToRest(GameSystem game)
        {
            game.PopView();
            string msg;

            if (game.Player.Inventory.Gold < Cost)
            {
                msg = "You do not have that much gold!";
            }
            else
            {
                game.Player.Inventory.Gold -= Cost;
                game.Player.Damageable.Heal(HealAmount);
                msg = "You feel rested!";
            }
            game.PushView(new ViewMessageInfo(game, game.Renderer, msg, () => { }));
        }
Beispiel #2
0
        public void Interact(GameSystem game)
        {
            var options = new List <MenuOption>();

            options.Add(new MenuOption
            {
                Text     = "Yes",
                Callback = () => TryToRest(game)
            });
            options.Add(new MenuOption
            {
                Text     = "No",
                Callback = () => game.PopView()
            });

            var view = new ViewMessage(game, game.Renderer, $"Do you want to rest? ({Cost} gold)", options);

            game.PushView(view);
        }