Exemplo n.º 1
0
 public override void LoadDefaultData()
 {
     for (int i = 0; i < this.Teams.Count; i++)
     {
         for (int q = 0; q < this.Teams[i].members.Count; q++)
         {
             if (this.Teams[i].members[q].isunique)
             {
                 Save.SavedCharacter chara = GameManager.saveData.characterStorage.SavedCharacters.Find(item => item.id == this.Teams[i].members[q].id);
                 if (chara != null)
                 {
                     this.Teams[i].members[q].LoadSaveData(chara);
                     this.Teams[i].members[q].stats.CalculateStats();
                     this.Teams[i].members[q].stats.ResetHPandMP();
                 }
                 else
                 {
                     Character chara2 = GameManager._intance.CharacterDatabase.uniqueCharacters.Find(item => item.id == this.Teams[i].members[q].id);
                     this.Teams[i].members[q] = chara2.Clone(true);
                     this.Teams[i].members[q].stats.CalculateStats();
                     this.Teams[i].members[q].stats.ResetHPandMP();
                 }
             }
             else
             {
                 this.Teams[i].members[q].stats.CalculateStats();
                 this.Teams[i].members[q].stats.ResetHPandMP();
             }
         }
     }
 }
Exemplo n.º 2
0
 public override void LoadDefaultData()
 {
     //  Debug.Log("Shop Load Default");
     for (int i = 0; i < GameManager._intance.CharacterDatabase.uniqueCharacters.Count; i++)
     {
         Save.SavedCharacter chara = GameManager.saveData.characterStorage.SavedCharacters.Find(item => item.id == GameManager._intance.CharacterDatabase.uniqueCharacters[i].id);
         Character           newChara;
         if (chara != null)
         {
             //   Debug.Log("Shop Character Load from Save");
             newChara = GameManager._intance.CharacterDatabase.uniqueCharacters.Find(item => item.id == chara.id).Clone(true);
             newChara.LoadSaveData(chara);
             //    Debug.Log(newChara.inventroy.items.Count);
             newChara.stats.CalculateStats();
             newChara.stats.ResetHPandMP();
         }
         else
         {
             //      Debug.Log("Shop Character Load from Default");
             newChara = GameManager._intance.CharacterDatabase.uniqueCharacters.Find(item => item.id == chara.id).Clone(true);
             newChara.stats.CalculateStats();
             newChara.stats.ResetHPandMP();
         }
         playerCharacters.Add(newChara);
     }
 }
Exemplo n.º 3
0
        public void LoadSaveData(Save.SavedCharacter SavedChara)
        {
            this.isUnique = SavedChara.isUnique;
            List <int> equipbables = SavedChara.SavedStats.CanEquipWeapons.Select(item => (int)item).ToList();

            this.stats = new Stats(this._Name, 0, SavedChara.SavedStats.BaseHP, SavedChara.SavedStats.BaseMP, SavedChara.SavedStats.BaseAttack, SavedChara.SavedStats.BaseDef, SavedChara.SavedStats.BaseSpeed, SavedChara.SavedStats.Gear.Clone(), equipbables, this);
            Inventory newInventory = new Inventory(SavedChara.SavedInventory.Items.Select(item => (ItemStack)item.Duplicate()).ToList());

            this.inventroy = newInventory;
        }
Exemplo n.º 4
0
 public override void LoadData(Save data)
 {
     //   Debug.Log("Shop Load Data");
     for (int i = 0; i < data.characterStorage.SavedCharacters.Count; i++)
     {
         Save.SavedCharacter charaData = data.characterStorage.SavedCharacters[i];
         Character           chara     = GameManager._intance.CharacterDatabase.GetCharacterWithID(charaData.id);
         chara.LoadSaveData(charaData);
         playerCharacters.Add(chara);
     }
 }
Exemplo n.º 5
0
        public void RegisterData(Character chara)
        {
            int foundIndex = SavedCharacters.FindIndex(item => item.id == chara.id);

            if (foundIndex != -1)
            {
                SavedCharacters[foundIndex] = new Save.SavedCharacter(chara);
            }
            else
            {
                SavedCharacters.Add(new Save.SavedCharacter(chara));
            }
        }
Exemplo n.º 6
0
 public Save.SavedCharacter GetData(int id)
 {
     Save.SavedCharacter chara = SavedCharacters.Find(item => item.id == id);
     return(chara);
 }