Exemplo n.º 1
0
        private void AntiblockCardSelected()
        {
            ListBoxItems.Show();
            ButtonUseCard.Show();
            ButtonDiscardCard.Show();

            PlayerSet myPlayer = Game.Players.Where(player => player.Name == Game.Player.Name).First();

            if (myPlayer.Blocks.HasValue)
            {
                if (Game.Player.SelectedCard.BlockType.Value.HasFlag(BlockType.Cart))
                {
                    if (myPlayer.Blocks.Value.HasFlag(BlockType.Cart))
                    {
                        ListBoxItems.Items.Add(BlockType.Cart);
                    }
                }
                if (Game.Player.SelectedCard.BlockType.Value.HasFlag(BlockType.Lantern))
                {
                    if (myPlayer.Blocks.Value.HasFlag(BlockType.Lantern))
                    {
                        ListBoxItems.Items.Add(BlockType.Lantern);
                    }
                }
                if (Game.Player.SelectedCard.BlockType.Value.HasFlag(BlockType.Pickaxe))
                {
                    if (myPlayer.Blocks.Value.HasFlag(BlockType.Pickaxe))
                    {
                        ListBoxItems.Items.Add(BlockType.Pickaxe);
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void HideControls()
 {
     PictureBoxPathPos1.Hide();
     PictureBoxPathPos2.Hide();
     ListBoxItems.Items.Clear();
     ListBoxItems.Hide();
     ButtonUseCard.Hide();
     ButtonDiscardCard.Hide();
     ButtonEndTurn.Hide();
     LabelGoalCard.Text = "";
 }
Exemplo n.º 3
0
        private void BlockCardSelected()
        {
            ListBoxItems.Show();
            ButtonUseCard.Show();
            ButtonDiscardCard.Show();

            PlayerSet[] players = Game.Players.Where(player => player.Name != "Field" &&
                                                     player.Name != "Deck" &&
                                                     player.Name != "Graveyard" &&
                                                     player.Name != Game.Player.Name &&
                                                     !player.Blocks.Value.HasFlag(Game.Player.SelectedCard.BlockType)).ToArray();
            ListBoxItems.Items.AddRange(players);
        }
Exemplo n.º 4
0
        private void PathCardSelected()
        {
            PictureBoxPathPos1.Show();
            PictureBoxPathPos2.Show();
            ButtonDiscardCard.Show();

            Game.Player.SelectedCard.IsPathUpside = false;
            PictureBoxPathPos1.Image = new Bitmap(CardSpriteGenerator.GetApropriateSprite(Game.Player.SelectedCard), new Size(85, 111));
            CardSet flipedCard = new CardSet();

            flipedCard.Path          = Game.Player.SelectedCard.Path;
            flipedCard.PathOpenings  = Game.Player.SelectedCard.PathOpenings;
            flipedCard.Type          = CardType.Path;
            flipedCard.IsPathUpside  = true;
            PictureBoxPathPos2.Image = new Bitmap(CardSpriteGenerator.GetApropriateSprite(flipedCard), new Size(85, 111));
        }
Exemplo n.º 5
0
        private void TileSelectMap(object sender)
        {
            CardSet[] goalCards = Game.Cards.Where(card => card.Type == CardType.GoalPath).ToArray();

            for (int i = 0; i < goalCards.Count(); i++)
            {
                if (fieldTiles[(int)goalCards[i].FieldCol - 1, (int)goalCards[i].FieldRow - 1] == sender)
                {
                    if (goalCards[i].Path == (Direction.Down | Direction.Left | Direction.Right | Direction.Up))
                    {
                        LabelGoalCard.Text = "Gold";
                    }
                    else
                    {
                        LabelGoalCard.Text = "Coal";
                    }
                    HideHand();
                    Game.DiscardCard(Game.Player.SelectedCard);
                    ButtonEndTurn.Show();
                    ButtonDiscardCard.Hide();
                    break;
                }
            }
        }
Exemplo n.º 6
0
 private void RemovePathCardSelect()
 {
     ButtonDiscardCard.Show();
 }
Exemplo n.º 7
0
 private void MapCardSelect()
 {
     ButtonDiscardCard.Show();
 }