public static void AddPartyUnit(string unitName) { List <string> partyUnits = SaveDataCenter.GetSaveData().party.partyUnitNames; partyUnits.Add(unitName); SaveDataCenter.Save(); }
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); }
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); }
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."); }
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(); }
public static int GetPartyLevel() { return(SaveDataCenter.GetSaveData().party.partyLevel); }
public static List <string> GetPartyUnits() { return(SaveDataCenter.GetSaveData().party.partyUnitNames); }