コード例 #1
0
ファイル: Card.cs プロジェクト: UnlikelyNomad/ld42
    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;
        }
    }
コード例 #2
0
 public ResponseAttributes()
 {
     ShouldEndSession = true;
     OutputSpeech     = new OutputSpeechAttributes();
     Card             = new CardAttributes();
     Reprompt         = new RepromptAttributes();
 }
コード例 #3
0
        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]);
        }
コード例 #4
0
ファイル: Card.cs プロジェクト: nielsvdbunt/Project
        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];
                    }
                }
            }
        }
コード例 #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;
        }
    }
コード例 #6
0
 public ResponseAttributes()
 {
     ShouldEndSession = true;
     OutputSpeech     = new OutputSpeechAttributes();
     Card             = new CardAttributes();
     Reprompt         = new RepromptAttributes();
     Directives       = new List <DirectivesAttributes>();
 }
コード例 #7
0
ファイル: CardDeck.cs プロジェクト: UnlikelyNomad/ld42
    Card CardFromAttributes(CardAttributes ca)
    {
        GameObject g = (GameObject)Instantiate(cardPrefab);
        Card       c = g.GetComponent <Card>();

        c.SetInfo(ca);
        return(c);
    }
コード例 #8
0
ファイル: CardLogic.cs プロジェクト: hubba368/DungeonDelivery
 public void Init()
 {
     _cardInstance = this.GetComponent <Card>();
     if (_cardInstance)
     {
         _playerHandInstance = Root.GetComponentFromRoot <CombatHandler>().PlayerHand;
         _cardAttributes     = _cardInstance.CardInfo.CardAttributes;
         _attachedCardEffect = _cardAttributes.DefaultCardEffect;
         //Debug.Log(_attachedCardEffect);
     }
 }
コード例 #9
0
 // 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);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #13
0
ファイル: Card91.cs プロジェクト: kinglamer/ArcomageHome
        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);
            }
        }
コード例 #14
0
ファイル: CardDeck.cs プロジェクト: UnlikelyNomad/ld42
    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);
    }
コード例 #15
0
 void Start()
 {
     cardAttributes = this.gameObject.GetComponent<CardAttributes>();
 }
コード例 #16
0
ファイル: CardDeck.cs プロジェクト: UnlikelyNomad/ld42
    public Card GetCardByIndex(int idx)
    {
        CardAttributes ca = cards[idx];

        return(CardFromAttributes(ca));
    }