Exemplo n.º 1
0
    public bool UseCard(AbilityCard card)
    {
        SpawnPlayEffect spawnEffect = card.PlayEffect as SpawnPlayEffect;

        if (spawnEffect != null)
        {
            if (Creature)
            {
                return(false);
            }

            // this is hard to debug because card.Play()'s use of the play effect depends on CurrentTarget
            TargetController.CurrentTarget = GetComponent <ITargetable>();
            card.Play();
            return(true);
        }
        else
        {
            if (!Creature)
            {
                return(false);
            }
            TargetController.CurrentTarget = Creature.gameObject.GetComponent <ITargetable>();
            card.Play();
            return(true);
        }
    }
    void PlayTopCard()
    {
        LeanTween.scale(playCard, new Vector3(2, 2, 2), .5f).setLoopPingPong(1);
        playSound.Play();

        decidingnum = Random.Range(1, 10);
        AbilityCard targetCard = _playerHand.TopItem;

        targetCard.Play();
        //TODO consider expanding Remove to accept a deck position
        _playerHand.Remove(_playerHand.LastIndex);
        _abilityDiscard.Add(targetCard);
        Debug.Log("Card added to discard: " + targetCard.Name);

        if (decidingnum <= 7)
        {
            StartCoroutine(turnChange());
            myPlayer.TakeDamage(enemyDamage);
        }
        else
        {
            StartCoroutine(turnChange());
            _creature.EnemyHeal(healAMount);
        }
    }
Exemplo n.º 3
0
    public void PlayTopCard()
    {
        AbilityCard targetCard = _enemyHand.TopItem;

        targetCard.Play();
        //TODO consider expanding Remove to accept a deck position
        _enemyHand.Remove(_enemyHand.LastIndex);
        _enemyAbilityDiscard.Add(targetCard);
        Debug.Log("Card added to discard: " + targetCard.Name);
    }
    void PlayTopCard()
    {
        AbilityCard targetCard = _playerHand.TopItem;

        targetCard.Play();
        //TODO consider expanding Remove to accept a deck position
        Destroy(_displayedHand[_playerHand.LastIndex]);
        _displayedHand.RemoveAt(_playerHand.LastIndex);
        _playerHand.Remove(_playerHand.LastIndex);

        _abilityDiscard.Add(targetCard);
        Debug.Log("Card added to discard: " + targetCard.Name);
    }
    public virtual void PlayAbilityCard(int index)
    {
        AbilityCard targetCard = Hand.GetCard(index);

        if (targetCard != null && Actions > 0 && Actions >= targetCard.Cost)
        {
            targetCard.Play();
            Actions -= targetCard.Cost;
            Hand.Remove(index);
            AbilityDiscard.Add(targetCard);

            RaiseActions(Actions);
            RaiseDiscard(AbilityDiscard);
            RaiseHand(Hand);
        }
    }
Exemplo n.º 6
0
 private void PlayTopCard()
 {
     if (_playerHand.Count > 0)
     {
         AbilityCard targetCard = _playerHand.TopItem;
         targetCard.Play();
         //TODO Consider expanding Remove to accept a deck position
         _playerHand.Remove(_playerHand.LastIndex);
         _abilityDiscard.Add(targetCard);
         Debug.Log("Card added to discard: " + targetCard.Name);
     }
     else
     {
         Debug.LogWarning("Player Hand: Nothing to play - hand is empty!");
     }
 }
Exemplo n.º 7
0
    public void PlayTopCard()
    {
        AbilityCard targetCard = _playerHand.TopItem;

        targetCard.Play();
        //TODO consider expanding Remove to accept a deck position
        _playerHand.Remove(_playerHand.LastIndex);
        _abilityDiscard.Add(targetCard);
        Debug.Log("Card added to discard: " + targetCard.Name);

        if (_abilityDeck.Count == 0)
        {
            Debug.Log("Shuffling cards...");
            foreach (AbilityCardData abilityData in _abilityDeckConfig)
            {
                AbilityCard newAbilityCard = new AbilityCard(abilityData);
                _abilityDeck.Add(newAbilityCard);
            }

            _abilityDeck.Shuffle();
            ShuffleCard.Play();
        }
    }