public override async Task <bool> OnExecute()
        {
            if (!HarvestField.CanExecuteSpecial)
            {
                return(await UprootVine.OnExecute());
            }
            if (!UprootVine.CanExecuteSpecial)
            {
                return(await HarvestField.OnExecute());
            }

            var selectedOption =
                await
                PlayerSelection.Select("Select action", "Choose to harvest 1 field or uproot 1 vine",
                                       "harvest 1 field", "uproot 1 vine");

            if (selectedOption == Selection.None)
            {
                return(false);
            }
            if (selectedOption == Selection.Option1)
            {
                return(await HarvestField.OnExecute());
            }
            return(await UprootVine.OnExecute());
        }
        protected override async Task <bool> ApplyOption1(IGameState gameState)
        {
            var selection = await PlayerSelection.Select("Select grape color",
                                                         "Choose which 1 value grape you want to put on your crushpad", "Red", "White");

            var grapeColor = selection == Selection.Option1 ? GrapeColor.Red : GrapeColor.White;

            gameState.Grapes.First(p => p.GrapeColor == grapeColor && p.Value == 1).IsBought = true;
            return(true);
        }
        protected override async Task <bool> ApplyOption2(IGameState gameState)
        {
            var selectedWine =
                await
                PlayerSelection.Select("Select wine", "Choose which wine to discard",
                                       gameState.Wines.Where(p => p.IsBought));

            if (selectedWine == null)
            {
                return(false);
            }
            return(await SelectCardsToDiscard(gameState, 3));
        }
        protected override async Task <bool> OnApply(IGameState gameState)
        {
            var selectedBenefit =
                await PlayerSelection.Select("Select benefit", "Choose the spring benefit you want to take", Benefits);

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

            selectedBenefit.OnApply(gameState);
            return(true);
        }
        protected override async Task <bool> ApplyOption2(IGameState gameState)
        {
            var selectedWine = await PlayerSelection.Select("Select wine", "Select wine to discard",
                                                            gameState.Wines.Where(p => p.Value >= 7 && p.IsBought));

            if (selectedWine == null)
            {
                return(false);
            }
            selectedWine.IsBought    = false;
            gameState.VictoryPoints += 4;
            return(true);
        }
Exemple #6
0
        protected override async Task <bool> ApplyOption2(IGameState gameState)
        {
            var selectedStructure =
                await
                PlayerSelection.Select("Select structure", "Choose a structure to build",
                                       gameState.Structures.Where(p => !p.IsBought));

            if (selectedStructure == null)
            {
                return(false);
            }
            selectedStructure.IsBought = true;
            return(true);
        }
Exemple #7
0
        protected override async Task <bool> OnApply(IGameState gameState)
        {
            var selectedAction =
                await
                PlayerSelection.Select("Select action", "Choose a summer action to execute",
                                       Actions.OfType <ISummerAction>().OfType <PlayerAction>());

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

            return(await selectedAction.OnExecute());
        }
        protected override async Task <bool> ApplyOption2(IGameState gameState)
        {
            var selectedGrape =
                await
                PlayerSelection.Select("Select grape", "Choose 1 grap to discard",
                                       gameState.Grapes.Where(p => p.IsBought));

            if (selectedGrape == null)
            {
                return(false);
            }
            selectedGrape.IsBought = false;
            gameState.Money       += 2;
            gameState.VictoryPoints++;
            return(true);
        }
        protected override async Task <bool> ApplyOption2(IGameState gameState)
        {
            var selectedWine =
                await
                PlayerSelection.Select("Select wine", "Choose a wine to discard",
                                       gameState.Wines.Where(p => p.IsBought));

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

            selectedWine.IsBought    = false;
            gameState.ResidualMoney += 2;
            return(true);
        }
        protected override async Task <bool> OnApply(IGameState gameState)
        {
            var building = await PlayerSelection.Select("Select structure", "Choose a structure you want to build",
                                                        gameState.Structures.Where(p => !p.IsBought && p.Cost - 2 <= gameState.Money));

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

            building.IsBought = true;
            gameState.Money  -= building.Cost - 2;
            if (building.Cost >= 5)
            {
                gameState.VictoryPoints++;
            }
            return(true);
        }
Exemple #11
0
        private async Task <bool> HarvestField()
        {
            var selectedField =
                await
                PlayerSelection.Select("Select field", "Choose a field to harvest",
                                       GameState.Fields.Where(p => p.IsBought && p.Vines.Any() && !p.HasBeenUsed));

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

            selectedField.HasBeenUsed = true;
            AddToCrushpad(selectedField.RedVines, GameState.RedGrapes);
            AddToCrushpad(selectedField.WhiteVines, GameState.WhiteGrapes);

            return(true);
        }
Exemple #12
0
        protected override async Task <bool> OnApply(IGameState gameState)
        {
            var selectedAction =
                await
                PlayerSelection.Select("Select action", "Choose which action you want to plan for.",
                                       AllActions.OfType <IWinterAction>().Cast <PlayerAction>());

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

            var worker = gameState.GetFirstAvailableWorker();

            worker.HasBeenUsed   = true;
            worker.PlannedAction = selectedAction;
            return(true);
        }
Exemple #13
0
        protected override async Task <bool> OnApply(IGameState gameState)
        {
            var selectedWine =
                await
                PlayerSelection.Select("Select wine", "Choose 1 wine to discard",
                                       gameState.Wines.Where(p => p.IsBought));

            if (selectedWine == null)
            {
                return(false);
            }
            selectedWine.IsBought = false;
            gameState.Money      += 4;
            if (gameState.Wines.All(p => p.IsBought && p.Value < selectedWine.Value))
            {
                gameState.VictoryPoints += 2;
            }
            return(true);
        }
        protected override async Task <bool> ApplyOption2(IGameState gameState)
        {
            var selectedWine = await PlayerSelection.Select("Select wine", "Choose 1 wine to age", gameState.Wines);

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

            var nextLevelWine =
                gameState.Wines.FirstOrDefault(p => p.Value == selectedWine.Value + 1 && p.Type == selectedWine.Type);

            if (nextLevelWine == null || nextLevelWine.IsBought)
            {
                return(false);
            }

            selectedWine.IsBought  = false;
            nextLevelWine.IsBought = true;

            return(await FillOrder.OnExecute());
        }
        public override async Task <bool> OnExecute()
        {
            var selectedField = await PlayerSelection.Select("Select field", "Select field to uproot",
                                                             GameState.Fields.Where(p => p.Vines.Any()));

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

            var selectedVine = await PlayerSelection.Select("Select vine", "Select vine to uproot", selectedField.Vines);

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

            GameState.Hand.AddCard(selectedVine);
            selectedField.UprootVine(selectedVine);

            return(true);
        }