Exemple #1
0
 private TextBox MakeDetailsBox(Card.PokemonCard card)
 {
     TextBox newTextBox = new TextBox();
     newTextBox.Multiline = true;           
     newTextBox.Size = new System.Drawing.Size(245, 500);            
     newTextBox.AppendText("Name: " + card.Name + Environment.NewLine);
     newTextBox.AppendText("Stage: " + card.Stage + Environment.NewLine);
     newTextBox.AppendText("HP: " + card.HP.ToString() + Environment.NewLine);
     newTextBox.AppendText("Type: " + card.PokemonType.ToString() + Environment.NewLine);
     newTextBox.AppendText("Ability Name: " + card.AbilityName + Environment.NewLine);
     newTextBox.AppendText("Ability Text: " + card.AbilityText + Environment.NewLine);
     newTextBox.AppendText("Moves: " + Environment.NewLine);
     foreach(Move move in card.MoveData)
     {
         newTextBox.AppendText(move.ToString() + Environment.NewLine);
     }
     newTextBox.AppendText("Weakness Type: " + card.WeaknessType.ToString() + Environment.NewLine);
     newTextBox.AppendText("Weakness Amount: " + card.WeaknessAmount + Environment.NewLine);
     newTextBox.AppendText("Resistance Type: " + card.ResistanceType.ToString() + Environment.NewLine);
     newTextBox.AppendText("Resistance Amount: " + card.ResistanceAmount + Environment.NewLine);
     newTextBox.AppendText("Retreat Cost: " + card.RetreatCost.ToString() + Environment.NewLine);
     newTextBox.AppendText("Card Set: " + card.CardSet + Environment.NewLine);
     newTextBox.AppendText("Card Number: " + card.CardNumber + Environment.NewLine);
     newTextBox.AppendText("Rarity: " + card.CardRarity.ToString() + Environment.NewLine);
     newTextBox.AppendText("Illustrator: " +  card.Illustrator + Environment.NewLine);
     newTextBox.AppendText("Price: " + card.CardPrice);
     return newTextBox;
 }
Exemple #2
0
 public void burn(Card input)
 {
     //If tails. zero is tails by convention
     if (flipCoin() == 0)
     {
         input.HP -= 20;
     }
 }
Exemple #3
0
 public void addCard(Card card)
 {
     if (counter < this.max - 1)
     {
         this.hnd[counter] = card;
     }
     else
     {
         //Tell the game somehow that the hand is full
     }
 }
Exemple #4
0
        //overloaded it incase the calling method knows which card it wants.
        public Card chooseCard()
        {
            /* Get choosecard to show us the cards in Hand,
             * use the index it returns to get that card and store it temporarly
             * Remove that card from hand and return it to the calling method
             */

            int intTemp = Program.choosecard(this.hnd);
            temp = hnd[intTemp];
            removeCard(intTemp);
            return temp;
        }
Exemple #5
0
 public Card chooseCard(int index)
 {
     //Check if the card it wants is valid
     if (hnd[index] != null)
     {
         temp = hnd[index];
         removeCard(index);
         return temp;
     }
     else
     {
         //Someway to tell the calling method this is not vaild
         //Since the contrustor isn't called, it will return a card that is null
         return errCard;
     }
 }
Exemple #6
0
 /// <summary>
 /// Checks that the evolution is valid
 /// </summary>
 /// <param name="from">The card that is in play</param>
 /// <param name="to">The card you want to evolve to</param>
 /// <returns>True or false</returns>
 public bool validEvol(Card from, Card to)
 {
     foreach (int i in to.evolvesFrom)
     {
         if (i == from.pNum)
             return true;
     }
     //if none of the values of evolves from match the pokemon number of the input.
     return false;
 }
Exemple #7
0
 public void setActPkm(List<Card> input, int index)
 {
     this.actPkm = input[index];
     input.RemoveAt(index);
 }
Exemple #8
0
 private void check(Card card)
 {
     throw new NotImplementedException();
 }
Exemple #9
0
 public void paralyzed(Card input)
 {
     throw new System.NotImplementedException();
 }
Exemple #10
0
 public void discard(Card c)
 {
     //Probably passing in the actPKM in this case
     move(c, Discarded);
 }
Exemple #11
0
 /// <summary>
 /// Check if the input the calling method wants is valid,
 /// if it is, the input is removed from the source list and
 /// returned
 /// </summary>
 /// <param name="index">The index of the input in question</param>
 /// <returns>The chosen input or null if there is an error</returns>
 public Card chooseCard(int index)
 {
     //Check if the input it wants is valid
     if (Hand[index] != null)
     {
         temp = Hand[index];
         this.Hand.RemoveAt(index);
         return temp;
     }
     else
     {
         //Someway to tell the calling method this is not vaild
         //Since the contrustor isn't called, it will return a input that is null
         return null;
     }
 }
Exemple #12
0
        /// <summary>
        /// Presents a menu with the availible cards in the source list
        /// </summary>
        /// <param name="source">A List</param>
        /// <returns>A input</returns>
        public Card chooseCard(List<Card> source)
        {
            /* Get choosecard to show us the cards in Hand,
             * use the index it returns to get that input and store it temporarly
             * Remove that input from hand and return it to the calling method
             */

            int intTemp = gInstance.choosecard(source);
            temp = source[intTemp];
            source.RemoveAt(intTemp);
            return temp;
        }
Exemple #13
0
 public void attachEnergy(Card c, List<Card> source)
 {
     //Predicate is a method that will return true or flase based on the passed in input
     Predicate<Card> energy = new Predicate<Card>(isEnergy);
     //If an energy input exists in the source:
     if(source.Exists(energy))
     {
         //Keeps track of the index of the input in the array
         int i = 0;
         //Keeps track of the number of energies in the players hand.
         int j = 0;
         //Takes the return from getValidInput();
         int chosen = 0;
         Console.WriteLine("Pick an energy:");
         foreach (Card lCard in source) //I know that is a weird variable name but I was hoping to keep it from being confusing
         {
             i++;
             if(isEnergy(lCard))
             {
                 j++;
                 Console.WriteLine("{0}: {1}", i, lCard.Name);
             }
         }
         chosen = gInstance.getValidUserInput(0,j);
         move(source, chosen, c.attached);
     }
     else
     {
         Console.WriteLine("You have no enegeries in your hand");
     }
 }
Exemple #14
0
 //This is a repeat of makeActPKM?
 public void addCard(Card card)
 {
     this.Hand.Add(card);
 }
Exemple #15
0
 private bool isEnergy(Card c)
 {
     if (c.stage == Enums.Stage.Energy)
     {
         return true;
     }
     //Else
         return false;
 }
Exemple #16
0
 //Player may get a key section for encrypting and decryting keys
 //Methods
 //Constructor
 public Player(string name, Card[] deck, Game gInst)
 {
     this.name = name;
     this.deck = new Deck();
     this.deck.AddRange(deck);
 }
Exemple #17
0
 /// <summary>
 /// Calls the deck 
 /// </summary>
 /// <returns></returns>
 public bool draw(out Card draw)
 {
     bool tmpReturn = deck.draw(out draw);
     return tmpReturn;
 }
Exemple #18
0
 public void confused(Card input)
 {
     throw new System.NotImplementedException();
 }
Exemple #19
0
 public bool isBasic(Card c)
 {
     return (c.stage == Enums.Stage.Basic);
 }
Exemple #20
0
 public void poisoned(Card input)
 {
     //Subtract ten from the Cards health
     input.HP -= 10;
 }
Exemple #21
0
 public bool isStage(Card c, Enums.Stage stage)
 {
     //Return whatever this expression evaluates to (true or false)
     return (c.stage == stage);
 }
Exemple #22
0
 //This might be a confusing name, since status like burn and such need to be implemented as well
 public string getStatus(Card c)
 {
     string status = c.Name + " || HP: " + c.HP + " Status: " + c.Status;
     return status;
 }
Exemple #23
0
 //This method seems useless however it is also used for active pokemon which is a input type instead of a list
 //Therefore it's usefull there.
 public void move(Card c, List<Card> dest)
 {
     dest.Add(c);
     c = null; //Are objects passed by ref in C#? //Todo: find out
 }
Exemple #24
0
        private Card[] intArrayDeck(int[] intDeck)
        {
            int Size = intDeck.Length;
            Card[] deck = new Card[Size];

            //TODO: If mongo can't connect for some reason find out why and correct the issue,
            //To improve performance and to ensure that we don't run out of connections
            //A universal connection is created outside the loop, then closed after the deck is created.
            //Instanate the connection
            MongoDataStore ms = new MongoDataStore();

            try
            {
                ms.connect();
                deck = ms.getCardArray(intDeck).ToArray(); //TODO: Figure out why this method (intArrayDeck) returns a Card array instead of a list?
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: Unable to connect to the database, please try again.");
                deck = null;
                System.Environment.Exit(-1);
            }

            ms.disconnect();
            return deck;
        }
Exemple #25
0
        //Todo: Fix this method; it assumes that the only thing that can be attached is energies.
        //Realized you can only retreat the actPKm so no point having parameters :P
        public bool retreat()
        {
            //Check if the retreat cost can be met
             	if (actPkm.attached.Count > actPkm.retreatCost)
            {
                //If it can remove the number of cards from the attached
                for (int i = 0; i < actPkm.retreatCost; i++)
                {
                    move(actPkm.attached, 0, Discarded); //Move the first input from the attached array to discarded.
                }

                //Move the input to the bench
                move(actPkm, Bench);
                actPkm = null;

                return true; //<-- The operation was sucsessful
            }
            else
            {
                return false; //<-- The requirements for the retreat cost were not met
            }
        }