Esempio n. 1
0
 public void RefreshStatsBasedOnLevel()
 {
     foreach (KeyValuePair <ModifiableStat, PlayerStatWithModifiers> statPair in this.modifiableStats)
     {
         PlayerStatWithModifiers statWithModifiers = statPair.Value;
         statWithModifiers.ApplyBaseValueBasedOnLevel(this.level);
     }
 }
Esempio 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);
    }