Exemplo n.º 1
0
    public GameObject createSpell()
    {
        RectTransform holder    = CardFactory.GetHolder("Holder");
        GameObject    spellCard = GameObject.Instantiate(cardbase, holder.transform);

        holder.GetComponent <CardSpot> ().card = spellCard;
        CardData card;

        card = spellCard.GetComponent <BaseCard> ().data;

        card.ImageFrame = "ImageFrame";
        card.Abilities  = 1;
        card.Element    = "Spell";
        card.Type       = type [0];
        card.Frame      = card.Type;
        card.Name       = spells.ElementAt(Random.Range(0, traps.Count));

        switch (card.Name)
        {
        case "Fireball":
            card.Level      = 2;
            card.AbilityTwo = "Shoot a fireball: 25 damage";
            card.Rarity     = rarity [0];
            break;

        case "Ice Spike":
            card.Level      = 2;
            card.AbilityTwo = "Shoot spikes of ice: 25 damage";
            card.Rarity     = rarity [0];
            break;

        case "Heal":
            card.Level      = 4;
            card.AbilityTwo = "Heal yourself for 50 health!";
            card.Rarity     = rarity [1];
            break;

        case "Armor":
            card.Level      = 4;
            card.AbilityTwo = "Shield yourself for 50 health!";
            card.Rarity     = rarity [1];
            break;

        case "Mind Control":
            card.Level      = 5;
            card.AbilityTwo = "Steal one creature from your opponent";
            card.Rarity     = rarity [2];
            break;
        }
        card.Value     = card.Level * 75;
        card.Image     = card.Name;
        spellCard.name = card.Element + " " + card.Name + " Level " + card.Level;

        RectTransform goRect = spellCard.GetComponent <RectTransform> ();

        goRect.position   = holder.position;
        goRect.localScale = new Vector3(0.4152496f, 0.4152496f, 0.4152496f);
        SaveData.AddCardData(card);
        spellCard.tag = "Card";
        return(spellCard);
    }
Exemplo n.º 2
0
    public GameObject createCreature(int level)
    {
        RectTransform holder       = CardFactory.GetHolder("Holder");
        GameObject    creatureCard = GameObject.Instantiate(cardbase, holder.transform);

        holder.GetComponent <CardSpot> ().card = creatureCard;
        CardData card;

        card = creatureCard.GetComponent <BaseCard> ().data;

        card.ImageFrame = "ImageFrame";

        card.Type    = type[2];
        card.Frame   = card.Type;
        card.Element = elements [Random.Range(0, elements.Length)];

        switch (card.Element)
        {
        case "Earth":
            card.Name = creatures [Random.Range(0, 8)];
            break;

        case "Water":
            card.Name = creatures [9];
            break;

        case "Wind":
            card.Name = creatures [10];
            break;

        case "Fire":
            card.Name = creatures [11];
            break;
        }

        card.Level = level;
        card.Value = level * 50;
        if (card.Level < 4)
        {
            card.Rarity    = rarity [0];
            card.Abilities = 1;
        }
        else if (card.Level > 3 && card.Level < 7)
        {
            card.Rarity    = rarity [1];
            card.Abilities = 2;
        }
        else if (card.Level > 6)
        {
            card.Rarity    = rarity [2];
            card.Abilities = 3;
        }

        switch (card.Abilities)
        {
        case 1:
            card.AbilityOne   = string.Empty;
            card.AbilityTwo   = abilities.ElementAt(Random.Range(0, 2));
            card.AbilityThree = string.Empty;
            break;

        case 2:
            card.AbilityOne   = abilities.ElementAt(Random.Range(0, 2));
            card.AbilityTwo   = string.Empty;
            card.AbilityThree = abilities.ElementAt(Random.Range(3, 6));
            break;

        case 3:
            card.AbilityOne   = abilities.ElementAt(Random.Range(0, 2));
            card.AbilityTwo   = abilities.ElementAt(Random.Range(3, 6));
            card.AbilityThree = abilities.ElementAt(Random.Range(7, 9));
            break;
        }

        card.Image        = card.Name;
        creatureCard.name = card.Element + " " + card.Name + " Level " + card.Level;

        RectTransform goRect = creatureCard.GetComponent <RectTransform> ();

        goRect.position   = holder.position;
        goRect.localScale = new Vector3(0.4152496f, 0.4152496f, 0.4152496f);
        SaveData.AddCardData(card);
        creatureCard.tag = "Card";
        return(creatureCard);
    }
Exemplo n.º 3
0
    public GameObject createTrap()
    {
        RectTransform holder   = CardFactory.GetHolder("Holder");
        GameObject    trapCard = GameObject.Instantiate(cardbase, holder.transform);

        holder.GetComponent <CardSpot> ().card = trapCard;
        CardData card;

        card = trapCard.GetComponent <BaseCard> ().data;

        card.ImageFrame = "ImageFrame";
        card.Abilities  = 1;
        card.Element    = "Trap";
        card.Type       = type [1];
        card.Frame      = card.Type;

        card.Name = traps.ElementAt(Random.Range(0, traps.Count));

        switch (card.Name)
        {
        case "Black Hole":
            card.Level      = 5;
            card.AbilityTwo = "When an enemy attacks destroy that creature";
            card.Rarity     = rarity [2];
            break;

        case "Spikes":
            card.Level      = 2;
            card.AbilityTwo = "Shoot spikes around the target: 10 damage each turn for 3 turns";
            card.Rarity     = rarity [0];
            break;

        case "Swarm":
            card.Level      = 3;
            card.AbilityTwo = "When an enemy attack leech 20 health";
            card.Rarity     = rarity [1];
            break;

        case "Pitfall":
            card.Level      = 4;
            card.AbilityTwo = "When an enemy attacks disable that creature for 1 turn";
            card.Rarity     = rarity [1];
            break;

        case "Mimic":
            card.Level      = 5;
            card.AbilityTwo = "Mimic one of the opponents creatures";
            card.Rarity     = rarity [2];
            break;
        }
        card.Value    = card.Level * 75;
        card.Image    = card.Name;
        trapCard.name = card.Element + " " + card.Name + " Level " + card.Level;

        RectTransform goRect = trapCard.GetComponent <RectTransform> ();

        goRect.position   = holder.position;
        goRect.localScale = new Vector3(0.4152496f, 0.4152496f, 0.4152496f);
        SaveData.AddCardData(card);
        trapCard.tag = "Card";
        return(trapCard);
    }