Example #1
0
    public virtual void Initialize(bool alreadyDiscarded)
    {
        useGUILayout = false;

        cardUI    = gameObject.GetComponent <CardUI> ();
        cardSFX   = gameObject.GetComponent <CardSFX> ();
        playerObj = GameObject.FindGameObjectWithTag("Player");

        // Initialize card variables
        ThisLibraryCard = CardLibrary.Lib[CardName];

        name            = CardName;
        CardName        = ThisLibraryCard.CardName;
        DisplayName     = ThisLibraryCard.DisplayName;
        IconPath        = "sprites/card icons/" + ThisLibraryCard.IconPath;
        Tooltip         = ThisLibraryCard.Tooltip;
        DisplayText     = ThisLibraryCard.DisplayText;
        MiniDisplayText = ThisLibraryCard.MiniDisplayText;
        rangeTargetType = ThisLibraryCard.RangeTargetType;
        minRange        = ThisLibraryCard.rangeMin;
        maxRange        = ThisLibraryCard.rangeMax;
        aoeTargetType   = ThisLibraryCard.AoeTargetType;
        aoeMinRange     = ThisLibraryCard.aoeMinRange;
        aoeMaxRange     = ThisLibraryCard.aoeMaxRange;
        ThisRarity      = ThisLibraryCard.ThisRarity;
        CardAction      = ThisLibraryCard.CardAction;
        God             = ThisLibraryCard.God;

        if (!alreadyDiscarded)
        {
            S.GameControlInst.Hand.Add(gameObject);
        }

        switch (ThisRarity)
        {
        case Card.Rarity.Gold:
            Cost = 10;
            break;

        case Card.Rarity.Silver:
            Cost = 6;
            break;

        case Card.Rarity.Bronze:
            Cost = 3;
            break;

        case Card.Rarity.Paper:
            Cost = 0;
            break;
        }

        cardUI.Initialize(alreadyDiscarded);

        cardSFX.PlayDrawCardSFX();
    }
Example #2
0
    public virtual void Initialize(bool alreadyDiscarded)
    {
        useGUILayout = false;

        cardUI = gameObject.GetComponent<CardUI> ();
        cardSFX = gameObject.GetComponent<CardSFX> ();
        playerObj = GameObject.FindGameObjectWithTag("Player");

        // Initialize card variables
        ThisLibraryCard = CardLibrary.Lib[CardName];

        name = CardName;
        CardName = ThisLibraryCard.CardName;
        DisplayName = ThisLibraryCard.DisplayName;
        IconPath = "sprites/card icons/" + ThisLibraryCard.IconPath;
        Tooltip = ThisLibraryCard.Tooltip;
        DisplayText = ThisLibraryCard.DisplayText;
        MiniDisplayText = ThisLibraryCard.MiniDisplayText;
        rangeTargetType = ThisLibraryCard.RangeTargetType;
        minRange = ThisLibraryCard.rangeMin;
        maxRange = ThisLibraryCard.rangeMax;
        aoeTargetType = ThisLibraryCard.AoeTargetType;
        aoeMinRange = ThisLibraryCard.aoeMinRange;
        aoeMaxRange = ThisLibraryCard.aoeMaxRange;
        ThisRarity = ThisLibraryCard.ThisRarity;
        CardAction = ThisLibraryCard.CardAction;
        God = ThisLibraryCard.God;

        if (!alreadyDiscarded) {
            S.GameControlInst.Hand.Add(gameObject);
        }

        switch (ThisRarity)
        {
        case Card.Rarity.Gold:
            Cost = 10;
            break;
        case Card.Rarity.Silver:
            Cost = 6;
            break;
        case Card.Rarity.Bronze:
            Cost = 3;
            break;
        case Card.Rarity.Paper:
            Cost = 0;
            break;
        }

        cardUI.Initialize (alreadyDiscarded);

        cardSFX.PlayDrawCardSFX();
    }