Esempio n. 1
0
    public void SetInfo(CardAttributes ca)
    {
        info = ca;

        if (title != null)
        {
            title.text = info.cardName;
        }

        if (flavor != null)
        {
            flavor.text = info.description;
        }

        foreach (Image i in sections)
        {
            i.color = info.sectionColor;
        }

        if (outline != null)
        {
            outline.color = info.cardColor;
            outline.transform.localScale = new Vector3(scale, scale);
        }

        if (artImage != null)
        {
            artImage.sprite = info.art;
        }
    }
Esempio n. 2
0
 public ResponseAttributes()
 {
     ShouldEndSession = true;
     OutputSpeech     = new OutputSpeechAttributes();
     Card             = new CardAttributes();
     Reprompt         = new RepromptAttributes();
 }
        async void CheckForWinner()
        {
            IsBusy          = false;
            TradeCategory   = "";
            PlayerFirstData = PlayerSecondData = null;

            Random random = new Random();
            int    rnd1   = random.Next(0, allAre.Count);

            if (POnePlaying == true)
            {
                PlayerFirstData = (allAre[rnd1]);
            }
            else
            {
                PlayerSecondData = (allAre[rnd1]);
            }

            int rnd2 = random.Next(0, allAre.Count);

            if (rnd1 == rnd2)
            {
                rnd2 = random.Next(0, allAre.Count);
            }
            playerHiddenData = (allAre[rnd2]);
        }
Esempio n. 4
0
        public void Rotate(int Degrees)
        {
            CardAttributes[] Attr = new CardAttributes[5];
            m_Attributes.CopyTo(Attr, 0);
            m_Rotation += Degrees;

            for (int i = 0; i < 4; i++)
            {
                if (Degrees > 0)
                {
                    if (i == 3)
                    {
                        m_Attributes[0] = Attr[3];
                    }
                    else
                    {
                        m_Attributes[i + 1] = Attr[i];
                    }
                }
                if (Degrees < 0)
                {
                    if (i == 0)
                    {
                        m_Attributes[3] = Attr[0];
                    }
                    else
                    {
                        m_Attributes[i - 1] = Attr[i];
                    }
                }
            }
        }
Esempio n. 5
0
    public void InitialiseCard(CardInfo info)
    {
        // setup card graphics
        _cardInfo             = info;
        _cardIcon.sprite      = _cardInfo.CardIcon;
        _cardName.text        = _cardInfo.CardName;
        _cardDescription.text = _cardInfo.CardDescription;
        _cardType             = _cardInfo.CardType;
        _cardTypeText.text    = _cardType.GetTypeString();

        // setup card logic
        _cardAttributes     = _cardInfo.CardAttributes;
        _cardCostValue.text = _cardAttributes.BaseCardCost.ToString();
        _cardType.OnInitCard();

        try
        {
            _cardLogic = this.gameObject.GetComponent <CardLogic>();
        }
        catch (NullReferenceException e)
        {
            Debug.Log("card does not have accompanying logic. Adding class...");
            var temp = this.gameObject.AddComponent <CardLogic>();
            _cardLogic = temp;
        }
    }
 public ResponseAttributes()
 {
     ShouldEndSession = true;
     OutputSpeech     = new OutputSpeechAttributes();
     Card             = new CardAttributes();
     Reprompt         = new RepromptAttributes();
     Directives       = new List <DirectivesAttributes>();
 }
Esempio n. 7
0
    Card CardFromAttributes(CardAttributes ca)
    {
        GameObject g = (GameObject)Instantiate(cardPrefab);
        Card       c = g.GetComponent <Card>();

        c.SetInfo(ca);
        return(c);
    }
Esempio n. 8
0
 public void Init()
 {
     _cardInstance = this.GetComponent <Card>();
     if (_cardInstance)
     {
         _playerHandInstance = Root.GetComponentFromRoot <CombatHandler>().PlayerHand;
         _cardAttributes     = _cardInstance.CardInfo.CardAttributes;
         _attachedCardEffect = _cardAttributes.DefaultCardEffect;
         //Debug.Log(_attachedCardEffect);
     }
 }
 // Use this for initialization
 void Start()
 {
     priceOfMana = this.gameObject.GetComponent<TotemDamageAttributes>().priceOfMana;
     buffDamage = this.gameObject.GetComponent<TotemDamageAttributes>().buffDamage;
     enemies = GameObject.FindGameObjectsWithTag("Enemy");
     sprites = Resources.LoadAll<Sprite>("font");
     CardAttributes = this.gameObject.GetComponent<CardAttributes>();
     cardSprite = this.GetComponent<SpriteRenderer>().sprite;
     player = GameObject.FindGameObjectWithTag("Player").transform;
     this.gameObject.GetComponent<SpriteRenderer>().sprite = Resources.Load<Sprite>("zeq76fkwtd");
     priceOfmanaText = this.gameObject.transform.GetChild(6);
 }
Esempio n. 10
0
        public override void Apply(Player playerUsed, Player enemy)
        {
            base.Apply(playerUsed, enemy);

            //if Magic > Enemy Magic 12 Damage else 8 Damage

            int value = playerUsed.PlayerParams[Attributes.Diamonds] > enemy.PlayerParams[Attributes.Diamonds] ? 12 : 8;

            CardAttributes item = new CardAttributes();

            item.attributes = Attributes.DirectDamage;
            item.value      = value;

            ApplyDirectDamage(item, enemy);
        }
Esempio n. 11
0
        public override void Apply(Player playerUsed, Player enemy)
        {
            base.Apply(playerUsed, enemy);

            //if Wall > Enemy Wall 3 Damage else 2 Damage

            int value = playerUsed.PlayerParams[Attributes.Wall] > enemy.PlayerParams[Attributes.Wall] ? 3 : 2;

            CardAttributes item = new CardAttributes();

            item.attributes = Attributes.DirectDamage;
            item.value      = value;

            ApplyDirectDamage(item, enemy);
        }
Esempio n. 12
0
        public override void Apply(Player playerUsed, Player enemy)
        {
            base.Apply(playerUsed, enemy);

            // if Enemy Wall = 0 10 Damage else 6 Damage

            int value = enemy.PlayerParams[Attributes.Wall] == 0 ? 10: 6;

            CardAttributes item = new CardAttributes();

            item.attributes = Attributes.DirectDamage;
            item.value      = value;

            ApplyDirectDamage(item, enemy);
        }
Esempio n. 13
0
        public override void Apply(Player playerUsed, Player enemy)
        {
            base.Apply(playerUsed, enemy);

            // if Wall > Enemy Wall 6 Damage to Enemy Tower else 6 Damage

            if (playerUsed.PlayerParams[Attributes.Wall] > enemy.PlayerParams[Attributes.Wall])
            {
                enemy.PlayerParams[Attributes.Tower] -= 6;
                if (enemy.PlayerParams[Attributes.Tower] < 0)
                {
                    enemy.PlayerParams[Attributes.Tower] = 0;
                }
            }
            else
            {
                CardAttributes item = new CardAttributes();
                item.attributes = Attributes.DirectDamage;
                item.value      = 6;

                ApplyDirectDamage(item, enemy);
            }
        }
Esempio n. 14
0
    public Card RandomNonSpeciesCard()
    {
        List <int> choice = new List <int>();

        for (int i = 0; i < cards.Count; ++i)
        {
            choice.Add(i);
        }

        while (choice.Count > 0)
        {
            int            c  = Random.Range(0, choice.Count);
            CardAttributes ca = cards[choice[c]];

            if (ca.species == Species.UNSPECIFIED && ca.Random)
            {
                return(CardFromAttributes(ca));
            }

            choice.RemoveAt(c);
        }

        return(null);
    }
Esempio n. 15
0
 void Start()
 {
     cardAttributes = this.gameObject.GetComponent<CardAttributes>();
 }
Esempio n. 16
0
    public Card GetCardByIndex(int idx)
    {
        CardAttributes ca = cards[idx];

        return(CardFromAttributes(ca));
    }