Exemplo n.º 1
0
    public void UpdateUIValues()
    {
        this.value = theStat.GetBaseValue();
        this.cost  = StatLevelHelpers.GetCostToLevelUpStat(theStat.growth, theStat.divisor);
        text.SetText(theStat.stat.ToString() + ": " + this.value + " | " + "COST: " + this.cost);

        if (this.playerStats.statPoints < this.cost)
        {
            this.button.interactable = false;
        }
        else
        {
            this.button.interactable = true;
        }
    }
Exemplo n.º 2
0
    // Level up stat. Used for hero.
    public bool LevelUpStat(ModifiableStat stat)
    {
        // TODO: FIX THIS
        if (!this.modifiableStats.ContainsKey(stat))
        {
            Debug.LogError("ERROR: Not assignable stat");
            return(false);
        }


        PlayerStatWithModifiers theStat = this.modifiableStats[stat];
        int costToLevelUp = StatLevelHelpers.GetCostToLevelUpStat(theStat.growth, theStat.divisor);

        theStat.growth += StatLevelHelpers.LEVEL_UP_GROWTH_INCREASE;
        theStat.ApplyBaseValueBasedOnLevel(this.level);
        this.statPoints -= costToLevelUp;

        return(true);
    }