Advertisement
gotoheavenbro

BaseStat

Sep 30th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class BaseStat {
  5.     private int _baseValue;
  6.     private int _buffValue;
  7.     private int _nextLevel;
  8.     private float _nextLevelModifier;
  9.     public BaseStat()
  10.     {
  11.         _baseValue = 0;
  12.         _buffValue = 0;
  13.         _nextLevel = 100;
  14.         _nextLevelModifier = 1.1f;
  15.     }
  16. #region Public Accessor Method
  17.     public int BaseValue
  18.     {
  19.         get { return _baseValue; }
  20.         set { _baseValue = value; }
  21.     }
  22.     public int BuffValue
  23.     {
  24.         get { return _buffValue; }
  25.         set { _buffValue = value; }
  26.     }
  27.     public int NextLevel
  28.     {
  29.         get { return _nextLevel; }
  30.         set { _nextLevel = value; }
  31.     }
  32.     public float NextLevelModifier
  33.     {
  34.         get { return _nextLevelModifier; }
  35.         set { _nextLevelModifier = value; }
  36.     }
  37. #endregion
  38.     public void LevelUp()
  39.     {
  40.         _nextLevel = (int)(_nextLevel * _nextLevelModifier);
  41.         _baseValue++;
  42.  
  43.  
  44.     }
  45.     public int BuffedValue
  46.     {
  47.         get { return _baseValue + _buffValue; }
  48.     }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement