Example #1
0
    public void SetupDeck(bool newShouldShuffle)
    {
        enemyDiscard  = FindObjectOfType <EnemyDiscard>();
        shouldShuffle = newShouldShuffle;

        if (shouldShuffle)
        {
            ShuffleDeck();
        }
    }
 public void DiscardCard()
 {
     // USE THE PREFAB INSTEAD OF INSTANCE
     if (!destroyOnPlay)
     {
         EnemyCard    cardPrefab   = FindObjectOfType <AllEnemyCards>().GetEnemyCardById(cardId);
         EnemyDiscard enemyDiscard = FindObjectOfType <EnemyDiscard>();
         enemyDiscard.AddCardToDiscard(cardPrefab);
     }
     Destroy(gameObject);
 }
Example #3
0
    public void DrawInitialHand(int handSize)
    {
        handSize += handBuff;
        handSize += FindObjectOfType <Enemy>().GetPermaBuffAmount(StatusEffect.PermaBuffType.HandSize);
        // minimum hand size is 1, debuffs shouldn't prevent them from every playing anything
        handSize = Mathf.Clamp(handSize - FindObjectOfType <BattleData>().GetEnemyHandSizeDebuff(), 1, 999999);
        handBuff = 0;

        playingCards = false;
        enemyDeck    = FindObjectOfType <EnemyDeck>();
        enemyDiscard = FindObjectOfType <EnemyDiscard>();
        Debug.Log("enemy handsize: " + handSize);
        StartCoroutine(DrawHandTimer(handSize));
    }
Example #4
0
    public void BattleSetup(float setupTimeInSeconds)
    {
        configData = FindObjectOfType <ConfigData>();
        configData.SetupPipManagers(this);
        healthPipManager = configData.GetEnemyHealthPipManager();
        energyPipManager = configData.GetEnemyEnergyPipManager();
        SetupHealthAndEnergyText();

        enemyDeck = FindObjectOfType <EnemyDeck>();
        enemyDeck.SetupDeck(shuffleDeck);

        enemyDiscard = FindObjectOfType <EnemyDiscard>();
        enemyHand    = FindObjectOfType <EnemyHand>();
    }
    public void SetupCard(int count)
    {
        // do something with sprite layers (over everything including player hand)
        // save the card image and replace it with nothing (back of card)
        GetComponent <Animator>().Play("CardSpin");
        SpriteRenderer imageComponent = GetImageComponentByName("CardImage");

        // Rework this if more than one canvas is ever on the card
        cardText = GetComponentInChildren <TextMeshProUGUI>();
        cardText.gameObject.SetActive(false);

        cardImage             = imageComponent.sprite;
        imageComponent.sprite = null;
        SetSpriteLayers(count);

        enemyDeck    = FindObjectOfType <EnemyDeck>();
        enemyDiscard = FindObjectOfType <EnemyDiscard>();
        xPos         = transform.position.x;
        yPos         = transform.position.y;
    }