示例#1
0
    public override string CardText(bool plural)
    {
        if (targetType == TargetType.PLAYERS)
        {
            return("each player");
        }

        return("all " + QualifierText() + CardParsing.Parse(targetType, true));
    }
示例#2
0
    public override string CardText(bool plural)
    {
        plural = amount != 1;
        string targetString = QualifierText() + CardParsing.Parse(targetType, plural);

        targetString = (plural ? amount.ToString() : (("aeiouAEIOU".IndexOf(targetString[0]) >= 0) ? "an" : "a")) + " " + targetString;
        return(targetString);
        //return (plural ? amount.ToString() + " " : "target ") + targetString;
    }
示例#3
0
    public override string CardText(bool plural)
    {
        string text = (plural ? "draws " : "draw ") + ((amount == 1) ? "a" : amount.ToString());

        if (cardQualifier != null)
        {
            switch (cardQualifier.qualifierType)
            {
            case QualifierType.CARD_TYPE:
            {
                CardTypeQualifierDescription cardTypeQualifier = cardQualifier as CardTypeQualifierDescription;
                text += " " + CardParsing.Parse(cardTypeQualifier.cardType);
            }
            break;

            case QualifierType.CREATURE_TYPE:
            {
                CreatureTypeQualifierDescription creatureTypeQualifier = cardQualifier as CreatureTypeQualifierDescription;
                text += " " + CardParsing.Parse(creatureTypeQualifier.creatureType);
            }
            break;
            }
        }

        text += ((amount == 1) ? " card" : " cards");

        switch (drawModifier)
        {
        case DrawModifier.RANDOM:
            text += " randomly";
            break;

        case DrawModifier.OPPONENT:
            text += " from the opposite deck";
            break;

        case DrawModifier.OPPONENT_RANDOM:
            text += " randomly from the opposite deck";
            break;
        }

        return(text);
    }
示例#4
0
    public string CardText(bool plural = false)
    {
        string text = ((triggerCondition == TriggerCondition.NONE) ? "" : CardParsing.Parse(triggerCondition) + ": ");

        if (effectType is DrawEffectDescription || effectType is SummonEffectDescription || effectType is AuraModifierEffectDescription)
        {
            if (targettingType is SelfTargettingDescription)
            {
                text += CardParsing.CapitalizeSentence(effectType.CardText(targettingType.RequiresPluralEffect()));
            }
            else
            {
                text += CardParsing.CapitalizeSentence(targettingType.CardText() + " " + effectType.CardText(targettingType.RequiresPluralEffect()));
            }
        }
        else
        {
            text += CardParsing.CapitalizeSentence(effectType.CardText(false) + " " + targettingType.CardText());
        }
        text += ".";
        return(text);
    }
示例#5
0
 public override string CardText(bool plural)
 {
     return(CardParsing.Parse(cardType));
 }
示例#6
0
 public override string CardText(bool plural)
 {
     return((plural ? "summons " : "summon ") + amount.ToString() + " " + CardParsing.Parse(tokenType) + ((amount == 1) ? " token" : " tokens"));
 }
示例#7
0
 public override string CardText(bool plural)
 {
     return(CardParsing.Parse(keyword));
 }
示例#8
0
 public override string CardText(bool plural)
 {
     return("all " + QualifierText() + CardParsing.Parse(targetType, true) + " except " + targetDescription.CardText());
 }
示例#9
0
    // Update is called once per frame
    void Update()
    {
        if (referenceCard != null)
        {
            cardDesc = referenceCard.cardData;
        }

        if (cardDesc != null)
        {
            cardName.text = cardDesc.GetCardName();
            typeText.text = CardParsing.Parse(cardDesc.GetCardType()).ToUpper();

            int manaVal     = cardDesc.GetManaCost();
            int baseManaVal = cardDesc.GetBaseManaCost();

            mana.text = manaVal.ToString();

            if (manaVal < baseManaVal)
            {
                mana.text = "<color=green>" + mana.text + "</color>";
            }
            else if (manaVal > baseManaVal)
            {
                mana.text = "<color=red>" + mana.text + "</color>";
            }

            string effectText = "";

            creatureFields.SetActive(false);

            switch (cardDesc.GetCardType())
            {
            case CardType.CREATURE:

                creatureFields.SetActive(true);
                creatureType.text = CardParsing.Parse(cardDesc.GetCreatureType()).ToUpper();

                int atkVal     = cardDesc.GetAttackVal();
                int baseAtkVal = cardDesc.GetBaseAttackVal();

                int hpVal     = cardDesc.GetHealthVal();
                int hpBaseVal = cardDesc.GetBaseHealthVal();

                atk.text = atkVal.ToString();
                def.text = hpVal.ToString();

                if (atkVal > baseAtkVal)
                {
                    atk.text = "<color=green>" + atk.text + "</color>";
                }
                else if (atkVal < baseAtkVal)
                {
                    atk.text = "<color=red>" + atk.text + "</color>";
                }

                if (hpVal > hpBaseVal)
                {
                    def.text = "<color=green>" + def.text + "</color>";
                }
                else if (hpVal < hpBaseVal)
                {
                    def.text = "<color=red>" + def.text + "</color>";
                }

                bool first = true;

                SortedSet <KeywordAttribute> baseAttributes = cardDesc.GetBaseAttributes();

                foreach (KeywordAttribute a in cardDesc.GetAttributes())
                {
                    if (first)
                    {
                        first = !first;
                    }
                    else
                    {
                        effectText += ", ";
                    }

                    if (baseAttributes.Contains(a))
                    {
                        effectText += CardParsing.Parse(a);
                    }
                    else
                    {
                        effectText += "<color=#009A35ff>" + CardParsing.Parse(a) + "</color>";
                    }
                }
                if (!first)
                {
                    effectText += "\n\n";
                }

                templateImage.sprite = cardTemplates[0];

                break;

            case CardType.SPELL:
                templateImage.sprite = cardTemplates[1];

                break;

            case CardType.TRAP:
                templateImage.sprite = cardTemplates[2];

                break;
            }

            foreach (CardEffectDescription effect in cardDesc.GetCardEffects())
            {
                string effectString = effect.CardText();

                effectString += '\n';
                effectText   += effectString;
            }

            textBox.text = effectText;
            if (cardDesc.GetImage())
            {
                Sprite[] sprites = Resources.LoadAll <Sprite>(GameConstants.PATHS.CARD_IMAGES + cardDesc.GetImage().name);
                cardImage.sprite = sprites[0];
            }
        }
    }
 public override string CardText(bool plural)
 {
     return((isNegated ? "non-" : "") + CardParsing.Parse(creatureType));
 }
示例#11
0
 public override string CardText(bool plural)
 {
     return("up to " + amount.ToString() + " " + QualifierText() + CardParsing.Parse(targetType, amount != 1));
 }