Ejemplo n.º 1
0
 /// <summary>
 /// Check through each card to see if a bonus should be revealed
 /// </summary>
 private void ScanCards()
 {
     if (displayManager.updateMatchMadness)
     {
         displayManager.updateMatchMadness = false;
         MatchMadness mm = displayManager.currentScene.MatchMadnessData;
         cardset = false;
         //if (CardGrid.transform.childCount == mm.cardList.Count)
         //{
         //Debug.Log("Step 1: " + mm.cardList.Count);
         for (int i = 0; i < mm.cardList.Count; i++)
         {
             ///Debug.Log("Step 1: " + mm.cardList.Count);
             mmCard currentCard = mm.cardList[i];
             //Debug.Log("Step 2: " + currentCard.Card);
             Transform currentGridCard = CardGrid.transform.GetChild(i);
             currentGridCard.GetComponent <UISprite>().spriteName = currentCard.Card;
             if (currentCard.TimeStampHit != null)
             {
                 ShowBonus(currentGridCard, currentCard);
                 previousCard = currentCard;
             }
             else
             {
                 NextCard(currentGridCard, currentCard);
             }
         }
         initialLaunch = false;
         //}
     }
 }
Ejemplo n.º 2
0
 public void generateCards()
 {
     for (int i = 0; i < cardList.Length; i++)
     {
         mmCard mm = new mmCard(cardList[i]);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Activate the bonus multiplier banner
 /// </summary>
 public void ActivateBanner(mmCard currentCard)
 {
     displayCard.setCard(currentCard, "Activate Banner");
     pointMultiplierLabel.text = currentCard.Value;
     sparkles.SetActive(false);
     tweenBackgroundAlpha.PlayForward();
     beam.SetActive(true);
     banner.SetActive(true);
 }
Ejemplo n.º 4
0
    /// <summary>
    /// Sets the next active card in the grid
    /// </summary>
    /// <param name="currentGridCard"></param>
    /// <param name="currentCard"></param>
    private void NextCard(Transform currentGridCard, mmCard currentCard)
    {
        //Debug.Log("Should have reset" + currentCard.Card);
        currentGridCard.GetComponent <UISprite>().color = new Color32(220, 220, 220, 255);
        currentGridCard.GetComponent <mmCardScript>().resetCard();

        if (!cardset)
        {
            if (!initialLaunch)
            {
                multiplierBanner.ActivateBanner(previousCard);
                Invoke("DisableBannerHelper", 5);
                playSound(0, 5f);
            }

            currentHitCard.GetComponent <mmLargeCard>().setCard(currentCard, "Next Card");
            cardset = true;
        }
    }
Ejemplo n.º 5
0
 /// <summary>
 /// Activates the bonus for the current card
 /// </summary>
 /// <param name="currentGridCard"></param>
 /// <param name="currentCard"></param>
 private void ShowBonus(Transform currentGridCard, mmCard currentCard)
 {
     currentGridCard.GetComponent <UISprite>().color = Color.gray;
     currentGridCard.GetComponent <mmCardScript>().setCard(currentCard);
 }
Ejemplo n.º 6
0
 public void setCard(mmCard theCard)
 {
     currentCard = theCard;
     multiplier.SetActive(true);
     multLabel.text = theCard.Value;
 }
Ejemplo n.º 7
0
    // Update is called once per frame
    public void setCard(mmCard theCard, string what)
    {
        CardString = theCard.Card;
        //Debug.Log(what + " is setting Card: " + theCard.Card + "on " + gameObject.name);
        currentCard = theCard;
        string[] cardVal;
        if (theCard.Card.Length > 1)
        {
            cardVal = new string[] { theCard.Card.Substring(0, 1), theCard.Card.Substring(1, 1) };
            suitContainer.transform.localPosition = new Vector3(0, 0, 0);
            suitContainer.transform.localScale    = new Vector3(1f, 1f, 1f);
        }
        else
        {
            cardVal = new string[] { theCard.Card };
            suitContainer.transform.localPosition = new Vector3(-16, 35, 0);
            suitContainer.transform.localScale    = new Vector3(1.25f, 1.25f, 1.25f);
        }

        if (theCard.Card.Contains("10"))
        {
            if (!theCard.Card.Equals("10"))
            {
                cardVal = new string[] { theCard.Card.Substring(0, 2), theCard.Card.Substring(2, 1) };
            }
            else
            {
                cardVal = new string[] { theCard.Card };
            }
        }
        disableAllSuits();
        if (cardVal.Length > 1)
        {
            CardValueLarge.text = "";
            CardValueLarge.gameObject.SetActive(false);
            switch (cardVal[1])
            {
            case "H":
                heart.SetActive(true);
                isBlack = false;
                break;

            case "D":
                diamond.SetActive(true);
                isBlack = false;
                break;

            case "C":
                club.SetActive(true);
                isBlack = true;
                break;

            case "S":
                spade.SetActive(true);
                isBlack = true;
                break;
            }
            CardValue.text = cardVal[0];
        }
        else
        {
            CardValue.text = "";
            CardValueLarge.gameObject.SetActive(false);
            switch (cardVal[0].ToUpper())
            {
            case "H":
                heart.SetActive(true);
                isBlack = false;
                break;

            case "D":
                diamond.SetActive(true);
                isBlack = false;
                break;

            case "C":
                club.SetActive(true);
                isBlack = true;
                break;

            case "S":
                spade.SetActive(true);
                isBlack = true;
                break;

            default:
                CardValueLarge.gameObject.SetActive(true);
                CardValueLarge.text = cardVal[0];
                break;
            }
        }

        if (isBlack)
        {
            CardValue.color = Color.black;
        }
        else
        {
            CardValue.color = Color.red;
        }
    }