Esempio n. 1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (buttonFont != null)
         {
             buttonFont.Dispose();
             buttonFont = null;
         }
         if (passButton != null)
         {
             passButton.Dispose();
             passButton = null;
         }
         if (passDot != null)
         {
             passDot.Dispose();
             passDot = null;
         }
         if (surf != null)
         {
             surf.Dispose();
             surf = null;
         }
         if (drawer != null)
         {
             drawer.Dispose();
             drawer = null;
         }
     }
 }
Esempio n. 2
0
    public static void spawnPlayerSpells(Player p, string name)
    {
        CardDrawer.spellsList.Clear();
        counter = 0;
        int temp = 0;
        int help = 0;

        //////////////
        //Debug.Log(p.getSpells().Count);
        foreach (Card c in p.getSpells())
        {
            if (temp > 3)
            {
                if (help == 0)
                {
                    counter = 0;
                    help    = 1;
                }
                CardDrawer.spawnCard(c.getName(), name, counter, 220);
            }
            else
            {
                CardDrawer.spawnCard(c.getName(), name, counter, 0);
            }
            counter += 200;
            temp++;
        }
        //////////////
    }
Esempio n. 3
0
        /* Constructor */
        internal GraphicsEngine(SurfaceControl surfaceControl)
        {
            surf     = Video.CreateRgbSurface(surfaceControl.Width, surfaceControl.Height, 32, 0, 0, 0, 0, true);
            userHand = new List <Rectangle>();

            LoadImages();

            drawer = new CardDrawer();
        }
Esempio n. 4
0
        /* Constructor */
        internal GraphicsEngine(SurfaceControl surfaceControl)
        {
            surf = Video.CreateRgbSurface(surfaceControl.Width, surfaceControl.Height, 32, 0, 0, 0, 0, true);
            LoadImages();
            drawer = new CardDrawer();

            particles = new ParticleSystem();
            particles.Manipulators.Add(new ParticleBoundary(surf.Size));
        }
Esempio n. 5
0
 public void toggleRewardPanel(Player player)
 {
     _subPanel_Reward_Opened = !_subPanel_Reward_Opened;
     setSubPanelVisibility(subPanel_Reward, _subPanel_Reward_Opened);
     if (_subPanel_Spell_Opened == true)
     {
         CardDrawer.spawnPlayerItems(player, "PanelWyboruNagrody");
     }
     else
     {
         clearPlayerPanelView(CardDrawer.itemsList);
     }
 }
Esempio n. 6
0
 public void toggleSpellPanel(Player player)
 {
     _subPanel_Spell_Opened = !_subPanel_Spell_Opened;
     setSubPanelVisibility(subPanel_Spell, _subPanel_Spell_Opened);
     if (_subPanel_Spell_Opened == true)
     {
         var sl = GameObject.Find("PanelZaklecWalki").GetComponent <SpellListener>();
         sl.text.text = "";
         CardDrawer.spawnPlayerSpells(player, "PanelZaklecWalki");
         sl.text.text = "Panel zaklęć gracza: " + player.name;
     }
     else
     {
         clearPlayerPanelView(CardDrawer.spellsListCombat);
     }
 }
Esempio n. 7
0
    public static void spawnPlayerItems(Player p, string name)
    {
        CardDrawer.itemsList.Clear();
        counter = 0;
        int temp = 0;
        int help = 0;
        var q    = GameObject.Find("PanelEkwipunku").GetComponent <ItemsListener>();

        if (p.weapon == null)
        {
            q.bron.text = "Założona broń: \n";
        }
        else
        {
            q.bron.text = "Założona broń: \n" + p.weapon.getName();
        }
        if (p.armor == null)
        {
            q.zbroja.text = "Założony pancerz: \n";
        }
        else
        {
            q.zbroja.text = "Założony pancerz: \n" + p.armor.getName();
        }

        //////////////
        foreach (Card c in p.getItems())
        {
            if (temp > 3)
            {
                if (help == 0)
                {
                    counter = 0;
                    help    = 1;
                }
                CardDrawer.spawnCard(c.getName(), name, counter, 240);
            }
            else
            {
                CardDrawer.spawnCard(c.getName(), name, counter, 0);
            }
            counter += 150;
            temp++;
        }
        //////////////
    }
Esempio n. 8
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (surf != null)
         {
             surf.Dispose();
             surf = null;
         }
         if (cellBackground != null)
         {
             cellBackground.Dispose();
             cellBackground = null;
         }
         if (font != null)
         {
             font.Dispose();
             font = null;
         }
         if (Font != null)
         {
             Font.Dispose();
             Font = null;
         }
         if (KingLeft != null)
         {
             KingLeft.Dispose();
             KingLeft = null;
         }
         if (KingRight != null)
         {
             KingRight.Dispose();
             KingRight = null;
         }
         if (KingSmile != null)
         {
             KingSmile.Dispose();
             KingSmile = null;
         }
         if (drawer != null)
         {
             drawer.Dispose();
             drawer = null;
         }
     }
 }
Esempio n. 9
0
 void DrawCard(PointerEventData obj) => CardDrawer.DrawCard();
Esempio n. 10
0
 private void DrawCard(PointerEventData obj)
 {
     CardDrawer.DrawCard();
 }
Esempio n. 11
0
    public void iterate_cards()
    {
        var g1      = GameObject.Find("SpecialEvents").GetComponent <SpecialFields>();
        int size    = this.cardsToIterate.Count;
        int current = 0;


        while (current != size)
        {
            card_type et = cardsToIterate[current].getCard_Type();
            {
                switch (et)
                {
                case card_type.BOARDFIELD:
                    GameObject.Find("Tile").GetComponent <TalismanBoardScript>().HelperTextBox.GetComponent <Text>().text = "Wydarzenie specjalne!\nRzuć kością i przekonaj się co się stało!";
                    if (cardsToIterate[current].getName().Equals("Gospoda"))
                    {
                        g1.SetGospodaOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Cmentarz"))
                    {
                        g1.SetCmentarzOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Kaplica"))
                    {
                        g1.SetKaplicaOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Arena"))
                    {
                        g1.SetArenaOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Las"))
                    {
                        g1.SetLasOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Czarodziejka"))
                    {
                        g1.SetCzarodziejkaOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Strażnik"))
                    {
                        g1.SetStraznikOn();
                    }
                    //
                    else if (cardsToIterate[current].getName().Equals("Wieża wampira"))
                    {
                        g1.SetWiezaWampiraOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Wieża w Dolinie"))
                    {
                        g1.SetWiezaWDolinieOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Przepaść"))
                    {
                        g1.SetPrzepascOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Śmierć"))
                    {
                        g1.SetSmiercOn();
                    }
                    //
                    else if (cardsToIterate[current].getName().Equals("Sklep"))
                    {
                        shopCanvas.gameObject.SetActive(true);
                        var go = GameObject.Find("ContentB").GetComponent <ShopScrollList>();
                        go.startShop();
                    }
                    else if (cardsToIterate[current].getName().Equals("Strażnik"))
                    {
                        g1.SetStraznikOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Przepaść"))
                    {
                        g1.SetPrzepascOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Krypta"))
                    {
                        g1.SetKryptaOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Kopalnia"))
                    {
                        g1.SetKopalniaOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Tajemne Wrota"))
                    {
                        g1.SetTajemneWrotaOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Czarny Rycerz"))
                    {
                        g1.SetRycerzOn();
                    }
                    else if (cardsToIterate[current].getName().Equals("Zamek"))
                    {
                        g1.SetZamekOn();
                    }
                    break;

                case card_type.ENEMY:
                    GameObject.Find("Tile").GetComponent <TalismanBoardScript>().HelperTextBox.GetComponent <Text>().text = "Spotkałeś na swojej drodze przeciwnika! Możesz walczyć lub próbować ucieczki.";
                    combat.StartCombat(this, cardsToIterate[current]);
                    break;

                case card_type.SPELL:
                    GameObject.Find("Tile").GetComponent <TalismanBoardScript>().HelperTextBox.GetComponent <Text>().text = "Zdobyłeś zaklęcie. Pew! Pew!";
                    CardDrawer.spawnMessage(cardsToIterate[current]);
                    this.getSpells().Add(cardsToIterate[current]);
                    break;

                case card_type.ITEM:
                    GameObject.Find("Tile").GetComponent <TalismanBoardScript>().HelperTextBox.GetComponent <Text>().text = "Zdobyłeś nowy przedmiot!\nMożesz go wykorzystać w panelu EQ!";
                    if (this.getItems().Count < 8)
                    {
                        CardDrawer.spawnMessage(cardsToIterate[current]);
                        this.getItems().Add(cardsToIterate[current]);
                    }
                    else
                    {
                        var go = GameObject.Find("Tile").GetComponent <TalismanBoardScript>();
                        go.showFullEQMessage();
                    }
                    break;

                    //case event_type.ADD_COIN:
                    //    this.gold++;
                    //    break;
                    //case event_type.LOSE_HEALTH:
                    //    this.current_health--;
                    //    break;
                    //case event_type.GAIN_HEALTH:
                    //    this.current_health++;
                    //    break;
                    //case event_type.ROLL_DICE:
                    //    //this.rollDice();
                    //    break;

                    //case card_type.DRAW_CARD:
                    //    Card c = deck.drawCard();
                    //    if (cardsToIterate[current].getCard_Type() == card_type.ITEM)
                    //    {
                    //        this.items.Add(c);
                    //    }
                    //if (cards[current].getCard_Type() == card_type.MAGIC_ITEM)
                    //{
                    //    this.items.Add(c);
                    //}
                    //break;


                    //case event_type:
                    //    combat.StartCombat(this, cardsToIterate[current]);
                    //    break;
                }
            }
            current++;
        }
    }
Esempio n. 12
0
        // TODO: Abstract each step into its own method.
        private void drawGame(SolitaireGame game, CardStack deck, CardStack drawStack, List <StackColumn> columns)
        {
            var cardDrawer = new CardDrawer();

            // Draw the stack number for the draw stack.
            int posX = GAME_PADDING_X + STACK_SPAN + STACK_NUMBER_LOCAL_OFFSET;
            int posY = GAME_PADDING_Y;

            drawStackNumber(posX, posY, 0, game.SelectedStackIndex == 0);

            // Draw the deck.
            if (deck.Count > 0)
            {
                posX = GAME_PADDING_X;
                posY = GAME_PADDING_Y + DRAW_STACK_OFFSET_Y;
                cardDrawer.DrawCard(posX, posY);
            }

            // Draw the draw stack.
            if (drawStack.Count > 0)
            {
                posX = GAME_PADDING_X + STACK_SPAN;
                posY = GAME_PADDING_Y + DRAW_STACK_OFFSET_Y;
                bool highlight = game.SelectedStackIndex == 0;
                cardDrawer.DrawCard(posX, posY, drawStack[drawStack.Count - 1], highlight);
            }

            for (int i = 0; i < columns.Count; i++)
            {
                CardStack faceDownStack = columns[i].FaceDownStack;
                CardStack faceUpStack   = columns[i].FaceUpStack;

                // Draw the stack numbers for the main stack.
                posX = GAME_PADDING_X + i * STACK_SPAN + STACK_NUMBER_LOCAL_OFFSET;
                posY = GAME_PADDING_Y + MAIN_STACK_OFFSET_Y;
                drawStackNumber(posX, posY, i + 1, game.SelectedStackIndex == i + 1);

                // Draw face down cards.
                if (faceDownStack.Count > 0 && faceUpStack.Count == 0)
                {
                    // There's nothing covering them.
                    posX = GAME_PADDING_X + i * STACK_SPAN;
                    posY = GAME_PADDING_Y + MAIN_STACK_OFFSET_Y + 1;
                    cardDrawer.DrawCard(posX, posY);
                }
                else if (faceDownStack.Count > 0)
                {
                    // There are face up cards on top, only draw a sliver.
                    posX = GAME_PADDING_X + i * STACK_SPAN;
                    posY = GAME_PADDING_Y + MAIN_STACK_OFFSET_Y + 1;
                    cardDrawer.DrawCardSliverTop(posX, posY);
                }

                int numDrawnCards = 0;

                bool stackHighlighted = game.SelectedStackIndex == i + 1;

                // Draw face up cards.
                for (int ii = 0; ii < faceUpStack.Count; ii++)
                {
                    Card card = faceUpStack[ii];

                    int  invertedCardNum = faceUpStack.Count - ii;
                    bool cardHighlighted = game.NumCardsSelected >= invertedCardNum;
                    bool highlight       = stackHighlighted && cardHighlighted;

                    // Draw the top card at full length.
                    if (ii == faceUpStack.Count - 1)
                    {
                        posX = GAME_PADDING_X + i * STACK_SPAN;
                        posY = GAME_PADDING_Y + MAIN_STACK_OFFSET_Y + MAIN_STACK_SECONDARY_OFFSET_Y + numDrawnCards * 2;

                        cardDrawer.DrawCard(posX, posY, card, highlight);
                    }
                    // And the rest just draw partially.
                    else
                    {
                        posX = GAME_PADDING_X + i * STACK_SPAN;
                        posY = GAME_PADDING_Y + MAIN_STACK_OFFSET_Y + MAIN_STACK_SECONDARY_OFFSET_Y + numDrawnCards * 2;

                        cardDrawer.DrawFaceUpCardTop(posX, posY, card, highlight);
                        numDrawnCards++;
                    }
                }

                Console.WriteLine("\n\n\n\n\n\n\n\n");
            }
        }