Example #1
0
    public Goal(string Name, string minidescription, string description, 
	            ShopControl.Gods god, int[] goalScore, bool higherScoreIsGood)
    {
        MiniDescription = minidescription;
        Description = description;
        God = god;
        GoalScore = goalScore;
        HigherScoreIsGood = higherScoreIsGood;
    }
Example #2
0
 public Goal(string Name, string minidescription, string description,
             ShopControl.Gods god, int[] goalScore, bool higherScoreIsGood)
 {
     MiniDescription   = minidescription;
     Description       = description;
     God               = god;
     GoalScore         = goalScore;
     HigherScoreIsGood = higherScoreIsGood;
 }
Example #3
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 #4
0
    public static void AddGodInOrderToUnlocked(ShopControl.Gods newGod)
    {
        if (!UnlockedGods.Contains(newGod))
        {
            UnlockedGods.Add(newGod);
        }
        List <ShopControl.Gods> newList = new List <ShopControl.Gods>();

        for (int i = 0; i < ShopControl.AllGods.Count; i++)
        {
            if (UnlockedGods.Contains(ShopControl.AllGods[i]))
            {
                newList.Add(ShopControl.AllGods[i]);
            }
        }
        UnlockedGods = newList;
    }
Example #5
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 #6
0
    //normal
    public LibraryCard(string cardname, string displayname, string iconpath, ShopControl.Gods god, Card.Rarity rarity, 
	                   string tooltip, string displaytext, string minidisplaytext, Card.CardActionTypes cardAction,
	                   GridControl.TargetTypes rangeTargetType, int rangeMinArg, int rangeMaxArg, GridControl.TargetTypes aoeTargetType, int aoeMinArg, int aoeMaxArg)
    {
        CardName = cardname;
        DisplayName = displayname;
        IconPath = iconpath;
        God = god;

        ThisRarity = rarity;

        Tooltip = tooltip;

        DisplayText = displaytext;
        MiniDisplayText = minidisplaytext;

        CardAction = cardAction;
        RangeTargetType = rangeTargetType;
        rangeMin = rangeMinArg;
        rangeMax = rangeMaxArg;
        AoeTargetType = aoeTargetType;
        aoeMinRange = aoeMinArg;
        aoeMaxRange = aoeMaxArg;

        switch(rarity) {
        case Card.Rarity.Paper:
            Cost = 0;
            break;
        case Card.Rarity.Bronze:
            Cost = 2;
            break;
        case Card.Rarity.Silver:
            Cost = 4;
            break;
        case Card.Rarity.Gold:
            Cost = 6;
            break;
        case Card.Rarity.Platinum:
            Cost = 8;
            break;
        }
        UnlockCost = Cost;
    }
Example #7
0
    /// <summary>
    /// Universal method for interacting with a goal. Functions like
    /// an event system; goals take different actions when they hear an event.
    /// </summary>
    public void MakeCheck()
    {
        // Goal increments by 1 when checked
        if (MiniDescription == "Kill X enemies in one turn"
            | MiniDescription == "Protect against X attacks"
            | MiniDescription == "Play X cards in one turn"
            | MiniDescription == "Play X paper cards in one turn"
            | MiniDescription == "Play less than X cards total"
            | MiniDescription == "Draw X cards in one turn"
            | MiniDescription == "Draw X paper cards in one turn"
            | MiniDescription == "Touch the screen no more than than X times"
            | MiniDescription == "Move X times in one turn"
            | MiniDescription == "Deal X damage in one turn"
            | MiniDescription == "Punch X times")
        {
            AddToScore(1);
        }
        // Goal increments by 1 and remembers it was done when checked
        else if (MiniDescription == "Kill enemies X turns in a row")
        {
            if (!DidGoalThisTurnTracker)
            {
                AddToScore(1);
            }
            DidGoalThisTurnTracker = true;
        }
        // Goal resets to 0 when checked
        else if (MiniDescription == "Don't deal damage X turns in a row" |
                 MiniDescription == "Don't deal damage or move X turns in a row" |
                 MiniDescription == "Don't play a card X turns in a row" |
                 MiniDescription == "Don't move X turns in a row")
        {
            DidGoalThisTurnTracker = true;
            ChangeScore(0);
        }
        // Special case
        else if (MiniDescription == "Discard pile has X cards in it")
        {
            ChangeScore(S.GameControlInst.Discard.Count);
        }
        else if (MiniDescription == "Discard pile has X cards in a row with the same God")
        {
            int inARow  = 1;
            int hiScore = 0;
            ShopControl.Gods lastGod = ShopControl.Gods.none;
            for (int i = 0; i < S.GameControlInst.Discard.Count; i++)
            {
                Card c = S.GameControlInst.Discard[i].GetComponent <Card>();
                if (lastGod != c.God)
                {
                    inARow = 1;
                }
                else
                {
                    inARow++;
                }

                lastGod = c.God;

                if (inARow > hiScore)
                {
                    hiScore = inARow;
                }

                ChangeScore(hiScore);
            }
        }
        SetDisplayScore();
    }