Ejemplo n.º 1
0
        public static void AddPartyUnit(string unitName)
        {
            List <string> partyUnits = SaveDataCenter.GetSaveData().party.partyUnitNames;

            partyUnits.Add(unitName);
            SaveDataCenter.Save();
        }
Ejemplo n.º 2
0
        public static List <string> GetLearnedSkillNames(string unitName)
        {
            List <SkillSaveData> skillSaveDatas = SaveDataCenter.GetSaveData().skills;

            var allLearnedSkillsForUnit = skillSaveDatas.FindAll(skill => Parser.GetSkillInfoByName(skill.skillName).owner == unitName);

            if (allLearnedSkillsForUnit.Count == 0)
            {
                List <string> level1Skills = GetLevel1Skills()[unitName];
                foreach (string level1Skill in level1Skills)
                {
                    skillSaveDatas.Add(new SkillSaveData(level1Skill, 1));
                }
                SaveDataCenter.Save();
            }

            List <string>    skillNames    = new List <string>();
            List <SkillInfo> allUnitSkills = Parser.GetSkillInfoByUnit(unitName);

            foreach (SkillSaveData skillSaveData in skillSaveDatas)
            {
                if (Parser.GetSkillInfoByName(skillSaveData.skillName).owner == unitName)
                {
                    skillNames.Add(skillSaveData.skillName);
                }
            }

            return(skillNames);
        }
Ejemplo n.º 3
0
        public static int GetEnhanceLevel(string character, string skillName)
        {
            List <SkillSaveData> skillSaveDatas = SaveDataCenter.GetSaveData().skills;

            foreach (SkillSaveData skillSaveData in skillSaveDatas)
            {
                if (skillSaveData.skillName == skillName)
                {
                    return(skillSaveData.level);
                }
            }

            return(0);
        }
Ejemplo n.º 4
0
        public static void Enhance(string character, string skillName)
        {
            List <SkillSaveData> skillSaveDatas = SaveDataCenter.GetSaveData().skills;

            foreach (SkillSaveData skillSaveData in skillSaveDatas)
            {
                if (skillSaveData.skillName == skillName)
                {
                    skillSaveData.level += 1;
                    SaveDataCenter.Save();
                    return;
                }
            }

            Debug.LogError("Cannot enhance not learned skill.");
        }
Ejemplo n.º 5
0
        public static void Learn(string character, string newSkillName)
        {
            List <string> skillNames = GetLearnedSkillNames(character);

            foreach (string skillName in skillNames)
            {
                if (skillName == newSkillName)
                {
                    Debug.LogWarning("Already learend skill " + newSkillName + " of " + character);
                    return;
                }
            }

            List <SkillSaveData> skillSaveDatas = SaveDataCenter.GetSaveData().skills;

            skillSaveDatas.Add(new SkillSaveData(newSkillName, 1));
            SaveDataCenter.Save();
        }
Ejemplo n.º 6
0
 public static int GetPartyLevel()
 {
     return(SaveDataCenter.GetSaveData().party.partyLevel);
 }
Ejemplo n.º 7
0
 public static List <string> GetPartyUnits()
 {
     return(SaveDataCenter.GetSaveData().party.partyUnitNames);
 }