public void AddExp_Positive() { PlayerLevelSystem sys = new PlayerLevelSystem(); Player p = new Player(new PlayerStats(0, 0)); sys.AddExp(p, 10); Assert.AreEqual(10, p.Exp); }
public void AddExp_LevelUp() { PlayerLevelSystem sys = new PlayerLevelSystem(); Player p = new Player(new PlayerStats(0, 0)); sys.AddExp(p, 100); Assert.AreEqual(2, p.Level); }
public void AddExp_LevelUp_Max() { PlayerLevelSystem sys = new PlayerLevelSystem(); Player p = new Player(new PlayerStats(0, 0)); sys.AddExp(p, 1000000); Assert.AreEqual(sys.MaxExperience, p.Exp); Assert.AreEqual(sys.MaxLevel, p.Level); }
// Use this for initialization void Start() { // Debug.LogError("Player Data Start"); if (_gameStatistics == null) { //Instantuate the player statistics. _gameStatistics = Instantiate(BlankStatistics) as Statistics; _gameStatistics.transform.parent = transform; _gameStatistics.gameObject.name = "TotalGameStatistics"; _gameStatistics.ContainerLabel = "All Game Stats"; //Set the multiplier to none since its full game stats. _gameStatistics.ValueMultiplier = 0; _gameStatistics.LoadFromPlayerPrefs(); DontDestroyOnLoad(_gameStatistics.gameObject); } if (_gameHistory == null) { //Create a list for the game histroy. _gameHistory = new Stack <Statistics>(); } if (PTPLevelingPrefab && !MyPTPLevel) { //Create the level object. _myLeveling = Instantiate(PTPLevelingPrefab) as PlayerLevelSystem; _myLeveling.transform.parent = transform; DontDestroyOnLoad(_myLeveling.gameObject); } //Create the array. _gameSlots = new ItemSlot[_itemSlots.Length]; ItemToGameSlots(); //Fill up infinite modes phase mission with data from the item cards. if (!cardInit) { InitalizeItemCards(); } }
public void LoadAllDataFromFileSystem() { if (FileFetch.FetchFloat("VERSION") < FileVersion) { FileFetch.ClearAllKeys(); } //Destroy the old if we have one if (_gameStatistics != null) { Destroy(_gameStatistics.gameObject); } //Instantuate the player statistics. _gameStatistics = Instantiate(BlankStatistics) as Statistics; _gameStatistics.transform.parent = transform; _gameStatistics.gameObject.name = "TotalGameStatistics"; _gameStatistics.ContainerLabel = "All Game Stats"; _gameStatistics.LoadFromPlayerPrefs(); DontDestroyOnLoad(_gameStatistics.gameObject); //Load the gem bank _gemBank = FileFetch.FetchInt("GEMBANK"); //Load the total xp _totalXP = FileFetch.FetchInt("TOTALXP"); //_totalXP = 0; //Set the total xp into the leveling system to calculate. if (!MyPTPLevel) { //Create the level object. _myLeveling = Instantiate(PTPLevelingPrefab) as PlayerLevelSystem; _myLeveling.transform.parent = transform; DontDestroyOnLoad(_myLeveling.gameObject); } TotalXP = _totalXP; foreach (BaseItemCard card in CardDeck) { //Only go through missions for dirty cards. card.LoadCardItem(); } //Load slots here //LoadSlots(); ClearGameSlots(); //Handle options and other data here. Options.Load(); //SocialCenter.Instance.LoadLeaderboard("Highscore_PPS"); }
void Awake() { PLevelS = this; }